<pre style='margin:0'>
Chris Jones (cjones051073) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/e64458801647db031268463e7766a3cffc819170">https://github.com/macports/macports-ports/commit/e64458801647db031268463e7766a3cffc819170</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new e6445880164 bazel{-X}: Extend support to OSX10.11 for selected versions
</span>e6445880164 is described below
<span style='display:block; white-space:pre;color:#808000;'>commit e64458801647db031268463e7766a3cffc819170
</span>Author: Chris Jones <jonesc@macports.org>
AuthorDate: Mon May 3 18:26:01 2021 +0100
<span style='display:block; white-space:pre;color:#404040;'> bazel{-X}: Extend support to OSX10.11 for selected versions
</span>---
devel/bazel/Portfile | 85 +++++++++++++++++++++++++++++++++++++++++++---------
1 file changed, 71 insertions(+), 14 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/bazel/Portfile b/devel/bazel/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 9cd1017258b..526bd7d1edb 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/devel/bazel/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/devel/bazel/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4,6 +4,10 @@ PortSystem 1.0
</span> PortGroup github 1.0
PortGroup java 1.0
PortGroup compiler_blacklist_versions 1.0
<span style='display:block; white-space:pre;background:#e0ffe0;'>+PortGroup legacysupport 1.1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+legacysupport.use_static yes
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+legacysupport.newest_darwin_requires_legacy 13
</span>
epoch 1
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -16,9 +20,6 @@ lappend all_bazels bazel
</span> name bazel
foreach b ${bazel_subports} { subport $b {} }
<span style='display:block; white-space:pre;background:#ffe0e0;'>-# Min supported Darwin version
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-set min_darwin 16
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span> # The oldest Xcode version to use default Xcode compiler
set bazel_min_xcode 9.0
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -38,6 +39,7 @@ if { ${name} eq ${subport} } {
</span> set bazel_min_xcode 12.0
compiler.blacklist-append {clang < 1200}
compiler.blacklist-append {macports-clang-[5-9].0}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ set min_darwin 16
</span>
} elseif { "bazel-3.7" eq ${subport} } {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -54,6 +56,7 @@ if { ${name} eq ${subport} } {
</span>
compiler.blacklist-append {clang < 710}
compiler.blacklist-append {macports-clang-[7-9].0}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ set min_darwin 15
</span>
} elseif { "bazel-3.5" eq ${subport} } {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -70,6 +73,10 @@ if { ${name} eq ${subport} } {
</span>
compiler.blacklist-append {clang < 710}
compiler.blacklist-append {macports-clang-[7-9].0}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ set min_darwin 15
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # https://trac.macports.org/ticket/62551
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set extra_args "--host_javabase=@local_jdk//:jdk"
</span>
} elseif { "bazel-3.1" eq ${subport} } {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -86,6 +93,7 @@ if { ${name} eq ${subport} } {
</span>
compiler.blacklist-append {clang < 710}
compiler.blacklist-append {macports-clang-[7-9].0}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ set min_darwin 15
</span>
# https://trac.macports.org/ticket/62551
set extra_args "--host_javabase=@local_jdk//:jdk"
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -105,6 +113,7 @@ if { ${name} eq ${subport} } {
</span>
compiler.blacklist-append {clang < 710}
compiler.blacklist-append {macports-clang-[7-9].0}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ set min_darwin 16
</span>
} elseif { "bazel-0.25" eq ${subport} } {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -119,10 +128,9 @@ if { ${name} eq ${subport} } {
</span> sha256 7456032199852c043e6c5b3e4c71dd8089c1158f72ec554e6ec1c77007f0ab51 \
size 275804130
<span style='display:block; white-space:pre;background:#ffe0e0;'>- # min OS
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set min_darwin 14
</span> compiler.blacklist-append {clang < 710}
compiler.blacklist-append {macports-clang-[7-9].0}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ set min_darwin 14
</span>
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -131,7 +139,7 @@ if { ${os.platform} eq "darwin" && ${os.major} < ${min_darwin} } {
</span> known_fail yes
# https://trac.macports.org/ticket/58518
pre-fetch {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_error "${subport} ${version} requires Darwin ${min_darwin} or newer"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_error "${subport} ${version} requires macOS 10.[expr ${min_darwin} - 4] (Darwin${min_darwin}) or newer"
</span> return -code error "incompatible macOS version"
}
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -174,6 +182,9 @@ use_xcode yes
</span>
compiler.cxx_standard 2011
<span style='display:block; white-space:pre;background:#e0ffe0;'>+# Always force the use of the un-versioned SDK
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+configure.sdk_version
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> # python versions. Build needs both 'python2' and 'python3'
set py3ver 3.8
set py2ver 2.7
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -195,6 +206,17 @@ if {${os.platform} eq "darwin" && ${os.major} < 16} {
</span> # https://github.com/bazelbuild/bazel/issues/6188
depends_build-append port:unzip
}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+proc bazel_get_ccache_dir {} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ global portdbpath
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return [file join $portdbpath build .ccache]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+proc bazel_wrap_dir {} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ global workpath
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return ${workpath}/bazelwrap
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> post-patch {
if {[vercmp ${xcodeversion} 7.0] < 0} {
# Use hacked version that does not find anything.
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -211,7 +233,8 @@ post-patch {
</span> }
# Patch build files to enforce correct compiler
<span style='display:block; white-space:pre;background:#ffe0e0;'>- foreach f [ exec find ${worksrcpath}/ -name "configure" -or -name "configure.py" -or -name "compile.sh" -or -name "*.tpl" -or -name "*.bzl" -or -name "CROSSTOOL" -or -name "configure.py" -or -name "MOCK_CROSSTOOL" ] {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach f [ exec find ${worksrcpath}/ -name "configure" -or -name "configure.py" -or -name "compile.sh" -or -name "*.tpl" \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -or -name "*.bzl" -or -name "CROSSTOOL" -or -name "configure.py" -or -name "MOCK_CROSSTOOL" ] {
</span> foreach cmd {ar nm strip libtool ld objdump} {
reinplace -q "s|/usr/bin/${cmd}|${prefix}/bin/${cmd}|g" ${f}
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -223,21 +246,55 @@ post-patch {
</span> reinplace -q "s|std=c++1y|std=c++14|g" ${f}
reinplace -q "s|std=c++1z|std=c++17|g" ${f}
}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Patch the wrapped clang code to use MP's compiler selection
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set wrapdir [bazel_wrap_dir]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ xinstall -m 755 -d ${wrapdir}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach comp {cc cxx} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set f [ open ${wrapdir}/${comp} w 0755 ]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts ${f} "#!/bin/bash"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts ${f} "export CCACHE_DIR=[bazel_get_ccache_dir]"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set bzflags "\"\$\{\@\}\""
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set bzcomp "[set configure.${comp}]"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if { [option configure.ccache] && [file exists ${prefix}/bin/ccache] } {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set bzcomp "${prefix}/bin/ccache ${bzcomp}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if { ${os.major} <= [option legacysupport.newest_darwin_requires_legacy] } {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set bzflags "[option legacysupport.header_search] ${bzflags}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts ${f} "exec ${bzcomp} ${bzflags}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ close ${f}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach f [ exec find ${workpath}/ -name "wrapped_clang.cc" ] {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Switch to selected compiler
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ reinplace -q "s|\"clang++\"|\"${wrapdir}/cxx\"|g" ${f}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ reinplace -q "s|\"clang\"|\"${wrapdir}/cc\"|g" ${f}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Bazel **really** doesn't want you changing stuff ;)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # https://stackoverflow.com/questions/47775668/bazel-how-to-skip-corrupt-installation-on-centos6
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ system "touch -m -t 210012120101 ${f}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span> }
<span style='display:block; white-space:pre;background:#ffe0e0;'>-build.env-append CC=${configure.cc} \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- CXX=${configure.cxx} \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+set wrapdir [bazel_wrap_dir]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+build.env-append CC=${wrapdir}/cc \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ CXX=${wrapdir}/cxx \
</span> TMPDIR=${workpath}/tmp \
JAVA_HOME=${java.home}
<span style='display:block; white-space:pre;background:#ffe0e0;'>-# Work out if we should be using macports clang
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-set use_mp_clang [ expr ( [ string match macports-clang-* ${configure.compiler} ] || [ vercmp ${xcodeversion} ${bazel_min_xcode} ] < 0 ) ]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+proc use_external_toolchain {} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ global configure.compiler xcodeversion bazel_min_xcode os.major
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set is_mp_clang [ expr { [ string match macports-clang-* ${configure.compiler} ] } ]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set xcode_not_ok [ expr { ${xcodeversion} eq "none" || [ vercmp ${xcodeversion} ${bazel_min_xcode} ] < 0 } ]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set use_legacy_s [ expr ${os.major} <= [option legacysupport.newest_darwin_requires_legacy] ]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return [ expr ${is_mp_clang} || ${xcode_not_ok} || ${use_legacy_s} ]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span>
# Disable Xcode detection on older OSes, as we want the
# MP provided commandline utilities to be used instead.
<span style='display:block; white-space:pre;background:#ffe0e0;'>-if { ${use_mp_clang} } {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+if { [use_external_toolchain] } {
</span> compiler.blacklist-append {clang}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set extra_args "--action_env=CC=${configure.cc} --action_env=CXX=${configure.cxx} ${extra_args}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set extra_args "--action_env=CC=${wrapdir}/cc --action_env=CXX=${wrapdir}/cxx ${extra_args}"
</span> build.env-append "BAZEL_USE_CPP_ONLY_TOOLCHAIN=1"
configure.env-append "BAZEL_USE_CPP_ONLY_TOOLCHAIN=1"
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -266,7 +323,7 @@ build {
</span> # Build bazel
set bazel_cmd "PATH=${workpath}/bin:\$PATH JAVA_HOME=${java.home} VERBOSE=yes BAZEL_WRKDIR=${workpath} ./compile.sh"
# If using MP toolchain pass options to enforce this
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if { ${use_mp_clang} } {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if { [use_external_toolchain] } {
</span> set bazel_cmd "BAZEL_USE_CPP_ONLY_TOOLCHAIN=1 ${bazel_cmd}"
}
if { ${extra_args} ne "" } {
</pre><pre style='margin:0'>
</pre>