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

Upgraded MinGW-W64 to stable version 5.0.3 #24985

Merged
merged 2 commits into from Mar 20, 2018

Conversation

taktoa
Copy link
Member

@taktoa taktoa commented Apr 18, 2017

Motivation for this change

There is a new version of MinGW-W64, so I updated the package to use that.

I also refactored the package a bit and added the --enable-idl and --enable-secure-api
flags which I found necessary when hacking on MinGW cross compilation last October.

I tested all the packages in crossMingwW64 and they all compile except for coreutils, guile_1_8 (because libsigsegv fails), and windows.wxMSW. See #24984 for more details. Note that all three of those packages were broken before this change.

Things done
  • Tested using sandboxing (nix.useSandbox or build-use-sandbox in nix.conf)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all modified pkgs using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@mention-bot
Copy link

@taktoa, thanks for your PR! By analyzing the history of the files in this pull request, we identified @aszlig and @vcunat to be potential reviewers.

@DavidEGrayson
Copy link
Contributor

DavidEGrayson commented Apr 18, 2017

Yes, --enable-secure-api is necessary to compile some programs.

Thanks for the tip about enable-idl, I'll use that in my work too.

MSYS2, a project that relies heavily on mingw-w64, usually just builds from the latest Git version, and I find that to be convenient too because mingw-w64 can take a long time between releases and most of the commits to it are pretty straightforward bug fixes. The upstream project is also pretty fast at accepting patches when I send them. So I would prefer to use git, but I suppose it also works to do it this way and just patch it as needed in nixpkgs.

@taktoa
Copy link
Member Author

taktoa commented Apr 18, 2017

I'm fine with using the latest git revision, but I've usually found there to be a fairly strong bias in nixpkgs towards using the latest stable release (and having 5.0.2 is still going to be a huge improvement over 4.0.6), so I'll leave it as-is and someone else can make another PR that upgrades it to the latest git.

@Mic92
Copy link
Member

Mic92 commented Apr 18, 2017

It would also acceptable to have a newer unstable variant of mingw-w64 as well.

@7c6f434c
Copy link
Member

7c6f434c commented May 1, 2017

I think having both stable and unstable is OK when there is a reason to have unstable, too.

Maybe adding meta would be a good idea.

@vcunat
Copy link
Member

vcunat commented May 1, 2017

This would break 32-bit builds, as gcc-5.4.0-i686-pc-mingw32-stage-final fails with:

checking for -rdynamic... g++   -g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -DGENERATOR_FILE -static-libstdc++ -static-libgcc  -o build/genmatch \
    build/genmatch.o ../build-x86_64-unknown-linux-gnu/libcpp/libcpp.a build/errors.o build/vec.o build/hash-table.o ../build-x86_64-unknown-linux-gnu/libiberty/libiberty.a
yes
checking for library containing dlopen... genattr: Internal error: abort in copy_rtx, at rtl.c:356
make[2]: *** [Makefile:2130: s-attr] Error 1
make[2]: *** Waiting for unfinished jobs....

You can test quickly e.g. by nix-build pkgs/top-level/release-cross.nix -Q -A crossMingw32.libtool.

@Ericson2314 Ericson2314 added the 6.topic: windows Running, or buiding, packages on Windows label Dec 29, 2017
@Ericson2314 Ericson2314 changed the title Upgraded MinGW-W64 to stable version 5.0.2 Upgraded MinGW-W64 to stable version 5.0.3 Mar 19, 2018
@Ericson2314
Copy link
Member

Ericson2314 commented Mar 19, 2018

@taktoa I last summer split that derivation up kind of like you did, but into separate files. I figured that was good enough, but integrated your extra configure flags, and then cherry-picked @angerman's patch.

I'll get hydra to build this to see what happens! https://hydra.nixos.org/eval/1436486

taktoa and others added 2 commits March 20, 2018 13:09
This came up with GHC, as GHC requires `_(un)lock_file`, which are only present in mingw-w64 >= 5.
@Ericson2314
Copy link
Member

Ooop, I had broken the cross jobs quite bad. https://hydra.nixos.org/eval/1442341 has it.

@Ericson2314
Copy link
Member

Ericson2314 commented Mar 20, 2018

OK hydra is slow but I built in manually. Thanks, you both!

@Ericson2314 Ericson2314 merged commit dfee3e6 into NixOS:master Mar 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet