Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nix bundle fails on macos #16

Open
peacememories opened this issue Nov 30, 2023 · 2 comments
Open

nix bundle fails on macos #16

peacememories opened this issue Nov 30, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@peacememories
Copy link

Describe the bug

When running e.g. nix bundle nixpkgs#hello on aarch64-darwin, it fails with the following error:

error: attribute 'aarch64-darwin' missing

       at /nix/store/1rc10ydlf4c2aphrg2z2dxaaikbggba0-source/flake.nix:12:20:

           11|       nix-bundle = { program, system }: let
           12|         nixpkgs' = nixpkgs.legacyPackages.${system};
             |                    ^
           13|         nix-bundle = import self { nixpkgs = nixpkgs'; };

Steps To Reproduce

  1. Use a macOS system with Apple Silicon
  2. Enable the nix-command and flakes experimental features
  3. Run nix bundle nixpkgs#hello
  4. See error

Expected behavior

I would expect a self-extracting zip with the hello command to be created.

nix-env --version output

nix-env (Nix) 2.13.6

Additional context

Trying something like

nix bundle nixpkgs#legacyPackages.x86_64-linux.hello results in the same error. I was originally trying to bundle murmur for linux (using a build server which is set up) from my macOS machine when I ran into this error.

@peacememories peacememories added the bug Something isn't working label Nov 30, 2023
@edolstra edolstra transferred this issue from NixOS/nix Dec 1, 2023
@tomberek tomberek added enhancement New feature or request and removed bug Something isn't working labels Dec 3, 2023
@tomberek
Copy link
Collaborator

tomberek commented Dec 3, 2023

The upstream default bundler does not support aarch64-darwin: https://github.com/matthewbauer/nix-bundle/blob/master/flake.nix#L7 . This is very likely due to nix-user-chroot requiring linux namespaces... and well, not available on darwin.

It would be great to have this and to have "cross-bundling" better supported.

@peacememories
Copy link
Author

That would make it hard to support darwin, true 😅 Although it would still be nice to be able to start the bundling from my mac and have it run on the build server in the background. I did also run into the problem with namespaces when trying to run a completed bundle on an old CentOS7 machine, but that's a different problem altogether^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants