-
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
print out dependency build failure during cabal build / repl #8296
Conversation
That’s better: we pass CI now. Next, need a test showing actual profit from it as the current tests that I had to update are not very convincing unfortunately. |
Can't figure out how to make a test because in practice the difference shows up if you build with -j1 vs -j2 (or any number greater than 1), but the test runner seem to not showing that difference. I can see that the example from #5974 with |
Does the runner run with -j2? Does it apply any special segregation of the outputs? |
just in case it could help, the test runner uses 2 jobs: cabal/.github/workflows/validate.yml Line 30 in 1209433
|
@jneira ooo... I knew there should be something like this! One thing, though: I don't see an effect of (I should perhaps upload the test I'm trying, so that you see it even if it doesn't work at this point.) |
@Mikolaj I want to petition for this to be merged without a test:
|
I see. So the runner runs with -j2, but inside it, (most of) out tests run with -j1? I trust your judgement on that. Let's skip adding more tests. |
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.
@@ -1153,7 +1153,7 @@ dieOnBuildFailures verbosity currentCommand plan buildOutcomes | |||
, [pkg] <- rootpkgs | |||
, installedUnitId pkg == pkgid | |||
, isFailureSelfExplanatory (buildFailureReason failure) | |||
, currentCommand /= InstallCommand | |||
, not $ currentCommand `elem` [InstallCommand, BuildCommand, ReplCommand] |
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.
Good catch. Must be a left-over from when there was no build, but only
install`.
@@ -217,11 +218,11 @@ withContextAndSelectors noTargets kind flags@NixStyleFlags {..} targetStrings gl | |||
defaultTarget = [TargetPackage TargetExplicitNamed [fakePackageId] Nothing] | |||
|
|||
with = do | |||
ctx <- establishProjectBaseContext verbosity cliConfig OtherCommand | |||
ctx <- establishProjectBaseContext verbosity cliConfig cmd |
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 also a good catch.
In a nutshell, yes. That j1 is what is passed to the cabal being tested, whereas validate’s j2 is what gets the cabal that executes the test suite. |
@jneira by any chance, could you take another look here? |
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, not only the ux is improved but the types are more precise so i hope future improvements will be easier
small note: iiuc there is no test over cabal repl and no previous one had to be updated, have you checked them?
@jneira thank you for the review. Could you, perhaps, expand a little bit on what you think could be checked about repl? I just checked that cabal from this PR gives the same error for I think important thing to understand about this PR is that it changes the behavior observable only in the case of an unrecoverable error during the build. So, hopefully, it's hard to screw up things under this scenario: the user will only see any difference if they are not getting anything useful out of a build anyway. So, hopefully, it's a low-stake change. |
I observed repl command was included for show the new message and I did not see a repl test changed to take the new msg in account, but maybe it should not? |
@jneira indeed, and thanks for noticing (I completely forgot about Repl by now). The reason that no repl tests have to be updated is simply because there seems to be no |
well not as requirement to merge If you have tested it manually but the fails test could help in ongoing PRS updating it, the same way the previous ones helped this pr |
I was playing with I tried erroring local package, and erroring in a dependency supplied by
( No matter what I tried, this patch doesn't seem to affect In particular, for
The last line was added by this PR. But
And that's it... (again, this is I really don't want to spend much more time on this. Please, scream if you have ideas how to improve |
fix #5974 #7727
This is a cheap fix via straightforward extension of #6102
Please include the following checklist in your PR:
Please also shortly describe how you tested your change. Bonus points for added tests!