Fix repl discarding --build-depends after allow-newer/older#8732
Fix repl discarding --build-depends after allow-newer/older#8732mergify[bot] merged 5 commits intohaskell:masterfrom
Conversation
|
Note: this is currently hacky. It fixes my use case (namely run doctest), but I am not sure it fixes it in general. The following points need review:
|
|
New version, which hopefully is correct and much simplier. |
|
I hope to attend to this PR ASAP. I really hope we can squeeze it into 3.10 @Mikolaj |
There was a problem hiding this comment.
This looks great. Two requests (apart from minor inline comments):
- A changelog file
- A better commit sequence. Please, force-push your branch so that it doesn't have the previous attempt, and has the cleanup work in a separate commit: this will make reviewers' live resort
Yes, we are only in semi-freeze, so if there are good reasons, we should merge it into 3.10. E.g., improving CI is a good reason, because 3.10 is going to stay there longer, since we need some other changes before release. |
|
Fixed based on feedback, rebased and squashed. |
|
@wismill amazing, thanks! One more thing: could you, please, explain in the commit message (1) what this change does, in plain English, as much as possible, and (2) why you think this fixes the issue? |
|
@ulysses4ever I added proper comment & commit message. Unfortunately there is an issue withe the recent release of |
Mikolaj
left a comment
There was a problem hiding this comment.
Splendid. I'm now doubly edified: from the code comment and commit comment.
|
Yes, our colleague has already reported the happy problem and we count on them fixing it ASAP so that we don't have to exclude the happy version ourselves. Happy times. |
|
Note that I am new to Cabal and although I think the patch is consistent, please double check it! There might be more places where the pattern |
ulysses4ever
left a comment
There was a problem hiding this comment.
Typo in the commit message: "manipuling". Other than that — terrific, thanks!
Please kindly open a ticket about that. We don't have to do everything in one go. |
3c4f715 to
b4a4f92
Compare
|
@wismill: feel free to set a label (squash+merge_me I guess), which will still give @fgaz 2 days to ponder and grace us with a comment, if @fgaz so chooses. BTW, let's not forget to open a ticket for the other occurrences of the same pattern in the codebase. Even if we later close the ticket with "nothing to do". |
|
@mergify rebase |
Previously the function `\f -> L.allCondTrees $ traverseCondTreeC f` was used to add the dependencies, but manipulating `CondTree` this way does not update the nested fields `targetBuildDepends` of the tree, only the conditions. It worked merely by chance if one does not further process these fields: this explains why options like `--allow-newer` or `allow-older` were incompatible with `--build-depends`. Using `L.traverseBuildInfos . L.targetBuildDepends` ensures `targetBuildDepends` fields and conditions are all updated consistently.
b4a4f92 to
8a51101
Compare
|
To get the future behavior now, you can configure Or you can create a dedicated github account for squash and rebase operations, and use it in different |
✅ Branch has been successfully rebased |
|
Regarding backport to 3.10: I'm of two minds here. On one hand, I truly believe this can make 3.10 release greater and brighter. On the other, I think it may break some stuff, perhaps — at least, I didn't see anyone on this thread pleading that it can't. So, perhaps, it's Mikolaj's call. |
|
@ulysses4ever: I asked people at the last devs meeting to give this an extra scrutiny specifically due to the late semi-freeze backporting and we did get a lot of reviews in. However, I find your sudden lack of faith disturbing. :) |
|
@wismill: do we have the ticket about "the other occurrences of the same wrong pattern in our codebase"? If so, it would be useful to link it here for cross-referencing. |
|
@mergify backport 3.10 |
* Fix repl discarding `build-depends` argument Previously the function `\f -> L.allCondTrees $ traverseCondTreeC f` was used to add the dependencies, but manipulating `CondTree` this way does not update the nested fields `targetBuildDepends` of the tree, only the conditions. It worked merely by chance if one does not further process these fields: this explains why options like `--allow-newer` or `allow-older` were incompatible with `--build-depends`. Using `L.traverseBuildInfos . L.targetBuildDepends` ensures `targetBuildDepends` fields and conditions are all updated consistently. * Add test * Add changelog * Cleanup --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> (cherry picked from commit e9b4744)
✅ Backports have been createdDetails
|
Fix repl discarding --build-depends (backport #8732)
Fix REPL discarding
--build-dependswhen usingallow-newerorallow-older.Fixes #6859
Fixes #7081
Related issues: #8504, #5900.
Please also shortly describe how you tested your change. Bonus points for added tests!