10 Aug 2024 |
emily | 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 |
Randy Eckenrode | Linux may be more of an issue, but wasn’t there a desire to go PIE on Linux eventually? | 20:11:28 |
emily | 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 |
emily | 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 |
emily | (I consider it shameful for PIE not to be default) | 20:17:02 |
Randy Eckenrode | I think there’s some compatibility issues. | 20:17:26 |
emily | that's what hardeningDisable is for | 20:17:33 |
Randy 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 explode. | 20:17:46 |
Randy 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 |
emily | I don't really see how, any more than they can use a different version of glibc | 20:19:30 |
emily | I 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 |
emily | (also I sort of expect Rust has some kind of compile-time checks for that, but I'm not sure.) | 20:20:00 |
Alyssa Ross | I haven't caught up with the whole conversation, but no, Cargo goes out of its way to prevent you dropping in an rlib built elsewhere | 20:21:06 |
Randy Eckenrode | Redacted or Malformed Event | 20:21:14 |
Alyssa Ross | the only feasible way to do this is to reimplement cargo a la crate2nix | 20:21:27 |
Randy 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 |
emily | ah, I see. so we would be perfectly fine doing this with rustc but not with Cargo 🙃 | 20:21:59 |
emily | I'm tempted to look at other distro Rust packaging to see if they found a way to work around that. | 20:22:15 |
emily | it does work to just share Cargo caches between projects, annoyingly | 20:22:54 |
emily | like, that doesn't work for Nix, but the functionality is there. | 20:23:01 |
emily | maybe we could just construct Cargo cache directories 🙃 | 20:23:15 |
emily | Download image.png | 20:25:00 |
emily | 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 |
emily | anyway, I guess mixing incompatible feature sets does complicate this significantly 🫠 | 20:29:34 |
emily | so 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 |
emily | https://github.com/NixOS/nixpkgs/pull/332809 could maybe use a little testing before it goes in if anyone wants to take a look | 09:49:46 |
emily | I'm guessing a fair number of people use rustup on NixOS and we're bumping through like 1.5 years of changes | 09:50:22 |
Gaé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 |
Gaé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 |
Gaétan Lepage | Isn't postPatch suppose to happen... after the patchPhase ? | 12:13:44 |