!FBuJyWXTGcGtHTPphC:nixos.org

Nix Rust

473 Members
Rust115 Servers

Load older messages


SenderMessageTime
10 Aug 2024
@emilazy:matrix.orgemily so the cases where it could make a big difference seem rather marginal. you'd need a completely non-generic function that is also a hotspot but not #[inline] annotated and that you cross over constantly in a tight loop 20:11:06
@reckenrode:matrix.orgRandy EckenrodeLinux may be more of an issue, but wasn’t there a desire to go PIE on Linux eventually?20:11:28
@emilazy:matrix.orgemily
In reply to @emilazy:matrix.org
so the cases where it could make a big difference seem rather marginal. you'd need a completely non-generic function that is also a hotspot but not #[inline] annotated and that you cross over constantly in a tight loop
and also I don't think the overhead is big enough that it would matter the vast majority of the time even in this case
20:11:53
@emilazy:matrix.orgemily
In reply to @reckenrode:matrix.org
Linux may be more of an issue, but wasn’t there a desire to go PIE on Linux eventually?
(I hope so!)
20:16:56
@emilazy:matrix.orgemily(I consider it shameful for PIE not to be default)20:17:02
@reckenrode:matrix.orgRandy EckenrodeI think there’s some compatibility issues.20:17:26
@emilazy:matrix.orgemily that's what hardeningDisable is for 20:17:33
@reckenrode:matrix.orgRandy EckenrodeThe only issue I can see with providing pre-built artifacts is whether it’s possible users could use a different version of Rust and cause things to explode.20:17:46
@reckenrode:matrix.orgRandy Eckenrode * The only issue I can see with providing pre-built artifacts is whether it’s possible users could use a different version of Rust and cause things to break.20:17:54
@emilazy:matrix.orgemilyI don't really see how, any more than they can use a different version of glibc20:19:30
@emilazy:matrix.orgemilyI mean, I guess there is a sequence of contortions you could construct to mismatch things, but I don't think it'd be an easy mistake to make.20:19:49
@emilazy:matrix.orgemily(also I sort of expect Rust has some kind of compile-time checks for that, but I'm not sure.)20:20:00
@qyliss:fairydust.spaceAlyssa RossI haven't caught up with the whole conversation, but no, Cargo goes out of its way to prevent you dropping in an rlib built elsewhere20:21:06
@reckenrode:matrix.orgRandy EckenrodeRedacted or Malformed Event20:21:14
@qyliss:fairydust.spaceAlyssa Rossthe only feasible way to do this is to reimplement cargo a la crate2nix20:21:27
@reckenrode:matrix.orgRandy Eckenrode
In reply to @emilazy:matrix.org
I don't really see how, any more than they can use a different version of glibc
There’s a couple of popular overlays outside of nixpkgs. My thinking is someone could use one of those get a Rust of a different version and then try to use the nixpkgs crate stuff to build an app, and it goes wrong.
20:21:27
@emilazy:matrix.orgemily ah, I see. so we would be perfectly fine doing this with rustc but not with Cargo 🙃 20:21:59
@emilazy:matrix.orgemilyI'm tempted to look at other distro Rust packaging to see if they found a way to work around that.20:22:15
@emilazy:matrix.orgemilyit does work to just share Cargo caches between projects, annoyingly20:22:54
@emilazy:matrix.orgemily like, that doesn't work for Nix, but the functionality is there. 20:23:01
@emilazy:matrix.orgemilymaybe we could just construct Cargo cache directories 🙃20:23:15
@emilazy:matrix.orgemilyimage.png
Download image.png
20:25:00
@emilazy:matrix.orgemily haha, the Discourse forum thread I clicked on also immediately references Nix. we're the only people in the world who want this 20:26:04
@emilazy:matrix.orgemilyanyway, I guess mixing incompatible feature sets does complicate this significantly 🫠20:29:34
@emilazy:matrix.orgemilyso the source-based approach is probably better. (but we're still going to need to be careful about constructing lock files for transitive dependency versions, I think.)20:29:53
11 Aug 2024
@emilazy:matrix.orgemilyhttps://github.com/NixOS/nixpkgs/pull/332809 could maybe use a little testing before it goes in if anyone wants to take a look09:49:46
@emilazy:matrix.orgemilyI'm guessing a fair number of people use rustup on NixOS and we're bumping through like 1.5 years of changes09:50:22
@glepage:matrix.orgGaétan Lepage If I have set sourceRoot to some subfolder of the main source tree, but there is a single Cargo.lock file at the root, how should I do ?
I tried mv ../Cargo.lock . in postPatch, but the build fails even before
12:12:01
@glepage:matrix.orgGaétan Lepage
Running phase: buildPhase

ERROR: The Cargo.lock file doesn't exist

Cargo.lock is needed to make sure that cargoHash/cargoSha256 doesn't change
when the registry is updated.
12:12:20
@glepage:matrix.orgGaétan Lepage Isn't postPatch suppose to happen... after the patchPhase ? 12:13:44

Show newer messages


Back to Room ListRoom Version: 6