-
Notifications
You must be signed in to change notification settings - Fork 16
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
add env
option to pass environment like RUSTFLAGS
#36
Comments
You can set rustflags globally in In the meantime, it wouldn't be very hard to add support for this to the action. |
Yes, I workaround things by overwriting it for now
That's ok for this scenario, while However, adding the |
I was thinking about how I'd actually implement this, and I'm not sure it's worth doing. All of the inputs that an action defines must be strings. The caller can use things like YAML boolean values, but in the action this is a string. This is why I have to write things like this in the action YAML: When I added caching, I wanted to accept all of the inputs that the This "inputs must be strings" issue also comes up with env vars. What I'd like to do is accept a list of key-value pairs. But since I can only take a string, it'd either have to be JSON or a delimited list of pairs like this:
And then internally, all I would do with this input is parse it and
So it seems to me that it'd be a lot easier for callers to just put variables in All of which is to say that I think the best approach here is for me to simply document that you can set env vars yourself this way. The one thing that this doesn't give you is isolation. Once the vars are set, they're set for all remaining steps in the job. But you could always set them to a different value, including an empty string, after a given step. But I don't think this one downside is enough to justify the complexity of supporting this, especially given how bad the API for passing these to the action would be. |
Actually, I realized there's a very way to set env vars already!
I will document this in the |
will that pass environment variables to docker? |
It looks like cross does pass through all the relevant environment variables - https://github.com/cross-rs/cross/blob/main/docs/environment_variables.md |
Great, they said much of cargo-related environment variables will passthrough by default Could we access original |
This action should definitely not be modifying a |
Yeah, I will add this note |
For example, to profile build time with
RUSTFLAGS="-Z self-profile"
(and collect *.mm_profdata),setting
RUSTFLAGS
is requiredUpdate: for this case, setting build.rustflags in .cargo/config.toml could fit
The text was updated successfully, but these errors were encountered: