Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Fix #5974 If new Cabal copy is available, use it#6451

Merged
mpilgrem merged 2 commits into
masterfrom
fix5974
Jan 25, 2024
Merged

Fix #5974 If new Cabal copy is available, use it#6451
mpilgrem merged 2 commits into
masterfrom
fix5974

Conversation

@mpilgrem

Copy link
Copy Markdown
Member

Cabal's copy used to not allow components to be specified, and Stack had to build all executable components at least once for copy not to fail. This pull request continues to do that only if the Cabal version is sufficiently old (before Cabal-2.0.0.0). Otherwise, it copies only the library, sub-library, foreign library and executable components that were to be built. As a consquence, it does not need to build all executable components at least once for the Cabal version to be satisfied.

The tutorial part of the online guide to Stack is updated accordingly.

  • Any changes that could be relevant to users have been recorded in ChangeLog.md.
  • The documentation has been updated, if necessary

Please also shortly describe how you tested your change. Bonus points for added tests! Tested locally, by reference to output of internal-libraries integration test.

@mpilgrem

Copy link
Copy Markdown
Member Author

@theobat, if you could run your eye over this, I would be grateful. if what I have added works, then once Stack drops support for Cabal < 2.2, the historical complexity and the complexity of taking different approaches with different Cabal versions will fall away.

@theobat

theobat commented Jan 20, 2024

Copy link
Copy Markdown
Contributor

@mpilgrem Yes that seems good.

@mpilgrem mpilgrem mentioned this pull request Jan 20, 2024
6 tasks
Also updates the online guide to assume the use of new Cabal copy.
@mpilgrem mpilgrem merged commit 4914a58 into master Jan 25, 2024
@mpilgrem mpilgrem deleted the fix5974 branch January 25, 2024 01:15
philippedev101 added a commit to philippedev101/stack that referenced this pull request Jun 9, 2026
Brings PR commercialhaskell#6865 up to current upstream master (e6170f1), past:

* commercialhaskell#6921 / commercialhaskell#6920: don't ignore deps named like sub-libs or foreign libs,
  plus the reformatting/refactor in front of that fix.
* commercialhaskell#6929: refactor/reformat sweep with `allDeps` documentation and a
  type synonym for the build-log suffix parameter.
* commercialhaskell#6928 / commercialhaskell#6896 / commercialhaskell#6912: `InstalledLibraryInfo` now carries
  `Maybe GhcPkgId` for the main library plus a
  `Map StackUnqualCompName GhcPkgId` of sub-libraries (some Cabal
  packages have only sub-libraries with no main library, and now Stack
  represents that). `Task.present`, the custom-setup dependency map,
  and `ConfigCacheTypeFlagLibrary` are now keyed by
  `MungedPackageId` / `PackageIdentifier` instead of by `GhcPkgId`.

Adapts the PR's code to the new shapes:

* `findGhcPkgId` filters for main-library entries (`LMainLibName`)
  in the new `Map MungedPackageId GhcPkgId`.
* `mkInstantiateWithOpts` takes the new map shape unchanged
  otherwise.
* `addInstantiationTasks` wraps each implementing-package identifier
  with `toCabalMungedPackageId pid Nothing` before adding it to a
  CInst task's `present` map.
* `ConfigCacheType`'s PersistField instance keeps the PR's
  `ConfigCacheTypeInstantiation Text` variant on top of upstream's
  `flagCache` helper restructure.

`Task.allInOne` is intentionally NOT restored here; that lands as a
separate commit on top of this merge.

The PR's other changes (Phase 1 component-keyed plan, Phase 2 per
component split path for Backpack-using packages, Phase 3 CInst tasks,
the existing fixes for commercialhaskell#3996 / commercialhaskell#3959 / commercialhaskell#6451, the custom-setup
TestSuite fix from PR commercialhaskell#6884, etc.) are unchanged.

Verified: full stack build + 858 unit tests pass on the merged tree.
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.

2 participants