Skip to content

Commit

Permalink
Add libjulia_platforms() helper (#2314)
Browse files Browse the repository at this point in the history
... so that packages using libjulia_jll have an easier time to select
the right base set of platforms. Now they can just start with the result
of `libjulia_platforms()` instead of `supported_platforms()` and then
selectively remove those which are not supported.

Also adapt a few JLL recipes to use the new helper.

[skip build]
[skip ci]
  • Loading branch information
fingolfin authored Dec 29, 2020
1 parent dcd9177 commit ff4399b
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 46 deletions.
6 changes: 3 additions & 3 deletions F/FastJet_Julia_Wrapper/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ install_license $WORKSPACE/srcdir/FastJet_Julia_Wrapper/LICENSE.md

# These are the platforms we will build for by default, unless further
# platforms are passed in on the command line
platforms = expand_cxxstring_abis(supported_platforms())
# skip i686 musl builds (not supported by libjulia_jll)
filter!(p -> !(Sys.islinux(p) && libc(p) == "musl" && arch(p) == "i686"), platforms)
include("../../L/libjulia/common.jl")
platforms = expand_cxxstring_abis(libjulia_platforms(julia_version))

# the plugins aren't found on win. Disable for now, but this is not a fundamental limitation.
filter!(!Sys.iswindows, platforms)

Expand Down
5 changes: 2 additions & 3 deletions L/LCIO_Julia_Wrapper/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,11 @@ install_license $WORKSPACE/srcdir/LCIO_Julia_Wrapper/LICENSE

# These are the platforms we will build for by default, unless further
# platforms are passed in on the command line
platforms = supported_platforms()
include("../../L/libjulia/common.jl")
platforms = libjulia_platforms(julia_version)
filter!(!Sys.isfreebsd, platforms)
filter!(!Sys.iswindows, platforms)
filter!(p -> arch(p) != "armv7l", platforms)
# skip i686 musl builds (not supported by libjulia_jll)
filter!(p -> !(Sys.islinux(p) && libc(p) == "musl" && arch(p) == "i686"), platforms)

platforms = expand_cxxstring_abis(platforms)

Expand Down
11 changes: 2 additions & 9 deletions L/Libtask/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,8 @@ install_license LICENSE.md

# These are the platforms we will build for by default, unless further
# platforms are passed in on the command line
platforms = supported_platforms()

# skip i686 musl builds (not supported by libjulia_jll)
filter!(p -> !(Sys.islinux(p) && libc(p) == "musl" && arch(p) == "i686"), platforms)

# skip PowerPC builds in Julia 1.3 (not supported by libjulia_jll)
if julia_version < v"1.4"
filter!(p -> !(Sys.islinux(p) && arch(p) == "powerpc64le"), platforms)
end
include("../../L/libjulia/common.jl")
platforms = libjulia_platforms(julia_version)

# The products that we will ensure are always built
products = [
Expand Down
12 changes: 2 additions & 10 deletions L/libcxxwrap_julia/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,8 @@ install_license $WORKSPACE/srcdir/libcxxwrap-julia*/LICENSE.md

# These are the platforms we will build for by default, unless further
# platforms are passed in on the command line
platforms = supported_platforms()

# skip i686 musl builds (not supported by libjulia_jll)
filter!(p -> !(Sys.islinux(p) && libc(p) == "musl" && arch(p) == "i686"), platforms)

# skip PowerPC builds in Julia 1.3 (not supported by libjulia_jll)
if julia_version < v"1.4"
filter!(p -> !(Sys.islinux(p) && arch(p) == "powerpc64le"), platforms)
end

include("../../L/libjulia/common.jl")
platforms = libjulia_platforms(julia_version)
platforms = expand_cxxstring_abis(platforms)

# The products that we will ensure are always built
Expand Down
29 changes: 18 additions & 11 deletions L/libjulia/common.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
# Note that this script can accept some limited command-line arguments, run
# `julia build_tarballs.jl --help` to see a usage message.
using BinaryBuilder, Pkg.Types
using BinaryBuilder, Pkg

# return the platforms supported by libjulia
function libjulia_platforms(julia_version)
platforms = supported_platforms()

# skip 32bit musl builds; they fail with this error:
# libunwind.so.8: undefined reference to `setcontext'
filter!(p -> !(Sys.islinux(p) && libc(p) == "musl" && arch(p) == "i686"), platforms)

# in Julia <= 1.3 skip PowerPC builds (see https://github.com/JuliaPackaging/Yggdrasil/pull/1795)
if julia_version < v"1.4"
filter!(p -> !(Sys.islinux(p) && arch(p) == "powerpc64le"), platforms)
end

return platforms
end

# Collection of sources required to build Julia
function build_julia(version)
Expand Down Expand Up @@ -196,16 +212,7 @@ function build_julia(version)

# These are the platforms we will build for by default, unless further
# platforms are passed in on the command line
platforms = supported_platforms()

# skip 32bit musl builds; they fail with this error:
# libunwind.so.8: undefined reference to `setcontext'
filter!(p -> !(Sys.islinux(p) && libc(p) == "musl" && arch(p) == "i686"), platforms)

# in Julia <= 1.3 skip PowerPC builds (see https://github.com/JuliaPackaging/Yggdrasil/pull/1795)
if version < v"1.4"
filter!(p -> !(Sys.islinux(p) && arch(p) == "powerpc64le"), platforms)
end
platforms = libjulia_platforms(version)

# While the "official" Julia kernel ABI itself does not involve any C++
# symbols on the linker level, `libjulia` still exports "unofficial" symbols
Expand Down
12 changes: 2 additions & 10 deletions L/libsingular_julia/common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,8 @@ install_license LICENSE.md

# These are the platforms we will build for by default, unless further
# platforms are passed in on the command line
platforms = supported_platforms()

# skip i686 musl builds (not supported by libjulia_jll)
filter!(p -> !(Sys.islinux(p) && libc(p) == "musl" && arch(p) == "i686"), platforms)

# skip PowerPC builds in Julia 1.3 (not supported by libjulia_jll)
if julia_version < v"1.4"
filter!(p -> !(Sys.islinux(p) && arch(p) == "powerpc64le"), platforms)
end

include("../../L/libjulia/common.jl")
platforms = libjulia_platforms(julia_version)
platforms = filter!(!Sys.iswindows, platforms) # Singular does not support Windows
platforms = expand_cxxstring_abis(platforms)

Expand Down

0 comments on commit ff4399b

Please sign in to comment.