Skip to content

Patch layer: carried GNUstep patches, protocol, Windows layer build and setup --variant (v0.1.9) - #86

Merged
danjboyd merged 12 commits into
masterfrom
carried-patches-protocol
Nov 18, 2026
Merged

danjboyd merged 12 commits into
masterfrom
carried-patches-protocol

Conversation

@danjboyd

@danjboyd danjboyd commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

Dan chose option B on 2026-11-17, a stock toolchain plus an optional signed patch layer that the user chooses, and put it in v0.1.9.

Docs

  • protocol: how apps submit carried patches;
  • inventory: what ScreenshotTool, ObjcMarkdown and LinDirStat carry, and the drift between their copies;
  • design.

Patches: toolchains/carry/carry.json plus 17 Windows patches:

  • 13 libs-back, from danjboyd/libs-back carry-0.32.0.6;
  • 3 libs-gui: upstream 3f5efad1 and ObjcMarkdown's layout and theme patches;
  • 1 libs-base: ObjcMarkdown's hash patch, on top of our stock TLS recipe.

Each applies to the stock sources.

Layer build (windows-carry-layer.yml, carry_layer.py):

  • rebuilds base, gui and back with the patches in the locked MSYS2 root;
  • keeps only each base's declared outputs that differ from a stock toolchain zip;
  • fails on any removed export;
  • smoke-tests the patched root.

CLI

  • gnustep setup --variant stock|patched:
    • a transactional apply and restore: stock files are verified first and moved aside, which also works for DLLs in use on Windows;
    • it switches without reinstalling;
    • update keeps the variant, or falls back to stock with a warning when a release has none.
  • Both bootstraps take --variant and hand off to the installed CLI.
  • Doctor check managed.toolchain.variant in both doctors.

Release: stage-release --carry-input stages a layer only if it matches the staged toolchain file for file; verify-release repeats the check.

Evidence

  • Windows layer builds 44238854552 and 44246627890: 4 files; ABI adds only GSThemeInstallBackendDefaults and two private WIN32Server ivars; smoke ok.
  • Windows variant gate 44246627890: install patched, stock/patched round trip byte-identical, update keeps the variant (see comments).
  • CI: native 93 PASSED, Python passing.

Not here: a Linux layer (after v0.1.9, LinDirStat evaluating), and publishing the v0.1.9 release itself (its own ask).

🤖 Generated with Claude Code

https://claude.ai/code/session_01Ugm29zKJUHxvomQeDSzshZ

…er design

- docs/carried-patches/inventory.md: every GNUstep patch our toolchain and
  ScreenshotTool, ObjcMarkdown and LinDirStat carry, with bases, upstream
  state and the drift between the apps' copies.
- docs/carried-patches/README.md: how apps submit, update and retire
  carried patches (draft for Dan's review).
- docs/specs/patch-layer.md: option B, a stock toolchain plus an optional
  signed patch layer the user chooses (draft for Dan's review).

Docs only; no code or artifact changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ugm29zKJUHxvomQeDSzshZ
danjboyd and others added 7 commits November 17, 2026 22:39
- toolchains/carry/carry.json and the 17 Windows patches:
  - libs-back: danjboyd/libs-back carry-0.32.0.6's 13 code commits;
  - libs-gui: upstream 3f5efad1 plus ObjcMarkdown's layout and theme patches;
  - libs-base: ObjcMarkdown's attributed-string hash patch, on top of our
    stock recipe's patches.
  Each applies cleanly to the stock release sources.
- MSYS2-style recipes for gnustep-gui and gnustep-back that take the patches
  from CARRY_PATCH_DIR; the stock gnustep-base recipe applies them only when
  CARRY_PATCH_DIR is set, so the stock package is unchanged.
- src/gnustep_cli_shared/carry_layer.py: checks carry.json, keeps only each
  base's declared outputs that differ from a stock toolchain zip, refuses any
  removed export (ABI), and writes the layer zip with carry-layer.json.
  11 unit tests.
- windows-carry-layer.yml: builds the three packages in the locked MSYS2 root,
  builds the layer against a given stock toolchain zip, then smoke-tests the
  stock root with the layer applied (smoke-toolchain.sh plus an AppKit start
  on the win32 backend). Nothing is published.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ugm29zKJUHxvomQeDSzshZ
…ring the patch layer

- applyCarryLayerArtifact:
  1. fetches the release's carry-layer artifact (next to the manifest, or
     downloaded) and checks its sha256;
  2. requires the installed toolchain to be the one the layer was built for,
     and every file to be exactly the stock one, before anything moves;
  3. moves each stock file to state/carry/stock (a rename, which works for a
     DLL in use on Windows), copies the patched one in and verifies it;
  4. undoes everything on any failure.
  It records carry-layer.json at the root and toolchain_variant/carry_layer
  in the state.
- restoreStockToolchainForInstallRoot: puts the stock files back and checks
  them against stock_sha256.
- setup:
  - --variant on an existing install switches it without reinstalling;
  - on a new install it installs stock, then applies the layer;
  - --upgrade (what update runs) re-applies the layer when the install was
    patched, or keeps the new stock toolchain with a warning when the release
    has no layer.
- 4 native tests: round trip, refusals (changed stock file, other
  toolchain), a failed install putting stock back, option checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ugm29zKJUHxvomQeDSzshZ
…e installed CLI

Both bootstraps install stock as before. With --variant patched they then run
the installed CLI's 'setup --variant patched' (so the layer's checks live in
one place) and fold its JSON into theirs as carry_layer, keeping --json a
single document. A failure reports that the stock install is in place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ugm29zKJUHxvomQeDSzshZ
…d toolchain

stage-release takes --carry-input target=<layer zip> (the multi-run path
finds gnustep-carry-<target>-<version>.zip like the cli and toolchain inputs).
Before staging, every replaced file's stock_sha256 is checked against the
staged toolchain archive, along with the layer's recorded toolchain sha256.
The layer becomes artifact carry-layer-<target> (kind carry-layer,
requires_toolchain, optional). verify-release repeats the check. 2 tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ugm29zKJUHxvomQeDSzshZ
…tly applied layer

Both doctors read carry-layer.json and check each listed file against its
patched and stock sha256. Stock: ok. Patched and intact: ok, with the patch
ids. A mix, or a patched state without its record: an error that names the
repair (setup --variant stock, then patched). Full CLI only; the bootstrap
doctor lists it as not_run. 3 Python tests; native coverage added to the
round-trip test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ugm29zKJUHxvomQeDSzshZ
…ap hand-off, doctor id)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ugm29zKJUHxvomQeDSzshZ
…run 44238854552)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ugm29zKJUHxvomQeDSzshZ
@danjboyd

Copy link
Copy Markdown
Owner Author

First Windows layer build: passed (run 44238854552)

Stock base: the toolchain zip of Windows run 44189762879. The build root's gnustep-base and gnustep-gui DLLs matched it before building.

  • Layer: 4 files, 17 patches, gnustep-carry-windows-amd64-msys2-clang64-0.1.9-dev.zip (sha256 bbde5e0f…):

    • clang64/bin/gnustep-base-1_31.dll
    • clang64/bin/gnustep-gui-0.dll
    • clang64/bin/gpbs.exe
    • clang64/lib/GNUstep/Bundles/libgnustep-back-032.bundle/libgnustep-back-032.dll

    The other 33 files the rebuild changed (rebuilt tools, timestamps only) were reported and not shipped.

  • ABI: no export removed. Added:

    • gui: GSThemeInstallBackendDefaults, which ObjcMarkdown predicted;
    • back: WIN32Server ivar offsets for clientDrawsCaptions and perMonitorDPIAware. These are non-fragile ivars on a class private to the backend bundle.

    Recorded in carry.json.

  • Smoke, on the stock root with the layer applied:

    • the full smoke-toolchain.sh passed (Foundation, TLS, perl, NSLog, …);
    • an AppKit program started on the WIN32Server display server.

Next: a Windows gate of the CLI side (setup --variant stock→patched→stock, byte-identical, update keeping the variant).

🤖 Generated with Claude Code

danjboyd and others added 2 commits November 17, 2026 23:02
…tched round trip, update keeps the variant

A second job in windows-carry-layer.yml:
1. builds the CLI from the branch;
2. stages releases 0.1.9 and 0.1.10 with the real stage_release_assets
   (so the toolchain check on the layer runs too);
3. signs them with a throwaway key;
4. under Windows PowerShell 5.1, installs with the bootstrap's --variant
   patched, switches to stock and back with the root's own gnustep.exe
   (whose gnustep-base DLL is the patched one), checks the clang64 tree is
   byte-identical after a round trip, and updates to 0.1.10, checking
   files, state and doctor at every step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ugm29zKJUHxvomQeDSzshZ
Run 44241435699 passed every product step but reported ok=False: the
bootstrap's --allow-unsigned warning, merged in by *>, came before its JSON.
The bootstrap's stderr now goes to its own file, and Read-Json starts at the
first line beginning with '{'. Artifact downloads retry, after a dropped
connection failed the first attempt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ugm29zKJUHxvomQeDSzshZ
@danjboyd

Copy link
Copy Markdown
Owner Author

Windows variant gate: passed (run 44246627890, d6343a2)

Setup: GitHub windows-latest, Windows PowerShell 5.1. The CLI is built from this branch. Releases X (0.1.9) and Y (0.1.10) were staged with the real stage_release_assets, so the layer's toolchain check ran too, and signed with a throwaway key.

Step Result
bootstrap setup --variant patched exit 0; JSON toolchain_variant=patched, carry_layer.ok=True; all layer files patched; doctor ok/patched
setup --variant stock, by the root's own gnustep.exe (patched gnustep-base DLL loaded) exit 0; files stock; state stock; doctor ok/stock; carry-layer.json removed
setup --variant patched (switch, no reinstall) exit 0; patched; doctor ok/patched
setup --variant stock again exit 0; the clang64 tree is byte-identical to the first stock state
update to 0.1.10 while patched exit 0; still patched; state patched; doctor ok/patched

ok=True. The layer job in the same run passed again: 4 files, no removed exports, toolchain smoke and AppKit start.

Earlier attempt 44241435699 passed every product step, but my gate script misread the bootstrap's JSON: the --allow-unsigned warning on stderr was merged into the same file. Fixed in d6343a2, along with a download retry.

CI on d6343a2: native GSCommandWorkflowTests 93 tests PASSED, RunnerTests 31, ContextTests 4; python-shared passed.

🤖 Generated with Claude Code

@danjboyd danjboyd changed the title Carried GNUstep patches: inventory, submission protocol, patch-layer design Patch layer: carried GNUstep patches, protocol, Windows layer build and setup --variant (v0.1.9) Nov 18, 2026
…tocol

# Conflicts:
#	src/full-cli/Tests/GSCommandWorkflowTests.m
…tocol

# Conflicts:
#	src/gnustep_cli_shared/doctor_engine.py
@danjboyd
danjboyd marked this pull request as ready for review November 18, 2026 18:20
@danjboyd
danjboyd merged commit 0207021 into master Nov 18, 2026
5 checks passed
@danjboyd
danjboyd deleted the carried-patches-protocol branch November 18, 2026 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant