759 Commits

Author SHA1 Message Date
Emily 2f9b7c6c97 rustc: put the linker for the target platform first (#408710) 2025-05-22 21:38:45 +01:00
Emily 1cb94639f5 rustc: pass the linker for the target platform first
Fix `pkgsStatic.buildPackages.rustc` on Darwin.

Closes: #405969
2025-05-22 10:01:45 +01:00
Winter 4efa2ff7a1 rustc: remove redundant libiconv dependency on darwin
libiconv is included in the SDK now.
2025-05-15 15:43:26 -04:00
Winter 3b58d0ac85 rustc: 1.86.0 -> 1.87.0
https://github.com/rust-lang/rust/releases/tag/1.87.0
2025-05-15 15:43:26 -04:00
Niklas Korz ffbfd9c828 rustc: ensure standard library docs are installed
Fixes #405914

Upstream's installation script installs the `docs` component
for every target that is built.
Unfortunately, installing the docs for a target removes the
previous target's docs, ultimately leaving only the docs
of the last target in the list.
In our case, that is a `no_std` target, for which no `alloc`
or `std` docs are built, thus leaving `rustc.doc` without any
standard library docs.
Moving stdenv's `targetPlatform` to the end of the list ensures
we get standard library docs.
2025-05-13 17:54:17 +02:00
K900 f96ac2dcd6 Merge remote-tracking branch 'origin/master' into staging-next 2025-04-26 09:07:48 +03:00
Fernando Rodrigues 05580f4b44 treewide: switch instances of lib.teams.*.members to the new meta.teams attribute
Follow-up to #394797.

Signed-off-by: Fernando Rodrigues <alpha@sigmasquadron.net>
2025-04-25 22:20:17 -03:00
Ihar Hrachyshka dd0f03a56c treewide: remove usage of deprecated apple_sdk framework stubs
They are not doing anything right now. This is in preparation for their
complete removal from the tree.

Note: several changes that affect the derivation inputs (e.g. removal of
references to stub paths in build instructions) were left out. They will
be cleaned up the next iteration and will require special care.

Note: this PR is a result of a mix of ugly regex (not AST) based
automation and some manual labor. For reference, the regex automation
part was hacked in: https://github.com/booxter/nix-clean-apple_sdk

Signed-off-by: Ihar Hrachyshka <ihar.hrachyshka@gmail.com>
2025-04-19 20:28:20 -04:00
aleksana b90cd8e521 rust: add loongarch64-linux platforms 2025-04-19 14:07:41 +02:00
K900 f42e00d66e Merge remote-tracking branch 'origin/master' into staging-next 2025-04-08 10:29:26 +03:00
Winter a19cd4ffb1 Revert "treewide: replace rev with tag"
This reverts commit 65a333600d.

This wasn't tested for correctness with something like fodwatch [0],
and should not have been (self-)merged so quickly, especially without
further review.

It also resulted in the breakage of at least one package [1] (and that's
the one we know of and was caught).

A few packages that were updated in between this commit and this revert
were not reverted back to using `rev`, but other than that, this is a
1:1 revert.

[0]: https://codeberg.org/raphaelr/fodwatch
[1]: https://github.com/NixOS/nixpkgs/pull/396904 / 758551e458
2025-04-08 02:57:25 -04:00
K900 b3146d4446 Merge remote-tracking branch 'origin/master' into staging-next 2025-04-07 21:21:10 +03:00
Pol Dellaiera 65a333600d treewide: replace rev with tag 2025-04-07 16:57:22 +02:00
K900 a832ea381b rustc: fix fastCross
1.86 changed the naming scheme of the stamp files.
2025-04-04 21:57:57 +03:00
K900 f05e28d80d rust: 1.85.0 -> 1.86.0 2025-04-03 14:41:10 +03:00
K900 30830c6791 Merge remote-tracking branch 'origin/staging-next' into staging 2025-04-03 09:16:43 +03:00
Emily 1e6ab3434f treewide: drop support for 32‐bit Darwin
It’s dead, Jim.
2025-04-02 21:20:44 +01:00
Emily 445f90e628 rustPlatform.fetchCargoTarball: drop (#394012) 2025-04-02 21:17:36 +01:00
K900 b6fb91950c treewide: drop allowGitDependencies hack 2025-04-02 10:34:01 +03:00
Silvan Mosberger 374e6bcc40 treewide: Format all Nix files
Format all Nix files using the officially approved formatter,
making the CI check introduced in the previous commit succeed:

  nix-build ci -A fmt.check

This is the next step of the of the [implementation](https://github.com/NixOS/nixfmt/issues/153)
of the accepted [RFC 166](https://github.com/NixOS/rfcs/pull/166).

This commit will lead to merge conflicts for a number of PRs,
up to an estimated ~1100 (~33%) among the PRs with activity in the past 2
months, but that should be lower than what it would be without the previous
[partial treewide format](https://github.com/NixOS/nixpkgs/pull/322537).

Merge conflicts caused by this commit can now automatically be resolved while rebasing using the
[auto-rebase script](https://github.com/NixOS/nixpkgs/tree/8616af08d915377bd930395f3b700a0e93d08728/maintainers/scripts/auto-rebase).

If you run into any problems regarding any of this, please reach out to the
[formatting team](https://nixos.org/community/teams/formatting/) by
pinging @NixOS/nix-formatting.
2025-04-01 20:10:43 +02:00
Emily 7cf0473ccd rustPlatform.fetchCargoTarball: drop 2025-03-28 15:09:52 +00:00
Alex James cc6ed6d742 cargo: avoid using system curl on darwin (again)
Modern versions of macOS link the system-provided curl library against
the system-provided libressl library. On recent versions of macOS, the
system libressl library reads from /private/etc/ssl/openssl.cnf. As this
path is not included in the default Nix sandbox profile, applications
that use the system curl library will report a permission error [1].

PR #300521 previously addressed this for the prebuilt cargo binary used
by the bootstrap version of cargo. It appears that rustc-unwrapped,
which includes its own cargo binary, has the same issue [2]. Similarly
patch it with `install_name_tool` to replace use of the system curl
library with one from nixpkgs.

[1]: https://github.com/NixOS/nix/issues/9625
[2]: https://gist.github.com/al3xtjames/645c8be2c23021aadfe062cfc319c8c4
2025-03-02 10:08:03 +01:00
André Silva b8de2d206a rustc: add wasm32v1-none target 2025-02-24 14:03:08 +01:00
André Silva 6771697393 cargo,clippy,rustfmt,rustc: 1.84.1 -> 1.85.0 2025-02-21 11:38:38 +00:00
Niklas Korz b885ef3fa8 rust: remove obsolete darwin frameworks 2025-02-19 11:09:42 +01:00
Niklas Korz 0289aa115c rustc: enable bpfe library targets 2025-02-19 11:09:42 +01:00
Niklas Korz ea706f9895 rustc: fix combining no_std targets with other targets 2025-02-19 11:09:42 +01:00
Niklas Korz 5d808d3150 rustc: use indented string for buildPhase 2025-02-19 11:09:42 +01:00
Luka Blašković 3250c94d98 cargo,clippy,rustfmt,rustc: 1.84.0 -> 1.84.1 2025-02-03 09:39:30 +10:00
Jörg Thalheim c8b5329e7a rust: fix splicing for rust hooks (#369424) 2025-02-02 00:48:20 +07:00
DavHau db4cf6cb1d rust: fix splicing for rust hooks
This fixes a long standing issue where rust hooks behave differently when used inside buildRustPackage vs inside mkDerivation, which lead to surprising behavior, like for example the package being built for the wrong paltform or the linker not being found especially in cross compilation scenarios.

The reason for this inconsitency was, that buildRustPackage consumed the hooks in a non-spliced form, via [this inherit statement](https://github.com/NixOS/nixpkgs/blob/4506ece030a0c82d078edd0360ea8af6b4d94035/pkgs/development/compilers/rust/make-rust-platform.nix#L60), and therefore the usual platform shift on the hooks introduced by putting them in `nativeBuildInputs` was not applied here.

Thoug whenever the hook was used inside other builders like `mkDerivation` the platform shift did apply correctly as the hook was consumed via the spliced package set, introducing the inconsitecy.

Because of the wrong (non-spliced) use in buildRustPackage, most rust hooks have been designed with the wrong build/host/target shift in mind which is fixed by this change.

Due to the inconsitent behavior between different builders, workarounds like `rust.envVars`, which were previously introduced, likely become obsolete by this change.

This likely fixes a bunch of cross compilation issues for rust packages that are not based on `buildRustPackage` but instead consume the hooks directly.

Done:
- ensure that `buildRustPackage` consumes spliced hooks by using makeScopeWithSplicing' in make-rust-platform.nix.
- refactor hooks to make them refer to correct build/host/target packages.
- remove `rust.envVars` workaround from all rust hooks
- implement tests for most rust hooks in /pkgs/test/rut-hooks

The newly added tests can be executed for native as well as cross compilation via:
```
nix-build -A tests.rust-hooks -A pkgsCross.riscv64.tests.rust-hooks
```
2025-01-31 18:18:46 +07:00
Alyssa Ross 51fa0b03f5 cargo-auditable: useFetchCargoVendor
Cargo 1.84.0 seems to have changed the output format of cargo vendor
again, once again invalidating fetchCargoTarball FOD hashes.  It's
time to fix this once and for all, switching across the board to
fetchCargoVendor, which is not dependent on cargo vendor's output
format.
2025-01-28 13:31:22 +01:00
nixpkgs-ci[bot] 1c845e17be Merge staging-next into staging 2025-01-20 12:06:31 +00:00
Alyssa Ross 5ff390289e cargo,clippy,rustfmt,rustc: 1.83.0 -> 1.84.0 2025-01-20 08:33:25 +01:00
Seth Flynn 397e5bb5a7 rustc: mark broken for LLVM stdenv 2025-01-20 02:32:47 -05:00
Tristan Ross 0b0a0bbaf1 cargo: fix install check phase when cross 2025-01-16 16:00:10 +01:00
Silvan Mosberger 84d4f874c2 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build https://github.com/infinisil/treewide-nixpkgs-reformat-script/archive/a08b3a4d199c6124ac5b36a889d9099b4383463f.tar.gz \
      --argstr baseRev 78e9caf153
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:23:58 +01:00
github-actions[bot] ff82d2df73 Merge staging-next into staging 2024-12-06 18:05:23 +00:00
Gaetan Lepage 464187c486 rustc: patch the path to llvm-strip instead of using /usr/bin/strip on darwin 2024-12-06 13:35:12 +01:00
Alex James 153867a4e3 cargo: avoid using system curl on darwin
Modern versions of macOS link the system-provided curl library against
the system-provided libressl library. On recent versions of macOS, the
system libressl library reads from /private/etc/ssl/openssl.cnf. As this
path is not included in the default Nix sandbox profile, applications
that use the system curl library will report a permission error [1].

This issue affects the bootstrap version of cargo and can be seen while
building rustc for darwin with the sandbox enabled [2]. This change
works around the sandbox failure by using install_name_tool to patch the
cargo binary to use curl provided by Nix, which was the approach used in
oxalica/rust-overlay [3].

[1]: https://github.com/NixOS/nix/issues/9625
[2]: https://gist.github.com/al3xtjames/06bf71ceffd745eef20be8ce03b982c5
[3]: https://github.com/oxalica/rust-overlay/pull/149
2024-12-05 19:23:45 -06:00
Jörg Thalheim 3dbc3ea0bb rustfmt: wrap cargo-fmt with cargo (#291578) 2024-12-01 15:24:12 +01:00
Alyssa Ross 66817904a0 cargo,clippy,rustc,rustfmt: 1.82.0 -> 1.83.0 2024-11-30 11:34:22 +01:00
github-actions[bot] ccbd58eb4d Merge staging-next into staging 2024-11-28 00:15:45 +00:00
jopejoe1 2e2c7f54fd treewide: hide more deprecated stuff if allowAliases is false 2024-11-27 20:51:46 +01:00
figsoda 08fd6ab411 cargo-auditable: 0.6.2 -> 0.6.5 (#355792) 2024-11-25 11:09:11 -05:00
Emily ec34370267 rust: use LLVM 19 2024-11-20 02:14:49 +00:00
Masum Reza 76e7cb3fac rustPlatform.fetchCargoVendor: init (#349360) 2024-11-16 09:30:53 +05:30
TomaSajt 37ce479c7b buildRustPackage: add useFetchCargoVendor flag 2024-11-15 13:09:16 +01:00
figsoda 6c61c50246 cargo-auditable: 0.6.2 -> 0.6.5
Diff: https://github.com/rust-secure-code/cargo-auditable/compare/v0.6.2...v0.6.5

Changelog: https://github.com/rust-secure-code/cargo-auditable/blob/v0.6.5/cargo-auditable/CHANGELOG.md
2024-11-13 20:21:34 -05:00
TomaSajt 1911b1e399 rustPlatform.fetchCargoVendor: init 2024-11-11 15:52:54 +01:00