-
Notifications
You must be signed in to change notification settings - Fork 711
pretty-print run targets on failure #8234
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
Conversation
Splendid. And you got the right CI breakage: on golden test of the old kind of output. [edit: which means you probably don't need to write separate tests] |
| CExeName UnqualComponentName | ||
| CTestName UnqualComponentName | ||
| CBenchName UnqualComponentName | ||
data ComponentName = CLibName { toLibName :: LibraryName } |
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.
I’m worried about introduction of partial field accessors. The proper solution would be to factor out the other four fields into a separate data type (NonLibComponentName
or some such), which could have a total accessor. Didn’t check how much churn that would involve.
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.
If throw in some pattern synonyms on the top, the churn could actually be none.
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.
Perhaps we can forego the field accessors entirely, given a function like
extract :: ComponentName -> Either LibraryName UnqualComponentName
extract (CLibName s) = Left s
extract (CFLibName s) = Right s
extract (CExeName s) = Right s
extract (CTestName s) = Right s
extract (CBenchName s) = Right s
that way we can avoid redefining types while keeping componentNameRaw
and componentNameString
simple.
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.
I like @ulysses4ever 's proposal. One can define pattern synonyms for CFLibName
etc. so that the change to the codebase remains small.
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.
Could either of you show me what you have in mind? Perhaps my lack of understanding but I can't see the change to the codebase being smaller.
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.
Either
-based idea is not bad too, but here's an example of what I meant (can compile and run to get "x"
)
{-# LANGUAGE PatternSynonyms #-}
type LibraryName = String
type UnqualComponentName = String
data NotLibComponentName
= CNLFLibName UnqualComponentName
| CNLExeName UnqualComponentName
| CNLTestName UnqualComponentName
| CNLBenchName UnqualComponentName
data ComponentName
= CLibName LibraryName
| CNotLibName NotLibComponentName
pattern CFLibName n = CNotLibName (CNLFLibName n)
// ... 3 more of these
main = print n
where
c = CFLibName "x" -- using bidirectional pattern to construct
(CFLibName n) = c -- using bidirectional pattern to destruct
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 then change NotLibComponentName
to have a field accessor, and possibly some convenience function for ComponentName
)
Something got stuck after recent CI improvements, so let me restart CI (and rebase just in case, @mgsium, I hope you don't mind?). |
@Mergifyio rebase |
✅ Branch has been successfully rebased |
3933c0f
to
b876fe3
Compare
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.
LGTM (but @ulysses4ever has a point)
Looks like Suggestions as to how to proceed? |
GHC 8.0.2 has just fallen out of our support window, but I struggle to comprehend the consequences. Probably that means we no longer want to extend our custom prelude nor add CPP for the sake of 8.0.2. If you can make it work, fine, if not, we drop GHC 8.0.2 from CI. But IANAL, so let's wait until somebody confirms my understanding. :) |
It’s a warning, right? Maybe just leave it be? |
Oh, I missed Another idea is to stitch |
@mgsium do you have any trouble with finishing it off? Please, let us know. I'm looking forward for this change! |
Apologies for the delay, I'll get this done |
Edit: Ignore that, I lost track of the reason for the change. Looking at the most recent CI, we'll also need |
Please feel free to drop support for 8.0.2 in all parts of CI where you need to (including all of CI). This PR is a good place for that, because it contains the reason for removing 8.0.2 and the discussion of 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.
Another thing: if you could i-rebase in the way that there are two commits: removing 8.0.2 support and implementing the feature, that may be a cleaner history overall (as opposed to squashing all of that in one commit). |
Nope we shouldn't, I'll remove and test before rebasing. |
This looks good to go. Who should apply the label? If the author doesn't hold the appropriate role for that, should we fix it too? |
Oh, yes, let's get this merged. I forgot how the new system of permissions works. @mgsium: I've given you Triage rights to the repo. Are you now able to set the "merge_me" label? That should start the merge process, which ends in 2 days if there are no more changes to the PR. |
b1778fd
to
ff32a1d
Compare
@mgsium: hah, you've got yelled at due to whitespace. See https://github.com/haskell/cabal/blob/master/CONTRIBUTING.md#whitespace-conventions |
Perfect. Now mergify will sit on it for 2 days waiting for further comments, if any. |
fe276ac
to
bd998ce
Compare
Should this be backported? |
It isn't a bugfix so there's no need to backport it |
Fair enough, thanks! |
@mergify backport 3.8 |
✅ Backports have been created
|
Resolves #8189;
run
targets are pretty-printed when failing due to multiple targets. Duplicates are also removed.i.e.
The documentation has been updated, if necessary.(N/A)