From 47b4dea210a16589235aaae0667f6573a2991e6b Mon Sep 17 00:00:00 2001 From: Alexis Montoison Date: Sat, 16 Nov 2024 10:28:32 -0600 Subject: [PATCH 1/2] Fix some compilation errors on MacOS due to an old SDK --- .github/julia/build_tarballs_release.jl | 25 +++++++++++++++++++++-- .github/julia/build_tarballs_yggdrasil.jl | 22 +++++++++++++++++++- .github/workflows/release.yml | 1 + 3 files changed, 45 insertions(+), 3 deletions(-) diff --git a/.github/julia/build_tarballs_release.jl b/.github/julia/build_tarballs_release.jl index 088dffe8..45335cc5 100644 --- a/.github/julia/build_tarballs_release.jl +++ b/.github/julia/build_tarballs_release.jl @@ -2,14 +2,18 @@ using BinaryBuilder, Pkg haskey(ENV, "UNO_RELEASE") || error("The environment variable UNO_RELEASE is not defined.") haskey(ENV, "UNO_COMMIT") || error("The environment variable UNO_COMMIT is not defined.") +haskey(ENV, "UNO_URL") || error("The environment variable UNO_URL is not defined.") name = "Uno" version = VersionNumber(ENV["UNO_RELEASE"]) # Collection of sources required to complete build sources = [ - GitSource("https://github.com/cvanaret/Uno.git", ENV["UNO_COMMIT"]), - ArchiveSource("https://mumps-solver.org/MUMPS_5.7.3.tar.gz", "84a47f7c4231b9efdf4d4f631a2cae2bdd9adeaabc088261d15af040143ed112") + GitSource(ENV["UNO_URL"], ENV["UNO_COMMIT"]), + ArchiveSource("https://mumps-solver.org/MUMPS_5.7.3.tar.gz", + "84a47f7c4231b9efdf4d4f631a2cae2bdd9adeaabc088261d15af040143ed112"), + ArchiveSource("https://github.com/phracker/MacOSX-SDKs/releases/download/10.15/MacOSX10.15.sdk.tar.xz", + "2408d07df7f324d3beea818585a6d990ba99587c218a3969f924dfcc4de93b62"), ] # Bash recipe for building across all platforms @@ -83,6 +87,23 @@ cd $WORKSPACE/srcdir/Uno mkdir -p build cd build +if [[ "${target}" == x86_64-apple-darwin* ]]; then + # Work around the issue + # /workspace/srcdir/Uno/uno/options/Presets.cpp:17:48: error: 'value' is unavailable: introduced in macOS 10.14 + # Presets::set(options, optional_preset.value()); + # ^ + # /opt/x86_64-apple-darwin14/x86_64-apple-darwin14/sys-root/usr/include/c++/v1/optional:938:33: note: 'value' has been explicitly marked unavailable here + # constexpr value_type const& value() const& + # ^ + export MACOSX_DEPLOYMENT_TARGET=10.15 + # ...and install a newer SDK which supports `std::filesystem` + pushd $WORKSPACE/srcdir/MacOSX10.*.sdk + rm -rf /opt/${target}/${target}/sys-root/System + cp -ra usr/* "/opt/${target}/${target}/sys-root/usr/." + cp -ra System "/opt/${target}/${target}/sys-root/." + popd +fi + if [[ "${target}" == *mingw* ]]; then LIBHIGHS=${prefix}/lib/libhighs.dll.a else diff --git a/.github/julia/build_tarballs_yggdrasil.jl b/.github/julia/build_tarballs_yggdrasil.jl index ee9e9e83..e84801e6 100644 --- a/.github/julia/build_tarballs_yggdrasil.jl +++ b/.github/julia/build_tarballs_yggdrasil.jl @@ -9,9 +9,12 @@ haskey(ENV, "UNO_URL") || error("The environment variable UNO_URL is not defined name = "Uno" version = VersionNumber(ENV["UNO_RELEASE"]) + # Collection of sources required to complete build sources = [ - GitSource(ENV["UNO_URL"], ENV["UNO_COMMIT"]) + GitSource(ENV["UNO_URL"], ENV["UNO_COMMIT"]), + ArchiveSource("https://github.com/phracker/MacOSX-SDKs/releases/download/10.15/MacOSX10.15.sdk.tar.xz", + "2408d07df7f324d3beea818585a6d990ba99587c218a3969f924dfcc4de93b62"), ] # The remainder of the file is similar to the content found at the following link: @@ -21,6 +24,23 @@ cd $WORKSPACE/srcdir/Uno mkdir -p build cd build +if [[ "${target}" == x86_64-apple-darwin* ]]; then + # Work around the issue + # /workspace/srcdir/Uno/uno/options/Presets.cpp:17:48: error: 'value' is unavailable: introduced in macOS 10.14 + # Presets::set(options, optional_preset.value()); + # ^ + # /opt/x86_64-apple-darwin14/x86_64-apple-darwin14/sys-root/usr/include/c++/v1/optional:938:33: note: 'value' has been explicitly marked unavailable here + # constexpr value_type const& value() const& + # ^ + export MACOSX_DEPLOYMENT_TARGET=10.15 + # ...and install a newer SDK which supports `std::filesystem` + pushd $WORKSPACE/srcdir/MacOSX10.*.sdk + rm -rf /opt/${target}/${target}/sys-root/System + cp -ra usr/* "/opt/${target}/${target}/sys-root/usr/." + cp -ra System "/opt/${target}/${target}/sys-root/." + popd +fi + if [[ "${target}" == *mingw* ]]; then LBT=blastrampoline-5 LIBHIGHS=${prefix}/lib/libhighs.dll.a diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6c2d69eb..63a13eaa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,6 +22,7 @@ jobs: echo "BINARYBUILDER_AUTOMATIC_APPLE=true" >> $GITHUB_ENV echo "UNO_RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV echo "UNO_COMMIT=${{ github.sha }}" >> $GITHUB_ENV + echo "UNO_URL=https://github.com/${{ github.repository }}.git" >> $GITHUB_ENV - name: Cross-compilation of Uno -- x86_64-linux-gnu-cxx11 run: | julia --color=yes -e 'using Pkg; Pkg.add("BinaryBuilder")' From c7c3485187dc14fc15766c9b57565199312cac73 Mon Sep 17 00:00:00 2001 From: Alexis Montoison <35051714+amontoison@users.noreply.github.com> Date: Sat, 16 Nov 2024 10:30:57 -0600 Subject: [PATCH 2/2] Update .github/julia/build_tarballs_yggdrasil.jl --- .github/julia/build_tarballs_yggdrasil.jl | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/julia/build_tarballs_yggdrasil.jl b/.github/julia/build_tarballs_yggdrasil.jl index e84801e6..fe7ed2de 100644 --- a/.github/julia/build_tarballs_yggdrasil.jl +++ b/.github/julia/build_tarballs_yggdrasil.jl @@ -9,7 +9,6 @@ haskey(ENV, "UNO_URL") || error("The environment variable UNO_URL is not defined name = "Uno" version = VersionNumber(ENV["UNO_RELEASE"]) - # Collection of sources required to complete build sources = [ GitSource(ENV["UNO_URL"], ENV["UNO_COMMIT"]),