Skip to content

The rust writer is broken on darwin #126182

@sternenseemann

Description

@sternenseemann

Describe the bug

nix-build -A tests.writers results in the following error on x86_64-darwin:

error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-m64" "-arch" "x86_64" "-L" "/nix/store/ly04c58zsvb4c219sv6q393dik249hjy-rustc-1.52.1/lib/rustlib/x86_64-apple-darwin/lib" "/nix/store/153dkqp6bjpp3cg80bd8mxafk2bmllwi-test_writers_rust_bin.tmp.7rcbfp3g-cgu.0.rcgu.o" "/nix/store/153dkqp6bjpp3cg80bd8mxafk2bmllwi-test_writers_rust_bin.tmp.7rcbfp3g-cgu.1.rcgu.o" "/nix/store/153dkqp6bjpp3cg80bd8mxafk2bmllwi-test_writers_rust_bin.tmp.7rcbfp3g-cgu.2.rcgu.o" "/nix/store/153dkqp6bjpp3cg80bd8mxafk2bmllwi-test_writers_rust_bin.tmp.7rcbfp3g-cgu.3.rcgu.o" "/nix/store/153dkqp6bjpp3cg80bd8mxafk2bmllwi-test_writers_rust_bin.tmp.7rcbfp3g-cgu.4.rcgu.o" "/nix/store/153dkqp6bjpp3cg80bd8mxafk2bmllwi-test_writers_rust_bin.tmp.7rcbfp3g-cgu.5.rcgu.o" "/nix/store/153dkqp6bjpp3cg80bd8mxafk2bmllwi-test_writers_rust_bin.tmp.7rcbfp3g-cgu.6.rcgu.o" "/nix/store/153dkqp6bjpp3cg80bd8mxafk2bmllwi-test_writers_rust_bin.tmp.7rcbfp3g-cgu.7.rcgu.o" "-o" "/nix/store/153dkqp6bjpp3cg80bd8mxafk2bmllwi-test_writers_rust_bin" "/nix/store/153dkqp6bjpp3cg80bd8mxafk2bmllwi-test_writers_rust_bin.4i0hgzmnpf4h2pz.rcgu.o" "-Wl,-dead_strip" "-nodefaultlibs" "-L" "/nix/store/ly04c58zsvb4c219sv6q393dik249hjy-rustc-1.52.1/lib/rustlib/x86_64-apple-darwin/lib" "/nix/store/ly04c58zsvb4c219sv6q393dik249hjy-rustc-1.52.1/lib/rustlib/x86_64-apple-darwin/lib/libstd-8ecebea30c961804.rlib" "/nix/store/ly04c58zsvb4c219sv6q393dik249hjy-rustc-1.52.1/lib/rustlib/x86_64-apple-darwin/lib/libpanic_unwind-78b8371c8829edb9.rlib" "/nix/store/ly04c58zsvb4c219sv6q393dik249hjy-rustc-1.52.1/lib/rustlib/x86_64-apple-darwin/lib/libobject-11c2250f76ee79de.rlib" "/nix/store/ly04c58zsvb4c219sv6q393dik249hjy-rustc-1.52.1/lib/rustlib/x86_64-apple-darwin/lib/libaddr2line-138200afe481d69a.rlib" "/nix/store/ly04c58zsvb4c219sv6q393dik249hjy-rustc-1.52.1/lib/rustlib/x86_64-apple-darwin/lib/libgimli-50edf7ed96dca7d7.rlib" "/nix/store/ly04c58zsvb4c219sv6q393dik249hjy-rustc-1.52.1/lib/rustlib/x86_64-apple-darwin/lib/librustc_demangle-f5add760ba32d8c5.rlib" "/nix/store/ly04c58zsvb4c219sv6q393dik249hjy-rustc-1.52.1/lib/rustlib/x86_64-apple-darwin/lib/libhashbrown-107795e7ae43b1fc.rlib" "/nix/store/ly04c58zsvb4c219sv6q393dik249hjy-rustc-1.52.1/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_alloc-1a28e1881ca37aeb.rlib" "/nix/store/ly04c58zsvb4c219sv6q393dik249hjy-rustc-1.52.1/lib/rustlib/x86_64-apple-darwin/lib/libunwind-0b60cab5e184de42.rlib" "/nix/store/ly04c58zsvb4c219sv6q393dik249hjy-rustc-1.52.1/lib/rustlib/x86_64-apple-darwin/lib/libcfg_if-20066734a370e7ce.rlib" "/nix/store/ly04c58zsvb4c219sv6q393dik249hjy-rustc-1.52.1/lib/rustlib/x86_64-apple-darwin/lib/liblibc-0688efbb4c57e170.rlib" "/nix/store/ly04c58zsvb4c219sv6q393dik249hjy-rustc-1.52.1/lib/rustlib/x86_64-apple-darwin/lib/liballoc-0c8da59b450dd54a.rlib" "/nix/store/ly04c58zsvb4c219sv6q393dik249hjy-rustc-1.52.1/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_core-159337c2037ece59.rlib" "/nix/store/ly04c58zsvb4c219sv6q393dik249hjy-rustc-1.52.1/lib/rustlib/x86_64-apple-darwin/lib/libcore-1ba7a3965a87fb70.rlib" "/nix/store/ly04c58zsvb4c219sv6q393dik249hjy-rustc-1.52.1/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-2f50c7e4a63f3402.rlib" "-lSystem" "-lresolv" "-lc" "-lm" "-liconv"
  = note: ld: library not found for -liconv
          collect2: error: ld returned 1 exit status
          

error: aborting due to previous error

Seems like the writer expects to be executed in a stdenv environment to find iconv instead of knowing the path to it.

To Reproduce

nix-build -A tests.writers

Notify maintainers

@NixOS/darwin-maintainers, @madjar @cstrahan @globin @Havvy (rust maintainers)

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bugSomething is broken6.topic: darwinRunning or building packages on Darwin6.topic: rustGeneral-purpose programming language emphasizing performance, type safety, and concurrency.
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions