!FBuJyWXTGcGtHTPphC:nixos.org

Nix Rust

701 Members
Rust158 Servers

Load older messages


SenderMessageTime
9 Feb 2025
@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
@ahamon:matrix.orgAndy Hamon crate2nix lets you override the impl of buildRustCrate. So I made an impl with transforms arguments on the way in and tacks on extraRustcOpts = ["--target aarch64-apple-ios"]; 04:42:27
@ahamon:matrix.orgAndy Hamon(and I already have a custom rustPlatform from rust-overlay which has additional targets added)04:44:47
@ahamon:matrix.orgAndy Hamon not toooo worried about a lack of correctness here from a cross compiling point of view since I only want to build a staticlib 04:47:56
@ahamon:matrix.orgAndy Hamonnot sure yet if it works with dependencies or not, crate has 0 deps. But I don't see why it wouldn't04:48:48
@ahamon:matrix.orgAndy Hamonalso no idea if my .a file even works04:48:57

Show newer messages


Back to Room ListRoom Version: 6