Commit Graph

583 Commits

Author SHA1 Message Date
Vladimír Čunát
040c460262
Revert "rustc: avoid rebuild on linux right now"
This reverts commit 68538d36ce.
2024-07-01 09:26:16 +02:00
Vladimír Čunát
68538d36ce
rustc: avoid rebuild on linux right now 2024-07-01 07:32:23 +02:00
Robert Scott
4839263513 rustc: disable zerocallusedregs hardening flag on clang stdenv
to reverse breakage due to it not being supported by
clang when building for wasm32. really we should not be
using a wrapped compiler to build for wasm, but that's
a tangled knot..
2024-06-30 22:46:46 +01:00
Winter
2de1fd60fc
Revert "rust: Write config.toml not config" 2024-06-23 12:32:29 -04:00
Manuel Mendez
3f7663c1d7 rust: Write to .cargo/config.toml instead of .cargo/config
Seeing the following new warnings pop up on stderr when cargo was bumped
to 1.78:

```
warning: `/build/.cargo/config` is deprecated in favor of `config.toml`
note: if you need to support cargo 1.38 or earlier, you can symlink `config` to `config.toml`
```

which happens to break commitmsgfmt builds in nix (#320294).

closes #320294
2024-06-19 14:56:51 -04:00
Alyssa Ross
b00f262516 Revert "rustc: disable wasm32 if some gcc options are set"
This reverts commits 6d0ba08b97,
723100d83b, and
bf13eca852.

The underlying issue has now been fixed, so we can re-enable
wasm32-unknown-unknown on all platforms.
2024-06-15 08:02:29 +02:00
github-actions[bot]
c8c2ff3b9b
Merge staging-next into staging 2024-06-10 00:02:49 +00:00
Alyssa Ross
3df6bb2c85
Merge remote-tracking branch 'origin/master' into staging-next
Conflicts:
	pkgs/applications/blockchains/polkadot/default.nix
2024-06-09 22:47:12 +01:00
Alexis Hildebrandt
f8c4a98e8e treewide: Remove the definite article from meta.description
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-09 23:08:46 +02:00
Alexis Hildebrandt
755b915a15 treewide: Remove indefinite article from meta.description
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-09 23:07:45 +02:00
github-actions[bot]
afa876d6fe
Merge staging-next into staging 2024-06-09 12:01:33 +00:00
Alyssa Ross
bf13eca852
rustc: disable wasm32 if some gcc options are set
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-09 07:20:18 +01:00
github-actions[bot]
d7993cebbc
Merge staging-next into staging 2024-06-05 12:01:43 +00:00
Alyssa Ross
ddc356c1f0 buildPackages.rustc: fix cross
Fixes: 23d4f83453 ("cargo,clippy,rustc,rustfmt: 1.77.2 -> 1.78.0")
2024-06-05 09:58:33 +01:00
Artemis Tosini
8135af13f1 rustc: Add support for FreeBSD 2024-05-31 14:12:12 -07:00
Vladimír Čunát
30d447f909
Merge #309580: cargo,clippy,rustc,rustfmt: 1.77.2 -> 1.78.0
...into staging
2024-05-30 11:16:59 +02:00
Alyssa Ross
07f40e6892 rustc: don't try to use non-existent rust-lld
This removes the need to manually override Rust's default linker for
every package that builds for wasm32-unknown-unknown.
2024-05-29 23:08:09 +02:00
Alyssa Ross
b08a915532 treewide: drop workarounds for cargo --frozen
Since 4816a73bb5 ("rustPlatform: --frozen -> --offline"), these are
no longer necessary!
2024-05-19 11:15:55 +02:00
Alyssa Ross
23d4f83453
cargo,clippy,rustc,rustfmt: 1.77.2 -> 1.78.0 2024-05-06 11:52:01 +02:00
github-actions[bot]
dfdd2255bb
Merge staging-next into staging 2024-05-01 18:01:55 +00:00
John Ericson
266cdd7d37 treewide: freebsd13 -> freebsd
Co-authored-by: Alyssa Ross <hi@alyssa.is>
2024-04-30 18:20:23 -04:00
Alyssa Ross
b0a2a754fe
cargo,clippy,rustc,rustfmt: 1.77.1 -> 1.77.2
Fixes: CVE-2024-24576
2024-04-25 08:35:09 +02:00
Vladimír Čunát
8cb7d7cc7f
Merge #303214: rustc: build rustdoc even when cross compiling
...into staging
2024-04-12 06:33:38 +02:00
Alyssa Ross
9e0eb58032
rustc: build rustdoc even when cross compiling
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: 6f8fa05acf ("wrapRustc: wrap rustdoc")
2024-04-10 23:09:42 +02:00
Alyssa Ross
9bbc57f5a1
cargo,clippy,rustc,rustfmt: 1.76.0 -> 1.77.1 2024-04-08 18:46:59 +02:00
Martin Weinelt
3321e63b12
Merge remote-tracking branch 'origin/master' into staging-next
Conflicts:
- pkgs/development/python-modules/sphinx-autobuild/default.nix
2024-03-19 04:00:32 +01:00
stuebinm
ff1a94e523 treewide: add meta.mainProgram to packages with a single binary
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-19 03:14:51 +01:00
github-actions[bot]
339816cfdf
Merge staging-next into staging 2024-03-11 12:01:42 +00:00
Atemu
ce8ddcd321
Merge pull request #281192 from diogotcorreia/pgvecto.rs
postgresqlPackages.pgvecto-rs: init at 0.2.1
2024-03-11 07:12:52 +00:00
Weijia Wang
8aa26d372f
Merge pull request #290247 from r-ryantm/auto-update/cargo-auditable
cargo-auditable: 0.6.1 -> 0.6.2
2024-03-09 02:25:00 +01:00
Diogo Correia
72e550dbcc
rustPlatform: fix override on hooks
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-07 13:00:50 +00:00
Alyssa Ross
6f8fa05acf
wrapRustc: wrap rustdoc
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: 79156bf13a ("rustc: move crt-static default override to wrapper (#291829)")
2024-03-02 13:09:07 +01:00
Alyssa Ross
79156bf13a
rustc: move crt-static default override to wrapper (#291829)
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-28 23:10:07 +01:00
Alyssa Ross
866d117d42 cargo,rustc: 1.75.0 -> 1.76.0 2024-02-26 11:32:10 +01:00
R. Ryantm
2776ca8dcc cargo-auditable: 0.6.1 -> 0.6.2 2024-02-20 19:31:48 +00:00
Nick Cao
66dcc7de5f
Merge pull request #284079 from MatthewCash/add-clippy-mainProgram
clippy: set meta.mainProgram
2024-01-27 11:17:28 -05:00
Matthew_Cash
3672dd4c3d
clippy: add mainProgram 2024-01-26 11:11:50 -08:00
Alyssa Ross
3bf20e5bf8
rust.envVars: use wrapped LLD for aarch64 musl
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-23 17:25:50 +01:00
Alyssa Ross
f3a07da669
rust: use pkgsBuildHost/pkgsTargetTarget
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-23 17:25:23 +01:00
K900
bff9ee8862 Merge remote-tracking branch 'origin/master' into staging-next 2024-01-09 13:03:34 +03:00
Ryan Burns
c324705cc3 treewide: simplify exec format conditionals 2024-01-07 17:43:33 -08:00
github-actions[bot]
7c48a66399
Merge master into staging-next 2024-01-05 12:01:19 +00:00
Yureka
d890c560a6 rustc: fix musl crt_static substituteInPlace path 2024-01-04 15:06:30 +01:00
Paul Lietar
8e1e16fdcb rustc: Fix building cross-compilers for no_std targets.
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'
2024-01-04 10:18:33 +00:00
Alyssa Ross
28d97a5286 rustc,cargo: 1.74.1 -> 1.75.0 2023-12-30 03:20:36 +01:00
Vladimír Čunát
de84adb292
Merge branch 'master' into staging-next 2023-12-29 14:00:30 +01:00
Sergei Trofimovich
a3957236ce cargo: fix tests eval
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-29 10:20:59 +10:00
github-actions[bot]
24a900e557
Merge master into staging-next 2023-12-26 00:02:12 +00:00
Jörg Thalheim
e25b2d4e37
rustc: link to https homepage 2023-12-25 20:52:38 +01:00
Jörg Thalheim
4d8e7dfe21
cargo: fix description and homepage 2023-12-25 20:51:26 +01:00