Repository navigation
Add --project-dir flag - #8454
Conversation
810f80a to
39f06f8
Compare
|
It looks like a really comprehensive PR. I don't remember, is there a near-consensus to use this approach in the tickets you mention? Or do you plan to initiate discussion once the PR is ready? I'm asking to avoid a situation where you sit tight on a perfectly good PR, while people bemoan the lack of progress in the other tickets. :) |
|
This looks like a new approach to me, but a fairly clear and helpful one. I suggest to put forward a note that specifying |
No, this approach was:
I'm hoping that this PR can serve as the forum for discussion. |
Splendid. In that case, could you drop a note in the relevant tickets? |
62141b9 to
e95abdb
Compare
e95abdb to
9669621
Compare
|
I've added more details and an alternative proposal to the description. If others like the alternative better, I would be happy to implement the change. |
|
I think the alternative scenario is better (if the breaking change in scenario 3 is acceptable) as it works with an absolute path as well and fixes the relative path behaviour (this is the main reason for the existence of the other PR, see this comment by @fgaz for an explanation of the relative behaviour). So the new situation will be,
I wonder if one of the motivations mentioned (#7695 (comment)) is now better solved with imports in cabal.project. If the breaking behaviour is not acceptable and we want to just add the new --project-dir flag, I don't see why we would want to deprecate support for absolute paths when relative behaviour is definitely a bug |
Unfortunately not (unless I'm mistaken). How would one conditionally import a file based on whether or not the user is building with Nix? Can one check for the presence of an environmental variable in an if-clause condition? |
|
I think the RFC period is over. I propose to review and, if reviews are positive, merge to be released in cabal 3.10 and then collect feedback from users of 3.10. |
Mikolaj
left a comment
There was a problem hiding this comment.
I don't have the relevant user experience to judge the usability impact, but as a software contribution the PR is very solid and I trust the author's user experience.
|
Hi, i only want to note that i am not sure if changes has enough integration tests: i see a great unit test case but it is not clear to me changes in integration ones covers main cases of the new functionality |
|
An integration test can certainly help clarifying the expected behaviour of the patch. |
9669621 to
9e726f1
Compare
|
I've (hopefully) made all requested changes. |
|
@cydparser Fantastic, thank you very much! I'll let you set the "squash+merge me" label on this PR and the merge train will take it from here. :) |
9e726f1 to
c324205
Compare
|
Mergify failed with an obscure message. I manually rebased and squashed the commits into a single commit. "Validate macos-latest ghc-8.4.4" failed after running over 5 hours. |
|
@cydparser I'm sorry that you have to deal with CI falkiness, but it is only that and nothing else. Let's try once again (I restarted failing jobs). |
|
Yes, OSX runners sometimes do that. No idea. Potentially just GHA flakiness. The solution is stop the job and restart it. |
|
Too bad this was merged just days after 3.10 was frozen (informally, but so I heard)... |
|
Yes, unfortunately, But to clarify, we were in semi-freeze mode for some time already and for the last week or two we were only merging 3.8 and 3.9 regression fixes (and doc and CI tweaks). I failed to announce that on the IRC channel, probably. |
--project-dirflag for specifying the project's root directory--project-filewith an absolute pathDetails
Given the following directory structure:
/opt |-- proj |-- cabal.project |-- nix/ |-- cabal.project |-- lib/Where:
Behavior in 3.8.1.0
The last two scenarios result in an error after dist-newstyle is created in
the erroneously resolved root directories.
Behavior in this PR
--project-filewith an absolute path--project-dirThis is the conservative option: it is additive without changing the original
behavior. Scenarios 4 and 5 are still errors, but we could detect the misuse of
--project-fileby looking fordistDirectoryand add a warning that suggestsusing
--project-dir.Alternative proposal
Use the behavior of #7749.
--project-file--project-diror the directory containing--project-fileWhen both
--project-dirand--project-fileare specified, and--project-fileis a relative path,--project-filewill be resolved relativeto
--project-dir(rather than to the current working directory).Scenario three becomes an error, making this a breaking change, but the behavior
can be recovered by specifying
--project-dir.