!FBuJyWXTGcGtHTPphC:nixos.org

Nix Rust

691 Members
Rust156 Servers

Load older messages


SenderMessageTime
9 Feb 2025
@qyliss:fairydust.spaceAlyssa Rossoh! then it might be even more broken than just the docs problem09:34:50
@niklaskorz:korz.devNiklas Korzbrb checking at which stage it failed09:53:46
@sandro:supersandro.deSandro 🐧

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
@niklaskorz:korz.devNiklas 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:supersandro.deSandro 🐧yep, the build just failed with those 😕17:05:55
@niklaskorz:korz.devNiklas Korzhttps://github.com/rust-lang/rust/pull/135107#discussion_r194805237710:05:24
@sandro:supersandro.deSandro 🐧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-linux17:08:06
@niklaskorz:korz.devNiklas Korz yup tried with --disable-docs and that builds fine... 10:25:18
@sandro:supersandro.deSandro 🐧probably we would need to hock into https://github.com/mitmproxy/mitmproxy_rs/blob/79dbbf7e080574b7bb8b92766232f7e1b6e1d0a3/mitmproxy-linux/build.rs#L141 ?17:09:36
@niklaskorz:korz.devNiklas 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
@niklaskorz:korz.devNiklas Korznow 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 targets10:37:10
@niklaskorz:korz.devNiklas Korzthe 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-L41810:38:28
@niklaskorz:korz.devNiklas Korzwhich appears to have no_std handling already, odd10:39:00
@niklaskorz:korz.devNiklas Korzadded in https://github.com/rust-lang/rust/pull/128182 which was shipped with Rust 1.8210:39:48
@qyliss:fairydust.spaceAlyssa 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
@qyliss:fairydust.spaceAlyssa Rossre-importing nixpkgs is a huge antipattern17:18:07
@qyliss:fairydust.spaceAlyssa Rossshould absolutely not be doing that17:18:15
@dillonb:matrix.orgdgb joined the room.21:40:20
@tired:fairydust.space@tired:fairydust.space left the room.22:52:42
10 Feb 2025
@sandro:supersandro.deSandro 🐧I am fine with whatever but I just lack the knowledge to help with anything inside rustc 😕17:08:07
11 Feb 2025
@ahamon:matrix.orgAndy Hamon Is there any way to specify a custom --target in buildRustCrate without using crossSystem? 02:59:07
@ahamon:matrix.orgAndy Hamon(using crate2nix fwiw)02:59:18
@ahamon:matrix.orgAndy 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
@ahamon:matrix.orgAndy Hamon

but the advice in the manual says use crossSystem. I tried doing roughly this:

      rustTargetOverride = {rust.rustcTarget = "aarch64-apple-ios";};
      crossSystem = (lib.systems.elaborate "aarch64-darwin") // rustTargetOverride;

My rationale being "I just want to change the target for rustc"

03:22:36
@ahamon:matrix.orgAndy Hamonbut that results in an infinite loop. and i've realized by rationale was flawed, since i don't want to change rustc everywhere, only for my one target03:23:06
@ahamon:matrix.orgAndy Hamon* but that results in an infinite loop. and i've realized by rationale was flawed, since i don't want to change rustc everywhere, only for my one target (and perhaps its dependencies)03:23:17
@ahamon:matrix.orgAndy Hamonon the verge of giving up and doing a fixed-output runCommand that just invokes cargo in the way I want04:04:23
@ahamon:matrix.orgAndy Hamonactually I have something working!!!04:40:29
@ahamon:matrix.orgAndy Hamonwith crate2nix04:40:43
@ahamon:matrix.orgAndy Hamonvery jank though04:40:46

Show newer messages


Back to Room ListRoom Version: 6