5 Sep 2024 |
| @necoarc:transfem.dev removed their profile picture. | 03:49:32 |
| @necoarc:transfem.dev left the room. | 03:49:33 |
9 Sep 2024 |
| Pandapip1 joined the room. | 03:44:03 |
10 Sep 2024 |
zmitchell | Alright I have a patch for RedoxOS support, and I've added it to the list of patches for gcc here: https://github.com/NixOS/nixpkgs/compare/master...zmitchell:nixpkgs:zmitchell/redox-gcc-support
I'm not quite sure how to verify that I'm building it properly because I would expect to have to rebuild gcc from source, but a nix-build -A gcc or nix-build -A gcc13 in my nixpkgs fork takes about 2s and seems to substitute gcc rather than build it.
| 04:22:58 |
zmitchell | Trying to build the cross-compiler doesn't evaluate either:
$ nix-build -A pkgsCross.x86_64-unknown-redox.gcc13
...
… from call site
at /home/zmitchell/nixpkgs/pkgs/top-level/all-packages.nix:14930:16:
14929| gcc6Stdenv = overrideCC gccStdenv buildPackages.gcc6;
14930| gcc7Stdenv = overrideCC gccStdenv buildPackages.gcc7;
| ^
14931| gcc8Stdenv = overrideCC gccStdenv buildPackages.gcc8;
… while calling 'overrideCC'
at /home/zmitchell/nixpkgs/pkgs/stdenv/adapters.nix:35:24:
34| # Override the compiler in stdenv for specific packages.
35| overrideCC = stdenv: cc: stdenv.override {
| ^
36| allowedRequisites = null;
error: infinite recursion encountered
at «none»:0: (source not available)
| 04:23:45 |
Alyssa Ross | That's not a cross compiler | 11:47:54 |
Alyssa Ross | That's a cross compiled native compiler | 11:47:59 |
Alyssa Ross | A cross compiler would be pkgsCross.x86_64-unknown-redox.stdenv.cc or pkgsCross.x86_64-unknown-redox.buildPackages.gcc13
| 11:48:31 |
| matthewcroughan changed their display name from matthewcroughan - going to nix.camp to matthewcroughan. | 15:53:35 |
11 Sep 2024 |
zmitchell | Ah, it looks like relibc was recently removed from nixpkgs due to lack of maintenance. It also looks like Redox has their own patched Rust compiler.
I'm sifting through the nixpkgs source right now to try to figure out where I would swap out the URL pointing at rustc sources, but I'm a little confused by the layout. In pkgs/build-support/rust I see a bootstrap.nix that calls binary.nix , and that seems to download compiler binaries. But also in pkgs/development/compilers/rust it looks like rustc.nix is where we actually build rustc , but it takes a rustc argument?
| 19:07:59 |
12 Sep 2024 |
Alyssa Ross | Yes, it uses the bootstrap rustc to build itself | 08:20:01 |
Alyssa Ross | I'd first try to see how far you can get using the non-patched Rust compiler, which does have Redox targets | 08:20:19 |
Alyssa Ross | I'd be hesitant to add a patched rustc to Nixpkgs, because the last one made maintaining normal rustc more difficult. | 08:20:39 |
zmitchell | I wouldn't be adding the patched rustc to nixpkgs exactly for that reason. It also seems like their patched rustc exists because there's something missing from the upstream compiler. I'm not up to speed on that particular issue. | 15:16:35 |
zmitchell | My plan at the moment is get the patched rustc/cargo/etc packaged in their respective repositories, then replace the upstream versions via overlay in order to build relibc. That artifact can be exposed to nixpkgs. | 15:18:07 |
Alyssa Ross | How? | 15:18:21 |
Alyssa Ross | You can't use Nix code from elsewhere in Nixpkgs | 15:18:28 |
zmitchell | I'm not sure what you mean | 15:18:41 |
Alyssa Ross | What does "that artifact can be exposed to Nixpkgs" mean? | 15:18:56 |
zmitchell | I mean build it as a precompiled binary as it was previously done in https://github.com/NixOS/nixpkgs/pull/93568 | 15:20:07 |
Alyssa Ross | Well that's what I was talking about | 15:20:58 |
Alyssa Ross | That was removed because it got in the way of normal rustc | 15:21:04 |
Alyssa Ross | Since it used the same infrastructure | 15:21:10 |
zmitchell | Ok, I misunderstood | 15:21:29 |
Alyssa Ross | I think you should see how far you can get with upstream rustc first | 15:21:49 |
zmitchell | Sure, that's more of a Redox<->Rust Project conversation though instead of a Redox<->Nixpkgs conversation, and as a new contributor I'm not sure exactly what the limitations are that led them to maintain their own fork in the first place. I'll have to do more digging. | 15:23:05 |
zmitchell | How does providing relibc as a precompiled binary for Redox interfere with normal rustc? | 15:26:02 |
Alyssa Ross | Sorry, maybe I misunderstood | 15:27:11 |
Alyssa Ross | I thought you were talking about Redox rustc as a precompiled binary | 15:27:26 |
Alyssa Ross | What would be the point of having relibc as a precompiled binary though? If you need a special Rust compiler, presumably you need it for more than just libc. | 15:28:01 |