Skip to content
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

Fix Hpack #530 Make use of prettier Hpack error messages #74

Merged
merged 1 commit into from
Dec 14, 2022

Conversation

mpilgrem
Copy link
Member

@mpilgrem mpilgrem commented Dec 7, 2022

For the context to this pull request see Hpack issue #530, the Hpack PR #531 and the alternative Hpack PR #535 (on which this PR builds).

This PR is draft until such time as there is a released version of Hpack on which it relies.

@mpilgrem mpilgrem marked this pull request as draft December 7, 2022 19:02
mpilgrem added a commit to commercialhaskell/stack that referenced this pull request Dec 7, 2022
For the context to this pull request, see see [Hpack issue #530](sol/hpack#530), the [Hpack PR #531](sol/hpack#531) and the alternative [Hpack PR #535](sol/hpack#535) (on which this PR builds). See also [Pantry PR #74](commercialhaskell/pantry#74) (on which this PR builds).
@mpilgrem mpilgrem force-pushed the fix-hpack530 branch 3 times, most recently from fda261f to 6c90ce3 Compare December 7, 2022 20:59
mpilgrem added a commit to commercialhaskell/stack that referenced this pull request Dec 7, 2022
For the context to this pull request, see see [Hpack issue #530](sol/hpack#530), the [Hpack PR #531](sol/hpack#531) and the alternative [Hpack PR #535](sol/hpack#535) (on which this PR builds). See also [Pantry PR #74](commercialhaskell/pantry#74) (on which this PR builds).
@sol
Copy link
Contributor

sol commented Dec 11, 2022

@mpilgrem I think the MacOS build error is likely possibly related to caching. I deleted the cache entry and re-initiated the build.

src/Pantry.hs Show resolved Hide resolved
@sol
Copy link
Contributor

sol commented Dec 11, 2022

Ok, so apparently it was the cache. I'm still not sure how exactly. But some observations:

  • GitHub is currently migrating macos-latest from macos-11 to macos-12. This means that we might sometimes end up with one or the other.
  • We key the cache over the file name (say stack.yaml) instead of over the content of the file (https://github.com/commercialhaskell/pantry/blob/master/.github/workflows/tests.yml#L46), or better even the content of the lock files. However, this should only affect cache efficiency, not correctness. (Note: If somebody were to look into this, then you probably also want to specify restore keys.)
  • Initially I thought the issue is that we cache /.stack-work, something that you see e.g. in the docs of the caching action, but what I personally would refrain from doing. However, we don't do that already.

@mpilgrem mpilgrem force-pushed the fix-hpack530 branch 3 times, most recently from fbe8597 to ec2048a Compare December 11, 2022 20:03
mpilgrem added a commit to commercialhaskell/stack that referenced this pull request Dec 11, 2022
For the context to this pull request, see see [Hpack issue #530](sol/hpack#530), the [Hpack PR #531](sol/hpack#531) and the alternative [Hpack PR #535](sol/hpack#535) (on which this PR builds). See also [Pantry PR #74](commercialhaskell/pantry#74) (on which this PR builds).
@mpilgrem mpilgrem force-pushed the fix-hpack530 branch 2 times, most recently from 4334e28 to 94d68b5 Compare December 12, 2022 13:44
Prettier Hpack error messages are enabled by hpack-0.35.1.

For the context to this pull request see [Hpack issue #530](sol/hpack#530), the [Hpack PR #531](sol/hpack#531) and the alternative [Hpack PR #535](sol/hpack#535) (on which this PR builds).

Also conforms form of messages of Errors [S-305] and [S-720] and the naming of arguments (`err`) in the `PantryException` instance of `Display`.

Also bumps from lts-20.0 to lts-20.4 (most recent GHC 9.2.5).
@mpilgrem mpilgrem marked this pull request as ready for review December 12, 2022 15:42
@mpilgrem mpilgrem changed the title Fix Hpack #530 Fix Hpack #530 Make use of prettier Hpack error messages Dec 12, 2022
@mpilgrem
Copy link
Member Author

Example output of Pantry (via Stack):

Duff package.yaml:

Error: [S-305]
Failed to generate a Cabal file using the Hpack library on file:
D:\Users\mike\Code\Haskell\boo\package.yaml

The error encountered was:

YAML parse exception at line 64, column 0,
while scanning a simple key:
could not find expected ':'

Duff defaults.yaml used by package.yaml:

Error: [S-305]
Failed to generate a Cabal file using the Hpack library on file:
D:\Users\mike\Code\Haskell\boo\package.yaml

The error encountered was:

In respect of an Hpack defaults file:
D:\Users\mike\Code\Haskell\boo\defaults.yaml:

YAML parse exception at line 3, column 0,
while scanning a simple key:
could not find expected ':'

@mpilgrem mpilgrem merged commit 748162a into master Dec 14, 2022
@mpilgrem mpilgrem deleted the fix-hpack530 branch December 14, 2022 19:35
mpilgrem added a commit to commercialhaskell/stack that referenced this pull request Dec 15, 2022
For the context to this pull request, see see [Hpack issue #530](sol/hpack#530), the [Hpack PR #531](sol/hpack#531) and the alternative [Hpack PR #535](sol/hpack#535) (on which this PR builds). See also [Pantry PR #74](commercialhaskell/pantry#74) (on which this PR builds).
mpilgrem added a commit to commercialhaskell/stack that referenced this pull request Dec 16, 2022
For the context to this pull request, see see [Hpack issue #530](sol/hpack#530), the [Hpack PR #531](sol/hpack#531) and the alternative [Hpack PR #535](sol/hpack#535) (on which this PR builds). See also [Pantry PR #74](commercialhaskell/pantry#74) (on which this PR builds).
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.

None yet

2 participants