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 on Cygwin doesn't work because DBD::SQLite doesn't work #19

Closed
edolstra opened this issue May 11, 2012 · 15 comments
Closed

Nix on Cygwin doesn't work because DBD::SQLite doesn't work #19

edolstra opened this issue May 11, 2012 · 15 comments
Labels
Milestone

Comments

@edolstra
Copy link
Member

$ perl -e 'use DBD::SQLite;'
Can't load '/nix/store/nxy9c2s5443al8g601fjlg62idbzqh0w-perl-DBD-SQLite-1.35/lib/perl5/site_perl/5.10/i686-cygwin/auto/DBD/SQLite/SQLite.dll' for module DBD::SQLite: No such process at /usr/lib/perl5/5.10/i686-cygwin/DynaLoader.pm line 200.
 at -e line 1
Compilation failed in require at -e line 1.
BEGIN failed--compilation aborted at -e line 1.

The "No such process" error may be related to the base address of the DLL, but changing it using the "--image-base=..." linker flag didn't help. Running "rebaseall" didn't help either (but then it doesn't look in the Nix store so that's not surprising).

@viric
Copy link
Member

viric commented May 27, 2012

Does this problem happen only when building nix using nix?

I'm trying to build nix master on cygwin (not using nix), and I fail even to install DBD::SQLite. Somehow it wants to call 'gcc-4' instead of 'gcc'.

@viric
Copy link
Member

viric commented May 27, 2012

I just had to add gcc 4.x into cygwin, and install DBD::SQLite. Then I built the nix 1.0 tarball, with CC=gcc-4 CXX=g++-4, and then nix runs fine.

I haven't tried without setting gcc/g++ to 4.x for nix.
Now I'm trying to build nixpkgs' nix with that nix, having changed the native gcc-wrapper to point to gcc-4 and g++-4.

@viric
Copy link
Member

viric commented May 27, 2012

OTH, if nix uses shared libraries, trying to run nix inside nix (maybe in the make check stage) can fail hard, if nix shared libraries of different versions don't have different names.

Windows can't load multiple DLLs with the same name - systemwide constraint (unless using winsxs). If nix shared libraries have the same name regardless of the version, the nix under 'make check' would be dynamically linked with the nix DLLs doing the build, because they were loaded first there.

@viric
Copy link
Member

viric commented May 27, 2012

After building nix with nix and gcc-4, having disabled the doInstallCheck, I get this:

Can't exec "/nix/store/zh79050vfkrjax8kklydr559ydh3rwbg-nix-1.0/bin/nix-instantiate": Bad address at /nix/store/zh79050vfkrjax8kklydr559ydh3rwbg-nix-1.0/bin/nix-build line 166.

@viric
Copy link
Member

viric commented May 27, 2012

I tried rebaseall with a list of all exe and dlls in the nix store (-T list), and that did not help. I had to make the dll writeable, for it to success. As for the exe, it said the exe were not 'rebaseable'; maybe here is the trouble.

@viric
Copy link
Member

viric commented Mar 28, 2013

Finally I removed the perl DBD lines in configure.ac. I rebuilt all, installed (I disabled the manual generation the hard way, which also failed), and all went fine.
Now, nix-build, nix-env and nix-store work if called with "NIX_SUBSTITUTERS=".

So if the DBD stuff could be made optional (like the default substituters), it would make all easier by now.

@domenkozar
Copy link
Member

From #nixos:

3:31:28         niksnut | ah yes, the real issue is cygwin's requirement that all DLLs have a unique load address, or something like that                                                                                    │ mattw        
13:31:38         niksnut | which is basically unsupportable in a purely functional model                                                                                                                                      │ maxipin_     
13:31:56         niksnut | cygwin has a tool called "rebaseall" that rewrites all DLLs in the system to meet this requirement   

@ghost
Copy link

ghost commented Aug 13, 2015

nix builds on cygwin-nt 6.1 2.2.0 (0.289/5/3) x86_64
i roughly followed https://nixos.org/wiki/Nix_on_Windows which gives an idea but most of the dependencies i had to install manually via cygwin gui
after building nix, i can install hello, for example
many packages don't work, but that is a problem with nixpkgs, not nix

@chaoflow
Copy link
Member

chaoflow commented Sep 8, 2015

This issue is outdated and should be closed.

@tohl thx for reporting

@chaoflow
Copy link
Member

chaoflow commented Sep 8, 2015

For completeness: we describe a cygport file to install nix on cygwin: http://ternaris.com/lab/nix-on-windows.html#package-build-and-install-nix

@ghost
Copy link

ghost commented Sep 10, 2015

actually the version that builds under cygwin is nix-1.8

the latest nix from unstable (nix-1.10) doesn't build because of a compilation error
undefined ENOENT in nix-collect-garbage.cc
adding #include <errno.h> might fix this issue

@ryantrinkle
Copy link

My company, Obsidian Systems would be interested in helping to support development of a Windows distribution of Nix. If anyone is interested in working on this or helping support it, please send me an email at ryan@obsidian.systems.

@vcunat
Copy link
Member

vcunat commented Jan 10, 2016

@ryantrinkle: this particular issue will preferably be addressed by #341, IMHO.

@domenkozar domenkozar added this to the perl-to-c++ milestone Jul 21, 2016
@domenkozar
Copy link
Member

@ryantrinkle "Windows distribution of Nix" meaning natively without cygwin?

@domenkozar
Copy link
Member

As stated by @chaoflow this is outdated and we're very close to being perl free.

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

No branches or pull requests

6 participants