Nix Rust | 676 Members | |
| Rust | 153 Servers |
| Sender | Message | Time |
|---|---|---|
| 19 Jul 2025 | ||
| Is there any way (that is acceptable inside nixpkgs) to build a rust based project using only LLVM/clang? I'm seeing that the rustc's setEnv is using gcc even if I try to provide a different stdenv for buildRustPackage. | 22:58:02 | |
| * Is there any way (that is acceptable inside nixpkgs) to build a rust based project using only LLVM/clang? (on linux) I'm seeing that the rustc's setEnv is using gcc even if I try to provide a different stdenv for buildRustPackage. | 22:58:16 | |
pkgsLLVM is a good way | 23:03:16 | |
| I think we bake that stuff in annoyingly early | 23:03:17 | |
| we tried to get rid of setEnv but had to put it back | 23:03:29 | |
In reply to @rosscomputerguy:matrix.orgnot for an individual package in Nixpkgs though? | 23:03:44 | |
In reply to @emilazy:matrix.orgTrue | 23:03:57 | |
I think you might be able to produce a buildRustPackage that bakes in a different compiler but trying to kill setEnv again may be more fruitful | 23:04:26 | |
| 20 Jul 2025 | ||
Unfortunately, no (not currently). setEnv uses pkgsBuildHost.stdenv.cc, which rustPlatform doesn’t provide a way to override. | 14:52:53 | |
This was a motivating use case for taking libSystem out of the stdenv in the SDK rework. Overriding the SDK prior to that varied from difficult to impossible. | 14:54:28 | |
| 21 Jul 2025 | ||
| Note: Some breaking changes to the JSON target format will probably be merged to rustc soonish. I know Nixpkgs exposes that as an API so for anyone relying on it, they should be aware. | 02:21:56 | |
| https://github.com/rust-lang/rust/pull/144218 | 02:22:16 | |
| 09:29:07 | ||
| 22 Jul 2025 | ||
| 06:11:48 | ||
| 18:27:45 | ||
| 23 Jul 2025 | ||
| 02:11:18 | ||
In reply to @glepage:matrix.orgOpened a PR with a fix: https://github.com/NixOS/nixpkgs/pull/427702 | 15:46:30 | |
| I think we can agree that fetchCargoVendor being a two step construction is not very good for the cache. Now I think I came up with a pretty clever workaround, which keeps the two layers, but makes the non-FOD layer essentially just an empty derivation except a binary that you can run to start the unpacking process. Though, this would make it so that we can't "easily" get derivation with the vendored dependencies unpacked from the tarball. (Also, I put in a symlink into the non-FOD part for vendorStaging for easier access) I made a very rudimentary POC: https://github.com/NixOS/nixpkgs/pull/427815 Note: I did not take into consideration cross/splicing What do you all think? | 17:45:49 | |
| "a dependency on fetch-cargo-vendor-util for every rust package" doesn't seem like an issue, does it? | 17:47:21 | |
| 17:47:31 | |
| * >90% of Rust packages will already have that dependency and it's just a lightweight Python script, yeah? | 17:47:36 | |
| I worry about inf-rec since the fetch-cargo-vendor-util depends on cargo, which depends on cargoSetupHook IIRC. I havr not tried it though | 17:50:46 | |
| * I worry about inf-rec since the fetch-cargo-vendor-util depends on cargo, which depends on cargoSetupHook IIRC. I have not tried it though | 17:51:03 | |
| usually we use overrides to solve that | 17:54:18 | |
(cargoSetupHook.override { fetch-cargo-vendor-util = null; }) | 17:54:29 | |
| True | 17:54:45 | |
| I'm assuming that some people are using a custom implementation for vendoring. (e.g. for some authentication logic IDK) and their logic assumes that cargoSetupHook expects an unpacked cargo vendor structure. But maybe I'm overthinking this. Yes getting rid of the two steps would be healthier for easier overriding of hashes via overrideAttrs Anyways, I have to go now... I'll be back in an hour or so, sorry! | 17:59:23 | |
| we could expect such users to override it out of the setup hook | 18:00:53 | |
| we probably should have added a marker though 😅 | 18:01:04 | |
| wait | 18:01:08 | |