!FBuJyWXTGcGtHTPphC:nixos.org

Nix Rust

704 Members
Rust158 Servers

Load older messages


SenderMessageTime
8 Feb 2025
@9hp71n:matrix.orgghpzin
In reply to@sandro:supersandro.de
Can someone help us with https://github.com/NixOS/nixpkgs/pull/373425 and rust nightly in deps?
I do not think nightly is the problem, build-std=core it runs inside is:
https://github.com/mitmproxy/mitmproxy_rs/blob/79dbbf7e080574b7bb8b92766232f7e1b6e1d0a3/mitmproxy-linux/build.rs#L52-L62
(same thing linked in PR)
I think it would need separate build for that mitmproxy-linux-ebpf with defined target if you want to do it "properly".
08:47:22
@niklaskorz:korz.devNiklas Korz dumb attempt of removing -Z build-std=core still builds fine, but I haven't tested if it runs too 14:31:06
@niklaskorz:korz.devNiklas Korz
In reply to @niklaskorz:korz.dev
dumb attempt of removing -Z build-std=core still builds fine, but I haven't tested if it runs too
ah I only now see what that is needed for; there is no prebuilt standard library for eBPF
15:00:56
@niklaskorz:korz.devNiklas Korza comment inside build.rs that clarifies this might be useful...15:01:08
@niklaskorz:korz.devNiklas KorzI don't think you can get around Rust nightly to produce the eBPF binary then15:02:54
@niklaskorz:korz.devNiklas Korz also see: https://github.com/rust-lang/rust/blob/33873b5f4dac431bf61246d7f55c1fc580fbb555/src/doc/rustc/src/platform-support/bpf-unknown-none.md 15:09:32
@niklaskorz:korz.devNiklas Korz (from https://github.com/rust-lang/rust/pull/135107 ) 15:09:39
@niklaskorz:korz.devNiklas Korz

Rust does not yet ship pre-compiled artifacts for this target. To compile for this target, you will either need to build Rust with the target enabled (see "Building the target" above), or build your own copy of core by using build-std or similar.

15:10:05
@niklaskorz:korz.devNiklas Korzhmmm so it could be done15:10:13
@niklaskorz:korz.devNiklas Korz(but would need to touch rustc)15:10:39
@niklaskorz:korz.devNiklas Korz* ah I only now see what that is needed for; there is no prebuilt core library for eBPF15:11:31
@niklaskorz:korz.devNiklas Korz FWIW we already do this for wasm: https://github.com/NixOS/nixpkgs/blob/69efc5afaddde1fb0c66763dcde7049837e5b744/pkgs/development/compilers/rust/rustc.nix#L164 15:14:32
@niklaskorz:korz.devNiklas Korzso arguably eBPF could be added here too15:14:42
@niklaskorz:korz.devNiklas Korz or more specifically, bpfel-unknown-none and bpfeb-unknown-none 15:15:28
@niklaskorz:korz.devNiklas KorzMaybe only when targeting Linux, and only one of the two endians depending on arch15:19:30
@niklaskorz:korz.devNiklas KorzMight take a shot at an exemplary staging PR later, gonna go for a walk now15:24:06
@9hp71n:matrix.orgghpzinIf it can get away with not building on hydra, then you can probably do cross with toolchain. Iirc there is something in nixpkgs that does it.17:36:40
@qyliss:fairydust.spaceAlyssa Ross
In reply to @niklaskorz:korz.dev
Maybe only when targeting Linux, and only one of the two endians depending on arch
IMO more rustc targets we can build into a single compiler, the better
17:50:21
@qyliss:fairydust.spaceAlyssa Rossthe reason we only have wasm in there atm is that it was the only once i could get to build17:51:42
@qyliss:fairydust.spaceAlyssa Rossif more can be built in now let's add them in every situation we can17:51:58
@marcel:envs.net@marcel:envs.net joined the room.20:25:55
@niklaskorz:korz.devNiklas KorzI see 💯 will give it a shot for the bpf targets20:52:21
@niklaskorz:korz.devNiklas Korz hm so that's mainly beind hindered by BPF only supporting no_std, gotta look tomorrow if there is something like --target for only building core, not std 23:18:35
9 Feb 2025
@qyliss:fairydust.spaceAlyssa RossI remember the main problem with adding no_std was that it would try to build non-existent std documentation. That probably needs fixing upstream.07:11:30
@niklaskorz:korz.devNiklas KorzI see, so odds are that you can't build that a documented yet. I'll ask for clarification on the pending docs PR for the BPF targets.09:26:48
@niklaskorz:korz.devNiklas Korz* I see, so odds are that you can't build that as documented yet. I'll ask for clarification on the pending docs PR for the BPF targets.09:26:52
@qyliss:fairydust.spaceAlyssa RossYou can, but you can't do it if you're also building targets that have std, I think09:29:49
@qyliss:fairydust.spaceAlyssa Rosssomething like that09:29:50
@niklaskorz:korz.devNiklas Korzso the solution would be to do something like we did before with rustc-wasm32?09:31:25
@niklaskorz:korz.devNiklas Korzas that also disabled building docs09:31:29

Show newer messages


Back to Room ListRoom Version: 6