-
-
Notifications
You must be signed in to change notification settings - Fork 15.4k
Cygwin fixes #26021
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
Cygwin fixes #26021
Conversation
@@ -35,7 +35,7 @@ _linkDLLs() { | |||
local dllPath2 | |||
for dllPath2 in "$dllPath" "$(dirname $(readlink "$dllPath" || echo "$dllPath"))"/*.dll; do | |||
if [ -e ./"$(basename "$dllPath2")" ]; then continue; fi | |||
ln -sr "$dllPath2" . | |||
CYGWIN+=\ winsymlinks:nativestrict ln -sr "$dllPath2" . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This forces cygwin to use real symlinks, which are needed for the windows library loader. Unfortunately it depends on having elevated permissions in some cases.
lib/systems/parse.nix
Outdated
@@ -71,7 +71,7 @@ rec { | |||
kernels = with execFormats; with kernelFamilies; setTypesAssert "kernel" | |||
(x: isExecFormat x.execFormat && all isKernelFamily (attrValues x.families)) | |||
{ | |||
cygwin = { execFormat = pe; families = { inherit /*unix*/ windows-nt; }; }; | |||
cygwin = { execFormat = pe; families = { inherit unix windows-nt; }; }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could also add cygwin support per-package, but it seems to be that cygwin is as unixy as the others here.
pkgs/top-level/perl-packages.nix
Outdated
name = "LocaleGettext-1.05"; | ||
buildInputs = stdenv.lib.optional (stdenv.isFreeBSD || stdenv.isDarwin || stdenv.isCygwin) pkgs.gettext; | ||
NIX_CFLAGS_LINK = stdenv.lib.optional (stdenv.isFreeBSD || stdenv.isDarwin || stdenv.isCygwin) "-lintl"; | ||
src = fetchurl { | ||
url = mirror://cpan/authors/id/P/PV/PVANDRY/gettext-1.05.tar.gz; | ||
sha256 = "15262a00vx714szpx8p2z52wxkz46xp7acl72znwjydyq4ypydi7"; | ||
}; | ||
}; | ||
} // stdenv.lib.optionalAttrs stdenv.isCygwin { | ||
LANG="C"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests fail without this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is safe to set this on all platforms.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
return | ||
fi | ||
find $out -name "*.dll" | while read DLL; do | ||
find "$prefix" -name "*.dll" -type f | while read DLL; do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stop it from rebasing linked libs that have already been rebased.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good!
I don't think that cygwin is really supported right now so we might as well merge that in quickly.
Do you have anything specific you want to tackle before merging into master?
@zimbatm I just wanted to make sure it good a solid review, but I'm not aware of any problems, so I removed WIP. Unfortunately, there's an non trivial conflict now (the cygwin kernel was removed), so I'll have to resolve that and test with latest master. |
Thanks, ping me when you fixed the rebase conflicts |
@Ericson2314 This patch currently adds back the cygwin kernel you recently removed. The intention was to allow cygwin to inherit 'unix' packages. Perhaps 'unix' doesn't really make sense as a kernel family... What do you think? |
@corngood Thanks for the @-mention and good work! So I originally had a cygwin kernel too, but then, following LLVM's example took it out. For now, perhaps you can modify the definition of isUnix instead? Also, I've been meaning to deprecate |
@@ -1,4 +1,4 @@ | |||
{ stdenv, fetchurl }: | |||
{ stdenv, lib, fetchurl }: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For just one use of lib
, it's more idiomatic to just do stdenv.lib
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was one other use of stdenv.lib
, so I shortened it.
@@ -41,6 +41,8 @@ stdenv.mkDerivation rec { | |||
moveToOutput lib/python2.7 "$py" | |||
''; | |||
|
|||
makeFlags = optionalString stdenv.isCygwin "LDFLAGS=-no-undefined"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be passed to configure instead? Not sure which is better, but somehow curious.
@@ -22,7 +22,6 @@ let | |||
++ [ ./nix-ssl-cert-file.patch ] | |||
++ optional (versionOlder version "1.1.0") | |||
(if stdenv.isDarwin then ./use-etc-ssl-certs-darwin.patch else ./use-etc-ssl-certs.patch) | |||
++ optional stdenv.isCygwin ./1.0.1-cygwin64.patch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you delete this patch file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@Ericson2314 Rewriting isUnix and removing the unix kernel family seems like a good idea. I'm thinking it's best to define Unix as a whitelist of:
|
@corngood yeah feel free to remove the whole notion of "kernel familes" if you like. |
715adca
to
f851fba
Compare
@Ericson2314 f851fba is what I came up with for I didn't completely remove kernel families, because there is at least a conceivable use for them, but I can do that if you'd prefer. |
BSD = { kernel = { families = { inherit (kernelFamilies) bsd; }; }; }; | ||
Unix = [ BSD Linux SunOS Hurd Cygwin ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you either remove the inner rec
and do with patterns;
here, or remove the existing patterns.
below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the redundant patterns.
, aside from the string indexed ones. I'm not aware of a better way to deal with them. I don't really have strong feelings on this vs. with patterns;
, but this is slightly more concise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it was the string ones that led me to avoid the inner rec
to begin with, but that was probably an overkill move on my part :).
@corngood good decisions on both counts. I just left you one tiny nit---hardly worth mentioning. Other than that, there is the notes on |
e89ad85
to
24a3b34
Compare
@Ericson2314 Is 974df1f what you had in mind? I'm pretty sure those are all correct as I can squash them into the original changes if you prefer. |
@corngood a quick skim found one that should actually be No preference on redoing the history or not. |
@Ericson2314 good catch. I made that one change and squashed each package. Looks like CI is failing due to timeout / log limit? |
CI is failing because travis sucks and the hydra channels are broken for days, sniff. I suppose I could just throw my hands in the error and merge this like other PRs, but I was waiting in hopes the channels would eventually be fixed and then it could be properly tested. It's really awful that
|
the rest were removed in 1dc6f15
System predicate patterns can now be specified as a list of OR'd attribute sets.
It's always on, and you get a warning if you specify it
@Ericson2314 rebased on staging. Building stdenv (especially gcc) is a can of worms. I'll keep plugging away at it in my spare time, but there's no point in holding this up. |
@corngood Fair enough. So is this PR just progress then? Or does git still build? |
@Ericson2314 git doesn't currently build due to breakage in ruby, via docbook. |
@Ericson2314 actually looks like |
Sounds great; I'm going to merge! Sorry this took so long, @corngood, but excellent job! |
@Ericson2314, @corngood: this made all darwin packages evaluate as broken, stopping Hydra builds. Any ideas? I bisected the error to 4ac1901, but I don't understand the changes enough (yet). |
The Unix list should include Darwin, but doesn't. Sorry I didn't catch this the first time around. |
Shit, sorry about that. I prepared a PR to fix isUnix: #27089. I'm just in the process of reproducing it. |
Thanks for the quick fixup. Job counts on Hydra seem OK now. |
Motivation for this change
This was enough to get git building on cygwin.
The changes should all be limited to stdenv.isCygwin.
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)