!pbdtvoHxUGLhcEvnlu:nixos.org

Exotic Nix Targets

345 Members
108 Servers

Load older messages


SenderMessageTime
4 Sep 2023
@kity:kity.wtfash (it/its) 🏳️‍⚧️i'm trying to explore the possibility of having a system whose "native" architecture is wasm64-wasi but always cross-compiles packages to the host architecture. that way, everything is cross compiled using a "standard" wasm64-wasi toolchain and you could, for example, have heterogenous machines that both specify wasm64-wasi in boot.binfmt.emulatedSystems and are then able to share packages19:06:24
@kity:kity.wtfash (it/its) 🏳️‍⚧️ unfortunately if i try to do for instance, NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 nix-build . -A stdenv --argstr system "wasm64-wasi" it exits because ENOENT when calling /bin/bash. i don't know if bash in this case is actually nonexistent or if it's a different issue (like bad linker path) but i don't actually understand how nixpkgs bootstraps itself or how to generate a bootstrap tarball or anything like that. it may not even be feasible at this point to generate a wasm stdenv! but i'd like to try and document it. 19:12:40
@rhelmot:matrix.orgrhelmotthe nixpkgs bootstrap routine is in pkgs/stdenv19:21:21
@rhelmot:matrix.orgrhelmotyou can in fact bootstrap without a bootstrap tarball if you're willing to temporarily copy some files off the host19:21:46
@rhelmot:matrix.orgrhelmotthe way it works is that there's a bootstrap routine for each host platform and it incrementally builds more and more packages out of nothing until it can instantiate all-packages in some meaningful way, then you can do whatever you want from there to achieve self-sufficiency19:22:44
@kity:kity.wtfash (it/its) 🏳️‍⚧️where is the bootstrap routine located?19:25:55
@kity:kity.wtfash (it/its) 🏳️‍⚧️presumably there's one for x86_64-linux but not wasm64-wasi?19:26:12
@rhelmot:matrix.orgrhelmotfor which host platform?19:26:12
@rhelmot:matrix.orgrhelmotthere's one for linux in general, it's in pkgs/stdenv/linux19:26:26
@rhelmot:matrix.orgrhelmotI truthfully don't know a lot about how the particular stdenv gets selected, when I was messing with it I just blindly grepped through and added cases until it worked19:27:26
@kity:kity.wtfash (it/its) 🏳️‍⚧️interesting19:30:58
@kity:kity.wtfash (it/its) 🏳️‍⚧️so i suppose for this it would mean creating a bootstrap for wasi19:32:34
@rhelmot:matrix.orgrhelmotokay okay hang on I can think about this more critically - creating a stdenv for wasi would imply that you had already compiled nix itself for wasi and you wanted to boot nixpkgs under that environment19:33:29
@rhelmot:matrix.orgrhelmotI have no knowledge about cross compilation...19:33:53
@kity:kity.wtfash (it/its) 🏳️‍⚧️
In reply to@rhelmot:matrix.org
okay okay hang on I can think about this more critically - creating a stdenv for wasi would imply that you had already compiled nix itself for wasi and you wanted to boot nixpkgs under that environment
well, not necessarily i think? i can native compile aarch64 packages with an x86_64 host if i do boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; i just want to do the same for wasi
19:36:13
@rhelmot:matrix.orgrhelmotyeah - but you're still using your host's stdenv, you've just parameterized it with a compiler for the target system19:37:21
@rhelmot:matrix.orgrhelmot(I think? grains of salt all around)19:37:33
@kity:kity.wtfash (it/its) 🏳️‍⚧️then in that case it would be impure, i think. but native compilation is pure that way, so i think it's not like that.19:38:15
@kity:kity.wtfash (it/its) 🏳️‍⚧️ie i can substitute from a binary cache if i use emulatedSystems, but i can't if i'm cross compiling19:39:02
@rhelmot:matrix.orgrhelmot......huh19:39:15
@kity:kity.wtfash (it/its) 🏳️‍⚧️ oh, #stdenv:nixos.org exists. will continue there. 19:41:54
@rvdp:infosec.exchangeRamses 🇵🇸 joined the room.22:02:45
@hive:the-apothecary.club👉@crystallinefire:chat.solarpunk.moe changed their display name from hive hive ⬡ to hive ⬡.23:15:41
7 Sep 2023
@jkachmar:matrix.org@jkachmar:matrix.org changed their profile picture.16:01:14
8 Sep 2023
@ultra:beeper.comAlex S joined the room.13:07:51
@svanderburg:matrix.org__Sander__ joined the room.13:16:04
11 Sep 2023
@olafklingt:matrix.org@olafklingt:matrix.org left the room.19:17:40
12 Sep 2023
@rhelmot:matrix.orgrhelmot
[nix-shell:~/proj/nix/nixpkgs]$ which nix                                                      
/nix/store/cchfc7cdajg5kbx31x6y6bn8ridqw6k1-nix-2.17.0/bin/nix                                 
                                                                                               
[nix-shell:~/proj/nix/nixpkgs]$ uname                                                          
FreeBSD 

yay

17:30:06
@rhelmot:matrix.orgrhelmotpr time17:30:15
@trofi:matrix.orgtrofiCongrats!18:22:22

Show newer messages


Back to Room ListRoom Version: 6