<pre style='margin:0'>
Joshua Root (jmroot) pushed a commit to branch release-2.6
in repository macports-base.
</pre>
<p><a href="https://github.com/macports/macports-base/commit/2e0ac42b3341c3b155ebf4b33c3e3fd8e68ef9b7">https://github.com/macports/macports-base/commit/2e0ac42b3341c3b155ebf4b33c3e3fd8e68ef9b7</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 2e0ac42b3341c3b155ebf4b33c3e3fd8e68ef9b7
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Wed Jun 24 16:53:17 2020 +1000
<span style='display:block; white-space:pre;color:#404040;'> Fixes for portconfigure::choose_supported_archs
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Revert d6ea0c8 which led to incorrect behaviour in some cases, and instead
</span><span style='display:block; white-space:pre;color:#404040;'> generalise the check that the archs are compatible with the SDK.
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> (cherry picked from commit c91081d2ffab6e1cd8ce2f3033c0fe7be831171f)
</span>---
src/port1.0/portconfigure.tcl | 55 ++++++++++++++++++++++++++++++++++++-------
1 file changed, 47 insertions(+), 8 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/port1.0/portconfigure.tcl b/src/port1.0/portconfigure.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index be7c68c0..15c2b43b 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/port1.0/portconfigure.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/port1.0/portconfigure.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -385,22 +385,61 @@ proc portconfigure::configure_start {args} {
</span>
# internal function to choose the default configure.build_arch and
# configure.universal_archs based on supported_archs and build_arch or
<span style='display:block; white-space:pre;background:#ffe0e0;'>-# universal_archs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# universal_archs, plus the SDK being used
</span> proc portconfigure::choose_supported_archs {archs} {
global supported_archs configure.sdk_version
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {$supported_archs eq ""} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {${configure.sdk_version} ne ""} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Figure out which archs are supported by the SDK
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[vercmp ${configure.sdk_version} 11.0] >= 0} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set sdk_archs [list arm64 x86_64]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } elseif {[vercmp ${configure.sdk_version} 10.14] >= 0} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set sdk_archs x86_64
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } elseif {[vercmp ${configure.sdk_version} 10.7] >= 0} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set sdk_archs [list x86_64 i386]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } elseif {[vercmp ${configure.sdk_version} 10.6] >= 0} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set sdk_archs [list x86_64 i386 ppc]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } elseif {[vercmp ${configure.sdk_version} 10.5] >= 0} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set sdk_archs [list x86_64 i386 ppc ppc64]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # 10.4u
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set sdk_archs [list i386 ppc ppc64]
</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;'>+ # Set intersection_archs to the intersection of what's supported by
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # the SDK and the port's supported_archs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$supported_archs eq ""} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Blank supported_archs; allow whatever the SDK does.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set intersection_archs $sdk_archs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set intersection_archs [list]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach arch $sdk_archs {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$arch in $supported_archs} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ lappend intersection_archs $arch
</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;'>+ if {$intersection_archs eq ""} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # No archs in common.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return ""
</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;'>+ } elseif {$supported_archs eq ""} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Nothing to filter on.
</span> return $archs
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # No SDK version (maybe not on macOS)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set intersection_archs $supported_archs
</span> }
set ret {}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Filter out unsupported archs, but allow demoting to 32-bit if needed.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # That means if build_arch is x86_64 it's still possible to build a port
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # that sets supported_archs to "i386 ppc" if the SDK allows it.
</span> foreach arch $archs {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {$arch in $supported_archs} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$arch in $intersection_archs} {
</span> set add_arch $arch
<span style='display:block; white-space:pre;background:#ffe0e0;'>- } elseif {$arch eq "x86_64" && "i386" in $supported_archs} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {${configure.sdk_version} ne "" && [vercmp ${configure.sdk_version} 10.14] >= 0} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- continue
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } elseif {$arch eq "x86_64" && "i386" in $intersection_archs} {
</span> set add_arch "i386"
<span style='display:block; white-space:pre;background:#ffe0e0;'>- } elseif {$arch eq "ppc64" && "ppc" in $supported_archs} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } elseif {$arch eq "ppc64" && "ppc" in $intersection_archs} {
</span> set add_arch "ppc"
} else {
continue
</pre><pre style='margin:0'>
</pre>