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

RFC: Update Windows build toolchain and instructions #11705

Merged
merged 4 commits into from
Jun 20, 2015
Merged

Conversation

tkelman
Copy link
Contributor

@tkelman tkelman commented Jun 14, 2015

This uses the opensuse toolchain, to maximize compatibility with WinRPM packages. Ref previous related issues and discussion in #10490 #11285 and #11682.

I haven't gotten this toolchain to fully work in Cygwin yet, since it's a native windows compiler executable and not cygwin-hosted so it doesn't understand Cygwin paths, symlinks, etc. If we're lucky, a future cygwin mingw-w64 package update might restore ABI compatibility with opensuse. We'll need to figure out something to do about the buildbots, which are currently cygwin-based. Maybe we could transition or augment them with MSYS2 and/or opensuse cross-compile.

I'd greatly appreciate people testing this, especially from a clean environment (pristine VM or fresh separate install of msys2, no pre-existing junk on the path, etc) to verify that it works as I'm describing for other people too.

I'll be adding another commit shortly that replaces the cross-compiling section of README.windows.md with a much simpler set of Docker+opensuse instructions.

@tkelman tkelman added building Build system, or building Julia or its dependencies system:windows Affects only Windows labels Jun 14, 2015
@tkelman tkelman force-pushed the tk/winbuild branch 4 times, most recently from 811fbe8 to c257a16 Compare June 14, 2015 09:13
@SimonDanisch
Copy link
Contributor

@tkelman
Copy link
Contributor Author

tkelman commented Jun 14, 2015

Thanks! That was MSYS2, using the script and instructions here? That commit looks like master, rather than this branch.

Looks like cross-compiling won't actually work under docker, will try with vagrant instead today.

@SimonDanisch
Copy link
Contributor

Oh I think I haven't fully understood your intentions. This was the binary from juliang.org!

@tkelman
Copy link
Contributor Author

tkelman commented Jun 14, 2015

At least that confirms #11682 (comment) that the nightlies are working. I moved the comment into a gist to save space.

This PR is about updating the recommended toolchain and build instructions.

@mikewl
Copy link
Contributor

mikewl commented Jun 14, 2015

pacman --needed -Sy bash pacman pacman-mirrors msys2-runtime

This line should replace point number 2. I just reinstalled msys2 and opening msys2_shell.bat just opens the msys shell on the latest version. After the above lines run the system files are then updated and then it must be restarted.

@tkelman
Copy link
Contributor Author

tkelman commented Jun 14, 2015

Should that replace ii or iii ? Is pacman-key --init still needed?

@mikewl
Copy link
Contributor

mikewl commented Jun 15, 2015

That'll teach me to read the raws and not the formatted version!
iii should be replaced. pacman -Syu fails otherwise.
I just checked and the system update works without it. -Syu seems to work as well. I am not sure what that does (other than init pacman-key).

@mikewl
Copy link
Contributor

mikewl commented Jun 15, 2015

I just ran the get_toolchain.sh and got 2 404s. It did say that it was successful however.

I will retry it and build it tomorrow, can't stay up and resume the failed downloads unfortunately.

@tkelman
Copy link
Contributor Author

tkelman commented Jun 15, 2015

The downloads fall back to a mirror so the 404's are probably not fatal, if the fallback fails then the script should terminate with an error. How do the updated msys2 setup steps look? I'll probably try in a clean VM just to make sure it works okay, so far I've been running the cross-compiles.

@mikewl
Copy link
Contributor

mikewl commented Jun 15, 2015

They look fine now. I can't see anything wrong with a quick read-through.

and no longer always cd to dist-extras

and explicitly check for its own dependencies
Partially fix using the opensuse toolchain from cygwin

Only create junction to includes if it does not exist yet
testers needed!

Rewrite cross-compiling instructions to use docker and opensuse 13.1

and fix markdown lists

Vagrant instead of Docker

adjust msys2 setup steps

Test with msys2's python2

Remove path recommendation, not really needed any more

[av skip]
@tkelman
Copy link
Contributor Author

tkelman commented Jun 17, 2015

Pretty sure this works now (though vagrant + wine can be flaky for the cross-compiles), let me know if any feedback, will merge soon if I don't get any.

We also need to fix the toolchain on release-0.3 before we tag 0.3.10.

@tkelman
Copy link
Contributor Author

tkelman commented Jun 18, 2015

Err, I thought this was working. Now msys2 Python (which I was hoping would make the installation simpler) is interacting badly with virtualenv pypa/virtualenv#650 - could have sworn I built the docs successfully at least once.

@tkelman tkelman changed the title Update Windows build toolchain and instructions WIP: Update Windows build toolchain and instructions Jun 18, 2015
@ihnorton
Copy link
Member

If we're lucky, a future cygwin mingw-w64 package update might restore ABI compatibility with opensuse.

Is the issue that opensuse did a major version bump of libstdc++?

@tkelman
Copy link
Contributor Author

tkelman commented Jun 18, 2015

Not even! They did that a month or two ago and it didn't cause that many problems. A couple weeks ago they fixed a typo in a gcc configure flag and that apparently caused ABI breakage. https://build.opensuse.org/package/rdiff/windows:mingw:win64/mingw64-gcc?linkrev=base&rev=73

Oh, the neverending "joys" of C++.

@ihnorton
Copy link
Member

I see, thanks. Fun times: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=16612

Linking (your) relevant cygwin mailing list post for future reference: http://comments.gmane.org/gmane.os.cygwin/153535

@tkelman
Copy link
Contributor Author

tkelman commented Jun 18, 2015

Also ref JuliaCI/julia-buildbot#20 (comment) where we're figuring out what to do about the buildbots.

@ScottPJones
Copy link
Contributor

Oh, the neverending "joys" of C++

Hehe... precisely why I'm working so hard to make sure I can use julia for my consulting job... Hell would be going to C++ full time!

@Keno
Copy link
Member

Keno commented Jun 18, 2015

C++ standard library ABIs are absolutely horrible. I just lost a week of my life to the fact that std::shared_ptr ABIs differ depending on whether the compiler thinks it has certain atomics, causing subtly memory corruption if not GRRRR.

separate installers are annoying, but MSYS2 python does not play well with virtualenv

[av skip]
@tkelman
Copy link
Contributor Author

tkelman commented Jun 19, 2015

Last call for comments, I'll merge if no one has any.

@tkelman tkelman changed the title WIP: Update Windows build toolchain and instructions RFC: Update Windows build toolchain and instructions Jun 19, 2015
@SimonDanisch
Copy link
Contributor

Seems to build fine on my windows machine + cygwin!

@tkelman
Copy link
Contributor Author

tkelman commented Jun 19, 2015

I know cygwin works, what's more in need of testing here is the opensuse toolchain + msys2. Cygwin-built Julia won't work with WinRPM packages at the moment. This unfortunately keeps changing.

@SimonDanisch
Copy link
Contributor

Is the behaviour that it hangs at "INFO: Extracting packageX" ?

@tkelman
Copy link
Contributor Author

tkelman commented Jun 19, 2015

The behavior would more likely be something like Provider PackageManager failed to satisfy dependency libzmq because it fails to dlopen the zmq library built against a different libstdc++ ABI.

@SimonDanisch
Copy link
Contributor

... Is the WinRPM problem supposed to also happen with the prebuild binaries from julialang?
Because the hanging actually happens with these binaries (on both my windows desktops).
Now I additionally tested the freshly build tk/winbuild branch:

using WinRPM
WinRPM.install("gcc")
..
..
..
INFO: Extracting: runtime
#nothing happens anymore

This goes for all tested versions, which were something between 5-day old master and 0-day old master (juliang binary) and this branch here.

@tkelman
Copy link
Contributor Author

tkelman commented Jun 19, 2015

Yes the nightly binaries are built from cygwin so are also broken with WinRPM packages right now.

Just checking, you did the usual make win-extras steps from this branch?

@SimonDanisch
Copy link
Contributor

yes! also make binary-dist, installed it and copied lib/julia

@tkelman
Copy link
Contributor Author

tkelman commented Jun 19, 2015

And by freshly built you mean from cygwin? I don't know what's wrong with the extraction.

I hope an msys2+opensuse toolchain build would run more smoothly, I'll try to test that along with WinRPM on my own machine.

@SimonDanisch
Copy link
Contributor

Yes, that's what I meant.
Also, I think that Julia hangs while starting sometimes...Not sure if this is still related in any way, though.

@tkelman
Copy link
Contributor Author

tkelman commented Jun 19, 2015

The freeze is #9242 #7942 and probably unrelated.

@tkelman
Copy link
Contributor Author

tkelman commented Jun 20, 2015

Sorry to @SimonDanisch that what I was wanting help with testing here was unclear. I just did some tests using an MSYS2 + opensuse toolchain build with WinRPM packages and things worked more or less the way I expected them to, so I'll merge this.

tkelman added a commit that referenced this pull request Jun 20, 2015
RFC: Update Windows build toolchain and instructions
@tkelman tkelman merged commit ab6d485 into master Jun 20, 2015
@tkelman tkelman deleted the tk/winbuild branch June 20, 2015 00:55
tkelman added a commit that referenced this pull request Jun 21, 2015
and no longer always cd to dist-extras

and explicitly check for its own dependencies

(cherry picked from commit acb3e68)
ref PR #11705
@tkelman
Copy link
Contributor Author

tkelman commented Jun 21, 2015

backport moved to #11793

tkelman added a commit that referenced this pull request Jun 22, 2015
[release-0.3] Backport #11705, windows build instructions
tkelman referenced this pull request Jun 24, 2015
Cygwin's mingw-w64 package was rebuilt for --enable-dynamic-string,
so now using julia built with cygwin's mingw works again with
gcc dlls from opensuse, but we do need opensuse gcc dlls to work
with winrpm packages

(cherry picked from commit 00242a4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
building Build system, or building Julia or its dependencies system:windows Affects only Windows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants