| 8 Feb 2025 |
ghpzin | 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 |
Niklas Korz | dumb attempt of removing -Z build-std=core still builds fine, but I haven't tested if it runs too | 14:31:06 |
Niklas 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 |
Niklas Korz | a comment inside build.rs that clarifies this might be useful... | 15:01:08 |
Niklas Korz | I don't think you can get around Rust nightly to produce the eBPF binary then | 15:02:54 |
Niklas Korz | also see: https://github.com/rust-lang/rust/blob/33873b5f4dac431bf61246d7f55c1fc580fbb555/src/doc/rustc/src/platform-support/bpf-unknown-none.md | 15:09:32 |
Niklas Korz | (from https://github.com/rust-lang/rust/pull/135107 ) | 15:09:39 |
Niklas 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 |
Niklas Korz | hmmm so it could be done | 15:10:13 |
Niklas Korz | (but would need to touch rustc) | 15:10:39 |
Niklas Korz | * ah I only now see what that is needed for; there is no prebuilt core library for eBPF | 15:11:31 |
Niklas 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 |
Niklas Korz | so arguably eBPF could be added here too | 15:14:42 |
Niklas Korz | or more specifically, bpfel-unknown-none and bpfeb-unknown-none | 15:15:28 |
Niklas Korz | Maybe only when targeting Linux, and only one of the two endians depending on arch | 15:19:30 |
Niklas Korz | Might take a shot at an exemplary staging PR later, gonna go for a walk now | 15:24:06 |
ghpzin | If 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 |
Alyssa 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 |
Alyssa Ross | the reason we only have wasm in there atm is that it was the only once i could get to build | 17:51:42 |
Alyssa Ross | if more can be built in now let's add them in every situation we can | 17:51:58 |
| @marcel:envs.net joined the room. | 20:25:55 |
Niklas Korz | I see 💯 will give it a shot for the bpf targets | 20:52:21 |
Niklas 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 |
Alyssa Ross | I 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 |
Niklas Korz | I 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 |
Niklas 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 |
Alyssa Ross | You can, but you can't do it if you're also building targets that have std, I think | 09:29:49 |
Alyssa Ross | something like that | 09:29:50 |
Niklas Korz | so the solution would be to do something like we did before with rustc-wasm32? | 09:31:25 |
Niklas Korz | as that also disabled building docs | 09:31:29 |