ZATP6MF2F6XB2VRVR2GEQ2Y6XXRES6C7QQYM2XJRAJJI3HYB7VFQC
6P7J7X7W2RBPODVMZWMW24IJLRT2DOFIZYDPEY323FH3EEQNSCEAC
OMTLDKD3B36US3ET4GRJDOUDVMQBIWHR7UHPIO57NSHLZJCJUPDAC
2IDNT6MOJ6YUKHMRE65IPBJYPH7R43T56CW6LOX3GTW7INZJKE3AC
(edited) there was a bug in the Nest, now fixed.
Why is naersk better than buildRustCrate?
The main reason is that it reads Cargo.lock and Cargo.toml directly and downloads dependencies directly. So you don’t need to generate a Cargo.nix and can always be compatible with cargo build. So it is zero config essentially. Naersk also has a lot of options to control how the build is done, but it could be improved too. Now this is probably not the best setup and it uses naersk via my repo at yatima-inc/nix-utils to load the rust compiler. I did this mostly to test.
This could indeed be an advantage, how does Naersk deal with features?
I’ve recently become a maintainer of naersk https://github.com/nix-community/naersk
The documentation is minimal, usually I read the source to figure things out.
To deal with features you simply need to add an argument to buildRustPackage
like
pijul-git = pijul.override { cargoBuildOptions = d: d ++ [ "--features git" ]; };
You can override any argument and setting really although this is not very well documented at this point.
Didn’t mean to close the discussion.
My question was how are features propagated? I don’t know how Naersk works, but I wrote the initial version of buildRustCrate in nixpkgs, and I like how features are dealt with using the Nix language itself.
Also, I’ve never managed to use Naersk to build and deploy things in production (this website, for example). I think an extra file to build with Naersk would be ok, but I’m not too favourable to replacing the current system with it.
DTZBX5FVU7ZRMLFPUKOR2PGWSC2M75WA2TPZHN5MJTN6RYL5TGJAC
Naersk just gives a simple interface to build crates with cargo. It provides functions to for example load dependencies and read from Cargo.toml. I guess it could be made into a separate file. Naersk works out of the box mostly, but I’m using my lib yatima-inc/nix-utils to load rust nightly. Naersk is nice for deploying things really. You can control which files are copied to the output directory. We use it for everything in Yatima Inc although we don’t have any active deployments.
Your patch contains lots of unrelated changes, I believe you could reset before recording. Also, are these against the latest main
?
I should probably fix that yeah. I’ve had some problems using pijul itself. They are against an older main
.
I’m experimenting with building pijul with naersk and a custom rust setup.