forge
Explore
Log in

Don't you dare go Hollow

Use `RUSTFLAGS` instead of `CARGO_BUILD_RUSTFLAGS` in dev shell

Browse files at this commit

6f1a2c5f0e8274223d4204b1f8d6f7f91538967eNoratriebParent: f717ae0
`CARGO_BUILD_RUSTFLAGS` has a very low precedence and is overruled by
global `target.<tuple>.rustflags`.
Since these rustflags are very important, ensure that they have a higher
precedence. We could even go for `CARGO_ENCODED_RUSTFLAGS` which has the
highest precedence, but is slightly annoying to construct and probably
not worth it.
flake.nixmodified+4 -4
@@ -139,8 +139,8 @@
139139 '';
140140
141141 env = {
142- # Force linking with libEGL and libwayland-client
143- # so they can be discovered by `dlopen()`
142+ # Force linking with libEGL and libwayland-client so they end up in RPATH and
143+ # can be discovered by `dlopen()`
144144 RUSTFLAGS = toString (
145145 map (arg: "-C link-arg=" + arg) [
146146 "-Wl,--push-state,--no-as-needed"
@@ -225,8 +225,8 @@
225225 # It is required for `dlopen()` to work on some libraries; see the comment
226226 # in the package expression
227227 #
228- # This should only be set with `CARGO_BUILD_RUSTFLAGS="$CARGO_BUILD_RUSTFLAGS -C your-flags"`
229- CARGO_BUILD_RUSTFLAGS = niri.RUSTFLAGS;
228+ # This should only be set with `RUSTFLAGS="$RUSTFLAGS -C your-flags"`
229+ RUSTFLAGS = niri.RUSTFLAGS;
230230 };
231231 };
232232 }