Nix Rust | 676 Members | |
| Rust | 153 Servers |
| Sender | Message | Time |
|---|---|---|
| 23 Nov 2021 | ||
In reply to @codysch:matrix.org I've been pretty happy with naersk and crate2nix though neither are perfect solutions. https://github.com/nix-community/naersk | 20:35:25 | |
In reply to @codysch:matrix.orgFWIW, pmeunier appears to be using crate2nix himself: https://nest.pijul.com/pijul/pijul:main/G734WNM64AR5A.BQAAA | 21:11:46 | |
| I had a good experience with crate2nix recently as well | 22:06:22 | |
In reply to @skamdart:matrix.orgthanks, I'll check those out. | 22:19:48 | |
| I was probably just mislead by https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/rust.section.md into trying to use carnix, should have looked at the wiki I guess (probably should pr an update to those docs) | 22:52:19 | |
| 24 Nov 2021 | ||
Ok, so I'm trying to use crate2nix, and it looks like it's mostly working. I have noticed that I need to add SystemConfiguration as an extra buildInput for crates that actually link outputs though (this is on macos). Is this expected? Or should defaultCrateOverrides normally handle this? I've done this (which calls the Cargo.nix generated by crate2nix) to handle: https://gist.github.com/jmesmon/bd3d489cdb45ee7daaf025d82a3fe0b9 | 14:56:08 | |
Secondary question: https://github.com/serokell/templates/blob/master/rust-crate2nix/flake.nix appears to be an example of how to have my flake.nix generate the required Cargo.nix internally (so I don't need to actually commit it to the repo). But I'm seeing an error when using that template: error: store path '/nix/store/90ijf9rkd4s4bbm8l0kw9lwqcx4bmbay-remule-crate2nix' is not allowed to have references. This lead me to https://github.com/NixOS/nix/issues/5410 and https://github.com/NixOS/nix/pull/5494 and https://github.com/kolloch/crate2nix/pull/215. If I'm understanding correctly, it looks like nix intended to fix this upstream (assuming this is actually the same error), but I'm pretty sure I'm using a new enough nix (2.4) and still seeing the above error. Any insight/advice on what might let me make this flake.nix work? | 15:04:25 | |
| For reference, here's the show-trace output of the failure I'm seeing with the flake: https://gist.github.com/jmesmon/248db03c9da55b77f9a386749b867c2a . I'm not too familiar with nix, so not sure exactly how to read it. | 16:08:01 | |
| 25 Nov 2021 | ||
| Ok, on the second one, I figured out that it's a fix that missed nix 2.4, so I switched to using an unreleased version of nix with Still not sure what the deal is with the | 03:37:17 | |
It seems like propagatedBuildInputs might help me with this, but adding libsqlite3-sys = attrs: { propagatedBuildInputs = [ SystemConfiguration]; } to defaultCrateOverrides doesn't appear to behave the same way as adding sqx-macros = attrs: { buildInputs = [ SystemConfiguration ] }. Still digging. | 04:43:19 | |
| 15:41:26 | ||
| 28 Nov 2021 | ||
| 04:54:25 | ||
| 29 Nov 2021 | ||
| 16:29:38 | ||
| 1 Dec 2021 | ||
| 08:14:53 | ||
Hey, curious if folks have any preference between cargo2nix and crate2nix? Managed to get cargo2nix working. The API seems a bit nice than crate2nix, but I'm not sure how to feel about committing a cached Cargo.nix file, and the finiky process of trying to initially generate an initial Cargo.nix, when your flake depends on it being present… | 23:43:33 | |
| I'm still very new to nix so it could be I'm mistaken and confused with stuff though 😅 | 23:44:56 | |
Or do folks just jump into a nix-shell or nix develop and just call cargo directly? | 23:47:09 | |
| depends a lot on what you want to do | 23:50:58 | |
| For development I do nix-shell | 23:51:06 | |
| For deployments I use the rustPlatform from nixpkgs | 23:51:22 | |
| you shouldn't really rely on binaries you've built in nix-shell for a longer time because the libraries they link to might be garbage-collected | 23:52:06 | |
| but doing buildRustPackage for each development run takes too much time because it is non-incremental | 23:52:35 | |
| 2 Dec 2021 | ||
| yeah, I do all my dev in a shell | 00:00:46 | |
| ahh gotcha | 00:02:10 | |
| thanks for the insights! can be a bit bewhildering hehe | 00:02:43 | |
| knowing what to choose 😅 | 00:02:58 | |
| This was what I ended up with: https://gist.github.com/brendanzab/eecc9d0b0e9c4042db1b736264e8c11c | 00:06:22 | |
| although I think I might remove the packaging stuff and just keep the shell stuff, based on what folks have said | 00:06:53 | |
| now gotta figure out how to get VS Code to work with it 😰 | 00:07:20 | |
| how do you work with different toolchains? as a library developer I often want to test against nightly, beta, stable, pinned toolchains. Do you just use the stable toolchain in your development flake, and then test different stuff on CI? Or are there better ways to switch between | 00:13:30 | |