-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
fixes for cygwin #4953
base: master
Are you sure you want to change the base?
fixes for cygwin #4953
Conversation
4220db4
to
9b97dc6
Compare
@edolstra are you able to take a look or recommend a reviewer? |
This fixes: src/libmain/shared.cc:173: undefined reference to `sodium_init' on cygwin.
I marked this as stale due to inactivity. → More info |
It would be very good to see this revived! The Nix team is more active now and so we can ensure it won't get neglected. What is the state of Cygwin/Msys2 cross in Nixpkgs? That one issue would be merging things we cannot CI. But it shouldn't be too hard to fix that. |
This is a better place for what I posted on #8901: I've never had much trouble building nix on cygwin. What I did have a lot of trouble with is fibers/coroutines, which are used by nix via boost. They are sort of fundamentally broken in cygwin, which causes nix to crash (e.g. on network operations). I actually proposed a patch to cygwin which allows them to work, but it hasn't been merged: https://cygwin.com/pipermail/cygwin-developers/2020-September/011970.html Last time I did any work on this, it was mostly on the nixpkgs side. The idea was to be able to cross compile a patched cygwin1.dll, and use that to bootstrap, and build up from there. Unfortunately I haven't had time to work on it for a while. I gave up on bootstrapping using unmodified cygwin. If anyone's interested in seeing where I was going: https://github.com/corngood/nix/tree/cygwin It's is a mess of WIP commits, but this will show you the changes from the base: https://github.com/corngood/nixpkgs/compare/66de24bef8351fb6ee4bd8e75717e99e1ada5794..cygwin There are some other things in there that I think are important for cygwin, such as stateless rebasing of dlls, and using native symlinks for dlls. I'd love to get back to this at some point, but performance on cygwin (forking especially) is so bad that it makes it extremely time consuming to build a stdenv. |
OK Awesome! Yes let's take it to the Nixpkgs, and start merging PRs there for your stuff, and then come back to this. :) |
https://www.msys2.org/wiki/How-does-MSYS2-differ-from-Cygwin/ I'm a bit more familiar with MSYS2 than Cygwin; since they are only slightly different I wonder how hard it would be to support both. |
It sounds like they would have a lot in common, and could probably both use the same method of handling dll dependencies, etc. I have a feeling cygwin is probably better supported as a build target upstream in many packages, but I could be wrong. I was at least able to build all of the gcc stdenv and nix on cygwin (with some hacks and patches). |
@corngood @Ericson2314 FYI a improvement to win-dll-links was merged NixOS/nixpkgs#252459, also see the linked PR |
I'm just working on building nix on cygwin. In addition to these changes, I needed to build libeditline locally.
Boost coroutines are also currently broken on cygwin, so I've been using the changes described here:
https://cygwin.com/pipermail/cygwin-developers/2020-September/011970.html
to work around the problem.