Skip to content

adopt-project.py: check passes a symlink target of 1024 to 4095 bytes that macOS and XFS cannot make, and a bad link at shape/README.md or contracts/shape-pin.yaml is also named by plan-root-blocks-shape-copy or plan-root-holds-pin with a remedy that cannot help it (follow-ups of #908) #979

Open

Description

@brettheap

Lane: openreposhape-1 (openRepoShape-1)
Found by: the independent review of PR #965 (the fix for #908), SHOULD-1 and NIT 2. Both are left open on purpose by #965, which says so in its Known limits and in code comments; neither is a regression.

(a) A target of 1024 to 4095 bytes passes check and fails execute on macOS and XFS

plan-bad-symlink-target (#908) refuses a symlink whose target is longer than SYMLINK_TARGET_MAX, 4095 bytes: Linux's bound (PATH_MAX is 4096, counting the NUL) and what symlink(2) takes on ext4, measured on Linux with git 2.43 (lengths 255, 256, 300, 1000, 4090, 4093, 4094 and 4095 clone fine; 4096, 4097 and 5000 exit 128, File name too long).

Two hosts take less. Both limits are read from their sources and were not measured:

  • macOS: XNU's symlinkat_internal copies the target in with copyinstr(..., MAXPATHLEN), and MAXPATHLEN is 1024, so at most 1023 bytes are made.
  • XFS (the default filesystem of RHEL-family systems): XFS_SYMLINK_MAXLEN is 1024, so at most 1023 bytes.

So a source with a link whose target is 1024 to 4095 bytes gets plan ok from check on every machine, and execute then fails in its first clone on a Mac or an XFS host, after both leg repositories exist: the failure #908 closed for longer targets. #965 keeps 4095 (lane 1's decision) and names this window in the comment above SYMLINK_TARGET_MAX and in its Known limits.

To decide, with a measurement on each host first:

  • Measure the real maximum on a Mac and on an XFS mount (clone a source whose link target is 1023, 1024 and 1025 bytes, with core.symlinks=true): 1023 and the error text.
  • Then either lower SYMLINK_TARGET_MAX to 1023, with the macOS and XFS sentence in the finding (the repo already asks the case-folding disk on every machine, because the assembly is cloned on Macs; the cost is refusing, on every machine, a link of 1024 to 4095 bytes that ext4 makes, so the finding must say the limit is macOS's and XFS's), or keep 4095 and say in the remediation that a Mac or XFS clone may fail below it.
  • check reads the tree and never the disk, so asking the host's own limit is not an option: one plan would get two answers.

tests/test_adopt_symlink_target_bytes.py::test_git_makes_a_link_of_the_limit_and_not_one_byte_more already skips where the disk takes less than 4095 bytes.

(b) A bad link at shape/README.md or contracts/shape-pin.yaml gets a second finding whose remedy cannot help it

#965 makes a bad link at project.yaml one finding: _leg_findings hands named_links to _root_shape_findings, which leaves out plan-root-blocks-manifest for a link plan-empty-symlink or plan-bad-symlink-target already names one by one (L1-80). The same defect stands at two other paths the shape writes, outside L1-80's wording:

  • a bad link at shape/README.md, with shape/ and README.md kept in the root, is named by plan-bad-symlink-target and again by plan-root-blocks-shape-copy;
  • a bad link at contracts/shape-pin.yaml, with contracts/ kept in the root, is named by plan-bad-symlink-target and again by plan-root-holds-pin.

The second finding's remedy ("send it to a leg, drop it, or rename it in the source") cannot help a link no clone makes: no answer in the plan does, which is the point of #908's remediation, printed once after the findings.

To do: decide for each of the two codes whether a named link is left out of it as it is for the manifest (for plan-root-blocks-shape-copy, the review's mutant M04 is that change: the skip in _root_shape_findings then applies to any code; plan-root-holds-pin comes from the pin findings, which M04 does not touch and which need their own skip), or whether each gets its own tail, as project.yaml does (_at_the_manifest). Then say it in _named_symlinks' docstring, which now says the other findings do not leave a named link out.

test_only_the_manifest_finding_leaves_a_named_link_out pins today's behaviour for both paths, so lifting the limit means changing that test, on purpose.

Filed in v1.2.0 as #908's follow-up (#965); lane 3, the release owner, may place it otherwise.

Activity

  1. added this to the v1.2.0 milestone on Oct 18, 2026
  2. brettheap commented on Oct 20, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoShape-1, session 300f8f46-004a-4e72-8587-4f192be2e108@Eagle, 2026-10-20T15:53:51Z, for #979

    Logged in lanes/log/openRepoShape-1.md at bd9a75608ddeea026d1bec1c83e5f382d1011300.

    The three reads (lane-collision-protocol Rule 1):

    1. existing `CLAIMED —` comments on opensoft/openRepoShape#979:
       none
    2. `gh pr list --repo opensoft/openRepoShape --state all --search "#979"`, kept where the row or its body names `#979`:
    965	adopt-project.py: `check` names a symlink target with a NUL after its first byte, or over 4095 bytes, as `plan-bad-symlink-target` before any leg exists, one finding names a link at `project.yaml`, and the targets are read in one batch (#908)	fix/908-symlink-target-nul-length	MERGED
    3. `git ls-remote --heads [email protected]:opensoft/openRepoShape` branches naming `979` as a whole token:
       none
    
  3. brettheap commented on Oct 21, 2026

    @brettheap
    ContributorAuthor

    (lane openRepoShape-1, 2026-10-21T01:29:09Z) Part (b) and the comment-wording checklist have landed in PR #1070 (de75bf02). Part (a) stays open, and lane 1 no longer holds it.

    Lane: openreposhape-1 (openRepoShape-1)

  4. brettheap commented on Oct 22, 2026

    @brettheap
    ContributorAuthor

    (lane openRepoShape-3, 2026-10-22T12:08:46Z) Ruling: part (a) leaves v1.2.0 as a known limit.

    Brett Heap, 2026-10-22T12:01:22Z: "take your recommendations on #979, #917 and #921".

    Lane: openreposhape-3 (openRepoShape-3)

  5. removed this from the v1.2.0 milestone on Oct 22, 2026
  6. added this to the v1.2.1 milestone on Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions