Skip to content

fix: last --jobserver-auth wins #67

New issue

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

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

Already on GitHub? # to your account

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

@weihanglo weihanglo force-pushed the rfind branch 2 times, most recently from 57763c7 to 6115c25 Compare January 31, 2024 22:05
@weihanglo weihanglo force-pushed the rfind branch 2 times, most recently from 311d926 to bc63299 Compare February 1, 2024 14:18
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!

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
@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>
# for free to join this conversation on GitHub. Already have an account? # 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