Hi all!
This aims to basically hit the same note as Brainstorming: What should Javascript support look like?, to get this SIG started.
Although - IMHO - the overall current situation is already pretty solid, there are still certainly things that can be improved upon in terms of Rust support in aux. I’d like to initiate a bit of simply “thinking out loud” here in this thread, on what exactly we can work on within this SIG.
General
- Dedicated repo where packages and build support will live, aka.
auxolotl/rust
orauxolotl/rust-support
(see also SIG Repos: How should they work? - #32 by liketechnik) - Being more “batteries-included” in terms of build support and tooling, usable from outside of our (internal) packaging too
- Having a project-“blessed” way do to things, but still giving user freedom (of course!)
Different compiler versions
Many Rust projects use oxalica/rust-overlay (or equivalents) to pin their compiler version, either for compatibility versions or to e.g. check building with multiple versions.
This should also include support for other compiler implementations than the reference compiler, e.g. if and when the Rust support in GCC gets ready for broader usage.
I think it would be nice to provide similar tooling directly in aux.
Expand and expose build support
In addition to the above point, many Rust projects also rely on e.g. ipetkov/crane for easily setting up a flake for their Rust project. Again, aux-native tooling would be nice, which should cover at least most usecases, which don’t have specialized requirements.
IOW, our internal build tooling should be improved to a point that can be properly used by Rust projects to set up their flake without having to necessarily rely on third-party flakes. That would also sigificantly lower the entry barrier for using Nix in Rust projects.
Native library linking
As of now in nixpkgs, there is this “great” file default-crate-overrides.nix
, which specifies (native) build inputs as needed for building. This is a maintainers nightmare, so getting rid of it in the mid- to long-term needs to a goal to make maintaining Rust support in aux sustainable.
As for -sys
crates, there is the package.links
field in the Cargo manifest, which has the potential to eliminate at least some of these entries.
Current pain points
-
Non-
crates.io
dependencies (i.e. mostly git dependencies)
Though git-dependencies are rather discouraged for various reason, lots of application use them, for varying and valid(!) reasons, e.g. using a patched dependency while waiting for upstream to merge it.To give an example, and the reason why I thought about this already quite a bit, is that I’m (among other things) packaging proxmox-backup-client, which uses some company-written libraries that are only available through git.
-
Cargo.lock
When explicitly needing to specify aCargo.lock
throughcargoLock.cargoLock{,Contents}
, it can be quite painful to update when the package version get’s bumped.Further, having then to copy the same lockfile into the source tree using
postPatch = "ln -s ${./Cargo.lock} Cargo.lock";
when missing seems kind of redundant. Maybe this can consolidated in some way.
These are just some of things I thought of, feel free to comment!
I would also regularly keep this top post updated with ideas from this thread, such that they are collected in one place.
Cheers,
Christoph