NixOS / nix

Nix, the purely functional package manager
https://nixos.org/
GNU Lesser General Public License v2.1
11.56k stars 1.45k forks source link

Make a standard format for input and content addressed builds that allows for interoperability and system su #7310

Open Anderssorby opened 1 year ago

Anderssorby commented 1 year ago

Is your feature request related to a problem? Please describe. There should be a standard specification for input and content addressed builds. So that you can make it use the nix store for dependencies and generate drv files for running compilation? That way you could basically have full interoperability between cargo and nix and cargo build and nix build could do the same thing. I've been working on this for Lean with Nix.lean.

Describe the solution you'd like In general we should just have a very standard and agnostic content addressed build standard protocol that could be implemented by any language and system. The requirement being that all derivations in that format would produce the same binary output. That way you could have a general interoperability between these systems.

We could then perhaps see legacy systems like cmake, make, stack, npm, maven, bundler, bazel, etc. implement that standard. Because there is really zero reason that these systems should not support input and content addressed builds. Impure input like direct internet access and . What do you think?

Additional context This should of course not be done by the nix community in isolation to get the mass adoption it deserves. But nix already has a standard for this that should perhaps be made more concrete and less opinionated. For example removing any system specific things like /nix/store/...-name and instead just using the hashes to reference trees and data (files and folders). Also cool if this can be made compatible with something like IPLD and IPFS. Essentially any content addressable format that can be isomorphic to the input specification should be supported. The drv-format is probably to obscure and nix specific to be adopted by anyone outside the nix community.

tomberek commented 1 year ago

This likely needs a bit more explanation, or an example. I'm having a hard time understanding the issue or the desired outcome.

Anderssorby commented 1 year ago

So essentially formalize and standardize the build process of nix and make it less opinionated so that it can be easily implemented by other tools and remain compatible.