-
Notifications
You must be signed in to change notification settings - Fork 727
Backpack infdefinite error explain #11669
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
Open
jappeace
wants to merge
5
commits into
haskell:master
Choose a base branch
from
jappeace:backpack-infdefinite-error-explain
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 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
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 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| cabal-version: 3.0 | ||
| name: Fail5 | ||
| version: 0.1.0.0 | ||
| build-type: Simple | ||
|
|
||
| library framework | ||
| signatures: App | ||
| hs-source-dirs: repo/framework-0.1.0.0/src-sig | ||
| build-depends: base | ||
| default-language: Haskell2010 | ||
| visibility: public | ||
|
|
||
| library app-impl | ||
| exposed-modules: App | ||
| hs-source-dirs: repo/app-impl-0.1.0.0 | ||
| build-depends: base | ||
| default-language: Haskell2010 | ||
| visibility: public | ||
|
|
||
| executable consumer | ||
| main-is: Main.hs | ||
| build-depends: base, Fail5:framework, Fail5:app-impl | ||
| hs-source-dirs: repo/consumer-0.1.0.0 | ||
| default-language: Haskell2010 |
3 changes: 3 additions & 0 deletions
3
cabal-testsuite/PackageTests/Backpack/Fail5/repo/app-impl-0.1.0.0/App.hs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| module App where | ||
| appMessage :: String | ||
| appMessage = "Hello from app-impl" |
9 changes: 9 additions & 0 deletions
9
cabal-testsuite/PackageTests/Backpack/Fail5/repo/app-impl-0.1.0.0/app-impl.cabal
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| cabal-version: 3.0 | ||
| name: app-impl | ||
| version: 0.1.0.0 | ||
| build-type: Simple | ||
|
|
||
| library | ||
| exposed-modules: App | ||
| build-depends: base | ||
| default-language: Haskell2010 |
3 changes: 3 additions & 0 deletions
3
cabal-testsuite/PackageTests/Backpack/Fail5/repo/consumer-0.1.0.0/Main.hs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| import App (appMessage) | ||
| main :: IO () | ||
| main = putStrLn appMessage |
9 changes: 9 additions & 0 deletions
9
cabal-testsuite/PackageTests/Backpack/Fail5/repo/consumer-0.1.0.0/consumer.cabal
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| cabal-version: 3.0 | ||
| name: consumer | ||
| version: 0.1.0.0 | ||
| build-type: Simple | ||
|
|
||
| executable consumer | ||
| main-is: Main.hs | ||
| build-depends: base, framework, app-impl | ||
| default-language: Haskell2010 |
10 changes: 10 additions & 0 deletions
10
cabal-testsuite/PackageTests/Backpack/Fail5/repo/framework-0.1.0.0/framework.cabal
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| cabal-version: 3.0 | ||
| name: framework | ||
| version: 0.1.0.0 | ||
| build-type: Simple | ||
|
|
||
| library | ||
| signatures: App | ||
| hs-source-dirs: src-sig | ||
| build-depends: base | ||
| default-language: Haskell2010 |
2 changes: 2 additions & 0 deletions
2
cabal-testsuite/PackageTests/Backpack/Fail5/repo/framework-0.1.0.0/src-sig/App.hsig
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| signature App where | ||
| appMessage :: String |
9 changes: 9 additions & 0 deletions
9
cabal-testsuite/PackageTests/Backpack/Fail5/setup-external-fail.out
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # Setup configure | ||
| Configuring consumer-0.1.0.0... | ||
| Error: | ||
| The following packages are broken because other packages they depend on are missing. These broken packages must be rebuilt before they can be used. | ||
| planned package consumer-0.1.0.0 | ||
| is broken due to missing package | ||
| framework-0.1.0.0 (has unfilled signature: App) | ||
| The package is installed as indefinite. | ||
| To use it, rebuild it in the same cabal project as the consumer so cabal can fill the signatures. |
16 changes: 16 additions & 0 deletions
16
cabal-testsuite/PackageTests/Backpack/Fail5/setup-external-fail.test.hs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| import Test.Cabal.Prelude | ||
| main = setupAndCabalTest $ do | ||
| skipUnlessGhcVersion ">= 8.1" | ||
| withPackageDb $ do | ||
| -- Install framework WITHOUT instantiation (simulates nix callCabal2nix) | ||
| recordMode DoNotRecord $ | ||
| withDirectory "repo/framework-0.1.0.0" $ setup_install [] | ||
| -- Install the App implementation package separately | ||
| recordMode DoNotRecord $ | ||
| withDirectory "repo/app-impl-0.1.0.0" $ setup_install [] | ||
| -- Configure consumer — should fail because the instantiated | ||
| -- framework (with App=app-impl:App) was never built. | ||
| -- The exact error message is checked via the .out file. | ||
| withDirectory "repo/consumer-0.1.0.0" $ do | ||
| fails $ setup' "configure" [] | ||
| return () | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| --- | ||
| synopsis: "Improve Backpack broken-package error to show unfilled signatures" | ||
| packages: [Cabal] | ||
| pr: 11669 | ||
| --- | ||
|
|
||
| When an indefinite Backpack package is installed separately (e.g. via | ||
| nix `callCabal2nix`), configuring a consumer that depends on it would | ||
| show an opaque hashed UnitId like | ||
| `framework-0.1.0.0+95RTb42ZWxa9J13cUStM0q`. The error now shows the | ||
| package name, which signatures are unfilled, and advises rebuilding | ||
| in the same cabal project so cabal can fill them. |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.