-
Notifications
You must be signed in to change notification settings - Fork 703
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
Extend the InstalledPackageInfo record with 2 fields for artifacts. #8696
Open
bairyn
wants to merge
1
commit into
haskell:master
Choose a base branch
from
bairyn:fix-dynamic-deps-2-arts-ipi
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -448,7 +448,9 @@ generalInstalledPackageInfo adjustRelIncDirs pkg abi_hash lib lbi clbi installDi | |
IPI.haddockInterfaces = [haddockdir installDirs </> haddockName pkg], | ||
IPI.haddockHTMLs = [htmldir installDirs], | ||
IPI.pkgRoot = Nothing, | ||
IPI.libVisibility = libVisibility lib | ||
IPI.libVisibility = libVisibility lib, | ||
IPI.providesStaticArtifacts = providesStaticArtifacts, | ||
IPI.providesDynamicArtifacts = providesDynamicArtifacts | ||
} | ||
where | ||
ghc84 = case compilerId $ compiler lbi of | ||
|
@@ -492,6 +494,15 @@ generalInstalledPackageInfo adjustRelIncDirs pkg abi_hash lib lbi clbi installDi | |
= (libdir installDirs : dynlibdir installDirs : extraLibDirs bi, []) | ||
-- the compiler doesn't understand the dynamic-library-dirs field so we | ||
-- add the dyn directory to the "normal" list in the library-dirs field | ||
(providesStaticArtifacts, providesDynamicArtifacts) = case compilerFlavor comp of | ||
GHC -> | ||
let | ||
none f t = all (not . f) t | ||
libDefaults = none ($ lbi) [withVanillaLib, withSharedLib] && hasLibrary | ||
statics = libDefaults || any ($ lbi) [withVanillaLib] | ||
dynamics = any ($ lbi) [withSharedLib] | ||
Comment on lines
+502
to
+503
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These uses of |
||
in (statics, dynamics) | ||
_ -> (True, True) -- Assume nothing is missing. | ||
|
||
-- | Construct 'InstalledPackageInfo' for a library that is in place in the | ||
-- build tree. | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
synopsis: Extend the InstalledPackageInfo record with fields for artifacts. | ||
packages: Cabal-syntax Cabal Cabal-tests | ||
prs: #8696 | ||
description: { | ||
Extend the InstalledPackageInfo record with new fields involving build | ||
artifact configuration. The moduler resolver could then (in a separate set | ||
of changes) use these new fields to avoid selecting installed package | ||
options missing required artifacts and producing build plans that would | ||
fail, even if alternatives would succeed. | ||
} |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These need more documentation. What do we mean by "artifacts" here? How do these relate to GHC's notion of ways? Why are "static" and "dynamic" special (e.g. what about profiling)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ben: this is discussed in the prior two PRs -- #8624 and #8461
Initially it had added five fields, not just two. However, the other part of the split PR only now makes use of these two, so the scope was scaled back for simplicity. (Unfortunately, this isn't in the history of the linked PR due to it being force-pushed). I think extending the logic to profiling (and teaching the solver about that) would also be useful, but its out of scope for the current round of work, so having those fields added without then being used opened the way to some bikeshedding and confusion which this hopefully avoids.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ben: do you mean documentation in the code included in GHC so that GHC devs don't need to rummage in cabal PRs? That makes sense. Or at least ready links to the aformentioned PRs from the code comments. Or both.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on common practice in GHC, I suspect the answer is "document it right there in the code." I think it's a best practice in any case. :)
(Wrong
@ben
fyi)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh. I'm sorry, @bgamari.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And I'm sorry @ben. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chreekat hit the nail on the head. Yes, the documentation should be next to the implementation otherwise future us has little chance of finding it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough. I should have been more specific when asking @bairyn for the artificial commit, but I lacked foresight. Let's wait with resuming the 3.10 semi-freeze and publishing a new dogfooding tag till today's devs meeting. I know @bairyn is busy, so that probably means the PRs have to wait until GHC 9.8. Tough luck.