!FBuJyWXTGcGtHTPphC:nixos.org

Nix Rust

635 Members
Rust147 Servers

Load older messages


SenderMessageTime
26 Oct 2025
@sliedes:hacklab.fiSami Liedes(I don't know if this is a related problem, but my rustup unstable toolchain fails to link because it tries to invoke a GCd ld-wrapper from the store.)15:34:38
@charles:computer.surgeryCharles

Is there a way to run cargo udeps on NixOS on a project that uses the stable toolchain?

No idea, not familiar with udeps

And should I use rustup or not use rustup?

I would recommend against it and instead recommend either fenix or rust-overlay

I've been developing with a direnv+flake that does pkgs.rustPlatform.buildRustPackage and for devShells takes inputsFrom that derivation. And setting RUST_SRC_PATH

This all sounds fine

and removing any $HOME/.cargo/bin entries from PATH in my shellHook—not sure if the latter is right or not, and I also don't 100% remember why I've done it, but I would assume any dynamically linked binaries there to rot when the store gets GCd.

Yeah you'll hit issues compiling/running stuff that gets installed there. Instead of doing shellHook crimes you should simply never have anything in this directory in the first place. For example, never use cargo install, always package it with nix (if no existing package is available) and install it that way

For cargo udeps, I'm told I should use cargo +nightly udeps, which tells me to use rustup

Yeah, the +toolchain syntax is a rustup thing, only works on rustup shim binaries for cargo and such, not the actual regular binaries. You can use fenix or rust-overlay to get a nightly toolchain, if you want to use stable most of the time you could have two devshells, one for stable and one for nightly

I noticed there's also a cargo-udeps packaged in nixpkgs (how if it requires nightly??)

It probably doesn't require nightly to build, just to run, but that's a guess. Also I think there are some things in nixpkgs that do actually need nightly to build, so that's not too crazy

but nix-shell -p cargo-udeps --command "cargo udeps" outputs the same errors.

Likely because it uses the toolchain from your ambient environment (which in this case is a stable toolchain) rather than e.g. being wrapped to force a particular toolchain (which would be awful UX-wise, so that's why it's not done that way)

17:20:25
27 Oct 2025
@let_rec:floss.uzrec set a profile picture.11:27:24
@let_rec:floss.uzrec changed their profile picture.11:27:29
@crop_tech:matrix.orgcrop joined the room.11:29:46
@crop_tech:matrix.orgcropI am using right now rust from nixpkgs. I want to use nightly for unit tests, rustup provides the possibility to switch to nightly for a single command invocation. Is there a way to do this with fennix or another overlay?11:32:30
@crop_tech:matrix.orgcrop* I am using right now rust from nixpkgs for development. I want to use nightly for unit tests, rustup provides the possibility to switch to nightly for a single command invocation. Is there a way to do this with fennix or another overlay?11:32:55
@glepage:matrix.orgGaétan Lepage

cargo-nextest is broken on aarch64-darwin:

error: custom attribute panicked
  --> nextest-runner/src/usdt.rs:63:1
   |
63 | #[usdt::provider(provider = "nextest")]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: message: called `Result::unwrap()` on an `Err` value: IO(Os { code: 2, kind: NotFound, message: "No such file or directory" })

error[E0433]: failed to resolve: could not find `usdt_probes` in `usdt`
   --> nextest-runner/src/usdt.rs:205:23
    |
205 |           $crate::usdt::usdt_probes::run__done!(|| {
    |                         ^^^^^^^^^^^ could not find `usdt_probes` in `usdt`
    |
   ::: nextest-runner/src/runner/imp.rs:381:9
    |
381 | /         crate::fire_usdt!(UsdtRunDone {
382 | |             run_id: self.run_id,
383 | |             profile_name: self.profile.name().to_owned(),
384 | |             total_tests: run_stats.initial_run_count,
...   |
389 | |             paused_nanos: _stopwatch_end.paused.as_nanos() as u64,
390 | |         });
    | |__________- in this macro invocation
    |
    = note: this error originates in the macro `crate::fire_usdt` (in Nightly builds, run with -Z macro-backtrace for more info)
13:17:59
@glepage:matrix.orgGaétan Lepage Bisected to https://github.com/NixOS/nixpkgs/pull/455250 13:29:19
@quadradical:federated.nexusQuadRadical (Ping) i reccomens using crane combined with fenix, i found it great myself. perhaps fenix alone is enough for you though. 13:52:15
@crop_tech:matrix.orgcrop
In reply to @quadradical:federated.nexus
i reccomens using crane combined with fenix, i found it great myself. perhaps fenix alone is enough for you though.
How would you switch between toolchains?
15:22:02
@charles:computer.surgeryCharlesmultiple devshells15:26:56
@quadradical:federated.nexusQuadRadical (Ping)yes, would work18:50:07
@quadradical:federated.nexusQuadRadical (Ping)for that fenix only is enough18:50:15
@quadradical:federated.nexusQuadRadical (Ping) but you can also for your unit tests, use crane with fenix, and then just use nix flake check to run your tests 18:50:29
@multisn8:matrix.orgmultisn8 (any) changed their display name from Multi (any) to multisn8 (any).20:55:00
28 Oct 2025
@rasmus:fricloud.dk@rasmus:fricloud.dk left the room.14:35:52
@crop_tech:matrix.orgcropa follow up question to yesterdays question. i use currently stable rust. because i want that every code i write to work on stable. i am only interested in unstable for things like miri and instrumentation (for test code coverage). ... when i choose nightly in my devenv i think there is only a very small chance that my code is treated differently compared to stable right?22:03:46
@dawnofmidnight:catgirl.cloud@dawnofmidnight:catgirl.cloudyeah, pretty much. differences in behavior are almost always either a bug (in rust) or a fix (which you'll get in a few weeks on stable, and you probably want)22:31:19
@dawnofmidnight:catgirl.cloud@dawnofmidnight:catgirl.cloud* yeah, pretty much. differences in behavior are almost always either a bug (in rust itself) or a fix (which you'll get in a few weeks on stable, and you probably want)22:31:39
@dawnofmidnight:catgirl.cloud@dawnofmidnight:catgirl.cloud * yeah, pretty much. differences in behavior are almost always either a bug (in rust itself) or a fix (which you'll get in a few weeks on stable, and you probably want)
(obviously this no longer holds true when you opt into unstable features with #![feature(...)] or -Z and such, but this is true for already-stable things)
22:34:04
@crop_tech:matrix.orgcropthank you for clarifying22:39:09
29 Oct 2025
@crop_tech:matrix.orgcrop I switched to fenix with complete toolchain. The problem is that rustfmt (or whatever is the default for formatting) somehow doesn't recognize that the project is written in edition 2024. It fails with an error something along the line "let chains only supported in edition 2024". 11:38:45
@crop_tech:matrix.orgcropThe editor i use is helix11:39:13
@charles:computer.surgeryCharles what's your rustfmt.toml say 14:41:13
@crop_tech:matrix.orgcropI don't have one in the project. Are there other places where i should look?17:10:20
@antifuchs:asf.computerantifuchs Make sure which rustfmt doesn’t pick up an older rustup installation? 17:21:22
@charles:computer.surgeryCharlesthat might be your problem. i'm not sure if rustup cares to read Cargo.toml to figure out the edition18:49:07
@charles:computer.surgeryCharlesyou do at least have the edition set properly in Cargo.toml, yeah?18:49:56
@charles:computer.surgeryCharles* that might be your problem. i'm not sure if rustfmt cares to read Cargo.toml to figure out the edition18:50:52

Show newer messages


Back to Room ListRoom Version: 6