Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile cleanups #5017

Merged
merged 6 commits into from
Jan 30, 2020
Merged

Conversation

vrothberg
Copy link
Member

A set of cleanups for the Makefile. I'm ultimately aiming at making it faster (and fix #4829) since it got very slow over time.

I bisected the performance and found that the release targets are responsible:
https://github.com/containers/libpod/blob/master/Makefile#L364-L372

@cevich, are podman-v$(RELEASE_NUMBER).tar.gz: and the remote counterpart used in the CI? Generating RELEASE_NUMBER for each invocation of the Makefile is burning most of the time. Commenting the two targets renders a make tab tab completion fast again. If needed, any chance we could not embed that in the target name?

@openshift-ci-robot openshift-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L labels Jan 29, 2020
@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vrothberg

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 29, 2020
@cevich
Copy link
Member

cevich commented Jan 29, 2020

If needed, any chance we could not embed that in the target name?

I'm not sure, looking...

@cevich
Copy link
Member

cevich commented Jan 29, 2020

...okay, the only user (I'm aware of) for that target is contrib/cirrus/build_release.sh. Conveniently for implementing your suggestion, that script only calls:

  • make podman-remote-${CROSS_PLATFORM}-release (where $CROSS_PLATFORM is known)
  • make podman.msi
  • make podman-release

So the file-name targets are not needed AFAICT, so long as the above targets function (and spit out the expected files).

Great detective work BTW 😀

@vrothberg
Copy link
Member Author

Thanks, @cevich! I updated the PR. The Makefile is now fast again. git-bisect to the rescue :)

Move the systemd-buildtag check into the `bin/podman` target.
No need to execute the check for all invocations of the
Makefile.

Signed-off-by: Valentin Rothberg <[email protected]>
Signed-off-by: Valentin Rothberg <[email protected]>
Add a .PHONY line over each target instead of mixing this notation with
a separate but incomplete single list.

Signed-off-by: Valentin Rothberg <[email protected]>
We don't set it, so there's no need to keep it.

Signed-off-by: Valentin Rothberg <[email protected]>
Just echo the message instead of warning to not impact the exit code.

Signed-off-by: Valentin Rothberg <[email protected]>
Speed up the Makefile by removing variable references from the release
targets.  Now, the variables will only be (lazily) evaluated when they
are actually needed and not for each invocation of the Makefile which
has it down considerably.

Fixes: containers#4829
Signed-off-by: Valentin Rothberg <[email protected]>
@vrothberg vrothberg changed the title WIP - Makefile cleanups Makefile cleanups Jan 30, 2020
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 30, 2020
@vrothberg
Copy link
Member Author

@cevich @baude @mheon @rhatdan PTAL

@rhatdan
Copy link
Member

rhatdan commented Jan 30, 2020

LGTM

@baude
Copy link
Member

baude commented Jan 30, 2020

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 30, 2020
@openshift-merge-robot openshift-merge-robot merged commit 83044fe into containers:master Jan 30, 2020
@vrothberg vrothberg deleted the fix-4829 branch February 3, 2021 08:37
edsantiago added a commit to edsantiago/libpod that referenced this pull request Feb 3, 2021
Backstory: every time you run 'make podman' or even
just 'make', you get a full recompile. This is sub-ideal.

Cause: I don't really know. It looks complicated. containers#5017
introduced a .PHONY for bin/podman, for reasons not
explained in the PR. Then, much later, containers#5880 well-
intentionedly but improperly tweaked the 'find'
command used in defining SOURCES, adding a -prune
but without the corresponding and required -print.
Let's just say, it was an unfortunate cascade of events.

This PR fixes the SOURCES definition and removes the
highly-undesired .PHONY from podman & podman-remote,
making it so you can type 'make' and, oh joy, not
build anything if it's current. The way 'make' is
supposed to work.

Why fix this now? Because my PR (containers#9209) was failing in CI,
in the Validate step:

    Can't exec "./bin/podman": No such file or directory at hack/xref-helpmsgs-manpages line 223.

It failed even on Re-run, and only passed once I force-pushed
the PR (with no changes, just a new commit SHA). I have no idea
why bin/podman wasn't built, and I have zero interest in pursuing
that right now, but the proper solution is to add bin/podman as
a Makefile dependency for that particular test. So done.

While I'm at it, fix what is pretty clearly a typo in a .PHONY

And, finally, fix a go-md2man warning introduced in containers#9189

[NO TESTS NEEDED]

Signed-off-by: Ed Santiago <[email protected]>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 23, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Makefile tab completion turned very slow
6 participants