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

Detect WSL1 and error #297

Merged
merged 4 commits into from
Mar 3, 2023
Merged

Conversation

cole-h
Copy link
Member

@cole-h cole-h commented Mar 2, 2023

WSL1 is not supported because some things Nix relies on to work are not available.

Description

Closes #281.

Checklist
  • Formatted with cargo fmt
  • Built with nix build
  • Ran flake checks with nix flake check
  • Added or updated relevant tests (leave unchecked if not applicable)
  • Added or updated relevant documentation (leave unchecked if not applicable)
  • Linked to related issues (leave unchecked if not applicable)
Validating with install.determinate.systems

If a maintainer has added the upload to s3 label to this PR, it will become available for installation via install.determinate.systems:

curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix/pr/$PR_NUMBER | sh -s -- install

WSL1 is not supported because some things Nix relies on to work are not
available.
@cole-h cole-h added the upload to s3 The labeled PR is allowed to upload its artifacts to S3 for easy testing label Mar 2, 2023
@cole-h cole-h added this to the v0.4.1 milestone Mar 2, 2023
@cole-h cole-h requested a review from Hoverbear March 2, 2023 21:26
@cole-h cole-h self-assigned this Mar 2, 2023
src/planner/linux.rs Outdated Show resolved Hide resolved
@cole-h
Copy link
Member Author

cole-h commented Mar 2, 2023

Nice.

image

image

@cole-h cole-h marked this pull request as ready for review March 2, 2023 22:42
src/planner/mod.rs Outdated Show resolved Hide resolved
@stuv
Copy link

stuv commented Nov 27, 2024

Sorry to open up this merge. But I wanted to install Determinate Systems Nix on WSL1 and I didn't get the error like this.

The one I bumped into was:

Proceed? ([Y]es/[n]o/[e]xplain): y
 INFO Step: Create directory `/nix`
 INFO Step: Provision Nix
 INFO Step: Create build users (UID 30001-30032) and group (GID 30000)
 INFO Step: Configure Nix
ERROR
   0: Install failure
   1: Error executing action
   2: Action `configure_nix` errored
   3: Action `setup_default_profile` errored
   4: Failed to execute command with status 1 `HOME="/root" NIX_SSL_CERT_FILE="/nix/store/852a51xd3m7jyzifqimxc3jf3w2ipc4k-nss-cacert-3.101/etc/ssl/certs/ca-bundle.crt" "/nix/store/hdy82qidsybc3fg561pqfwagv44vschb-nix-2.24.10/bin/nix-env" "--option" "substitute" "false" "-i" "/nix/store/hdy82qidsybc3fg561pqfwagv44vschb-nix-2.24.10"`, stdout:
      stderr: installing 'nix-2.24.10'
      error:
             … while setting up the build environment

             error: unable to load seccomp BPF program: Invalid argument

   4:

Location:
   src/cli/subcommand/install.rs:256

This was all with the default settings for as far as I can remember. Using the standard install command from the website:
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | \ sh -s -- install

I assume nix still isn't supported on WSL1? It's unfortunate, but with this computer I can't update it to WSL2, so I am stuck with WSL1 and would like to see if in any way it's possible to have some nix on this machine to make life a bit more bareable.

@cole-h
Copy link
Member Author

cole-h commented Dec 2, 2024

You are correct in that WSL1 is still not (explicitly) supported. If you can provide information on a more reliable way of detecting if the WSL version used is WSL1 and not WSL2, I'd be grateful!

In the meantime, while this "bug" exists, you can see if using --init none and one (or both) of --extra-conf "sandbox = false" and --extra-conf "filter-syscalls = false" works to install Nix -- if so, then we might be able to make WSL1 "usable" (by documenting this combination of flags).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upload to s3 The labeled PR is allowed to upload its artifacts to S3 for easy testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wsl issue with /etc/passwd spotted on hn
3 participants