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

Store dependencies in CradleError #186

Merged
merged 4 commits into from
Jun 11, 2020
Merged

Store dependencies in CradleError #186

merged 4 commits into from
Jun 11, 2020

Conversation

mpickering
Copy link
Collaborator

This allows you to attempt to rerun a failed cradle if any of the
dependencies change. It is not a very precise measure of why a cradle
failed but better than nothing.

Situations where this helps:

  • You have a malformed hie.yaml
  • You have a missing dependency in your cabal file
  • You have a missing prefix in your hie.yaml
  • You are missing a target in your cabal file

Situations where it doesn't help:

  • A specific module in a dependency doesn't compile.

src/HIE/Bios/Types.hs Outdated Show resolved Hide resolved
This allows you to attempt to rerun a failed cradle if any of the
dependencies change. It is not a very precise measure of why a cradle
failed but better than nothing.
@fendor fendor force-pushed the wip/cradle-error-deps branch 2 times, most recently from 87c41f7 to 81b54b6 Compare June 8, 2020 14:26
@fendor fendor self-requested a review June 8, 2020 14:29
@@ -183,6 +194,8 @@ test-suite bios-tests
extra,
tasty,
tasty-hunit,
tasty-expected-failure,
hspec-expectations,
Copy link
Collaborator

@fendor fendor Jun 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error message isnt as nice yet as I hoped. We probably need to adapt the runner a bit.
Currently, the error message in a test-case failure looks like this (pretty formatted):

HUnitFailure
  (Just
     SrcLoc
       { srcLocPackage = "main"
       , srcLocModule = "Main"
       , srcLocFile = "tests/BiosTests.hs"
       , srcLocStartLine = 150
       , srcLocStartCol = 37
       , srcLocEndLine = 150
       , srcLocEndCol = 84
       })
  (Reason "Cradle loaded successfully")

Comment on lines +126 to +128
CradleFail err ->
pure $ CradleFail
(err { cradleErrorDependencies = cradleErrorDependencies err `union` deps })
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This had to be added

@fendor fendor merged commit 2185371 into master Jun 11, 2020
@fendor fendor deleted the wip/cradle-error-deps branch December 16, 2020 20: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.

None yet

2 participants