!FBuJyWXTGcGtHTPphC:nixos.org

Nix Rust

667 Members
Rust149 Servers

You have reached the beginning of time (for this room).


SenderMessageTime
25 Mar 2025
@tomasajt:matrix.orgTomaI don't think so14:04:56
@emilazy:matrix.orgemily I am wondering if it makes sense to allow fetchCargoVendor to be driven by a Cargo.lock to avoid maintaining two paths for all of this altogether. but that's not release-blocking 14:07:20
@tomasajt:matrix.orgTomaafter my last few migrations to fetchCargoVendor get merged, almost all other packages that still have a Cargo.lock vendored do it because of upstream not publishing it14:07:29
@tomasajt:matrix.orgTomanot sure I understand14:08:08
@emilazy:matrix.orgemily we could have a mode where you supply a Cargo.lock and a hash, right? 14:08:38
@emilazy:matrix.orgemily which would meet the "no upstream Cargo.lock" use case and ~obsolete importCargoLock 14:08:53
@tomasajt:matrix.orgTomaI guess very much like with fetchYarnDeps14:09:44
@tomasajt:matrix.orgToma but for historical reasons almost everyone uses ${src}/yarn.lock instead of inherit src there (it's not IFD, since it only uses that in the build process) 14:10:37
@emilazy:matrix.orgemily

https://github.com/NixOS/nixpkgs/blob/15f3d37c73c8c1090f8fef7b8508675c9260eab6/pkgs/build-support/rust/import-cargo-lock.nix

  • https://github.com/NixOS/nixpkgs/blob/15f3d37c73c8c1090f8fef7b8508675c9260eab6/pkgs/build-support/rust/replace-workspace-values.py

isn't a trivial maintenance burden, so if 25.05 is doing breaking changes anyway, it might be best to eliminate it

14:11:05
@emilazy:matrix.orgemily * https://github.com/NixOS/nixpkgs/blob/15f3d37c73c8c1090f8fef7b8508675c9260eab6/pkgs/build-support/rust/import-cargo-lock.nix + https://github.com/NixOS/nixpkgs/blob/15f3d37c73c8c1090f8fef7b8508675c9260eab6/pkgs/build-support/rust/replace-workspace-values.py isn't a trivial maintenance burden, so if 25.05 is doing breaking changes anyway, it might be best to eliminate it 14:11:09
@emilazy:matrix.orgemily ah I guess we use the latter in fetchCargoVendor too 14:11:34
@emilazy:matrix.orgemilyso it's not so bad14:11:35
@emilazy:matrix.orgemilybut it still seems better to just consolidate14:11:45
@tomasajt:matrix.orgTomaif still thinking of how we could replace depsExtraArgs with a better alterative14:12:27
@tomasajt:matrix.orgToma* if still thinking of how we could replace depsExtraArgs with a better alterative (semi related)14:13:03
@emilazy:matrix.orgemily it looks like we could add lockFileContents ? null and lockFile ? null to fetchCargoVendor, and simply replace ./Cargo.lock with ${if lockFile != null then "${lockFile}" else if lockFileContents != null then writeText … else "./Cargo.lock"} 14:13:47
@emilazy:matrix.orgemilyI guess the downside is for "local" flakes with Rust packages though14:14:20
@emilazy:matrix.orgemilyso maybe it is not a good idea, even if it is better for Nixpkgs14:14:32
@tomasajt:matrix.orgTomabtw we're still using replace-workspace-values.py in fetchCargoVendor14:14:42
@emilazy:matrix.orgemilyyeah I saw :)14:14:48
@emilazy:matrix.orgemilyanyway, ok, this is a distraction. if we want to do that we can do it another release anyway14:15:16

Show newer messages


Back to Room ListRoom Version: 6