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

allow disabling RUSTFLAGS config #18

Merged
merged 5 commits into from
May 29, 2023

Conversation

JeanMertz
Copy link
Contributor

The change in behaviour allows people to use this action, without overwriting their own rustflags configurations.

@jonasbb
Copy link
Member

jonasbb commented May 19, 2023

Hi, thanks for the PR. The rustflags handling of cargo is quite bad, so it makes sense to suppress setting RUSTFLAGS.

You deleted the previous logic of never overwriting RUSTFLAGS. Any particular reason for removing that check? Otherwise I think it makes sense to keep that. Either in general or maybe only as long as it is the default value. For example if you set RUSTFLAGS in your build matrix then those values should not simply be overriden.

@JeanMertz
Copy link
Contributor Author

I don't mind adding it back, but the reason I removed it is two-fold:

  1. Since there's now a rustflags option, that somewhat makes it obvious that if you keep it as the default, it'll set RUSTFLAGS.
  2. But also, explaining what happens when became a bit more awkward if you keep both. As the default of the rustflags option is only applied if RUSTFLAGS isn't already set.

@jonasbb
Copy link
Member

jonasbb commented May 19, 2023

I think I rather keep the old behavior. Yes now there are two ways to set the RUSTFLAGS variable, but that seems ok.

But also, explaining what happens when became a bit more awkward if you keep both. As the default of the rustflags option is only applied if RUSTFLAGS isn't already set.

There are only three options. I would just describe it on a case by case basis.

  1. RUSTFLAGS is already set. In that case, the variable is left untouched.
  2. The variable is unset and rustflags input is empty. The variable remains unset.
  3. Otherwise, set the environment variable RUSTFLAGS to the content of rustflags.

@jonasbb
Copy link
Member

jonasbb commented May 29, 2023

I took your PR and added back the behavior to not touch existing RUSTFLAGS variables. I wrote the changelog too.

@jonasbb jonasbb merged commit f3c84ee into actions-rust-lang:main May 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants