| 9 Feb 2025 |
Alyssa Ross | No, please no more Rust compilers | 09:31:47 |
Alyssa Ross | The solution is for Rust's build system to be fixed. | 09:31:54 |
Niklas Korz | ok, I'll raise it on the docs PR after all then, at the very least to get that behavior documented | 09:32:34 |
Alyssa Ross | try adding the bpf target to Nixpkgs' rustc if you haven't already first though, just in case this has been fixed since last timme | 09:33:49 |
Alyssa Ross | * | 09:34:00 |
Alyssa Ross | or in case it's now broken for some other reason | 09:34:07 |
Niklas Korz | yeah I did that, and ended up with errors in std related to atomic types | 09:34:28 |
Alyssa Ross | oh! then it might be even more broken than just the docs problem | 09:34:50 |
Niklas Korz | brb checking at which stage it failed | 09:53:46 |
Sandro 🐧 | So
diff --git a/pkgs/development/compilers/rust/rustc.nix b/pkgs/development/compilers/rust/rustc.nix
index d7a1ee625f9c..92e0997a3e19 100644
--- a/pkgs/development/compilers/rust/rustc.nix
+++ b/pkgs/development/compilers/rust/rustc.nix
@@ -161,6 +161,7 @@
# Other targets that don't need any extra dependencies to build.
]
++ optionals (!fastCross) [
+ "bpfel-unknown-none"
"wasm32-unknown-unknown"
# (build!=target): When cross-building a compiler we need to add
diff --git a/pkgs/development/python-modules/mitmproxy-linux/default.nix b/pkgs/development/python-modules/mitmproxy-linux/default.nix
index 01bacdb002ed..0ee05f35dcb4 100644
--- a/pkgs/development/python-modules/mitmproxy-linux/default.nix
+++ b/pkgs/development/python-modules/mitmproxy-linux/default.nix
@@ -18,6 +18,13 @@
tag = "v${version}";
hash = "sha256-lWUHdS+AkMnIg+1SR+9fC+YjcyLK80UknwGablniLSg=";
};
+
+ postPatch = ''
+ substituteInPlace mitmproxy-linux/build.rs \
+ --replace-fail '"-Z",' "" \
+ --replace-fail '"build-std=core",' ""
+ '';
+
cargoDeps = rustPlatform.fetchCargoVendor {
inherit pname version src;
hash = "sha256-ihbVh73eulqFyKC49KfsCFJqahr3nWVFFc97iFFf3Nk=";
will not just work?
| 16:59:25 |
Niklas Korz | rustc> Documenting stage2 library {alloc, core, panic_abort, panic_unwind, proc_macro, std, sysroot, test, unwind} in HTML format (aarch64-apple-darwin -> bpfel-unknown-none)
so it's the docs after all
| 09:54:33 |
Sandro 🐧 | yep, the build just failed with those 😕 | 17:05:55 |
Niklas Korz | https://github.com/rust-lang/rust/pull/135107#discussion_r1948052377 | 10:05:24 |
Sandro 🐧 | Someone wrote earlier that we could compile the mitmproxy-linux-ebpf crate separately. I could do that probably by copying things from rust-hypervisor-firmware but I am a bit lost how to integrate that back into mitmproxy-linux | 17:08:06 |
Niklas Korz | yup tried with --disable-docs and that builds fine... | 10:25:18 |
Sandro 🐧 | probably we would need to hock into https://github.com/mitmproxy/mitmproxy_rs/blob/79dbbf7e080574b7bb8b92766232f7e1b6e1d0a3/mitmproxy-linux/build.rs#L141 ? | 17:09:36 |
Niklas Korz | so good news, unlike a few years ago it appears the set of crates to generate docs for is not hardcoded anymore | 10:36:49 |
Niklas Korz | now to find out how to configure this per target, and if that's not possible, how to patch it not to produce std docs for no_std targets | 10:37:10 |
Niklas Korz | the source of the crate set appears to be in https://github.com/rust-lang/rust/blob/43ca9d18e333797f0aa3b525501a7cec8d61a96b/src/bootstrap/src/core/build_steps/compile.rs#L399-L418 | 10:38:28 |
Niklas Korz | which appears to have no_std handling already, odd | 10:39:00 |
Niklas Korz | added in https://github.com/rust-lang/rust/pull/128182 which was shipped with Rust 1.82 | 10:39:48 |
Alyssa Ross | In reply to @sandro:supersandro.de Someone wrote earlier that we could compile the mitmproxy-linux-ebpf crate separately. I could do that probably by copying things from rust-hypervisor-firmware but I am a bit lost how to integrate that back into mitmproxy-linux please no more of that pattern | 17:17:55 |
Alyssa Ross | re-importing nixpkgs is a huge antipattern | 17:18:07 |
Alyssa Ross | should absolutely not be doing that | 17:18:15 |
| dgb joined the room. | 21:40:20 |
| @tired:fairydust.space left the room. | 22:52:42 |
| 10 Feb 2025 |
Sandro 🐧 | I am fine with whatever but I just lack the knowledge to help with anything inside rustc 😕 | 17:08:07 |
| 11 Feb 2025 |
Andy Hamon | Is there any way to specify a custom --target in buildRustCrate without using crossSystem? | 02:59:07 |
Andy Hamon | (using crate2nix fwiw) | 02:59:18 |
Andy Hamon | trying to compile a rust lib for iOS and android. its easy enough to add the extra targets I need using rust-overlay and then use them on the command line | 03:16:05 |