-
Notifications
You must be signed in to change notification settings - Fork 697
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
project-cabal/pkgs/cabal.config: withBinaryFile: does not exist (No such file or directory) #9901
Comments
That's a @philderbeast's patch, I think? |
I don't seem to be able to reproduce this locally with a just-built
Your command also completes successfully. (I was going to bisect it.) |
I am using
You are right that HEAD appears to work.. but you shouldn't require HEAD cabal-install to develop cabal-install! |
Still happens with 3.10.3.0. |
No, but
implies it, especially if you're talking about 3.10.2.1. |
@geekosaur Normal development practice is regressed because the current state of the repo doesn't work with existing developer workflows with a released version of cabal-install. (Arguably an even more critical reason to revert than a broken release) |
It's already reverted. What do you want, that we retroactively re-release 3.10.2 without whatever it was? |
|
[Edit: this was wrong again, though less so. See another take in the next comment.] Oh, I mis-read. You said "Still happens with 3.10.3.0". So the current stable cabal is broken in this way. So what @mpickering would need is porting the fix to the 3.10 branch (unless already ported and unless it changes the API) and releasing 3.10.4.0. Which ticket is it and which PR fixes it? I'm afraid, unless somebody steps up, we don't have the resources to release 3.10.4.0 for a couple more months and by then 3.12.1.0 with cabal-install should be released, which contains the fix (I hope). For now, is there an older version of cabal that doesn't have this bug? 3.10.1.0? 3.8.*? |
@alt-romes helped me understand what's probably going on: Probably, HEAD's dev configuration (cabal files, project files, whatever) uses a new feature that cabal 3.10 does not yet support. If so, that's a case of a too short transition period between introducing a new feature and requiring it for building the project. And so, it should be reverted temporarily and brought back when cabal 3.12 or cabal 3.14 is released (maybe the latter given the damage done already). The question is what this feature is exactly and how to revert it without breaking things (or even, potentially, with fixing bugs that the new feature fixed, in a more conservative way, for now --- but let's hope that's not the case and reverting is enough). |
Copying from the channel: <sclv> could be different semantics for relative paths is project import imho |
@philderbeast: you improved these or related things so you may have an inkling what's going on. Would you venture a guess? |
@philderbeast: we are discussing this in the channel right now, but I can't remember your Matrix nick. In any case, please feel free to read the channel backlog. |
Okay, so I confirmed that 3.12 branch works fine. I also bisected To summarize: we started using relative imports in cabal's source tree, which are relative to the wrong directory in 3.10. I did not determine when the relative-directory bug was fixed on |
@philderbeast turns out to be on holidays, so let's handle this ourselves. If making the reverts turns our relatively painless, I'd opt for that and I take personal responsibility for the decision to revert (and I will press the big red button and then remember to merge these PRs back again in a year). Otherwise, if reverting and re-applying the conflicting PRs is particularly messy, let's try workarounds, e.g., "some kind of git clone hook to automatically substitute SOMETHING for $(pwd) in the cabal.project files". If Phil returns before we are done, I'd love to get his input, but this it git, whatever gets reverted can be rereverted, so let's not spoil Phil's holidays by blocking any design or decision on him. If there is a good workaround in 2 weeks, we can re-revert in 2 weeks. |
(copied from Matrix) ANSWER: apparently not. |
cabal-install 3.10 and earlier mis-handle relative paths in cabal.project imports, as revealed by haskell#9901. Use an evil hack to make things work for all versions. This variant avoids recursive find traps.
BTW, I was wrong saying (on the Matrix channel?) that reverting the PR could cause problems backporting things to branch 3.12 --- the PR is not on branch 3.12, so that would actually get the two branches closer. |
BTW, there's a lot of great commits in that PR, e.g., removing many unused files. Yes, it may turn out in the future we need one of these files, but I'd rather keep the commits and only revert the ones that depend on the relatives paths functionality that we can't provide in the already released cabal-install 3.10 binaries. Or maybe just copy-paste all the common project file parts instead of including them. I wonder if we'd end up with many copies of the index state stamp. That would be a major nuisance. |
I'm back and will look at this today. |
@philderbeast: thank you! BTW a detail to take care of when we re-instate the PR: the bootstrap-regenerating project file (not bootstrap-building for tests) can't have tests in it or the build plan gets too large, so this file has just been added in #9897 (edit: just merged): Which unfortunately also duplicates index-state --- but we may have no choice in that until all reasonably new cabal binaries have correct relative path handling. |
If released
|
The nightly also works fine; instructions for getting it are in the README. |
I don't think so. It think the biggest problem is surprise and then churn. If you are new to cabal, you may spend a lot of time troubleshooting your setup before somebody remembers to ask "of course you are not using the stable cabal release?". Then let's suppose you spawn VMs for testing. First, something breaks and you need to diagnose. Then you discover it's this known problem and so from now on, in each VM instance you need to compile, copy or download a cabal version. Developer's comfort matters a lot. |
I'd suspected as much. Wouldn't a lighter weight fix be prominent contributor notes about known problems and workarounds. I feel bad about adding a workaround project in #9923 and would rather it not be merged. |
Now that you say so, indeed remembering (and initially, knowing) to add Regarding well written and advertised "known problems and workarounds" section in CONTRIBUTING.md, that would be good, but even better would be an empty "known problems and workarounds" section. :) It's really a pity one can't hardwire in Are we out of plausible workarounds? If so, how about reverting? As I've written above, this is such a valuable PR that it would be best to revert it selectively, but we probably can't avoid the worst outcomes, such as duplicating index state stamps (which has already happened due to bootstrap generation in another PR). In a year or a half we can deduplicate things again, maybe including the bootstrap stamp. Thoughts? |
The workaround project would get picked up automatically if named Can we deprecate the older versions as far as their use in cabal development goes? They're broken for 2+ hop project imports that include relative paths, aren't they? I'm really hoping that we can clean up our use of projects further, #9565 (comment). |
Absolutely. Given how broken they are, half a year (as opposed to a year, I'd reflexively propose in such cases) deprecation cycle sounds reasonable.
I think they are. Thank you for helping to discover that and fixing in another PR --- both unwittingly from what I gather. :D My idea is that while we in the deprecation period for cabal development with cabal-install 3.10, we should refrain from using the features that are broken in 3.10 and that were, apparently, not widely enough used to cause problems beforehand.
That would be amazing. And it's great we (you) are doing this gradually, letting the related errors emerge in smaller batches rather than all at once. So, shall we temporarily revert the part of the refactor that 3.10 can't handle? |
We are in a short lull between releses 3.12.0.0 and 3.12.1.0, so let's try to resolve this one way or the other. Are there any objections to temporarily reverting the problematic part of #9565? Assuming there are none, would somebody offer to do the revert PR? I can help by reviewing and pressing the merge button myself. |
@mpickering could you expand on what you mean by "normal development practice" please? Are you referring to development-in-general normal, developing-on-NixOS normal (where adhoc installing may be harder) or Cabal-specific-development normal? Do we recommend a version of Note There is no problem building the project using older |
I expect that developers provision If this isn't the widespread opinion, then feel free to close the ticket but it seems quite a basic requirement of a project to me. |
Thank you for your input. However, I can see no volunteers to revert parts of the PR (and I think reverting it whole would be an overkill at this point) so maybe we could just add a note to CONTRIBUTING.md and to cabal-install 3.12 release notes recommending at least 3.12 for cabal development, with a link to this very issue? Objections? Volunteers (but if none and no objections, I'd do this myself)? |
It is currently impossible to run
cabal
in any subdirectory of the cabal project.This makes it hard/impossible to automatically update tests such as the
parser-tests
.Can the patch responsible please be reverted quickly?
The text was updated successfully, but these errors were encountered: