!FBuJyWXTGcGtHTPphC:nixos.org

Nix Rust

465 Members
Rust111 Servers

Load older messages


SenderMessageTime
12 Oct 2024
@ralith:ralith.comRalith
In reply to @julius:mtx.liftm.de
patching script interpreter paths in /nix/store/…-rustc-1.80.1-doc Why do you take like 3 minutes… :/
too many files, I guess. Would be nice to optimize this.
18:49:57
@ralith:ralith.comRalith(are there even any scripts?)18:50:09
@abose:matrix.orgcatch22
In reply to @artturin:matrix.org
Yep, also supports regex.

I've ended up just adding the fenix toolchain as a home manager package

  home.packages = with pkgs; [
    inputs.fenix.packages.x86_64-linux.stable.toolchain

The nixpkgs rustc and cargo packages just didn't seem to setup the necessary stuff to get picked up by rust-rover or provide standard library such that it would be found.

22:05:46
@abose:matrix.orgcatch22
In reply to @artturin:matrix.org
Yep, also supports regex.
*

I've ended up just adding the fenix toolchain as a home manager package

  home.packages = with pkgs; [
    inputs.fenix.packages.x86_64-linux.stable.toolchain

The nixpkgs rustc and cargo packages just didn't seem to setup the necessary stuff to get picked up by rust-rover or provide standard library such that it would be found.. This one line magically make everything work perfectly

22:12:54
@abose:matrix.orgcatch22Maybe it would be helpful for nixpkgs to provide a standard rust dev toolchain like this alos 22:21:52
@abose:matrix.orgcatch22 * Maybe it would be helpful for nixpkgs to provide a standard rust dev toolchain like this also.22:22:06
13 Oct 2024
@rfvizarra:matrix.orgrfvizarra joined the room.18:37:01
15 Oct 2024
@yehowshua:matrix.orgyehowshua removed their profile picture.17:19:28
16 Oct 2024
@hive:the-apothecary.clubLi-ion changed their profile picture.20:04:41
@tomasajt:matrix.orgToma joined the room.20:59:05
@tomasajt:matrix.orgToma

I was looking through the recent darwin rework when I encountered an hook which gave me an interesting idea.
https://github.com/nixOS/nixpkgs/commit/121149836ef2c33bb62abd323eb95780ac7d59a2
This generates hashes in a script using openssl instead of letting nix fetch and hash the files.
Using this idea we might be able to get rid of importCargoLock usage when it's forced by git dependenies.
(About 270 lockfiles exists because of git dependencies, while only about 65 because of upstream not having the lockfile)

This may be flawed somewhere but the main idea would be to somehow implement importCargoLock in a non-nix language .
If the script encounters a git-dependency, it will fetch it, hash it and throw a hash mismatch error just like with the hook I mentioned above. Then, we could add the hash to outputHashes, which would then generate a .json file that our script will read, and check if the hash still matches.
The non-git dependencies should all have a checksum, those are probably easy to validate.
Finally, the script sets everything else up (e.g. place directories where they belong, create .cargo/config.toml)
As all of this is inside a FOD, a FOD hash will also be generated. This is the only part where the API of this new importCargoLock-like helper would deviate from importCargoLock.

If anyone has some additional ideas, please share them.

I'm aware that there's also another idea where there would be only ""One Big Lockfile"" for all cargo stuff.

21:33:53
@emilazy:matrix.orgemilyAIUI not hashing Git deps was a deliberate hack because Cargo changed the format of them in the past. I believe that something on the lines of what you proposed would work21:36:11
@emilazy:matrix.orgemilythough of course I'm partial to my own major surgery on Rust dependency handling (that I plan to get to after 24.11) :)21:36:27
@tomasajt:matrix.orgToma

https://github.com/rust-lang/cargo/pull/11414
I think this is the original PR that broke git stuff.

AFAICT fetchCargoTarball only broke because it relied on cargo's built-in vendoring method, which happened to change the Cargo.toml files (?)
Since neither importCargoLock or this new thing actually use cargo, it should be fine, I think.

21:40:44
@emilazy:matrix.orgemilyright23:03:32
17 Oct 2024
@creepinson:matrix.orgTheo ParisThis is more of a general nixpkgs bootstrapping question, but I'm having trouble using rust in a complicated flake/overlay. I've encountered a lot of "infinite recursion" errors, first with zlib -> zlib-ng, and openssl -> aws-lc, but now I'm getting recursion errors with rust. I'm currently receiving errors with rustc-bootstrap and auto-patchelfhook which need diffutils and findutils, but they are built with rust in my flake. Also, because of the infinite recursion errors I've gotten, I ended up overriding a lot more than I should need to. I had to make cmake more minimal and then I had to override ninja to bootstrap with clang++ manually since python was causing issues. The flake I'm working on is hosted here: https://codeberg.org/tinted-software/better-overlay/src/branch/rust/flake.nix#L3200:21:57
@creepinson:matrix.orgTheo Paris * This is more of a general nixpkgs bootstrapping question, but I'm having trouble using rust in a complicated flake/overlay. I've encountered a lot of "infinite recursion" errors, first with zlib -> zlib-ng, and openssl -> aws-lc, but now I'm getting recursion errors with rust. I'm currently receiving errors with rustc-bootstrap and auto-patchelfhook which need diffutils and findutils, but they are built with rust in my flake. Also, because of the infinite recursion errors I've gotten, I ended up overriding a lot more than I should need to. I had to make cmake more minimal and then I had to override ninja to bootstrap with clang++ manually since python was causing issues. The flake I'm working on is hosted here: https://codeberg.org/tinted-software/better-overlay/src/branch/rust/flake.nix#L32 I'm not aware of another way to properly override these packages without an overlay, and an overlay seems to be very problematic because it affects bootstrapping... any ideas?00:24:00
@emilazy:matrix.orgemilythis may cause havoc for us soon: https://github.com/rust-lang/rust/pull/12968704:51:39
@emilazy:matrix.orgemily it's already causing recent nightlies from rust-overlay to depend on the entire Rust distribution in the closure of compiled binaries 04:51:55
@emilazy:matrix.orgemily it appears that we will need to specify --remap-path-prefix=… in our build infrastructure to avoid unwanted dependencies, unless our toolchains already avoid having rust-src available? 04:52:33
@emilazy:matrix.orgemily cc Alyssa Ross 04:52:38
@emilazy:matrix.orgemily maybe we can just set trim-paths / CARGO_TRIM_PATHS? https://rust-lang.github.io/rfcs/3127-trim-paths.html has more info 04:54:33
@emilazy:matrix.orgemily though I guess we probably don't want to strip all paths so we might have to do the remap thing (if it applies to us) 04:54:55
@k900:0upti.meK900 We can --remap-path-prefix 05:59:23
@k900:0upti.meK900As it says05:59:25
@emilazy:matrix.orgemily yeah. do we always know what the store path to rust-src will be though? 06:02:16
@k900:0upti.meK900Well Rust knows06:04:04
@k900:0upti.meK900Presumably06:04:06
@k900:0upti.meK900So we can just ask it06:04:08
@emilazy:matrix.orgemilyfair06:05:00

Show newer messages


Back to Room ListRoom Version: 6