Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

golang: fix exception when coverage enabled and external tests import the base package (Cherry-pick of #21452) #21454

Merged
merged 2 commits into from
Sep 25, 2024

Conversation

WorkerPants
Copy link
Member

As reported in #21386, Pants raises an exception when coverage is enabled and a package has external tests (i.e., "xtests") which import the base package. The bug occurred because the code which injects the base package dependency did not properly pass through the coverage flag. Consequently, the compile graph ended up with two different variants of the base package: one with coverage codegen and the other without coverage codegen. This resulted in two different copies of the package archive which Pants cannot merge together into a single Digest.

The solution is to properly pass through the coverage flag when injecting the base package dependency on the external test package to ensure there are not multiple variants of the base package in the compile graph.

Fixes #21386.

… the base package (#21452)

As reported in #21386, Pants
raises an exception when coverage is enabled and a package has external
tests (i.e., "xtests") which import the base package. The bug occurred
because the code which injects the base package dependency did not
properly pass through the coverage flag. Consequently, the compile graph
ended up with two different variants of the base package: one with
coverage codegen and the other without coverage codegen. This resulted
in two different copies of the package archive which Pants cannot merge
together into a single `Digest`.

The solution is to properly pass through the coverage flag when
injecting the base package dependency on the external test package to
ensure there are not multiple variants of the base package in the
compile graph.

Fixes #21386.
@tdyas tdyas enabled auto-merge (squash) September 25, 2024 21:07
@tdyas tdyas merged commit 87bba37 into 2.22.x Sep 25, 2024
25 checks passed
@tdyas tdyas deleted the cherry-pick-21452-to-2.22.x branch September 25, 2024 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:bugfix Bug fixes for released features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants