Commit Graph

8928 Commits

Author SHA1 Message Date
Joshua Root 90eefc6648 regen docs 2026-03-22 06:33:46 +11:00
Joshua Root 56528f6416 Use ui_debug for phase timing
This is only occasionally important information.
2026-03-22 06:33:32 +11:00
Herby Gillot 0cd72bfdc8 portbump: replace sed with targeted Tcl-based checksum and revision handling
Drop sed(1) entirely from portbump. Instead, read the Portfile into a
line list and use three new procs for targeted modifications:

- replace_checksums: match hash values as whole words using \y
  word-boundary anchors, so a size value like 123 cannot accidentally
  clobber a larger value such as 12345; targets only the correct lines
  even with multiple subports, conditional branches, or variant-scoped
  checksums.

- find_revision_line: two-phase strategy — first check for an inline
  revision on the subport declaration line (e.g. llvm pattern), then
  fall back to the nearest standalone revision line, excluding lines
  inside subport { } blocks when bumping the parent port.

- reset_revision: simple regsub to set revision to 0, preserving
  indentation and surrounding text.

Fixes a bug where both_checksums was reset on each distfile iteration,
causing only the last distfile's checksums to be updated in Portfiles
with multiple distfiles (e.g. git with git-manpages and git-htmldocs).

Fixes a bug where already-correct checksums were shown in the
"We will bump these:" output.

Also fixes a bug where patch mode applied file attributes to the
Portfile instead of the patch file.

Removes dead code left over from the sed-based implementation.

Adds comprehensive test suite covering real-world Portfile patterns
(git, go, llvm-16, gradle), including tests for whole-word size
matching, subport blocks with nested braces, multiple distfiles,
partial mismatch, and the no-revision-line code path.

Closes: https://trac.macports.org/ticket/65601
Closes: https://trac.macports.org/ticket/73593

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-21 14:49:41 -04:00
Herby Gillot f75f634ec1 tests: fix rmrf helper to handle paths exceeding PATH_MAX
The previous implementation built full paths by concatenation, which
failed with ENAMETOOLONG on macOS (PATH_MAX=1024) when cleaning up
deeply nested directories like those in darwintrace_readdir_at_maxpathlen.

Use chdir()/fchdir() to descend into directories instead, keeping all
syscall arguments to single-component relative names. All functions
used are standard POSIX available on OS X 10.5+.

This likely went unnoticed in CI because GitHub Actions runs Linux where
PATH_MAX is 4096.
2026-03-21 12:14:45 -04:00
Herby Gillot 3cc6816f84 tests: ignore rmrf test helper binary 2026-03-17 23:26:38 -04:00
Herby Gillot 48bd88581c tests: fix rmrf helper to compile on OS X 10.5+
Replace POSIX.1-2008 *at() functions (fstatat, openat, unlinkat,
fdopendir) with traditional alternatives (lstat, opendir, rmdir,
unlink). The *at() family was introduced in macOS 10.10, so the
previous implementation failed to compile on 10.9 and earlier.

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

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 22:07:45 -04:00
Herby Gillot 2eebcda26a Update ChangeLog 2026-03-17 19:52:41 -04:00
Joshua Root 80a386d359 Set RELEASE_URL to 2.12.4 2026-03-18 10:42:39 +11:00
Herby Gillot f4b0a2e429 Update ChangeLog 2026-03-17 18:59:40 -04:00
Herby Gillot e736b1e094 port: downgrade phase elapsed time logging to info level
The phase-completion timing messages ("Phase X completed in N seconds")
were too noisy at the default output level. Changed from ui_notice to
ui_info so they only appear when -v (verbose) is passed.

Updated the two affected tests to redirect channels(info) instead of
channels(notice).

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

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 23:51:07 +01:00
Joshua Root b8f1c27e32 2.12.4 release date 2026-03-18 08:40:36 +11:00
Herby Gillot f392589709 tests: avoid arm64e dyld failures in darwintrace tests
Replace darwintrace test setup and cleanup steps that invoke system
binaries under DYLD_INSERT_LIBRARIES.

On macOS 15 arm64 GitHub runners, some Apple binaries used by the
tests are arm64e, while darwintrace.dylib is built with x86_64 and
arm64 slices. Injecting the library into those helpers causes dyld to
abort before the test body runs.

Use Pextlib symlink creation in the affected tests and add a local rmrf
helper for the long-path cleanup case so the suite no longer depends on
traced system ln/rm binaries.

See: https://trac.macports.org/ticket/60818
2026-03-17 21:51:36 +01:00
Herby Gillot 037d1686d1 port: add per-line timestamps (-T) and phase elapsed time logging
Adds two related logging improvements to port build output:

- New -T flag prepends an ISO 8601 timestamp (e.g. 2026-03-18T09:42:01-0400)
  to every line of terminal output. Timestamps are off by default. The flag is
  implemented via a new ui_options(ports_timestamps) option, consistent with
  ports_verbose, ports_debug, etc.

- Phase elapsed time is always reported. When a build phase completes,
  a notice is emitted showing the phase name and duration in seconds
  (e.g. "Phase build completed in 112.034 seconds"). This is implemented
  in set_phase, which now tracks phase_start_ms and emits the notice on
  each phase transition. A call to set_phase main after eval_targets
  ensures the final phase's elapsed time is also reported.

The timestamp format is stored in macports::log_timestamp_format so it
is defined in one place. Tests are added for both features.

Closes: https://trac.macports.org/ticket/2020

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 21:38:28 +01:00
Joshua Root 4c5b607eff Catch null cxx_stdlib errors when checking outdated 2026-03-18 02:01:05 +11:00
Joshua Root 2090c13404 reg_entry_propget: set better error message for NULLs 2026-03-18 02:01:05 +11:00
Joshua Root fc8deaa31d portarchivefetch: Move incoming_path back 2026-03-18 02:01:05 +11:00
Paul Guyot c225437627 Add test for fetch thread fix and add signature size check
Signed-off-by: Paul Guyot <pguyot@kallisys.net>
2026-03-16 02:57:23 +11:00
Joshua Root 29cb72a67e CI: use checkout@v6 and upload-artifact@v6 2026-03-15 23:32:18 +11:00
Joshua Root 9e58af6c95 Update ChangeLog 2026-03-15 23:04:23 +11:00
Paul Guyot b4709d08dc Use safe-directory instead of seteuid with git
Signed-off-by: Paul Guyot <pguyot@kallisys.net>
2026-03-15 21:39:15 +11:00
Herby Gillot 3ea4d20172 configure: add --with-git option
Add MP_TOOL_PATH(GIT, [git]) to configure.ac so that users can supply
an alternate git binary via --with-git=PATH at configure time, matching
the pattern used for rsync, openssl, cvs, and other tools.

Fixes: https://trac.macports.org/ticket/72451

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-15 21:04:30 +11:00
Joshua Root 07ff61198d Avoid deleting files on worker threads
Instead, clean up the temp files on the main thread after getting the
fetch results. Still deleting on workers in the case of cancellation,
since the whole program may be about to exit when that happens.
2026-03-15 20:52:35 +11:00
Joshua Root 2dff719bd9 action_deps: only search for portdir with --index 2026-03-14 11:33:06 +11:00
Joshua Root 701f693a4a deduplicate archive fetches too 2026-03-14 11:31:30 +11:00
Joshua Root d09b57dcb6 Update RELEASE_URL to 2.12.3 2026-03-09 23:15:13 +11:00