<pre style='margin:0'>
Christopher Nielsen (mascguy) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/d514b1a4d3aa3ae496f26ab5f2101486570e8c06">https://github.com/macports/macports-ports/commit/d514b1a4d3aa3ae496f26ab5f2101486570e8c06</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit d514b1a4d3aa3ae496f26ab5f2101486570e8c06
</span>Author: Steven Thomas Smith <s.t.smith@ieee.org>
AuthorDate: Mon Jul 18 06:20:52 2022 -0400
<span style='display:block; white-space:pre;color:#404040;'> PG bazel-1.0.tcl: Bugfix
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> * Fixes: https://trac.macports.org/ticket/64442
</span>---
_resources/port1.0/group/bazel-1.0.tcl | 24 ++++++++++++++++++++----
1 file changed, 20 insertions(+), 4 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/_resources/port1.0/group/bazel-1.0.tcl b/_resources/port1.0/group/bazel-1.0.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 278dae8c4c9..1cd521fe1f8 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/_resources/port1.0/group/bazel-1.0.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/_resources/port1.0/group/bazel-1.0.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -175,7 +175,7 @@ proc bazel::set_env {} {
</span> # patch PATH
bazel.path-append [option prefix]/libexec/[bazel::get_bazel_name]/bin
bazel::add_to_envs PATH=[string map {" " ":"} [option bazel.path]]:$env(PATH)
<span style='display:block; white-space:pre;background:#ffe0e0;'>- # ccache dir
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # ccache dir
</span> if { [option configure.ccache] } {
bazel::add_to_envs CCACHE_DIR=[compwrap::get_ccache_dir]
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -208,6 +208,13 @@ post-extract {
</span> }
}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+# Mirror cc_bazelwrap and cxx_bazelwrap compilers hardcoded in bazel binary
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# see devel/bazel/Portfile
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+proc bazel::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> # Patch configuration
pre-configure {
# enforce correct build settings
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -241,8 +248,19 @@ pre-configure {
</span> reinplace -q "s|-march=native|${base_march}|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::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;'>+ ln -s ${cc} ${wrapdir}/cc_bazelwrap
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ln -s ${cxx} ${wrapdir}/cxx_bazelwrap
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ bazel.path-prepend ${wrapdir}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ build.env-append PATH=${wrapdir}:$env(PATH)
</span> }
<span style='display:block; white-space:pre;background:#e0ffe0;'>+set cc [compwrap::wrap_compiler cc]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+set cxx [compwrap::wrap_compiler cxx]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> pre-build {
# bazel cannot build if gcc is 'port selected'
# https://trac.macports.org/ticket/58569
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -256,8 +274,6 @@ pre-build {
</span> return -code error "build error"
}
if { [option bazel.run_bazel_fetch] && [option bazel.build_cmd] ne "" && [file exists ${worksrcpath}] } {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set cc [compwrap::wrap_compiler cc]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set cxx [compwrap::wrap_compiler cxx]
</span> # Run fetch
set addpath [string map {" " ":"} [option bazel.path]]
system -W ${worksrcpath} "PATH=${addpath}:$env(PATH) [bazel::get_build_env] [option bazel.build_cmd] [option bazel.build_cmd_opts] fetch [option bazel.build_target]"
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -265,7 +281,7 @@ pre-build {
</span> foreach f [ exec find [bazel::get_bazel_build_area] -name "wrapped_clang.cc" ] {
# Switch to selected compiler
reinplace -q "s|\"clang++\"|\"${cxx}\"|g" ${f}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- reinplace -q "s|\"clang\"|\"${cc}\"|g" ${f}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ reinplace -q "s|\"clang\"|\"${cc}\"|g" ${f}
</span> # Bazel **really** doesn't want you changing stuff ;)
# https://stackoverflow.com/questions/47775668/bazel-how-to-skip-corrupt-installation-on-centos6
system "touch -m -t 210012120101 ${f}"
</pre><pre style='margin:0'>
</pre>