Wrong condition for passing --working-dir flag
https://github.com/haskell/cabal/blob/bccc59f78f64d8db8605380d6735e0730d8bea23/cabal-install/src/Distribution/Client/Setup.hs#L645-L649
#9718 was not backported to 3.12 branch, so the condition should be < 3.13.
CC @sheaf
@Bodigrim Is this a symptom of the bug? (trying to build ghc-paths with latest Cabal and GHC, using today's master of cabal-install):
ghc-paths$ cabal-master build -w ghc-9.10.0 -c 'Cabal >= 3.12'
Build profile: -w ghc-9.10.0.20240413 -O1
In order, the following will be built (use -v for more details):
- ghc-paths-0.1.0.12 (lib:ghc-paths) (cannot read state cache)
unrecognized 'configure' option `--working-dir=/.../ghc-paths/.'
Error: [Cabal-7125]
Failed to build ghc-paths-0.1.0.12. The failure occurred during the configure step.
Update: shows also with older GHCs.
Yes.
Thank you for the report. So it seems 3.12.1.0 will not be a cabal-install-only release...
Thanks for reporting this issue @Bodigrim. I have put up #9951 with a fix.
Thank you for the report. So it seems 3.12.1.0 will not be a cabal-install-only release...
The bug is only in cabal-install; fixing this does not by itself necessitate a new Cabal release. (However, I believe there are other reasons we will want a 3.12.1.0 Cabal release.)
@sheaf points out in https://github.com/haskell/cabal/pull/9951#discussion_r1584968725 that the pre-release cabal-install on the 3.12 branch is unaffected (and so cabal-install 3.12.1.0 won't be), because the functionality can't even be triggered there, because not only the Cabal part, but also the cabal-install part of https://github.com/haskell/cabal/pull/9718 was not backported to 3.12 branch and so --working-dir won't every appear. Do I get it right? Could you kindly confirm that? If so, this is not a regression of 3.12, only of master and, in particular, we don't have to backport.
I retract my previous comment, as it does seem like a master version of cabal-install is required to trigger it.
Nobody corrected me, so I will assume this does not affect cabal-install 3.12 and so we don't backport the fix and I can announce a pre-release without pointing this out as a known bug. Shall we close [edit: as soon as the fix lands on master branch in 2 days]?
Nobody corrected me, so I will assume this does not affect cabal-install 3.12 and so we don't backport the fix and I can announce a pre-release without pointing this out as a known bug. Shall we close [edit: as soon as the fix lands on master branch in 2 days]?
Yes, I believe no backport is needed and we just need to merge the fix to master.