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

rustc warns when finding an unknown jobserver style #120532

Open
ojeda opened this issue Jan 31, 2024 · 2 comments
Open

rustc warns when finding an unknown jobserver style #120532

ojeda opened this issue Jan 31, 2024 · 2 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-bug Category: This is a bug. D-terse Diagnostics: An error or lint that doesn't give enough information about the problem at hand.

Comments

@ojeda
Copy link
Contributor

ojeda commented Jan 31, 2024

rustc warns when finding an unknown jobserver style, but the Make manual seems to suggest to ignore it (since new kinds may be introduced in the future), or at least that is one possible interpretation:

If your tool does not recognize the format of the --jobserver-auth string, it should assume the jobserver is using a different style and it cannot connect.

One could also read that as "... and then warn about it", like it asks to do for the simple pipe case. But if that is the case, I am not sure why it would say "it cannot connect" since obviously one would not be able to do so, i.e. I take it to mean "ignore it".

Thus, should CannotParse from jobserver be taken as an OK case, or should we keep the current behavior?

$ echo 'fn main() {}' | MAKEFLAGS=--jobserver-auth=new rustc -
warning: failed to connect to jobserver from environment variable `MAKEFLAGS="--jobserver-auth=new"`: cannot parse jobserver environment variable value: expected `fifo:PATH` or `R,W`, found `new`
  |
  = note: the build environment is likely misconfigured

From #120515.

@ojeda ojeda added the C-bug Category: This is a bug. label Jan 31, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jan 31, 2024
@petrochenkov
Copy link
Contributor

I'd prefer to keep the current behavior, if some specific --jobserver-auth format actually exists and is used, then jobserver-rs should support it, and the we won't report a warning in that specific case.

@ojeda
Copy link
Contributor Author

ojeda commented Feb 1, 2024

Yeah, though users may have updated GNU Make and not rustc. Now, that may be unlikely, and it requires a new jobserver style to begin with, but it could happen. But, in that case, I would expect users to force their GNU Make to use an older jobserver style if they are really the kind of project that cannot upgrade rustc. So I think it is OK.

Perhaps what we should do here, for this case in particular, is adding a note: or similar to the diagnostic hinting users to do precisely that (upgrade or pass an older --jobserver-style to Make).

@jieyouxu jieyouxu added A-diagnostics Area: Messages for errors, warnings, and lints D-terse Diagnostics: An error or lint that doesn't give enough information about the problem at hand. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-bug Category: This is a bug. D-terse Diagnostics: An error or lint that doesn't give enough information about the problem at hand.
Projects
None yet
Development

No branches or pull requests

4 participants