Skip to content

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

Closed

Description

@edolstra
$ 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).

Activity

  1. viric commented on May 27, 2012

    @viric
    Member

    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'.

  2. viric commented on May 27, 2012

    @viric
    Member

    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.

  3. viric commented on May 27, 2012

    @viric
    Member

    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.

  4. viric commented on May 27, 2012

    @viric
    Member

    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.
    
  5. viric commented on May 27, 2012

    @viric
    Member

    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.

  6. viric commented on Mar 28, 2013

    @viric
    Member

    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.

  7. domenkozar commented on Jan 21, 2014

    @domenkozar
    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   
    
  8. chaoflow commented on Sep 8, 2015

    @chaoflow
    Member

    This issue is outdated and should be closed.

    @TOHL thx for reporting

  9. ryantrinkle commented on Jan 9, 2016

    @ryantrinkle

    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 [email protected].

  10. vcunat commented on Jan 10, 2016

    @vcunat
    Member

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

  11. added this to the perl-to-c++ milestone on Jul 21, 2016
  12. domenkozar commented on Jul 21, 2016

    @domenkozar
    Member

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

  13. domenkozar commented on Aug 10, 2016

    @domenkozar
    Member

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

  14. added a commit that references this issue on Apr 25, 2017
  15. added a commit that references this issue on Aug 28, 2020
  16. added a commit that references this issue on Jul 25, 2025
  17. added 3 commits that reference this issue on Jun 1, 2026
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

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions