Skip to content

Thirdparty perl stamp - #23

Open
zaucker wants to merge 2 commits into
masterfrom
thirdparty-perl-stamp
Open

Thirdparty perl stamp#23
zaucker wants to merge 2 commits into
masterfrom
thirdparty-perl-stamp

Conversation

@zaucker

@zaucker zaucker commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Some Makefile improvements suggested by Claude to ensure detection of stale thirdparty contents and also to fix pinning to cpan snapshots.

Action required after merging

Every existing checkout needs a one-time clean rebuild:

cd thirdparty && make clean-local && make

Without it the first build after this change stops with:

** ERROR: thirdparty/lib was built for a different perl than
**        /path/to/perl
**        (this tree has no touch-5.32.0-x86_64-linux)
**        Discard the stale tree and build again:
**            cd thirdparty && make clean-local && make

That is the new guard doing its job, not a broken build: the stamp is now named after the perl version and archname, and an existing tree carries the old version-agnostic touch stamp instead.

clean-local removes lib/ work/ cache/ carton/ build.log and the old stamp, keeping the Makefiles, the snapshots and bin/cpanm — so the rebuild needs network access. Anything else that builds thirdparty/ (Docker images, release scripts) wants the same one-time clean. No CI job is affected: .gitlab-ci.yml only runs gitleaks and sonar-scanner, neither of which builds the tree.

Note that after this the build installs the versions the snapshot pins rather than whatever CPAN offers that day, so the rebuilt tree may legitimately contain older modules than the one it replaces.

zaucker and others added 2 commits August 25, 2026 14:54
lib/perl5 is only valid for one perl: the XS modules are compiled for a
specific version and architecture, the pure perl ones are not. After a
perl upgrade the arch independent modules stay behind, cpanm sees them
as satisfied dependencies and never installs their arch dependent
prerequisites. The result is a tree that loads until something reaches
for an XS module, which is hard to tell apart from a bug in our code.

Name the build stamp after the perl version and archname, and refuse to
build on top of a tree that carries a different one, pointing at
clean-local instead of quietly adding to the mix.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…CPAN

The build copied cpanfile-$version.snapshot into place and then called
cpanm --installdeps, but cpanm does not read cpanfile.snapshot: that is
carton's format, and only the snapshot rule ever used carton. So an
ordinary build resolved the unversioned cpanfile against live CPAN and
the pins had no effect, which is how a tree of 2022 modules could sit
next to a snapshot naming quite different versions.

Install with carton install --deployment, so the snapshot is what gets
installed and a snapshot that does not cover the cpanfile is an error
rather than a silent upgrade. Carton itself moves into its own rule, as
an order only prerequisite: needing to reinstall the installer says
nothing about the dependency tree being stale, and as a normal
prerequisite it would retrigger the snapshot rule and rewrite the
checked in snapshot as a side effect of building.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@zaucker
zaucker requested a review from oetiker August 25, 2026 13:33
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