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

crosvm: warn that NIX_CFLAGS_COMPILE will break the build #204694

Closed
wants to merge 1 commit into from
Closed

crosvm: warn that NIX_CFLAGS_COMPILE will break the build #204694

wants to merge 1 commit into from

Commits on Dec 6, 2022

  1. crosvm: warn that NIX_CFLAGS_COMPILE will break the build

    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)
    ```
    Adam Joseph committed Dec 6, 2022
    Configuration menu
    Copy the full SHA
    483bfdf View commit details
    Browse the repository at this point in the history