Skip to content

Count link-only targets' external libraries in the link-closure check - #45

Open
anakanemison wants to merge 1 commit into
mschaller/u09-link-interface-flagsfrom
mschaller/u10-link-only-external-deps
Open

anakanemison wants to merge 1 commit into
mschaller/u09-link-interface-flagsfrom
mschaller/u10-link-only-external-deps

Conversation

@anakanemison

Copy link
Copy Markdown

Part 10 of 23 of a stacked series (tracking issue: #35). Based on U09-link-interface-flags, the previous part: review and merge that first.

Kind: fix. Lab proposal: P26.

What the migration runs showed

On qgis, seven libraries linked only by a cc_shared_library read as missing_dep although they were on its link line. On every stored model of 42 judged runs this removes exactly those seven errors and changes nothing else.

The change

The differ checks external link dependencies (-lz, -lhdf5, ...) as a
project-wide union over PRODUCTION targets. A target that compiles nothing
of its own is an AGGREGATE and is left out, and in a Bazel migration nearly
every cc_shared_library is one: its sources live in the cc_library targets
it wraps, and the external libraries it links appear only on its own link
line. So a library linked only by a shared library read as missing although
it was there.

Found by an agent migrating QGIS in any2bazel-lab: its own diff ended with
seven missing_dep errors (crypto, curl, dl, hdf5, netcdf, pthread, sz),
which it traced to provider_mdal, a cc_shared_library classified as an
aggregate. The lab confirmed the seven are on that target's Bazel link line.

Link-only targets now take part in the external-dependency union on both
sides, unless exclude_targets drops them. Their translation units are still
compared through the libraries they wrap.

Run over the stored models of the 42 migrations the lab has judged, each
with its agent's own config, this removes exactly those seven errors and
changes nothing else. (One earlier QGIS model is unreadable to both
versions.) The next QGIS migration, with this change, converged.

Testing

pytest tests/ at this commit: 196 passed (130 on main).

🤖 Generated with Claude Code

The differ checks external link dependencies (-lz, -lhdf5, ...) as a
project-wide union over PRODUCTION targets. A target that compiles nothing
of its own is an AGGREGATE and is left out, and in a Bazel migration nearly
every cc_shared_library is one: its sources live in the cc_library targets
it wraps, and the external libraries it links appear only on its own link
line. So a library linked only by a shared library read as missing although
it was there.

Found by an agent migrating QGIS in any2bazel-lab: its own diff ended with
seven missing_dep errors (crypto, curl, dl, hdf5, netcdf, pthread, sz),
which it traced to provider_mdal, a cc_shared_library classified as an
aggregate. The lab confirmed the seven are on that target's Bazel link line.

Link-only targets now take part in the external-dependency union on both
sides, unless exclude_targets drops them. Their translation units are still
compared through the libraries they wrap.

Run over the stored models of the 42 migrations the lab has judged, each
with its agent's own config, this removes exactly those seven errors and
changes nothing else. (One earlier QGIS model is unreadable to both
versions.) The next QGIS migration, with this change, converged.

Lab-Proposal: P26
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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