crosvm: warn that NIX_CFLAGS_COMPILE will break the build#204694
Conversation
|
Also, it is sad that |
This was a bit of a headache to track down, so I'd like to add a
`warnIf` to save others the hassle.
If you put anything in `NIX_CFLAGS_COMPILE` (including ARM
model-specific spectre mitigation flags), `build.rs` will produce an
empty `constants.json`, which will then cause the `bpf` files to not
be produced, which will result in errors like this at the very end
of the build process:
```
error: couldn't read /build/crosvm-5a49a83/target/aarch64-unknown-linux-gnu/release/build/crosvm-44bfa298077e14a2/out/policy_output/9p_device.bpf: No su
--> /build/crosvm-5a49a83/target/aarch64-unknown-linux-gnu/release/build/crosvm-44bfa298077e14a2/out/bpf_includes.in:2:15
|
2 | ...", include_bytes!("/build/crosvm-5a49a83/target/aarch64-unknown-linux-gnu/release/build/crosvm-44bfa298077e14a2/out/policy_output/9p_device.bpf")
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this error originates in the macro `include_bytes` (in Nightly builds, run with -Z macro-backtrace for more info)
```
|
@lukegb thank you. I think it's time to retire my glitchy dying keyboard before it embarrasses me again... |
|
I found the root cause: upstream stopped shipping the Generating the GCC and Clang disagree on what names to use for a lot of the ARM-specific flags, so I maintain two sets of flags and pick one or the other based on which C compiler a package uses. Unfortunately Nixpkgs doesn't seem to provide any way to indicate that certain flags in Ugh. PS it is unreasonably difficult to get |
|
In case anybody stumbles across this, the fix is in: |
CC @alyssais
Description of changes
(note: this seems to affect only arm, not x86)
This was a bit of a headache to track down, so I'd like to add a
warnIfto save others the hassle.As of crosvm-107, if you put anything in
NIX_CFLAGS_COMPILE(including ARM model-specific spectre mitigation flags),build.rswill produce an emptyconstants.json, which will then cause thebpffiles to not be produced, which will result in errors like this at the very end of the build process:Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)nixos/doc/manual/md-to-db.shto update generated release notes