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

rust: make pkgsCross.wasi32.rustPlatform.buildRustPackage work #323161

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Commits on Oct 20, 2024

  1. Configuration menu
    Copy the full SHA
    4d76556 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b6e6f6f View commit details
    Browse the repository at this point in the history
  3. rustc,rustPlatform: adjust compiler and linker names to match and be …

    …recognizable by rust
    
    rustc infers the linker flavor from the name of the linker, but refuses to recognize "cc" as anything.
    The reasons for this are not well documented, but are hinted at in a comment:
    https://github.com/rust-lang/rust/blob/18deb53874ac4701ba10ebc016cb8cde7a049b82/compiler/rustc_codegen_ssa/src/back/link.rs#L1392-L1397
    In short, "cc" could be (or at least historically could have been) anything, and there's no way to know what flags to pass to it.
    
    This is a problem because nixpkgs insists to on overriding CARG_TARGET_…_LINKER to gcc or clang always,
    but rustc defaults to expecting ldd directly (not wrapped in a compiler) for some targets (e.g. wasi).
    Since rustc did not detec this override changing the flaver, linking has so far been broken for these targets.
    
    Adjusting rustc itself is not absolutely necessary, but a matter of sanity.
    jcaesar committed Oct 20, 2024
    Configuration menu
    Copy the full SHA
    b843ef1 View commit details
    Browse the repository at this point in the history
  4. rustc: wasi32: disable expecting self-contained linker, the nixpkgs d…

    …erivation does not supply one
    jcaesar committed Oct 20, 2024
    Configuration menu
    Copy the full SHA
    4cba6c3 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    e5a2e63 View commit details
    Browse the repository at this point in the history