-
Notifications
You must be signed in to change notification settings - Fork 711
CI: remove dependency on cabal-plan (#8891) #8893
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
@@ -369,7 +368,6 @@ step_time_summary() { | |||
step_build() { | |||
print_header "build" | |||
timed $CABALNEWBUILD $TARGETS --dry-run || exit 1 | |||
$CABALPLAN topo --builddir=$BUILDDIR || exit 1 |
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 we still want a list of packages in the plan (though not topologically sorted) we can do it with a jq command:
jq -r '."install-plan" | map(."pkg-name" + "-" + ."pkg-version" + " " + ."component-name") | join("\n")' "$BUILDDIR/cache/plan.json"
iirc it's installed by default on github runners
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.
TBH I don't see a big value in this list. If someone feels strongly about it, I could add this oneliner, perhaps. But I'm not a fan of this solution either: it looks rather fragile to my uniformed taste.
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.
Ah, I guess, it was requested here: #8440 so there are users for 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.
Since #8440 was opened by @andreasabel, paging him in... Andreas, maybe you have a preference between:
- keeping cabal-plan; possibly, switching to binary distribution to save time and dependency management;
- removing cabal-plan and print the list of dependencies to be built using the on-liner provided above by fgaz;
- removing cabal-plan and keeping the list of dependencies to be built that is already produced by
cabal build [--dry-run]
actually; (see e.g. here)
I personally lean towards (3) as I fail to see much advantage of anything else. One difference between cabal build --dry-run
and cabal-plan topo
that I noticed today (and you can check it using the CI link above) is that the latter seems to print nearly twice as much as the former. I'm not sure why that is...
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.
One difference between cabal build --dry-run and cabal-plan topo that I noticed today (and you can check it using the CI link above) is that the latter seems to print nearly twice as much as the former. I'm not sure why that is...
cabal build
does not print cached stuff, it only prints what it's going to download/build
If we want the whole build plan we need 1. or 2. (or cabal freeze I guess)
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 to know, thank you!
I don't see much emotion one way or another, so I'm just leaving the current version (with your oneliner) for the review...
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.
Where is the one-liner replacement for the cabal-plan
printing? I cannot see it, I only see the deletion of the cabal-plan
step.
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.
@andreasabel oops: forgot to commit. Fixed.
Hmm, CI fails with rather mysterious solver error in the testsuite... https://github.com/haskell/cabal/actions/runs/4598996409/jobs/8123811204?pr=8893 |
Probably |
Well, yes, but the solver error I was referring to above happens before this. And because of this error |
All right, i can reproduce it under GHC 844 on Linux but not 944. CI also showed the failure only under 844/Linux and stopped in all other configuration. Still no idea why it happens. The actual build ends fine but then list-bin kicks the solver again for some mysterious reason, and that fails... |
20d1d93
to
1767cda
Compare
Got it: |
3d1ca1d
to
4432d40
Compare
All right, please review! |
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.
Thanks for your work on this, @ulysses4ever!
The printing of the complete build plan was added for a reason, which can be read up upon in #8398 (comment): Folks relax an upper bound, which is not picked up by the solver due to another dependency, and then CI/build passes and people think relaxing the bound was fine.
So, the correct workflow is:
- relax the bound of a dependency,
- build,
- check that the new version of the dependency was indeed picked up.
The inclusion of cabal-plan
served to enable step 3 by inspecting logs of CI runs.
@andreabedini added this rather recently (Aug 2022) upon my request. We have to avoid the whack-a-mole-situation, that one developer adds a feature that the next developer removes, which is then missed and added again etc.
If you want to remove it, you need to explain how step 3 of the bump workflow can be facilitated. Ideally would be a check that in the latest GHC, all the maximum versions of the dependencies are indeed picked up. Atm, cabal
does not offer such a check.
As pointed out by @fgaz, cabal build
does not output the complete build plan, only what has to be built, which does not include existing builds that can be reused.
@@ -369,7 +368,6 @@ step_time_summary() { | |||
step_build() { | |||
print_header "build" | |||
timed $CABALNEWBUILD $TARGETS --dry-run || exit 1 | |||
$CABALPLAN topo --builddir=$BUILDDIR || exit 1 |
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.
Where is the one-liner replacement for the cabal-plan
printing? I cannot see it, I only see the deletion of the cabal-plan
step.
504a7a3
to
bdebdbf
Compare
@andreasabel thanks for the review and I whole-heartedly agree. Let's leave the full list of dependencies then (getting it one way or another). I'm sad to say: I have no clue about the procedure for bumping dependencies you're describing. Perhaps, it'd be good to document it somewhere. Although, I'm not sure which place is the best for such information. Maybe we could have a little "CI Maintainer Guide" or something and reference it from validate.sh and validate.yml... |
@fgaz @andreabedini any interest here for a review or an opinion? |
bdebdbf
to
a80b696
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.
Thanks for the update.
a80b696
to
14a1bff
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.
Thanks!
14a1bff
to
d2bedea
Compare
d2bedea
to
66c4d80
Compare
Let's see what CI thinks...