nixpkgs cross compilation has an annoying property that it has entirely unique h...

@sodiboo@gaysex.cloud

nixpkgs cross compilation has an annoying property that it has entirely unique hashes from the native versions, because the inputs are "different compilers".

content-addressed derivations solve this to an extent, but there's still the need to compute that a non-cross derivation had the same input. so when "rebuilding the world" offline you'll have the same issue; but it DOES mean that caches can claim "yup the cross and non-cross derivations built the same content". so it saves a lot of rebuilds if you cross-deployed a system that you then rebuilt locally on, as long as most of the packages are in a cross-compilation-aware cache.

but what if cross compilation wasn't a unique derivation? what if the nix builder could execute wasm-wasi binaries and all compilers were built to wasm? and that even the "seed" packages at the root of the build graph were wasm-based?

then, cross-compilation would be the "always" case and it would always be wasm->target.

and it would make a cross/native build use the same derivation. because the derivations are architecture-agnostic.

(this all is completely ignoring the idea of supporting multiple operating systems. darwin/linux would need special care. but i'm specifically thinking of the linux->linux case where they have different CPU architectures)

it doesn't have to be wasm. but like, any architecture-independent intermediate representation. what if
nativeBuildInputs had to be architecture-independent?