cargo-dist icon indicating copy to clipboard operation
cargo-dist copied to clipboard

How to set RUSTFLAGS in release.yml?

Open Kodylow opened this issue 10 months ago • 2 comments

I need to set rustflags = ["--cfg", "tokio_unstable"]

or export RUSTFLAGS="--cfg tokio_unstable"

as part of my build, but can't figure out how to get release.yml to pick it up. When I modify the release.yml generated by cargo-dist to set RUSTFLAGS inline whenever it runs build I get an error that the release.yml is dirty as part of plan.

What's the correct way to set build flags for cargo-dist as part of CI?

Kodylow avatar Apr 20 '24 19:04 Kodylow

You can append an env block to the build task and set RUSTFLAGS that way. See example here: https://github.com/penumbra-zone/penumbra/blob/b7da9ece7c81a616b6b1222592eb305a7908f61a/.github/workflows/release.yml#L108

conorsch avatar Apr 22 '24 15:04 conorsch

Okay got it woorking this way, thanks!

Kodylow avatar Apr 22 '24 23:04 Kodylow