Skip to content

Investigate Nix on CloudABI / WASI #2759

Open

Description

@Ericson2314

https://cloudabi.org/ is an interesting idea for bolting cap-safety onto legacy kernels. It would be very interesting to see a port of Nix to this syscall interface. In particular, I'd hope this would allow for very low-overhead sandboxed derivations, as much of the cost in the past has been manipulating the ambient namespaces which this avoids entirely.

CC @shlevy

Edit: Added WASI, which basically CloudABI + Web Assembly

Activity

  1. changed the title [-]cloud abi[/-] [+]Investigate Nix with CloudABI[/+] on Apr 10, 2019
  2. changed the title [-]Investigate Nix with CloudABI[/-] [+]Investigate Nix on "CloudABI"[/+] on Apr 10, 2019
  3. 7c6f434c commented on Apr 10, 2019

    @7c6f434c
    Member

    Looking at the CloudABI introduction, it seems to have a different notion of running a program compared to, say POSIX (structured environment instead of command-line arguments, and capability token passing). I am not sure when, and if, a C compiler that would itself work under such rules will appear.

  4. Ericson2314 commented on Apr 10, 2019

    @Ericson2314
    MemberAuthor

    @7c6f434c Actually it's very much designed to be conservative enough that existing software can be shoehorned to work. See https://github.com/NuxiNL/cloudabi-ports; the first step is getting cross compilation to Cloud ABI in Nixpkgs working, cribbing from those bsd-style ports as necessary (should make another issue in Nixpkgs for that). Nix would be a more interesting port, but that's kind of the point :).

    https://lwn.net/Articles/674770/ goes into more detail of how things work in the Linux version. Also compare the earlier Capsicum from Academia. (Still not sure to what degree the implementation is shared, but the article sort of hints at it.)

  5. 7c6f434c commented on Apr 10, 2019

    @7c6f434c
    Member
  6. Ericson2314 commented on Apr 10, 2019

    @Ericson2314
    MemberAuthor

    @7c6f434c Yeah it would probably be easiest to cross compile Nix, and that Nix wouldn't be able to build most packages in Nixpkgs. But it would be really cool for experimental incremental software using the Nix daemon as an incremental cache. (e.g. compiler that forks off fine grained tasks as derivations. It would take a more radically redesigned Nix to make that "fork" maximally performant, but a basic demo of the concept can be made with today's Nix.)

  7. Ericson2314 commented on Apr 10, 2019

    @Ericson2314
    MemberAuthor

    CC @cleverca22, I feel like all this is vaguely up your alley.

  8. Ericson2314 commented on Apr 10, 2019

    @Ericson2314
    MemberAuthor

    Opened NixOS/nixpkgs#59285 for the Nix side of things.

  9. matthewbauer commented on Apr 10, 2019

    @matthewbauer
    Member

    I think we would get more hype/interest if we worked towards using WebAssembly/WASI. It’s got more people behind it, but also incorporates lots of the ideas behind CloudABI:

    https://github.com/CraneStation/wasi-sysroot

    I need to figure out how to bootstrap libc++ with LLVM before we can do that many interesting things with WebAssembly though.

  10. Ericson2314 commented on Apr 11, 2019

    @Ericson2314
    MemberAuthor

    Thanks for this! https://github.com/CraneStation/wasmtime/blob/master/docs/WASI-overview.md mentions CloudABI a lot, so it makes sense to see this on a spectrum (WASM supports safer models than OS-sandboxed Cish).

  11. changed the title [-]Investigate Nix on "CloudABI"[/-] [+]Investigate Nix on CloudABI / WASI[/+] on Apr 11, 2019
  12. shlevy commented on Apr 14, 2019

    @shlevy
    Member

    I'm not sure I see the point of this one. At the end of the day most of the work needs to happen with access to global namespaces, because at the end of the day everything still sucks and we're stuck with the build systems as they actually are.

  13. Ericson2314 commented on Apr 14, 2019

    @Ericson2314
    MemberAuthor

    @shlevy Everything indeed still sucks but:

    1. I'm mainly interested in doing this for sake of greenfield stuff on top, which can be right from the get go. Let this be the amphibian egg for some layer above chicken for a reinvented Nix chicken egg :).

    2. There's no security problem with creating a legacy unix sandbox from a cap-safe context. Were that an extension to WASI/CloudABI, we could shift all global namespace management from Nix to the derivations themselves, analogous to buildFHSUserEnv for building jank software.

  14. stale commented on Feb 16, 2021

    @stale

    I marked this as stale due to inactivity. → More info

  15. stale commented on Apr 29, 2022

    @stale

    I closed this issue due to inactivity. → More info

  16. Ericson2314 commented on Apr 29, 2022

    @Ericson2314
    MemberAuthor

    Still interested.

  17. armeenm commented on Feb 26, 2023

    @armeenm

    Bump.

  18. Ericson2314 commented on Feb 28, 2023

    @Ericson2314
    MemberAuthor

    Don't worry it won't be closed by stale bot again :)

  19. Ericson2314 commented on Mar 20, 2025

    @Ericson2314
    MemberAuthor

    @L-as's WASM derivations is related.

  20. L-as commented on Mar 20, 2025

    @L-as
    Member

    Still want to do this

  21. eveeifyeve commented on Feb 17, 2026

    @eveeifyeve
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions