about summary refs log tree commit diff
path: root/pkgs/development/compilers/rust
AgeCommit message (Collapse)AuthorFilesLines
2024-06-09Merge remote-tracking branch 'origin/master' into staging-nextAlyssa Ross5-6/+6
Conflicts: pkgs/applications/blockchains/polkadot/default.nix
2024-06-09treewide: Remove the definite article from meta.descriptionAlexis Hildebrandt1-1/+1
nix run nixpkgs#silver-searcher -- -G '\.nix$' -0l 'description.*"([Tt]he)? ' pkgs \ | xargs -0 nix run nixpkgs#gnused -- -i '' -Ee 's/(description.*")[Tt]he (.)/\1\U\2/'
2024-06-09treewide: Remove indefinite article from meta.descriptionAlexis Hildebrandt5-5/+5
nix run nixpkgs#silver-searcher -- -G '\.nix$' -0l 'description.*"[Aa]n?' pkgs \ | xargs -0 nix run nixpkgs#gnused -- -i '' -Ee 's/(description.*")[Aa]n? (.)/\1\U\2/'
2024-06-09rustc: disable wasm32 if some gcc options are setAlyssa Ross1-1/+3
This is a temporary fix to get rustc building again with these configurations (which notably include the default aarch64-darwin one) without causing a stdenv rebuild. The real fix will be to avoid passing these options through the Clang wrapper when the target is overridden. It could be that there are packages that need wasm32-unknown-unknown beyond those I've marked as broken here — it's impossible to be sure without a full rebuild. But this should be most of them.
2024-06-05buildPackages.rustc: fix crossAlyssa Ross1-0/+4
Fixes: 23d4f834536b ("cargo,clippy,rustc,rustfmt: 1.77.2 -> 1.78.0")
2024-05-30Merge #309580: cargo,clippy,rustc,rustfmt: 1.77.2 -> 1.78.0Vladimír Čunát2-59/+59
...into staging
2024-05-29rustc: don't try to use non-existent rust-lldAlyssa Ross1-0/+6
This removes the need to manually override Rust's default linker for every package that builds for wasm32-unknown-unknown.
2024-05-19treewide: drop workarounds for cargo --frozenAlyssa Ross1-5/+0
Since 4816a73bb53c ("rustPlatform: --frozen -> --offline"), these are no longer necessary!
2024-05-06cargo,clippy,rustc,rustfmt: 1.77.2 -> 1.78.0Alyssa Ross2-59/+59
2024-05-01Merge staging-next into staginggithub-actions[bot]1-1/+1
2024-04-30treewide: freebsd13 -> freebsdJohn Ericson1-1/+1
Co-authored-by: Alyssa Ross <hi@alyssa.is>
2024-04-25cargo,clippy,rustc,rustfmt: 1.77.1 -> 1.77.2Alyssa Ross1-2/+2
Fixes: CVE-2024-24576
2024-04-12Merge #303214: rustc: build rustdoc even when cross compilingVladimír Čunát1-1/+1
...into staging
2024-04-10rustc: build rustdoc even when cross compilingAlyssa Ross1-1/+1
rustdoc is built for native builds, because it's used to run doctests, but it wasn't built for cross builds, since they don't run doctests. This inconsistency led to wrapRustc not working for cross-compiled rustc, because it expected there to be a rustdoc binary. In the interests of consistency, let's instruct the build system to always build rustdoc. Link: https://github.com/NixOS/nixpkgs/pull/292777#issuecomment-2048071969 Fixes: 6f8fa05acf5e ("wrapRustc: wrap rustdoc")
2024-04-08cargo,clippy,rustc,rustfmt: 1.76.0 -> 1.77.1Alyssa Ross2-16/+24
2024-03-19Merge remote-tracking branch 'origin/master' into staging-nextMartin Weinelt2-0/+2
Conflicts: - pkgs/development/python-modules/sphinx-autobuild/default.nix
2024-03-19treewide: add meta.mainProgram to packages with a single binarystuebinm2-0/+2
The nixpkgs-unstable channel's programs.sqlite was used to identify packages producing exactly one binary, and these automatically added to their package definitions wherever possible.
2024-03-11Merge staging-next into staginggithub-actions[bot]1-2/+2
2024-03-11Merge pull request #281192 from diogotcorreia/pgvecto.rsAtemu1-2/+2
postgresqlPackages.pgvecto-rs: init at 0.2.1
2024-03-09Merge pull request #290247 from r-ryantm/auto-update/cargo-auditableWeijia Wang1-3/+3
cargo-auditable: 0.6.1 -> 0.6.2
2024-03-07rustPlatform: fix `override` on hooksDiogo Correia1-2/+2
Previously, trying to use `.override {}` on one of the hooks, specifically `bindgenHook` would yield in an error. By replacing `callPackage` with `callPackages`, this error is fixed and the overrides are propagated to the hooks. Co-Authored-By: Atemu <atemu.main+nixpkgs@gmail.com>
2024-03-02wrapRustc: wrap rustdocAlyssa Ross1-2/+1
We need to set -crt-static on musl for rustdoc as well, so let's unify the wrappers. Ideally, rather than wrapping rustdoc, we'd have rustdoc use the wrapped rustc, but that's currently only possible with an unstable option (--test-builder). The options set by the wrapper, -C target-feature and --sysroot, are supported by both rustdoc and rustc, but other flags maybe not be supported by both, so I've introduced different environment variables (the existing NIX_RUSTFLAGS and a new NIX_RUSTDOCFLAGS) to allow those to be set independently. This fixes cargo-auditable in pkgsMusl., which broke because its doctests stopped working when -crt-static was moved to the wrapper. Fixes: 79156bf13ae7 ("rustc: move crt-static default override to wrapper (#291829)")
2024-02-28rustc: move crt-static default override to wrapper (#291829)Alyssa Ross2-48/+0
Previously, when cross compiling from non-musl to musl, the crt-static default override wouldn't be applied, because the compiler wouldn't have been built with it due to fastCross. Moving it to the wrapper fixes this without having to introduce extra compiler rebuilds. And because the wrapper is applied even to the bootstrap rustc, we no longer need special handling of crt-static in the Cargo expression. Unlike --sysroot, rustc allows -C target-feature= to be passed multiple times, with later instances taking precedence over earlier ones. This means that it's very easy to set the default in the wrapper, just by our overridden default before any other arguments. This fixes pkgsCross.aarch64-multiplatform-musl.mesa from x86_64-linux.
2024-02-26cargo,rustc: 1.75.0 -> 1.76.0Alyssa Ross1-15/+15
2024-02-20cargo-auditable: 0.6.1 -> 0.6.2R. Ryantm1-3/+3
2024-01-27Merge pull request #284079 from MatthewCash/add-clippy-mainProgramNick Cao1-0/+1
clippy: set meta.mainProgram
2024-01-26clippy: add mainProgramMatthew_Cash1-0/+1
2024-01-23rust.envVars: use wrapped LLD for aarch64 muslAlyssa Ross2-2/+5
The unwrapped version doesn't know where to look for libraries, so this is required to e.g. build anything that uses openssl-sys with OPENSSL_NO_VENDOR. A randomly chosen example package that's fixed by this change is pkgsStatic.gitoxide.
2024-01-23rust: use pkgsBuildHost/pkgsTargetTargetAlyssa Ross2-9/+7
We're already using pkgsBuildBuild, and we'll soon be using pkgsBuildTarget, so for consistency, change buildPackages and targetPackages to their corresponding two-component names.
2024-01-09Merge remote-tracking branch 'origin/master' into staging-nextK9001-2/+1
2024-01-07treewide: simplify exec format conditionalsRyan Burns1-2/+1
2024-01-05Merge master into staging-nextgithub-actions[bot]1-1/+1
2024-01-04rustc: fix musl crt_static substituteInPlace pathYureka1-1/+1
2024-01-04rustc: Fix building cross-compilers for no_std targets.Paul Lietar1-1/+1
When building a cross-compiler, the rustc derivation does some tricks to only build the standard library and reuse the host's compiler, leading to much faster build time. Unfortunately, the way the build system was invoked, it would always build the `std` crate, whether or not the target supports it. Some bare-metal targets only support building the `core` and `alloc` crates. By being more vague about the build command, using `library` instead of `library/std`, Rust's build system is able to figure out exactly which crates to build: https://github.com/rust-lang/rust/blob/1.74.1/src/bootstrap/compile.rs#L370-L412 Oddly enough, the install command still needs to use `library/std`, even if building just a subset: https://github.com/rust-lang/rust/blob/1.74.1/src/bootstrap/install.rs#L207 The following command was used to reproduce the original issue. Without this patch, it leads to a build failure when trying to compile one of std's dependencies. With the patch it completes succesfully and produces a working cross-compiler. nix build --impure --expr '(import ./. { crossSystem = { config = "riscv32-none-elf"; rustc.config = "riscv32imc-unknown-none-elf"; }; }).buildPackages.rustc'
2023-12-30rustc,cargo: 1.74.1 -> 1.75.0Alyssa Ross2-61/+61
2023-12-29Merge branch 'master' into staging-nextVladimír Čunát1-1/+1
2023-12-29cargo: fix `tests` evalSergei Trofimovich1-1/+1
Without the change `cargo` tests fail the eval as: $ nix build --no-link -f. cargo.tests error: attribute 'tests' missing at pkgs/development/compilers/rust/cargo.nix:22:15: 21| 22| passthru = { | ^ 23| rustc = rustc; The test teried to pull `tests` attribute from `rustc`, which is a wrapper without `tests`. Pull tests from unwrapped rust instead.
2023-12-26Merge master into staging-nextgithub-actions[bot]1-3/+5
2023-12-25rustc: link to https homepageJörg Thalheim1-1/+1
2023-12-25cargo: fix description and homepageJörg Thalheim1-2/+2
2023-12-25rust: set sourceProvenance for bootstrap binarylinsui1-0/+2
2023-12-16cargo,rustc: 1.74.0 -> 1.74.1Alyssa Ross1-2/+2
2023-12-15Merge staging-next into staginggithub-actions[bot]3-5/+5
2023-12-15clippy: use unwrapped rustc when adding rpath for darwinSamyak S Sarnayak1-2/+2
2023-12-15rustfmt: use unwrapped rustc when adding rpath for darwinSamyak S Sarnayak1-2/+2
fixes nixpkgs#273920
2023-12-15treewide: add __attrsFailEvaluation and __recurseIntoDerivationForReleaseJobsAdam Joseph1-1/+1
2023-12-05rustc-wasm32: merge into rustcAlyssa Ross1-0/+6
Since wasm32-unknown-unknown doesn't require any extra platform-specific dependencies (e.g. libc), we might as well just always include in with rustc. We could also include other targets fitting these criteria, but I wasn't able to find any others that actually build (not even wasm64-unknown-unknown). The old rustc-wasm32 package disabled documentation, but we don't actually need to do that — we just need to allow for some broken links in the wasm32-unknown-unknown documentation. Broken links in documentation are an upstream issue anyway. There's no need we need to fail our build for them.
2023-11-30rustc: use the wrapper for fastCross sysrootAlyssa Ross3-4/+7
This avoids having two layers of wrapper for cross rustc.
2023-11-30rustc: add a compiler wrapperAlyssa Ross5-10/+15
We keep running into situations where we can't get the right combination of rustc flags through build systems into rustc. RUSTFLAGS is the only variable supported across build systems, but if RUSTFLAGS is set, Cargo will ignore all other ways of specifying rustc flags, including the target-specific ones, which we need to make dynamic musl builds work. (This is why pkgsCross.musl64.crosvm is currently broken — it works if you unset separateDebugInfo, which causes RUSTFLAGS not to be set.) So, we need to do the same thing we do for C and C++ compilers, and add a compiler wrapper so we can inject the flags we need, regardless of the build system. Currently the wrapper only supports a single mechanism for injecting flags — the NIX_RUSTFLAGS environment variable. As time goes on, we'll probably want to add additional features, like target-specific environment variables.
2023-11-17rustc,cargo: 1.73.0 -> 1.74.0Alyssa Ross2-23/+16
The BOOTSTRAP_ARGS patch is no longer necessary since 863d2fddd79 ("Pass `-jN` from Make to `BOOTSTRAP_ARGS`"). We now have to set sysconfdir, because since 350ead87205 ("add sanity checks for user write access on `x install`"), the build system will check it can write there, even though nothing actually gets installed there. (Previously it defaulted to /etc.)