Repository navigation
fix: cabal sdist target selection (#11385) - #12440
Open
blackheaven wants to merge 2 commits into
Open
blackheaven wants to merge 2 commits into
blackheaven wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Multiple selectors resolving to one package cause duplicate archive generation and incorrect stdout rejection.
1 open finding
What changed in this PR
Fixes cabal sdist so local component selectors package their containing package.
Changes:
- Reinterprets local component targets as package targets.
- Adds regression coverage for subdirectory and multi-target selection.
- Documents the behavior change.
| File | Description |
|---|---|
changelog.d/11385.md |
Documents corrected target selection. |
cabal-install/src/Distribution/Client/CmdSdist.hs |
Maps component selectors to packages. |
cabal-testsuite/PackageTests/NewSdist/SubDirPackageTarget/subdir-target.test.hs |
Tests package selection from a subdirectory. |
cabal-testsuite/PackageTests/NewSdist/SubDirPackageTarget/subdir-target.out |
Records expected command output. |
cabal-testsuite/PackageTests/NewSdist/SubDirPackageTarget/p/P.hs |
Provides the fixture module. |
cabal-testsuite/PackageTests/NewSdist/SubDirPackageTarget/p/p.cabal |
Defines the fixture package. |
cabal-testsuite/PackageTests/NewSdist/SubDirPackageTarget/cabal.project |
Configures the fixture project. |
cabal-testsuite/PackageTests/NewSdist/MultiTarget/valid-and-test-suite.test.hs |
Tests mixed package/component targets. |
cabal-testsuite/PackageTests/NewSdist/MultiTarget/valid-and-test-suite.out |
Records multi-target output. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
blackheaven
force-pushed
the
fix/sdist-selector
branch
from
October 10, 2026 14:16
5dffaa7 to
6326ab2
Compare
Multiple target selectors matching the same package (e.g. 'cabal sdist a a-tests') generated duplicate archives and made the stdout output guard reject a single tarball with [Cabal-7152]. Deduplicate the packages produced by reifyTargetSelectors by packageId. Addresses the Copilot review on haskell#12440.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Please read Github PR Conventions and then fill in one of these two templates.
Template Α: This PR modifies behaviour or interface
Include the following checklist in your PR:
Any changes that could be relevant to users have been recorded in the changelog.Is the change significant? If so, remember to addsignificance: significantin the changelog file.The documentation has been updated, if necessary.QA Notes
Fresh
cabal initproject, fromprova:sdist provawrote tarball sdist to/prova-0.1.0.0.tar.gz;sdist prova:lib:provasucceeds too;