!FBuJyWXTGcGtHTPphC:nixos.org

Nix Rust

508 Members
Rust112 Servers

Load older messages


SenderMessageTime
5 Dec 2024
@glepage:matrix.orgGaétan Lepage There is a rust package that added the following flag: "-Clink-arg=-fuse-ld=lld".
At first, the nix build was failing because it couldn't find ld. I added lld to nativeBuildInputs and the built went fine.
However, the patching is not working anymore. When I run ldd on the final binary, it has several "not found" libraries.
Any idea what I should do ?
17:25:05
@glepage:matrix.orgGaétan Lepageclipboard.png
Download clipboard.png
17:26:21
@glepage:matrix.orgGaétan Lepage Top: before adding "-Clink-arg=-fuse-ld=lld"
Bottom: after
17:26:34
@apache8080:matrix.orgapache8080When I use buildRustPackage in a workspace it tries to build all the dependencies in the workspace instead of just the binary I want build. Is there a way to avoid this?17:28:30
@glepage:matrix.orgGaétan Lepage
In reply to @glepage:matrix.org
There is a rust package that added the following flag: "-Clink-arg=-fuse-ld=lld".
At first, the nix build was failing because it couldn't find ld. I added lld to nativeBuildInputs and the built went fine.
However, the patching is not working anymore. When I run ldd on the final binary, it has several "not found" libraries.
Any idea what I should do ?
I guess that this is the issue:
https://github.com/NixOS/nixpkgs/issues/24744
What is the recommended workaround in this case ?
17:36:34
@charles:computer.surgeryCharles
In reply to @apache8080:matrix.org
When I use buildRustPackage in a workspace it tries to build all the dependencies in the workspace instead of just the binary I want build. Is there a way to avoid this?
there's probably some way to pass -p foo to cargo so that it only builds the foo package
18:43:34
@charles:computer.surgeryCharlessurely there are some examples of this in nixpkgs already somewhere18:45:44
@apache8080:matrix.orgapache8080

yeah I tried the cargoBuildFlags option and that doesn't seem to work.

https://github.com/kixelated/moq-rs/tree/main

This is the project I'm doing it on. The workspace recently got updated to have some wasm stuff and this package: https://github.com/kixelated/moq-rs/blob/main/nix/packages/moq.nix#L10 is trying to build the WASM stuff even though it doesn't depend on it

19:22:07
@apache8080:matrix.orgapache8080
cargo build -j 24 --target x86_64-unknown-linux-gnu --offline --profile release --package moq-relay

If I run this exact cargo command that nix build is using then it builds fine

19:25:45
@apache8080:matrix.orgapache8080 is crateOverrides an argument for buildRustPackage? I tried to use the examples here but can't get it working. I keep getting a cannot coerce a set to string 19:55:33
@apache8080:matrix.orgapache8080just moved over to crate2nix20:26:50
@apache8080:matrix.orgapache8080 * just moved over to crate2nix and now its working20:29:49
@djacu:matrix.orgdjacu That looks like the same command buildRustPackage would generate to build a package. So what is different when you try to build it with nix? 22:59:40
@apache8080:matrix.orgapache8080 yes that is why I manually ran that command. In nix build it tries to build dependencies for the whole workspace that my individual package doesn't depend on 23:11:20
8 Dec 2024
@shawn8901:matrix.orgshawn8901 set a profile picture.19:21:37
@marie:marie.cologneMarie changed their profile picture.22:38:07
@marie:marie.cologneMarie changed their profile picture.22:39:21
9 Dec 2024
@pveierland:matrix.orgpveierland joined the room.10:17:10
@pveierland:matrix.orgpveierland Hi. I'm attempting to build a Rust package with a toolchain via Fenix / pkgs.makeRustPlatform / buildRustPackage. It seems to fail as a dependency miette cannot be found, with location searched: registry crates-io`. Would I need to set up a separate buildRustPackage for each missing library, or how can I fix it? 10:19:37
@pveierland:matrix.orgpveierland * Hi. I'm attempting to build a Rust package with a toolchain via Fenix / pkgs.makeRustPlatform / buildRustPackage. It seems to fail as a dependency miette cannot be found, with location searched: registry crates-io. Would I need to set up a separate buildRustPackage for each missing library, or how can I fix it? 10:19:54
@pveierland:matrix.orgpveierland Giving crate2nix a go 10:20:32
@pveierland:matrix.orgpveierlandGot it to build for a while now after 1-2 hours of querying for substitutes (also added cachix eigenvalue). Build failed during libgit2 build. Is it likely that I'm doing something wrong if this was not taken from cache?13:00:12
@pveierland:matrix.orgpveierlandBuild for 1 crate from crates.io worked. Build for the second crate still fails on libgit2 though13:28:08
@pveierland:matrix.orgpveierland
Running phase: configurePhase
Running cd .
Building build.rs (libgit2_sys)
Running rustc --crate-name build_script_build build.rs --crate-type bin -C opt-level=3 -C codegen-units=1 --edition 2018 --cfg feature="default" --cfg feature="https" --cfg feature="libssh2-sys" --cfg feature="openssl-sys" --cfg feature="ssh" --cfg feature="ssh_key_from_memory" --out-dir target/build/libgit2-sys --emi>

error occurred in cc-rs: Command LC_ALL="C" "gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "/build/libgit2-sys-0.17.0+1.8.1/target/build/libgit2-sys.out/include" "-I" "libgit2/src/libgit2" "-I" "libgit2/src/util" "-I" "libgit2/deps/llhttp" "-I" "libgit2/deps/xdiff" "-I" "libgit2/deps/pcre" "-I>
13:33:51
@pveierland:matrix.orgpveierlandSeems to have been due to a parallel build issue which breaks some packages. Retrying did it16:08:01
@pveierland:matrix.orgpveierland * Seems to have been due to a parallel build issue which breaks some packages. Retrying a few times made it work16:08:07
10 Dec 2024
@junjihashimoto:matrix.orgjunji hashimoto

Hi Toma ,
Could you please review this again?
https://github.com/NixOS/nixpkgs/pull/282798

What do you think is missing to move forward? Unit tests?

00:50:44
@junjihashimoto:matrix.orgjunji hashimoto *

Hi Toma ,
Could you please review this again?
https://github.com/NixOS/nixpkgs/pull/282798

What do you think is missing to move forward? Unit tests or comments?

00:52:55
@pveierland:matrix.orgpveierland Keep having build issues with icu_properties and libgit2-sys. I'm using the nixpkgs defaultCrateOverrides. Are there other things that are important to do to make sure dependencies / flags are set up correctly? 03:17:42
@pveierland:matrix.orgpveierlandhttps://termbin.com/9gkz https://termbin.com/4ujd03:24:22

Show newer messages


Back to Room ListRoom Version: 6