Skip to content

Fix nix dev#1562

Open
cydparser wants to merge 1 commit intoimmunant:masterfrom
cydparser:fix-nix-dev
Open

Fix nix dev#1562
cydparser wants to merge 1 commit intoimmunant:masterfrom
cydparser:fix-nix-dev

Conversation

@cydparser
Copy link

I was unable to build c2rust and c2rust-refactor without modifying the flake. This change increases LLVM tools to v19.

Copy link
Contributor

@kkysen kkysen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Rua, would you like to review since I know you use Nix?

@Rua
Copy link
Contributor

Rua commented Jan 23, 2026

c2rust itself builds fine, but running the unit tests (scripts/test_translator.py tests/unit) I get a failure because the quadmath library can't be found:

warning: clang: warning: -lgfortran: 'linker' input unused [-Wunused-command-line-argument]
warning: clang: warning: -lquadmath: 'linker' input unused [-Wunused-command-line-argument]
warning: In file included from src/f128.c:1:
warning: In file included from /nix/store/74qjr01q87nwfl0dbsr1s45p8crw3q1f-glibc-2.40-66-dev/include/stdio.h:28:
warning: In file included from /nix/store/74qjr01q87nwfl0dbsr1s45p8crw3q1f-glibc-2.40-66-dev/include/bits/libc-header-start.h:33:
warning: /nix/store/74qjr01q87nwfl0dbsr1s45p8crw3q1f-glibc-2.40-66-dev/include/features.h:422:4: warning: _FORTIFY_SOURCE requires compiling with optimization (-O) [-W#warnings]
warning: 422 | # warning _FORTIFY_SOURCE requires compiling with optimization (-O)
warning: | ^
warning: src/f128.c:2:10: fatal error: 'quadmath.h' file not found
warning: 2 | #include <quadmath.h>
warning: | ^~~~~~~~~~~~
warning: 1 warning and 1 error generated.

error: failed to run custom build command for f128_internal v0.2.2

@cydparser
Copy link
Author

I've added an additional dependency that was needed for cargo test, and removed the stdenv override. @Rua, please reload the dev env and try again.

@Rua
Copy link
Contributor

Rua commented Jan 24, 2026

test_translator.py now runs properly, thanks! cargo test does not, but that wasn't working before with me on Nix, so that's not your fault I think.

@cydparser
Copy link
Author

I've rebased the code. I don't think the lighttpd_minimal test failure is related to my changes.

From analysis/tests/lighttpd-minimal/analysis.txt:

error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `/Users/cyd/src/c2rust/target/debug/c2rust-analyze /nix/store/z9nc2li8ajv7r1l26qcda951gblsxchv-cargo-auditable-0.6.5/bin/cargo-auditable rustc - --crate-name ___ --print=file-names -A warnings --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg` (exit status: 101)
  --- stderr
  error: multiple input filenames provided (first two filenames are `rustc` and `-`)

thread 'main' panicked at '
[ERROR @ c2rust-analyze/src/main.rs:241 @ c2rust_analyze]: error (exit status: 101) running: "/nix/store/nkj16k701yqg7q08szgn4q742hqlww7l-rust-nightly-with-components-2022-08-08/bin/cargo" "check" "--manifest-path" "../analysis/tests/lighttpd-minimal/Cargo.toml"
', c2rust-analyze/src/log.rs:50:17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants