!FBuJyWXTGcGtHTPphC:nixos.org

Nix Rust

464 Members
Rust111 Servers

Load older messages


SenderMessageTime
29 Aug 2024
@rosssmyth:matrix.orgrosssmyth
In reply to @9hp71n:matrix.org

This could be some way of doing second thing:

helix-unwrapped = inputs.helix.packages.x86_64-linux.helix-unwrapped.overrideAttrs(old: {
    cargoArtifacts = old.cargoArtifacts // { cargoExtraArgs = "--locked --features unicode-lines"; };
    cargoExtraArgs = "--locked --features unicode-lines";
} );

probably third too or using cargoBuildCommand instead.
Not sure if works, did not build myself and not sure how you would check if feature is there.
And also after that you would need to find a way to wrap resulting helix-unwrapped

It did work. Just with the caveat that you said, it is not wrapped.
02:41:07
@rosssmyth:matrix.orgrosssmythMaybe it would be worth reworking it? Are there any good examples of flakes with good configuration/override support?02:41:34
@aos1:matrix.orgaos Is it not possible to overrideAttrs the already wrapped helix package available in the flake? 03:55:38
@artur:glasgow.social(artur 'manuel) joined the room.05:55:56
@feathecutie:tchncs.de@feathecutie:tchncs.de left the room.12:40:42
@marijan:matrix.orgmarijan

Hey, I'm packaging https://github.com/golemcloud/golem using buildRustPackage and one of its dependencies is using cargo_metadata (https://github.com/oli-obk/cargo_metadata) to get another dependency-crates source location to get to its protobuf directory. However when cargo_metadata is called it fails with the following error here: https://github.com/golemcloud/wasm-rpc/blob/97cefa99408b89d12ed13f2dd6333df01c12666d/wasm-rpc/build.rs#L26-L29)

with the following error:

golem>   error: failed to get `arbitrary` as a dependency of package `golem-wasm-rpc v0.0.0 (/build/cargo-vendor-dir/golem-wasm-rpc-0.0.0)`
golem>   Caused by:
golem>     failed to load source for dependency `arbitrary`
golem>   Caused by:
golem>     Unable to update registry `crates-io`
golem>   Caused by:
golem>     failed to update replaced source registry `crates-io`
golem>   Caused by:
golem>     failed to read root of directory source: /build/cargo-vendor-dir/cargo-vendor-dir
golem>   Caused by:
golem>     No such file or directory (os error 2)
golem>   thread 'main' panicked at /build/cargo-vendor-dir/golem-wasm-rpc-0.0.0/build.rs:30:10:
golem>   called `Result::unwrap()` on an `Err` value: CargoMetadata { stderr: "" }

I don't understand why it would resolve to the path:

golem>     failed to read root of directory source: /build/cargo-vendor-dir/cargo-vendor-dir
golem>   Caused by:
golem>     No such file or directory (os error 2)
19:58:39
30 Aug 2024
@artur:glasgow.social(artur 'manuel) changed their display name from Artur Manuel (old email was lost, migrating) to (lambda (u) (format nil "~A lost their email!" u)) "Artur Manuel".03:53:07
@9hp71n:matrix.orgghpzin
In reply to @marijan:matrix.org

Hey, I'm packaging https://github.com/golemcloud/golem using buildRustPackage and one of its dependencies is using cargo_metadata (https://github.com/oli-obk/cargo_metadata) to get another dependency-crates source location to get to its protobuf directory. However when cargo_metadata is called it fails with the following error here: https://github.com/golemcloud/wasm-rpc/blob/97cefa99408b89d12ed13f2dd6333df01c12666d/wasm-rpc/build.rs#L26-L29)

with the following error:

golem>   error: failed to get `arbitrary` as a dependency of package `golem-wasm-rpc v0.0.0 (/build/cargo-vendor-dir/golem-wasm-rpc-0.0.0)`
golem>   Caused by:
golem>     failed to load source for dependency `arbitrary`
golem>   Caused by:
golem>     Unable to update registry `crates-io`
golem>   Caused by:
golem>     failed to update replaced source registry `crates-io`
golem>   Caused by:
golem>     failed to read root of directory source: /build/cargo-vendor-dir/cargo-vendor-dir
golem>   Caused by:
golem>     No such file or directory (os error 2)
golem>   thread 'main' panicked at /build/cargo-vendor-dir/golem-wasm-rpc-0.0.0/build.rs:30:10:
golem>   called `Result::unwrap()` on an `Err` value: CargoMetadata { stderr: "" }

I don't understand why it would resolve to the path:

golem>     failed to read root of directory source: /build/cargo-vendor-dir/cargo-vendor-dir
golem>   Caused by:
golem>     No such file or directory (os error 2)
If you mean why it includes /build/cargo-vendor-dir/cargo-vendor-dir, it is because of how buildRustPackage works.
There is probably a way to patch it with placeholder on cargoDeps somehow.
06:45:40
@julius:mtx.liftm.deˈt͡sɛːzaɐ̯Download auditable.txt09:34:20
@julius:mtx.liftm.deˈt͡sɛːzaɐ̯Anyone remember putting a forkbomb into rust-analyzer/cargo-auditable?09:34:41
@julius:mtx.liftm.deˈt͡sɛːzaɐ̯ I'm running rust-analyzer from nixos-unstable on a rust project that is mostly a blank project with cargo add matrix-sdk. And I get 100eds of cargo-auditable processes. 09:36:17
@marijan:matrix.orgmarijanCan you point me to the relevant code? what do you mean with patching it with placeholder on cargoDeps?09:52:17
@cafkafk:gitter.imcafkafkit seems to use olm so makes sense?10:46:02
@cafkafk:gitter.imcafkafkor... https://github.com/matrix-org/matrix-rust-sdk/blob/224292ab3e3425600a6ee25aa5df17eb197c3831/crates/matrix-sdk-crypto/Cargo.toml#L8510:47:00
@cafkafk:gitter.imcafkafk
In reply to @julius:mtx.liftm.de
sent a file.
also lol wtf
10:47:38
@9hp71n:matrix.orgghpzin
In reply to @marijan:matrix.org
Can you point me to the relevant code? what do you mean with patching it with placeholder on cargoDeps?
I do not know about it much myself, but buildRustPackage has hooks inside them.
One of them vendors dependencies, so I thought for your case it could be possible to somehow postPatch placeholder value that would expand into store path of that vendor dir.
https://github.com/NixOS/nixpkgs/blob/e5a5a40ef65f73afb94e63faa046f5e77afb294a/pkgs/build-support/rust/hooks/cargo-setup-hook.sh
https://github.com/NixOS/nixpkgs/blob/bb26612729b2e1a54de781572eaef5b5ba04f3e6/pkgs/build-support/rust/fetch-cargo-tarball/default.nix
But reading around it, not sure if it is possible.
Maybe you can just patch it into relative path ie ../golem-wasm-ast, which may work, because all of the crates should be in that same cargo-vendor-dir
11:49:54
@9hp71n:matrix.orgghpzin
In reply to @julius:mtx.liftm.de
I'm running rust-analyzer from nixos-unstable on a rust project that is mostly a blank project with cargo add matrix-sdk. And I get 100eds of cargo-auditable processes.
Is it just from starting rust-analyzer ?
It was the first point here about potential of recursing, maybe something else does it too (that one was resolved with wrapper):
https://github.com/rust-secure-code/cargo-auditable/issues/89
12:25:27
@marijan:matrix.orgmarijan Do I understand correctly that cargoSetupPostUnpackHook will create a cargo-vendor-dir in the crates source directory?
I don't think your latter suggestion works as golem-wasm-ast is only used to find the package by name
14:22:48
@marijan:matrix.orgmarijan * Do I understand correctly that cargoSetupPostUnpackHook will create a cargo-vendor-dir in the crates source directory?
I don't think your latter suggestion works as the string "golem-wasm-ast" is only used to find the package by name
14:23:08
@marijan:matrix.orgmarijan When I use cntr I can also see that there is obviously no cargo-vendor-dir/cargo-vendor-dir 14:24:00
@geekio:sibnsk.netIlya Ovsyannikov joined the room.15:59:02
@zmitchell:matrix.orgzmitchell set a profile picture.22:09:29
31 Aug 2024
@julius:mtx.liftm.deˈt͡sɛːzaɐ̯I think I know part of the cause: I have rust-analyzer on path twice, one because I have it in my user packages, and once from a devShell.04:54:47
@julius:mtx.liftm.deˈt͡sɛːzaɐ̯ * I think I know part of the cause: I have rust-analyzer on path twice, one because I have it in my ~~user packages~~ home-manager.user.….programs.helix.extraPackages, and once from a devShell. 05:54:06
@julius:mtx.liftm.deˈt͡sɛːzaɐ̯ * I think I know part of the cause: I have rust-analyzer on path twice, one because I have it in my user packages home-manager.user.….programs.helix.extraPackages, and once from a devShell. 05:54:20
@devurandom:matrix.orgDennis joined the room.08:09:13
@vedantmgoyal:beeper.comVedant joined the room.19:07:34
1 Sep 2024
@ultranix:matrix.orgtgunnoe joined the room.15:28:31
@niklaskorz:korz.devNiklas Korz joined the room.18:24:13
@marijan:matrix.orgmarijan ghpzin: ? 18:53:24

Show newer messages


Back to Room ListRoom Version: 6