<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/adcc95357713411086123d9eb953ad28b5b18b2a">https://github.com/macports/macports-ports/commit/adcc95357713411086123d9eb953ad28b5b18b2a</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 adcc953 xcode_workaround PG: Extend blacklisting to Darwin18+Xcode11
</span>adcc953 is described below
<span style='display:block; white-space:pre;color:#808000;'>commit adcc95357713411086123d9eb953ad28b5b18b2a
</span>Author: Chris Jones <jonesc@macports.org>
AuthorDate: Sun May 10 12:31:43 2020 +0100
<span style='display:block; white-space:pre;color:#404040;'> xcode_workaround PG: Extend blacklisting to Darwin18+Xcode11
</span>---
_resources/port1.0/group/xcode_workaround-1.0.tcl | 68 ++++++++++++++---------
1 file changed, 43 insertions(+), 25 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/_resources/port1.0/group/xcode_workaround-1.0.tcl b/_resources/port1.0/group/xcode_workaround-1.0.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index e79c95f..474a724 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/_resources/port1.0/group/xcode_workaround-1.0.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/_resources/port1.0/group/xcode_workaround-1.0.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,15 +1,18 @@
</span> # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
#
<span style='display:block; white-space:pre;background:#ffe0e0;'>-# This PortGroup attempts to work around a bug in Xcode 11 on Catalina.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# This PortGroup attempts to work around problemtaic Xcode versions
</span> # See https://forums.developer.apple.com/thread/121887
#
<span style='display:block; white-space:pre;background:#e0ffe0;'>+# -fno-stack-check issue only applies to macOS10.15 but in general this PG
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# could be used to address issues in other Xcode versions as well.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#
</span> # Usage:
#
# PortGroup xcode_workaround 1.0
#
# xcode_workaround.type:
<span style='display:block; white-space:pre;background:#ffe0e0;'>-# append_to_compiler_flags (add -fno-stack-check to compiler flags)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# append_to_compiler_name (add -fno-stack-check to compiler name)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# append_to_compiler_flags (e.g. add -fno-stack-check to compiler flags)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# append_to_compiler_name (e.g. add -fno-stack-check to compiler name)
</span> # avoid_xcode_compiler (blacklist broken compiler)
#
# xcode_workaround.fixed_xcode_version: minimum developer version in which bug is fixed
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -26,6 +29,7 @@ default xcode_workaround.type {append_to_compiler_flags}
</span> default xcode_workaround.fixed_xcode_version {11.3}
proc xcode_workaround::xcode_workaround.appy_fix {} {
<span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> global \
os.major \
xcodeversion \
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -42,19 +46,22 @@ proc xcode_workaround::xcode_workaround.appy_fix {} {
</span> compiler.blacklist \
use_xcode
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {${os.major} != 19} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # -fno-stack-check is the default prior to macOS 10.15
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # assume this issue will be fixed by macOS 10.16
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set apply_fix no
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Xcode 11 fixes (Applicable to macOS1 0.14 and macOS 10.15)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set apply_fix [ expr ( ${os.major} == 19 || ( ${os.major} == 18 && [vercmp $xcodeversion 11] >= 0 ) ) ]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if { ${apply_fix} } {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Check if Xcode is newer than defined fixed version
</span> # N.B. vercmp should properly handle none or "" for $xcodeversion or $cltversion
set xcode_is_ok [expr [vercmp $xcodeversion ${xcode_workaround.fixed_xcode_version}] >= 0]
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Check flag from cltversion PG to see if Xcode or CLT should be used
</span> if {${use_xcode}} {
set apply_fix [expr !${xcode_is_ok}]
} else {
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Check if CLT version is fixed or not
</span> set clt_is_ok [expr [vercmp $cltversion ${xcode_workaround.fixed_xcode_version}] >= 0]
<span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # If broken, but Xcode OK, use that instead
</span> if {${xcode_is_ok} && !${clt_is_ok}} {
# MacPorts defaults to CLTs, but Xcode can easily be ahead
ui_debug "xcode_workaround: using Xcode since the bug is fixed there"
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -64,29 +71,38 @@ proc xcode_workaround::xcode_workaround.appy_fix {} {
</span> set apply_fix [expr !${clt_is_ok}]
}
}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> }
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {${apply_fix}} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Apply the configured fix type
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if { ${apply_fix} } {
</span> switch -- ${xcode_workaround.type} {
append_to_compiler_flags {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_debug "xcode_workaround: Adding -fno-stack-check to compiler flags."
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- configure.cflags-delete -fno-stack-check
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- configure.cflags-append -fno-stack-check
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- configure.cxxflags-delete -fno-stack-check
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- configure.cxxflags-append -fno-stack-check
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- configure.objcflags-delete -fno-stack-check
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- configure.objcflags-append -fno-stack-check
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- configure.objcxxflags-delete -fno-stack-check
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- configure.objcxxflags-append -fno-stack-check
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # -fno-stack-check workaround only needed on Darwin 19
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if { ${os.major} == 19 } {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_debug "xcode_workaround: Adding -fno-stack-check to compiler flags."
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ configure.cflags-delete -fno-stack-check
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ configure.cflags-append -fno-stack-check
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ configure.cxxflags-delete -fno-stack-check
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ configure.cxxflags-append -fno-stack-check
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ configure.objcflags-delete -fno-stack-check
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ configure.objcflags-append -fno-stack-check
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ configure.objcxxflags-delete -fno-stack-check
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ configure.objcxxflags-append -fno-stack-check
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span> }
append_to_compiler_name {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_debug "xcode_workaround: Adding -fno-stack-check to compiler name."
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- configure.cc-delete -fno-stack-check
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- configure.cc-append -fno-stack-check
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- configure.cxx-delete -fno-stack-check
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- configure.cxx-append -fno-stack-check
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # -fno-stack-check workaround only needed on Darwin 19
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if { ${os.major} == 19 } {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_debug "xcode_workaround: Adding -fno-stack-check to compiler name."
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ configure.cc-delete -fno-stack-check
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ configure.cc-append -fno-stack-check
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ configure.cxx-delete -fno-stack-check
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ configure.cxx-append -fno-stack-check
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span> }
avoid_xcode_compiler {
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Applicable to both Darwin 18 and 19
</span> ui_debug "xcode_workaround: blacklisting Clang compiler."
compiler.blacklist-delete clang
compiler.blacklist-append clang
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -97,11 +113,13 @@ proc xcode_workaround::xcode_workaround.appy_fix {} {
</span> }
}
}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> }
<span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> port::register_callback xcode_workaround::xcode_workaround.appy_fix
proc xcode_workaround::xcode_workaround._proc {option action args} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {$action ne "set"} return
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$action ne "set"} return
</span> xcode_workaround.appy_fix
}
</pre><pre style='margin:0'>
</pre>