!FBuJyWXTGcGtHTPphC:nixos.org

Nix Rust

651 Members
Rust147 Servers

Load older messages


SenderMessageTime
4 Aug 2025
@kjeremy:matrix.orgkjeremy I'm not sure. It's even worse than this in reality. This is an unholy abomination. We're a few years out of date with nixpkgs and the latest nix-ros-overlay so I'm trying to jam these packages into our older nix-ros-overlay with an overlay and then use rust from nix-unstable to compile the zenoh packages since they require a newer toolchain. Miraculously it works natively but dies horribly during cross 18:48:11
@emilazy:matrix.orgemilyuhhh18:49:01
@kjeremy:matrix.orgkjeremyyep18:49:09
@emilazy:matrix.orgemilyyou should be happy it can build anything :D18:50:05
@kjeremy:matrix.orgkjeremyhonestly it's pretty impressive that nix can do this when non-cross18:50:30
@emilazy:matrix.orgemily anyway any time you nativeBuildInputs you must explicitly use buildPacakges 18:50:45
@emilazy:matrix.orgemilysince no splicing18:50:51
@kjeremy:matrix.orgkjeremy Okay! So I got it to use the right packages by using buildPackages.{rustPlatform, cargo, rustc}. It turns out I had to tell zeno to pass the right architecture down to cmake with cmakeFlags = [ "-DZENOHC_CUSTOM_TARGET=aarch64-unknown-linux-gnu" ]; 20:06:51
@kfiz:matrix.sopado.dekfiz joined the room.20:33:12
@kfiz:matrix.sopado.dekfiz changed their display name from kfiz 🏳️‍⚧️ to kfiz.21:18:59
@impqxr:matrix.orgimpqxr joined the room.21:52:01
5 Aug 2025
@isabel:isabelroses.comisabel changed their profile picture.09:49:06
@kfiz:matrix.sopado.dekfiz set a profile picture.20:14:27
6 Aug 2025
@vidariondr:matrix.orgvidariondr set a profile picture.18:30:52
7 Aug 2025
@goatastronaut0212:matrix.orgThe Little Waltz joined the room.17:31:33
@damccull:matrix.orgdamccull

How do I find out what "buildRustPackage" has as far as options? Like, I see it has a 'buildFeatures' option by looking at someone else's code, but does it have a buildPackages option, for instance? Where would I look to find that out?

Basically I want to specify which particular binary in the cargo.toml to build. Normally would do this with cargo build --package mybin but not sure how in the buildRustPackage helper.

23:10:42
@damccull:matrix.orgdamccull *

How do I find out what "buildRustPackage" has as far as options? Like, I see it has a 'buildFeatures' option by looking at someone else's code, but does it have a cargoPackages option, for instance? Where would I look to find that out?

Basically I want to specify which particular binary in the cargo.toml to build. Normally would do this with cargo build --package mybin but not sure how in the buildRustPackage helper.

23:12:04
@dramforever:matrix.orgdramforever
In reply to @damccull:matrix.org

How do I find out what "buildRustPackage" has as far as options? Like, I see it has a 'buildFeatures' option by looking at someone else's code, but does it have a cargoPackages option, for instance? Where would I look to find that out?

Basically I want to specify which particular binary in the cargo.toml to build. Normally would do this with cargo build --package mybin but not sure how in the buildRustPackage helper.

maybe buildAndTestSubdir? it's a bit confusingly documented i agree
23:18:36
@damccull:matrix.orgdamccull

So this is what I'm using in my flake:

          rustPackage =
            package: features:
            (pkgs.makeRustPlatform {
              cargo = pkgs.rust-bin.stable.latest.minimal;
              rustc = pkgs.rust-bin.stable.latest.minimal;
            }).buildRustPackage
              {
                inherit (cargoToml.package) name version;
                src = ./.;
                cargoLock.lockFile = ./Cargo.lock;
                buildFeatures = features;
                buildInputs = rustBuildInputs;
                nativeBuildInputs = [ rustToolchain ];
                cargoInstallFlags = [
                  "--package"
                  package
                ];
              };

I want to run cargo build --package dioxus-cli --features no-downloads specifically. Then copy the bin to the right location for future use, but first I just want to get it building.

23:23:23
8 Aug 2025
@damccull:matrix.orgdamccullThink I've got it.00:05:10
@rrose:ungleich.chrorosen changed their display name from Robert to rorosen.12:07:13
@kity:kity.wtfproblems changed their profile picture.02:34:43
@glepage:matrix.orgGaétan Lepage

Hi,
I have some trouble building rerun:

Web viewer .wasm built in 279.5s

Generating JS bindings for wasm…
Error: Failed to run wasm-bindgen: cannot import from modules (`env`) with `--no-modules`. This is often because some dependency is calling `std::time::Instant::now()` or similar. You can try diagnosing this with:
wasm2wat /build/source/target_wasm/wasm32-unknown-unknown/web-release/re_viewer.wasm | rg '"env"'
wasm2wat /build/source/target_wasm/wasm32-unknown-unknown/web-release/re_viewer.wasm | rg 'call .now\b' -B 20

You can also try https://rustwasm.github.io/twiggy/usage/command-line-interface/paths.html#twiggy-paths

Any idea?

14:34:53
@kjeremy:matrix.orgkjeremy

I have a cmake project that is also a cargo workspace. So there is a top-level Cargo.lock and multiple Cargo.toml files. How do I build? I'm using:

cargoDeps = rustPlatform.importCargoLock {
    lockFile = "${src.outPath}/Cargo.lock";
};

but at some point nix still tries to download from crates.io and obviously fails

18:56:53
@qyliss:fairydust.spaceAlyssa RossDepends on what your CMake build system is doing18:57:23
@kjeremy:matrix.orgkjeremyIt's nothing exciting: https://github.com/eclipse-zenoh/zenoh-plugin-ros2dds/blob/main/CMakeLists.txt18:57:47
@kjeremy:matrix.orgkjeremy maybe i need to patch the cargo invocation 19:14:19
@kjeremy:matrix.orgkjeremy I figured it out. I had to add rustPlatform.cargoSetupHook 19:26:55
9 Aug 2025
@0x545a:matrix.org0x545a joined the room.15:15:41
@theeasternfurry:beautifulblossomgarden.io.vntheeasternfurry set a profile picture.15:54:54

Show newer messages


Back to Room ListRoom Version: 6