-
Notifications
You must be signed in to change notification settings - Fork 704
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
Drop file and module targets #8966
Drop file and module targets #8966
Conversation
I am afraid this got hit badly by the reformatting :-/ I'll pick it back up another time. |
@andreabedini would you allow me to fix this? |
Absolutely 😂 I don't feel obliged though :-) Do you have any trick up your sleeve to deal with the situation? |
Yes I plan on recreating your changes based on the latest HEAD instead of resolving conflicts by hand. :) |
Any updates on this front? |
This got bitrotten by the codebase formatting. I guess I could give this another go. |
c694b92
to
1a6eb9b
Compare
Redoing this wasn't hard in the end, but I must have broken something for the cabal script. |
Alright I understood what is going on. In affected test, we have a package with executable
After removing sub-component targets, there is no target for "a file part of a component", so that check disappears and we get a more down to earth message:
which is also expected and correct since I am inclined to think we can accept this new behaviour: |
@Kleidukos @Mikolaj @ulysses4ever @sheaf what do you think? |
I'm really too ignorant here to comment but, yes, let's drop and delete it all! |
I maked this as ready and updated the description. |
1a6eb9b
to
7eaaf92
Compare
Sorry, busy end of year, haven't gotten any cycles to look into this. On the surface of it sounds fine. |
11f227a
to
6916351
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.
I agree with your assessment that it's better to remove this effectively dead code rather than hope it will eventually be resuscitated into a working feature.
✅ Pull request refreshed |
Perhaps, it needs a manual rebase on master. |
Isn't it all fine now? Mergify just waiting the 2 days after 2nd review? |
The reason I mention manual rebase is that GitHub UI says there are conflicts that cannot be automatically resolved. I don't know what Mergify will do about it. We can wait and see. |
@ulysses4ever: I see "This branch has no conflicts with the base branch". Am I looking in the wrong place or do you need to reload the page? |
@ulysses4ever welcome to the Twilight Zone I guess |
"Impossible" happened, I suppose? Run for the woods? |
Actually, if you select the dropdown next to "Update branch", you will find that "Rebase" is grayed out with a message "This branch cannot be rebased due to conflicts". Apparently merge is okay, though. |
oh yeah if you make a merge commit then it will "work"(??) |
IIRC both would run into conflicts but only github's merge code knows how to deal with them at present? From a local checkout you can fix conflicts and |
Oh, so that's it! I think rebase is more strict than merge, so no wonder. If the commits are going to be squashed, no harm in merging (I forgot, does mergify merge or rebase when it's going to squash?), except that rarely some subtle merge errors may occur (e.g., wrong line order) when rebase would just refuse to cooperate. |
Just when you thought you understood git, git strikes you in the back ... The only explanation I can think of has to do with multiple commits. Rebase tries to apply every commit in order and can fail on some of them. Whereas merge tries to reconcile the final states of two branches. II wonder if this is the case that with a single-commit PR rebase and merge will always have the same outcome in terms of conflicts… And then the whole other trap is GitHub's dreadful UI feature that remembers your last PR action (rebase vs merge vs squash). Thanks to it, everyone can see something different... (Well, no more than three options.) |
Maybe this is something we can fix? |
This change removes support for building sub-component targets in cabal-install, since no versions of Cabal support this feature. The test RunMainBad is also dropped because without the concept of a file target, RunMainBad is the same test as ScriptBad.
30e2e00
to
eda0b22
Compare
Did it fix itself? |
I rebased manually |
This reverts commit 3f4c81f.
This reverts commit 3f4c81f.
…rgets Revert "Drop sub-component targets (#8966)"
This change removes support for building sub-component targets in cabal-install, since no versions of Cabal support this feature. The test RunMainBad is also dropped because without the concept of a file target, RunMainBad is the same test as ScriptBad.
This reverts commit 3f4c81f.
It looks like the ability of compile sub-component targets (i.e. single files and single modules) has been sitting half backed for many years. This PR indends to remove what is effectively dead code.
cabal-install has a lot of logic to support many different forms of target selectors (see TargetSelector.hs), only to drop the whole thing on the floor when it comes to call Cabal.
https://github.com/haskell/cabal/pull/8966/files#diff-2adae381a2eb2d8c804d5396694a431e1e3babd816a5d2408a62213cf774a893L3132-L3134
Similarly Cabal implements complex matching logic to parse sub-component targets (so it seems to be aware of the functionality it does not yet have) only to give up at the end
https://github.com/haskell/cabal/pull/8966/files#diff-92dccb98376c4c010aaedf4bbea0733e6ab8016318f0038db9ccf4e366fd9e95L1059-L1067
I suggest all this can go, shaving ~1200 loc. I am also confident all this can be done in a simpler way, if and when we decide to have this functionality.
Please include the following checklist in your PR:
Bonus points for added automated tests!