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 Installation Failure on "Bash on Ubuntu on Windows" #1038

Closed
chexxor opened this issue Aug 23, 2016 · 4 comments
Closed

Nix Installation Failure on "Bash on Ubuntu on Windows" #1038

chexxor opened this issue Aug 23, 2016 · 4 comments

Comments

@chexxor
Copy link

chexxor commented Aug 23, 2016

Issue description

As a Windows 10 user, I want to use Nix to manage packages in my "Bash on Ubuntu on Windows" environment.

I follow the Nix installation instructions, which is bash <(curl https://nixos.org/nix/install), but I get an error: cannot execute binary file: Exec format error. See "Steps to reproduce", below.

It seems the "nix-store" binary can't be executed. I did readelf -a $NIX_STORE, which shows the following summary at the top:

  • Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
  • Class: ELF64
  • Data: 2's complement, little endian
  • Version: 1 (current)
  • OS/ABI: UNIX - System V
  • ABI Version: 0
  • Type: EXEC (Executable file)
  • Machine: Advanced Micro Devices X86-64
  • Version: 0x1
  • Entry point address: 0x407770
  • Start of program headers: 64 (bytes into file)
  • Start of section headers: 149120 (bytes into file)
  • Flags: 0x0
  • Size of this header: 64 (bytes)
  • Size of program headers: 56 (bytes)
  • Number of program headers: 9
  • Size of section headers: 64 (bytes)
  • Number of section headers: 31
  • Section header string table index: 28

(Moved from nixpkgs issue: NixOS/nixpkgs#17915)

Steps to reproduce

After installing "Bash on Ubuntu on Windows", enter a bash shell and execute the Nix installation command to see the following results:

alex@ALEX-CARBON:/mnt/c/Users/Alex$ bash <(curl https://nixos.org/nix/install)
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2590  100  2590    0     0   5121      0 --:--:-- --:--:-- --:--:--  5118
downloading Nix binary tarball for x86_64-linux from 'https://nixos.org/releases/nix/nix-1.11.2/nix-1.11.2-x86_64-linux.tar.bz2' to '/tmp/nix-binary-tarball-unpack.3ZltkRNJp1'...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
 37 67.1M   37 25.0M    0     0   403k      0  0:02:50  0:01:03  0:01:47  729k
100 67.1M  100 67.1M    0     0   531k      0  0:02:09  0:02:09 --:--:--  524k
performing a single-user installation of Nix...
copying Nix to /nix/store...........................
initialising Nix database...
/tmp/nix-binary-tarball-unpack.3ZltkRNJp1/unpack/nix-1.11.2-x86_64-linux/install: line 58: /nix/store/4z8srway6dl128dxzn5r0wwdvglz3m61-nix-1.11.2/bin/nix-store: cannot execute binary file: Exec format error
/tmp/nix-binary-tarball-unpack.3ZltkRNJp1/unpack/nix-1.11.2-x86_64-linux/install: failed to initialize the Nix database

Technical details

  • System:
    ** Windows 10 Pro, Version 1607, OS Build 14393.51, System type 64-bit OS, x64-based CPU (Intel Core i5-5200U)
    ** uname -a: Linux ALEX-CARBON 3.4.0+ The sync option #1 PREEMPT Thu Aug 1 17:06:05 CST 2013 x86_64 x86_64 x86_64 GNU/Linux
  • Nix version: Latest installation script
@jb55
Copy link

jb55 commented Aug 23, 2016

An important thing to note is that even if it served a proper binary, it wouldn't work because Nix currently doesn't work on Windows. I tracked it down to a failing prctl call in util.cc. But that's for another issue...

@Ericson2314
Copy link
Member

I heard that nix binaries have a custom ELF interpreter (aka the dynamic linker) which the Windows Linux subsystem doesn't yet support.

@bobvanderlinden
Copy link
Member

Related microsoft/WSL#743

@dezgeg
Copy link
Contributor

dezgeg commented Jan 19, 2017

This has been fixed by Microsoft in the latest Windows Insider builds.

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

No branches or pull requests

6 participants