-
Notifications
You must be signed in to change notification settings - Fork 101
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
Win64 std::string error #407
Comments
Makes no difference, still hitting JuliaPackaging/BinaryBuilder.jl#407
After reading JuliaPackaging/BinaryProvider.jl#152 I thought I'd try building and forcing to use the GCC7 build on Windows. I did this in JuliaGeo/LibGEOS.jl#56 and the std::string issue is gone, all tests pass. |
So in practice just this change here should fix it? Will update as soon as the building is done and I can see if AppVeyor passes. |
Yes, and I used Gnimuc/Cxx.jl@cc9dd95 to make BinaryProvider get the GCC7 version, that may be needed as well. |
Yes, can confirm that this fixes my issue as well (in piever/Sass.jl#10) and the manual editing of the build.jl was needed for it to find the windows GCC7 download. |
Mmmm, you should note that while what you're doing works right now, it's really sub-optimal. By doing this:
You are making the guarantee that whatever version of Julia you're running has been compiled with gcc 7.X. I see that your |
I guess the optimal solution would be to fix this JuliaPackaging/BinaryProvider.jl#152 ? The released Julia for Windows x86_64 is compiled with gcc 7(6?), but the default compiler_abi that BP is looking for is gcc4, which causes ABI mismatch. julia> using BinaryProvider
julia> platform_key_abi()
Windows(:x86_64, compiler_abi=CompilerABI(:gcc4, :cxx11))
julia> versioninfo()
Julia Version 1.1.0
Commit 80516ca202 (2019-01-21 21:24 UTC)
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.1 (ORCJIT, skylake) |
Which has expanded GCC versions, and uses the workaround for the failing GCC4 builds as described in JuliaPackaging/BinaryBuilder.jl#407 (comment)
See comments in Travis and build.jl about the workarounds for GCC4 issues, these are based on JuliaPackaging/BinaryBuilder.jl#407 (comment)
Ok I implemented the alternative workaround suggested in #407 (comment) in LibGEOS.jl, and it is working. So I did not build GCC4 for the problematic two platforms (this issue and x86_64-linux-musl), and removed the Does this mean that the downstream builders (GDALBuilder) that may not have GCC4 issues should also stick to GCC7 for those two platforms (so implement the exact same workaround? Happy to have a working build now, thanks for all the help. Agree with @Gnimuc that it's worth considering JuliaPackaging/BinaryProvider.jl#152 instead. |
I'm glad you got it working with the GCC 7 build; there are other issues that cause us to choose GCC 4 as the default, so I don't think it's as simple as just choosing GCC7 as the default for Windows. It sounds like the problem you're running into is that your Julia uses cxx11 ABI strings, and because GCC 4 doesn't support that, the binaries are wrong. However, your Julia is probably actually a GCC7-built Julia, it's probably a GCC6-built Julia, so if you were to have a package that contained both fortran code and C++ code, neither a GCC 7 nor a GCC 4 build would work. As it stands, our GCC "versioning" is essentially locked to libgfortran version; GCC 4 is the oldest release we support with libgfortran3, GCC 7 is the oldest with libgfortran4, and GCC8 is the oldest with libgfortran5. We need these "oldest" versions so that users who compiled Julia against libgfortranX can get a binary that links against the correct version, but the "oldest" release will be the most compatible so as to not use features that may or may not exist on the target user's machine. Unfortunately, as you can see in this issue, libgfortran compatibility is not the only thing we need to worry about. We also need to match cxx11 string ABI. This is usually not a problem, as users rarely mess with the defaults (and this only strikes when calling a C++ object that passes actual I think the "proper" fix here is that we need to start being stricter on tracking GCC and CXX ABI compatibility. We need to introduce a GCC 5 shard that is still as old as possible (to maximize compatibility) while supporting the cxx11 ABI. We would then add an audit pass that looks for affected datatypes within binaries (similarly to how we detect linkage against |
@staticfloat thanks for the thorough explanation. IIUC, the underlying reason is that the released Julia binary for Windows is shipped with |
We now have the ability to build C++ objects with multiple C++ string ABI backends, and should be choosing the appropriate binary automatically. Please open new issues if you have new issues, and if you have a builder that hasn't been updated to use the new BinaryBuilder infrastructure, head on over to Yggdrasil and open an issue/pull request! |
I ran into this a while ago in JuliaGeo/LibGEOS.jl#56, but so far I assumed it was library specific. Until @piever mentioned running into the same issue in piever/Sass.jl#10 yesterday.
To trigger (Win64 only), check out the linked branches of LibGEOS.jl or Sass.jl (both try to switch to a newer BinaryBuilder build). Then
build LibGEOS
|build Sass
and run this code to trigger the error:Both examples involve sending julia strings to the library. For
LibGEOS
it is telling that all earlier tests that send numbers and pointers to the library seem to work fine, it only fails here.As @staticfloat suggested I ran both under
gdb
and posted the backtrace here: https://gist.github.com/visr/6472f9e9921e83f45eb26f9669749f33Possibly relevant and similar lines from the backtrace posted here:
LibGEOS.jl
Sass.jl
The text was updated successfully, but these errors were encountered: