close
Skip to content

Fix #6896 Allow dependency package to have no main library#6928

Draft
mpilgrem wants to merge 1 commit into
masterfrom
re6896
Draft

Fix #6896 Allow dependency package to have no main library#6928
mpilgrem wants to merge 1 commit into
masterfrom
re6896

Conversation

@mpilgrem
Copy link
Copy Markdown
Member

@mpilgrem mpilgrem commented Jun 2, 2026

See:

This pull request is experimental, to see if the CI is passed. Even if it passes, it may not be a good thing for Stack to accept something that Cabal (the tool) does not accept: in one sense, the Cabal package description format is specified by what Cabal (the tool) in fact does (notwithstanding that the specification is purportedly documented).

The basic idea is:

  • The InstalledLibraryInfo constructor is modified so that the GhcPkgId of a main library is optional.

  • A ConfigCacheTypeFlagLibrary value is, like a ConfigCacheTypeFlagExecutable value, based on the package identifier (rather than the 'GhcPkgId' of the main library, which may not be present)

  • Stack.SDist needs to be considered more carefully.

  • fetchAndMarkInstalledPackage allows for the absence of a buildable main library but the presence of sublibraries.

An integration test is added.

  • 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!

The basic idea is:

* The `InstalledLibraryInfo` constructor is modified so that the `GhcPkgId` of a main library is optional.

* A `ConfigCacheTypeFlagLibrary` value is, like a `ConfigCacheTypeFlagExecutable` value,  based on the package identifier (rather than the 'GhcPkgId' of the main library, which may not be present)

* `Stack.SDist` needs to be considered more carefully.

* `fetchAndMarkInstalledPackage` allows for the absence of a buildable main library but the presence of sublibraries.

An integration test is added.
@mpilgrem mpilgrem marked this pull request as draft June 2, 2026 22:55
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