Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

gh-104490: Consistently define phony make targets #104491

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

Merged
merged 2 commits into from
May 15, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
gh-104490: consistently define phony make targets
By convention make targets that don't refer to a file have a dependency
on the fake `.PHONY` target/file. This ensures that these targets are
always evaluated because there is no rule to create a `.PHONY` file
and that will force make to think the rule is out of date and needs
to be rebuilt.

This commit consistently associates our virtual targets with `.PHONY`
by declaring the `.PHONY` dependency immediately above the make rule.

Before, some `.PHONY` associations were inline (as this patch
establishes). Others were defined in common blocks. Even others were
defined incorrectly, actually assigning a `.PHONY` variable instead
of operating on the make target!

Before, not all virtual targets had `.PHONY` associations. And there
were some defined `.PHONY` associations in common blocks whose targets
had long been deleted.

Hopefully the unified convention will prevent things from getting out
of sync going forward.

Why do this?

First, consistency is good. Now people don't have to know to look for
a separate block of `.PHONY` attribution. Hopefully this prevents
missing `.PHONY` annotations going forward.

Second, there are some cases where virtual make targets are virtual
/ phony when they shouldn't be. These are creating race conditions and
avoidable rebuilds across multiple `make` invocations. e.g. a `make all`
+ `make install` invocation will perform PGO+BOLT if BOLT is enabled
because `profile-opt` and `bolt-opt` are phony and always invoked. I
plan follow-ups to this cleanup to fix some bugs I've run into.
  • Loading branch information
indygreg committed May 15, 2023
commit aafd614220d5c4c725fd1c73c8326023d5b20880
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.