Skip to content

skalibs, execline, s6: update; add s6-rc 0.7.0.0 - #34539

Open
bjornpagen wants to merge 5 commits into
macports:masterfrom
bjornpagen:skarnet-update
Open

skalibs, execline, s6: update; add s6-rc 0.7.0.0#34539
bjornpagen wants to merge 5 commits into
macports:masterfrom
bjornpagen:skarnet-update

Conversation

@bjornpagen

@bjornpagen bjornpagen commented Sep 6, 2026

Copy link
Copy Markdown

Description

Update skalibs, execline, and s6; add s6-rc, retaining all proposed runtime
corrections. Four per-port commits are followed by a separate maintainer-only
commit proposing @bjornpagen openmaintainer for all four ports.

Port Previous Proposed
skalibs 2.15.0.0_2 2.15.1.0_0
execline 2.9.9.1_1 2.9.9.2_0
s6 2.15.0.0_2 2.15.1.0_0
s6-rc not packaged 0.7.0.0_0

This submission is AI-assisted, including the source patches and tests.
The patches are explicitly identified as MacPorts downstream changes, not
upstream submissions or accepted upstream backports.

Response to review: tests and upstreaming

The standalone C tests, live-update driver, associated test phases, and
test-only dependency have been removed from the proposed ports tree and its
rewritten commit series. They remain reviewable, with before/after logs and
reproduction instructions, at this immutable evidence commit.

I cannot submit these LLM-generated changes upstream consistently with Skarnet's
published contribution policy. The policies for
skalibs,
s6, and
s6-rc explicitly reject
LLM-generated contributions and prohibit attempts to bypass that restriction.
No upstream PRs have been opened, and I will not obscure their provenance.

The MacPorts Guide, section 4.6.2
says necessary or useful source patches should generally be sent to the
application developer and documents carrying separate logical source patches
in files/. I am asking for explicit acceptance of these as maintained
downstream corrections in this circumstance—not asserting that the Guide
requires an exception or that maintainer status overrides review.

I volunteer to maintain all four ports and the downstream corrections: handle
tickets and reviews, rebase and rerun regressions for updates, and retire patches
when released upstream code resolves the defects. The
maintainer policy, section 7.3.3
welcomes volunteers for unmaintained ports, does not require commit access,
and asks that maintainer changes be separate from functional changes. The
maintainers keyword
supports the proposed GitHub handle and openmaintainer arrangement.

Corrections and evidence
  • skalibs/select: return POLLIN for read readiness rather than the request
    mask IOPAUSE_READ, which includes POLLHUP. The original reports 0x11 for
    ordinary pipe data; the correction reports 0x1. A false hangup can send
    s6-svscan into its crash path.
  • skalibs/timeval: normalize nearest-microsecond rounding before converting
    seconds. The original produces invalid tv_usec = 1000000 at the carry
    boundary. Tests cover all three converters, negative/zero/positive seconds,
    rounding boundaries, and relative signed-time overflow.
  • skalibs/availability: use the existing compiler-flag probe mechanism to
    reject APIs newer than the deployment target. SDK 26 can otherwise enable
    unavailable standard spawn directory actions for macOS 15. The negative
    runtime exits 139; corrected chdir/fchdir actions pass using available _np
    functions. The patch is selected only for Darwin targets below macOS 26.
  • execline links: recreate only the staged cd and umask symlinks with
    native Tcl operations, preserving their relative targets. This corrects the
    installer-created 0700 links to 0755, following the existing skalibs treatment.
  • s6-setlock: move the selected descriptor before taking its POSIX lock.
    Closing the original after locking releases the process-owned lock even if a
    duplicate remains. With corrected dependencies, original s6-setlock fails all
    four fd 9 shared/exclusive and timed/blocking acquisition cases; the correction
    passes all 12 default/fd 3/fd 9 cases, including competing timeout and release.
  • s6-rc supervisor retirement: unlink obsolete scan entries without sending
    xd to their supervisors. Once replacement management succeeds, request the
    scanner's ordered rescan/prune before fdholder adjustment, so its failure,
    timeout, or cancellation cannot skip the request. The scanner defers retirement
    until a successful scan marks obsolete directories inactive. Pristine code
    logs 14 missing-directory restart errors in the 30-update regression; corrected
    native and x86_64 runs each pass 100 updates plus service-state transitions
    with empty supervision logs.
  • s6-rc rollback: additional failure testing found that rollback removes
    the old active live directory at offset 0 rather than the failed candidate at
    pos. A separate one-line patch corrects the cleanup target. Injected failure
    before the symlink switch now preserves the old target and running PID, and a
    subsequent normal update succeeds. The prior patch fails this test.

The updater has five passing injected failure/recovery cases on arm64 and
x86_64: pre-switch failure, pre-management failure, fdholder restart-spawn
failure, fdholder timeout, and cancellation at fdholder entry. Fault injection
exists only in external test builds. Production patches add no sleeps, retries,
signal masking, test hooks, or warning suppression. An interrupted update is
still not a transaction; a control write is not a retirement acknowledgement,
and not every partial failure or interruption point is covered.

The patches are Darwin-only. Apart from the explicitly deployment-gated
availability probe, these are source-level defects, not new Tahoe APIs.
The select/timeval/setlock defects are already present in the previously
packaged source; no newer-only Darwin boundary has been established.

Packaging scope and history

Preserve existing normalized build/target tuples, legacy support, and linking
choices. Retain s6's optional StartupItem and empty scandir without enabling
them. s6-rc creates no database, repository, service definitions, StartupItem,
account, or running service. No personal configuration or mount setup is shipped.

Type(s)
  • bugfix
  • enhancement
  • security fix
Testing and limitations

macOS 15.7.7 (24G720), arm64, Xcode 26.3, MacPorts 2.12.6. The normal MacPorts
builds select the installed macOS 15 SDK; the separate availability reproduction
uses SDK 26. Testing is in an unprivileged disposable prefix, with its own
registry, two build jobs, and StartupItem installation/autostart disabled.
No host live MacPorts installation or services were changed.

All four final Portfiles lint with zero errors/warnings and build/stage with
+universal (arm64/x86_64). Fresh build-tree regressions pass for skalibs and s6;
the staged updater passes the live-update suite. x86_64 regressions execute under
Rosetta with extracted x86_64 s6-rc/core-supervision tools. The evidence identifies
earlier SDK configure and source-level sanitizer logs separately from new runs.

Earlier native and universal isolated installs are recorded in the prior PR
revision; this revision newly rebuilds/stages all four ports and tests the changed
updater, rather than claiming a fresh privileged install. Native Intel hardware,
older macOS/Tahoe runtime, root-owned activation, trace mode, all utility binaries,
and cross-host universal sysdeps reuse remain untested locally. CI/reviewer
approval is still required; local results do not imply green MacPorts CI.

Verification
  • Logical per-port commits; maintainer-only change separate.
  • Source patches separated by logical correction.
  • No standalone test source or custom test phase in the proposed ports tree.
  • All four Portfiles pass port lint --nitpick.
  • Revised universal source builds and staging complete.
  • Targeted native and x86_64 regressions, negative controls, and failure/recovery tests.
  • Relevant existing history and downstream-maintenance rationale linked.
  • Basic functionality of every binary (targeted coverage only).
  • Privileged trace-mode install.
  • MacPorts CI/reviewer approval.

@herbygillot

Copy link
Copy Markdown
Member

If these patches are to address core library differences on the most recent versions of macOS, then they should target those versions specifically. As it is now, these patches will apply and be built on every version of macOS, including versions that have been fine to date.

@bjornpagen

bjornpagen commented Sep 7, 2026

Copy link
Copy Markdown
Author

@herbygillot Thanks for flagging this! I’ve made the new patches Darwin-only and limited the spawn-probe workaround to deployment targets below macOS 26, following the Guide’s platform conditions. Native Tahoe builds leave configure unchanged.

One clarification on “fine to date”: the select/timeval and descriptor-lock bugs already exist in the previously packaged code. I reproduced the scanner shutdown and lock failures on Sequoia 15.7.7—not Tahoe. Successful builds wouldn’t catch these runtime failures, so restricting those fixes to the newest macOS would miss affected systems. I’ve added comments explaining that distinction.

All four ports lint cleanly, and the regression tests—including 30 live updates—pass. I think this is ready to merge pending CI confirmation on the other releases. Could you approve the workflow? It covers macOS 14, 15 and 26; I haven’t tested Tahoe locally.

@herbygillot

Copy link
Copy Markdown
Member

Please do the following:

  1. Remove the test .c files, and the associated test phases exercising them. These are almost akin to shipping source code in the port's files/ tree, which MacPorts frowns upon. The test files are indeed useful for verification, but we would rather not stuff and ship these into the ports tree.

  2. Please open the appropriate pull requests correctly integrating these patches and test files against the https://github.com/skarnet projects, and annotate the commits and PR with links to the PRs.

Thank you.

Keep read readiness distinct from hangup and normalize timeval carries.
Reject unavailable spawn APIs for deployment targets below macOS 26.
The event/conversion defects predate this release; no newer-only Darwin
boundary is established. Preserve the existing build/target tuple.

These are AI-assisted downstream patches, not upstream backports.
Skarnet does not accept LLM-generated contributions:
https://github.com/skarnet/skalibs/blob/main/CONTRIBUTING

External tests, negative controls, and results:
https://github.com/bjornpagen/macports-ports/tree/c8f3c8b0da1998378636d1d363823d0cabea2b48

Assisted-by: OpenAI Codex
Recreate the staged Darwin cd/umask links using native Tcl operations,
preserving relative targets and restoring normal symlink permissions.
Retain normalized build/target tuples and existing packaging choices.

Follow the existing skalibs library-link treatment:
macports@7e20704

External validation:
https://github.com/bjornpagen/macports-ports/tree/c8f3c8b0da1998378636d1d363823d0cabea2b48

Assisted-by: OpenAI Codex
Move the descriptor before acquiring its POSIX record lock. Closing the
original descriptor after locking releases the process-owned lock even
when a duplicate remains open. The affected code is unchanged from
2.15.0.0; restrict this downstream correction to Darwin, not Tahoe only.
Retain the optional StartupItem and existing dependency choices.

These are AI-assisted downstream changes, not an upstream backport.
Skarnet does not accept LLM-generated contributions:
https://github.com/skarnet/s6/blob/main/CONTRIBUTING

External tests cover shared/exclusive locks, default/fd 3/fd 9,
timed/blocking acquisition, competing timeout, and release:
https://github.com/bjornpagen/macports-ports/tree/c8f3c8b0da1998378636d1d363823d0cabea2b48

Assisted-by: OpenAI Codex
Install tools and documentation without creating a service database,
repository, account, or StartupItem. Match the existing normalized tuple.

Keep obsolete supervisors until a rescan marks them inactive. Request
rescan/prune after replacement management and before fdholder adjustment,
so its failure or timeout cannot bypass retirement. Do not prune after
failed management when preserved services may lack replacement links.

Separately fix rollback cleanup to remove the candidate at offset pos,
not the still-active old live directory at offset zero.

These are AI-assisted Darwin downstream patches, not upstream backports.
Skarnet does not accept LLM-generated contributions:
https://github.com/skarnet/s6-rc/blob/main/CONTRIBUTING

External repeated-update and failure/recovery regressions:
https://github.com/bjornpagen/macports-ports/tree/c8f3c8b0da1998378636d1d363823d0cabea2b48

Assisted-by: OpenAI Codex
Volunteer @bjornpagen with openmaintainer for all four ports, including
ongoing downstream patch review, rebases, regressions, and follow-up
issues. Keep the maintainer change separate from functional changes.

https://guide.macports.org/#project.contributing
https://guide.macports.org/#reference.keywords.maintainers

Assisted-by: OpenAI Codex
@bjornpagen

bjornpagen commented Sep 9, 2026

Copy link
Copy Markdown
Author

@herbygillot Thanks for the review. I've removed the standalone C tests, the
live-update driver, and their test phases/dependency from the proposed ports tree
and rewritten the series so those test files are not in its commits. The tests,
negative controls, and reproduction instructions are now on a
separate evidence branch, pinned here.

There is an upstream-policy constraint: these changes are AI-assisted, and
Skarnet's published policies for skalibs, s6, and s6-rc explicitly reject
LLM-generated contributions and prohibit bypassing that policy. I cannot file
the requested upstream PRs consistently with those terms, and will not hide
their provenance. The commits and patches identify them as downstream changes.

Could these be accepted as maintained downstream corrections? The
Guide's source-patch policy says patches should generally be sent upstream and describes carrying logical
patches in files/. I am requesting an explicit exception here, not claiming
that wording requires acceptance. I also volunteer to maintain all four ports
and their patches, including reviews, regressions, rebases, and retirement when
released upstream fixes supersede them. Following Guide 7.3.3, the
@bjornpagen openmaintainer proposal is a separate maintainer-only commit.

All corrections remain, with stronger updater coverage. Retirement now happens
after replacement management but before fdholder adjustment: injected spawn
failure, timeout, and cancellation no longer leave the old idle supervisor
behind. Failure testing also exposed a separate one-line rollback bug: cleanup
selected the old active directory instead of the failed candidate. Its correction
preserves the old database and permits a successful subsequent update. The
before/after logs are in the evidence above; these are not claims of full
transactional or arbitrary-interruption safety.

All four ports lint cleanly and rebuild/stage as universal. Targeted arm64 and
x86_64/Rosetta regressions pass, including 100 live updates plus transitions and
five updater failure/recovery cases per architecture. The PR lists the remaining
platform and privileged-testing limitations. Please review the downstream
maintenance proposal and approve the CI workflow if it remains gated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants