During selfupdate, only a few configure arguments (--prefix,
--with-install-user, --with-install-group, --with-directory-mode)
were reconstructed and passed to configure. Other arguments such as
--with-curlprefix, --with-applications-dir, --with-frameworks-dir,
and tool paths were silently lost.
Save the original configure arguments to
$prefix/share/macports/configure_args during make install, and read
them back during selfupdate. Fall back to the previous reconstruction
logic when upgrading from an older version that lacks the saved file.
Closes: https://trac.macports.org/ticket/73670
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This is no longer required with Tcl 9, since it will outright fail on
non-UTF-8 characters in the input even without this:
| Can't map the URL 'file://$path' to a port description file ("couldn't read file "$path": invalid or incomplete multibyte or wide character").
| Please verify that the directory and portfile syntax are correct.
Note that `-encoding binary` is no longer supported and will trigger an
error. The error message above is with `-translation binary`.
/bin/ln on macOS 14 is built with a set of relocations that break when
binary-patching the architecture from arm64e to arm64, leading to 'dyld:
bad bind opcode 0x19'.
Newer versions don't seem to ship such binaries, so until somebody comes
along to find a solution for these few binaries, let's just disable
tracemode support on macOS <= 14.
Attempting to normalize the userhome of the macports user might not work
if the user has not yet been created while running tests from within the
source tree, so don't do that unless running as root (where the test
that triggers this is skipped).
Additionally, the SIP workaround path for darwintrace needs to be
configurable, because the path in the installation directory might not
exist yet (CI may not have yet run make install). This path then also
needs to be added to the various sandboxes we configure.
This also means darwintrace.dylib needs to be picked up from the source
tree, so add another variable to test-tclsh.in (and pass that variable
through by modifying test-macports.conf) and check for its existence in
porttrace.tcl.
This also means we no longer need to reinplace the macports user's
username into the test file, so there's no longer a need to generate it
using configure.
Since we're moving to being able to run tests without installing
MacPorts, we can't rely on the SIP workaround path to exist yet. Prefer
the path from $DARWINTRACE_SIP_WORKAROUND_PATH if it is set in
darwintrace's sip_copy_proc.c, and set up a new temporary directory for
each test.