9047 Commits

Author SHA1 Message Date
Clemens Lang 6beaf1e6a5 tracelib: allow access to trace socket by any user
There are some operations that depend on filesystem permissions and are
run under trace mode; for example, at the end of the install section,
MacPorts attempts to call git rev-parse on the port's path, and in order
to prevent git from refusing to work on a directory not owned by the
user it is running as, drops privileges to whoever owns the copy of the
ports tree.

When running under trace mode, this means the git process will run as
a user that might not normally be able to connect to the trace socket,
which leads to the traced git process calling abort() in the inserted
darwintrace.dylib library. This isn't really necessary, since it's
perfectly fine for this process to connect to the tracing socket, too
— we just need to make sure the permissions of the socket on the
filesystem allow for that. Add a chmod() to change permissions to 0o777
to support this.

This fixes crashes during the install phase when port trees aren't owned
by root or the macports user.
2026-04-12 14:29:41 +02:00
Clemens Lang 6dda4cc6c0 pextlib1.0: Fix corner case in trace mode re-signing
In particular, I've seen this failure mode when building the openjdk11
port in trace mode. I don't know why this happens, and it feels like
a bug in macOS that I can successfully posix_spawn a process, get its
pid, waitpid on that pid, and then be told that my process does not have
children, but as long as the re-signing works (which it seems to),
I don't care.
2026-04-12 14:29:41 +02:00
Clemens Lang 1b3ba14fdb darwintracelib1.0: re-enable proc tests on arm64
Relax the path check in sip_copy_proc.c so that it also passes in the
build tree, not only in the install location.
2026-04-12 14:29:41 +02:00
Clemens Lang aacd364512 pextlib1.0: Fix trace mode on arm64
Fix trace mode on arm64 by stripping the CPU subtype that enables
pointer authentication in the Mach-O headers of Apple's binaries.

Closes: https://trac.macports.org/ticket/66358
2026-04-12 14:29:41 +02:00
Clemens Lang 8d8bc09190 pextlib1.0: re-copy to SIP workaround if pextlib changed
When we modify the copying algorithm for the trace mode SIP workaround,
re-copy the files if the mtime didn't change since they were initially
copied, but their ctime is older than that of the Pextlib.dylib (or
darwintrace.dylib) that contains the copying code.

This allows us to modify the copying algorithm, which will then cause
all previously copied files to be considered outdated.
2026-04-12 14:29:41 +02:00
Joshua Root 1277eefb9a get_actual_cxx_stdlib: add missing qualifiers 2026-04-12 14:28:56 +10:00
Joshua Root 1fc07473be Fix checksum tests 2026-04-12 13:44:40 +10:00
Joshua Root 7609a7bcb2 Update old file deletion lists 2026-04-12 13:44:40 +10:00
Joshua Root 62e40c9c61 worker_init test: remove interp create assumption 2026-04-12 13:44:40 +10:00
Joshua Root ecebe60573 Adapt to Tcl 9 variable name resolution changes 2026-04-12 13:44:40 +10:00
Joshua Root b31287562c Handle glob not erroring when there are no matches 2026-04-12 13:44:40 +10:00
Joshua Root d9de469b5f Use integer/int instead of wide and entier 2026-04-12 13:44:40 +10:00
Joshua Root 6fff909c87 Use Tcl 9 octal syntax 2026-04-12 13:44:40 +10:00
Joshua Root e0ccc63e4f Use file tildeexpand where needed 2026-04-12 13:44:40 +10:00
Joshua Root 48a2566a6b Use Tcl_Size where needed 2026-04-12 13:44:40 +10:00
Joshua Root 035070928c Fix critcl with tcl 9 2026-04-12 13:44:40 +10:00
Joshua Root 0c24646347 Update .gitignore 2026-04-12 13:44:40 +10:00
Joshua Root f119b92318 Restore tcl/compat/zlib/contrib/minizip
It's now needed by zipfs.
2026-04-12 13:44:40 +10:00
Joshua Root ee1ccba2bc Replace CONST with const 2026-04-12 13:44:40 +10:00
Joshua Root 0dbeb94794 Update TclX for Tcl 9
Changes from https://github.com/tcltk-depot/tclx/tree/tclx-9-port
2026-04-12 13:44:40 +10:00
Joshua Root d875700c34 Update Tcl to 9.0.3 2026-04-12 13:44:40 +10:00
Herby Gillot 227a37b749 tests: run test suite fully in-tree without depending on prefix
Add a test-specific tclsh wrapper (`tests/test-tclsh`) that extends the
vendor tclsh wrapper with all `src/` package directories on `TCLLIBPATH`,
allowing the test suite to find in-tree packages without anything
installed at the configured prefix.

Switch all test Makefiles from `$(TCLSH)` to `$(TEST_TCLSH)` so unit and
integration tests use the in-tree interpreter. Replace all references
to `${bindir}/port` and `${bindir}/portindex` with direct invocations of
the in-tree `src/port/port.tcl` and `src/port/portindex.tcl` via the test
tclsh wrapper.

Add `init_tmp_prefix` to all test files that call `mportinit`, creating a
throwaway prefix with `macports.conf`, `sources.conf`, and `share/macports`
data populated from the source tree rather than the installed prefix.
Set `extra_env TCLLIBPATH` in test `macports.conf` files so that
`mportinit`'s environment scrub does not strip `TCLLIBPATH`, which threads
need to resolve packages.

Reorder CI workflows to run `make test` before `make install`, since the
test suite no longer requires an installed prefix.

See: https://trac.macports.org/ticket/56016

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-11 03:39:35 +02:00
Clemens Lang a4e03e33b8 darwintracelib1.0: Use unset over array unset
array unset does a pattern match against every entry in the array, unset
is more efficient; unset -nocomplain also doesn't fail if the variable
isn't set in the first place.

See: https://github.com/macports/macports-base/pull/389#discussion_r3067331371
2026-04-11 03:35:20 +02:00
Herby Gillot 963a5c670f tests: attempt to avoid macOS 15 portindex test aborts
Strip inherited darwintrace DYLD and DARWINTRACE environment variables
from the shared non-trace test helpers before invoking portindex and
most port commands, and replace a couple of shell/env helper calls with
Tcl-native setup.

Also clean up the negative darwintrace environment tests so they do not
leave injected DYLD state behind for later tests.

This is an attempted fix for the macOS 15 CI failures where the
site-tags test aborts while portindex is running.
2026-04-11 03:21:12 +02:00
Herby Gillot 1dadbbf8b5 pextlib: add BLAKE3 as new checksum type
Bundle the BLAKE3 1.8.4 C implementation (CC0/Apache-2.0 licensed) in
pextlib and wire it up as a new checksum type alongside md5, sha1,
rmd160, and sha256.

Architecture-specific SIMD acceleration is selected at configure time:
x86-64 gets SSE2/SSE41/AVX2/AVX512 assembly with runtime dispatch,
arm64 gets NEON intrinsics, and all other architectures (including
i386 and ppc for OS X 10.5 compatibility) use the portable C fallback.

Includes tests, and fixes some bad tests around checksum validation.

See: https://trac.macports.org/ticket/63885
2026-04-11 02:50:09 +02:00