Skip to content

Build failure on Nix: panics with MissingOption for --out-dir #225

@HeitorAugustoLN

Description

@HeitorAugustoLN

Hello,

When building the cosmic-initial-setup package on Nix/NixOS, the build fails due to a panic within cargo-auditable. The error message indicates that cargo-auditable expected an --out-dir argument but did not receive one.

This appears to be related to how the Nix build environment invokes rustc, which may differ from a standard Cargo build and cause this unwrap() to fail.

Error Log:

cosmic-initial-setup> error: failed to run `rustc` to learn about target-specific information
cosmic-initial-setup>
cosmic-initial-setup> Caused by:
cosmic-initial-setup>   process didn't exit successfully: `/nix/store/wwg0dja74scm2nwqb2l28n87pazcaf8h-cargo-auditable-0.6.5/bin/cargo-auditable rustc - --crate
      -name ___ --print=file-names --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro
      --print=sysroot --print=split-debuginfo --print=crate-name --print=cfg -Wwarnings` (exit status: 101)
cosmic-initial-setup>   --- stderr
cosmic-initial-setup>
cosmic-initial-setup>   thread 'main' panicked at cargo-auditable/src/rustc_wrapper.rs:91:36:
cosmic-initial-setup>   called `Result::unwrap()` on an `Err` value: MissingOption(Keys(["--out-dir", ""]))
cosmic-initial-setup>   note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
cosmic-initial-setup>
cosmic-initial-setup> error: custom attribute panicked
cosmic-initial-setup>   --> src/page/welcome.rs:11:1
cosmic-initial-setup>    |
cosmic-initial-setup> 11 | #[crabtime::function]
cosmic-initial-setup>    | ^^^^^^^^^^^^^^^^^^^^^
cosmic-initial-setup> ...
cosmic-initial-setup> 27 | gen_dpi_scale_variables!([50, 75, 100, 125, 150, 175, 200, 225, 250, 275, 300]);
cosmic-initial-setup>    | ------------------------------------------------------------------------------- in this macro invocation
cosmic-initial-setup>    |
cosmic-initial-setup>    = help: message: thread 'main' panicked at cargo-auditable/src/rustc_wrapper.rs:91:36:
cosmic-initial-setup>              called `Result::unwrap()` on an `Err` value: MissingOption(Keys(["--out-dir", ""]))
cosmic-initial-setup>              note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
cosmic-initial-setup>
cosmic-initial-setup>    = note: this error originates in the macro `gen_dpi_scale_variables` (in Nightly builds, run with -Z macro-backtrace for more info)
cosmic-initial-setup>
cosmic-initial-setup> error[E0425]: cannot find value `DPI_SCALE_LABELS` in this scope
cosmic-initial-setup>   --> src/page/welcome.rs:95:17
cosmic-initial-setup>    |
cosmic-initial-setup> 95 |                 DPI_SCALE_LABELS,
cosmic-initial-setup>    |                 ^^^^^^^^^^^^^^^^ not found in this scope

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions