!FBuJyWXTGcGtHTPphC:nixos.org

Nix Rust

689 Members
Rust154 Servers

Load older messages


SenderMessageTime
14 Jan 2026
@yawd:matrix.orgDiego Reisamazing! Thank you18:44:52
@yawd:matrix.orgDiego Reisgotta study more18:45:04
@ttraj:matrix.orgttraj joined the room.22:47:23
15 Jan 2026
@bivsk:matrix.orgbivsk joined the room.00:37:38
@bivsk:matrix.orgbivsk

Hello! I'm trying to package a rust program, however one of the dependent crates is failing to build due to a missing patch. This is my package.nix: https://bpa.st/LQWQ

I'm getting the error: Error: "Error applying patch '/build/tari-5.2.0-vendor/libtor-src-47.13.0+0.4.7.13/patches/libevent-0001-libevent-makefile.patch': \"Os { code: 2, kind: NotFound, message: \\\"No such file or directory\\\" }\""

I am able to find the patch file in nix store: /nix/store/109zbiqkhxnw9dpr0qazg29m4ap8p6ha-tari-5.2.0-vendor/libtor-src-47.13.0+0.4.7.13/patches, but I'm not quite sure how to tell cargo to look there. Would appreciate any help :)

00:48:27
@bivsk:matrix.orgbivsk * Hello! I'm trying to package a rust program, however one of the dependent crates is failing to build due to a missing patch. This is my package.nix: https://bpa.st/LQWQ
I'm getting the error: Error: "Error applying patch '/build/tari-5.2.0-vendor/libtor-src-47.13.0+0.4.7.13/patches/libevent-0001-libevent-makefile.patch': \"Os { code: 2, kind: NotFound, message: \\\"No such file or directory\\\" }\""
I am able to find the patch file in nix store: /nix/store/109zbiqkhxnw9dpr0qazg29m4ap8p6ha-tari-5.2.0-vendor/libtor-src-47.13.0+0.4.7.13/patches, but I'm not quite sure how to tell cargo to look there. Would appreciate any help :)
01:14:16
@bivsk:matrix.orgbivskRedacted or Malformed Event01:37:24
@bivsk:matrix.orgbivsk I thought maybe the directory under /nix/store differed from the actual build directory, but after running nom build .#tari --keep-failed and checking the build directory under /nix/var/nix/builds/..., the patches directory is there too. I'm really confused now where the no such file error is coming from :/ 03:03:24
@bivsk:matrix.orgbivskfigured it out!06:42:43
@n8henrie:matrix.orgn8henrie

Have not been able to get this to work using cargoHash directly either; I specify

[dev-dependencies]
rustc-demangle = "=0.1.24"

but unfortunately get

     > error: failed to select a version for the requirement `rustc-demangle = "^0.1.24"` (locked to 0.1.26)
       > candidate versions found which didn't match: 0.1.24

which seems odd, as it's clearly properly locked:

$ rg -A1 rustc-demangle
Cargo.toml
41:rustc-demangle = "=0.1.24"
42-rustc-literal-escaper = "0.0.5"

Cargo.lock
589: "rustc-demangle",
590- "rustc-literal-escaper",
--
601:name = "rustc-demangle"
602-version = "0.1.24"

Unfortunately cargo tree doesn't seem to work with the build-std dependencies (previously noted: https://github.com/rust-lang/wg-cargo-std-aware/issues/61#issuecomment-774570256):

$ cargo +nightly tree -Z build-std=core --target avr-none -i rustc-demangle
rustc-demangle v0.1.24
[dev-dependencies]
└── relay v0.1.0 (/Users/n8henrie/git/attiny85-relay)
15:44:32
@n4ch7:n3831.netn4ch723hr3r (putting stuff in your name is cringe) joined the room.21:45:52
@logn:zirco.devLogan Devine

Hey folks! I'm trying to get miri to work on Nix Darwin.

I am using rust-overlay for my devShell:

      let
        overlays = [ rust-overlay.overlays.default ];
        pkgs = import nixpkgs { inherit system overlays; };
        llvm = pkgs.llvmPackages_20;
      in
      {
        devShells.default = pkgs.mkShell {
          buildInputs = with pkgs; [
            (rust-bin.selectLatestNightlyWith (
              toolchain:
              toolchain.default.override {
                extensions = [ "rust-src" "miri" "rustc-dev" ];
              }
            ))
            llvm.llvm
            llvm.libllvm
            llvm.clang
            llvm.lld
            pkg-config
            libffi
            libxml2
            nixfmt
          ];

          LLVM_SYS_201_PREFIX = llvm.llvm.dev;
        };

When I execute miri, it seems to believe it can't find cargo-miri:

$ cargo miri run
error: 'cargo-miri' is not installed for the toolchain 'nightly-aarch64-apple-darwin'.
To install, run `rustup component add miri`

I do still see cargo-miri and miri in my Nix store:

ls $(which cargo | xargs dirname)
cargo cargo-miri miri ...(etc)

Anyone got any insight?

23:55:11
16 Jan 2026
@marcel:envs.net@marcel:envs.net left the room.00:49:58
@emilazy:matrix.orgemily fwiw I did pkgs.rust-bin.fromRustupToolchain { channel = "nightly"; components = ["miri" "rust-src"]; } last time I needed Miri. maybe toolchain.default.override doesn't work properly there. not sure 02:47:25
@logn:zirco.devLogan DevineStill doesn't work, hm03:13:56
@accelbread:matrix.orgaccelbreadI've got my miri package definitions here if it helps: [https://github.com/accelbread/flakelight-rust/tree/master/packages](miri packages)05:43:42
@accelbread:matrix.orgaccelbread* I've got my miri package definitions here if it helps: https://github.com/accelbread/flakelight-rust/tree/master/packages05:43:54
@accelbread:matrix.orgaccelbreadHas anyone gotten build-std working with nixpkgs rustc?05:57:29
@logn:zirco.devLogan Devine thank ya, I'll try this out 15:47:28
17 Jan 2026
@mirrorwake:matrix.orgroxie joined the room.03:33:14
@mirrorwake:matrix.orgroxie set a profile picture.03:35:00
@mirrorwake:matrix.orgroxie changed their profile picture.03:37:35
@debtquity:matrix.orgdebtquity

are there any tricks for speeding up local build times for rust packages in nixpkgs?

...
┏━ Dependency Graph:
┃ ✔ stalwart-0.15.3 ⏱ 21m29s
┣━━━ Builds
┗━ ∑ ⏵ 0 │ ✔ 1 │ ⏸ 0 │ Finished at 22:18:53 after 21m38s

20 minutes is wild

06:04:49
@charles:computer.surgeryCharles try disabling runtime performance optimizations like codegen-units = 1 and lto = true https://github.com/stalwartlabs/stalwart/blob/22fc4a795d56264aefd082040c6998c9371b83aa/Cargo.toml#L46-L47 06:21:37
@charles:computer.surgeryCharlesnot sure if that fits your "local" criteria though06:22:30
@debtquity:matrix.orgdebtquityoh, i was hoping to do it from the building side without modifying the project06:22:44
@charles:computer.surgeryCharlesi don't know any such tricks unfortunately (but maybe someone else might?)06:23:11
@charles:computer.surgeryCharles i mean, you could add patches to the derivation to make those changes via overrideAttrs, unless you really mean "without changing any nix code or upstream code" 06:25:20
@debtquity:matrix.orgdebtquityah, i'll give that a shot. what do we lose with LTO, though?06:26:09
@charles:computer.surgeryCharleshttps://doc.rust-lang.org/cargo/reference/profiles.html#lto06:26:46

Show newer messages


Back to Room ListRoom Version: 6