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

fix: last --jobserver-auth wins #67

Merged
merged 5 commits into from
Feb 5, 2024
Merged

Conversation

weihanglo
Copy link
Member

@weihanglo weihanglo commented Jan 31, 2024

From the GNU make manual1:

Be aware that the MAKEFLAGS variable may contain multiple
instances of the --jobserver-auth= option.
Only the last instance is relevant.

Hence this commit makes it so.

With this commit, --jobserver-auth also takes precedence over
--jobserver-fds, even when --jobserver-fds is the last instance
of these flags. This is made intentionally since --jobserver-fds
was an undocumented internal-only flag before --jobserver-auth
made public, according to this announcement2.

fixes #66

Footnotes

  1. https://www.gnu.org/software/make/manual/make.html#Job-Slots

  2. https://git.savannah.gnu.org/cgit/make.git/tree/NEWS?h=4.2#n31

src/lib.rs Outdated Show resolved Hide resolved
Copy link

@ojeda ojeda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for solving this!

src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
From the GNU make manual[^1]:

> Be aware that the `MAKEFLAGS` variable may contain multiple
> instances of the `--jobserver-auth=` option.
> Only the last instance is relevant.

Hence this commit makes it so.

With this commit, `--jobserver-auth` also takes precedence over
`--jobserver-fds`, even when `--jobserver-fds` is the last instance
of these flags. This is made intentionally since `--jobserver-fds`
was an undocumented internal-only flag before `--jobserver-auth`
made public, according to this announcement[^2].

[^1]: https://www.gnu.org/software/make/manual/make.html#Job-Slots
[^2]: https://git.savannah.gnu.org/cgit/make.git/tree/NEWS?h=4.2#n31
@petrochenkov petrochenkov merged commit cc54e70 into rust-lang:main Feb 5, 2024
14 checks passed
@weihanglo weihanglo deleted the rfind branch February 5, 2024 15:08
NobodyXu added a commit to rust-lang/cc-rs that referenced this pull request Feb 13, 2024
`--jobserver-auth=` is the only documented makeflags.
`--jobserver-fds=` is actually an internal only makeflags, so we should
always prefer `--jobserver-auth=`.

Also, according to doc of makeflags, if there are multiple `--jobserver-auth=`
the last one is used

ref: rust-lang/jobserver-rs#67

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The last --jobserver-auth flag should be used
3 participants