You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As discussed in #6880, --cabal-file has never been used for what people think it's meant. The best way forward, seemingly, is to remove the option (edit by @fgaz: from cabal-install). This follows up on not only #6880 but also #7225.
Alternatives
Different people want different things from --cabal-file, e.g.:
The second scenario is not supported currently. The first one can be worked around with another option: --project-file. In particular, you can create a project file along with the package of interest (if there's none currently), and point to it calling cabal from anywhere. In that case the respective package will be built/ran/installed. Beware of a current bug not allowing to use relative paths with --project-file: use absolute path until #7749 (or analogous fix) is merged.
Reacted by Mikolaj Konarski, Andreas Abel and George Thomas
I had a go myself here. I am a bit confused (not new 😂). The option --cabal-file is (originally) a Cabal option. The options of Cabal and cabal-install (both v1 and v2 commands) are all jumbled up and this is how it becomes a cabal-install option.
Do we want to remove it from Cabal or only from cabal-install?
AFAIU we do have a mechanism to hide some Cabal flags when we use them from cabal-install. But that's also a bit messed up because it's duplicated in a fewplaces and doesn't really inspire confidence.
Also Cabal's cabalFilePath gets passed to what I understand is the Hooks API (haddockCabalFilePath, hscolourCabalFilePath, copyCabalFilePath, installCabalFilePath, regCabalFilePath, cleanCabalFilePath, ...) and there's some warning in the code about breaking that API.
The ticket got closed via the excellent PR by @andreabedini. Is there anything left here to do? If so, maybe let's move it to other tickets with clear scopes?
Activity
andreasabel commentedon Aug 19, 2022
Yes, option
--cabal-fileshould be replaced by a--cwd/--directoryoption as suggested in:Alternatively, it could be fixed to mean these two things (conjunction):
--cabal-file..cabalfiles in this directory.fgaz commentedon Aug 19, 2022
-1 to giving it some other behaviour, +1 to removing it from cabal-install.
if an option to select a cabal file is needed, we could make
packagesa valid cli option (#3585).andreasabel commentedon Aug 20, 2022
I played a bit with removing the option. It seems to be used in the testsuite. So most work in removing this option would go into restructuring the test that currently use it.
E.g. here are several
.cabalfiles in the same directory, and selected using the--cabal-fileoption: https://github.com/haskell/cabal/tree/a97e1f13bdb28a3f761d55845f14a9072bee17ca/cabal-testsuite/PackageTests/ReexportedModules/pfgaz commentedon Aug 20, 2022
Those look like Setup.hs tests though, so removing the option from
cabal-installshould be fineandreabedini commentedon Jul 3, 2023
I had a go myself here. I am a bit confused (not new 😂). The option
--cabal-fileis (originally) a Cabal option. The options of Cabal and cabal-install (both v1 and v2 commands) are all jumbled up and this is how it becomes a cabal-install option.Do we want to remove it from Cabal or only from cabal-install?
AFAIU we do have a mechanism to hide some Cabal flags when we use them from cabal-install. But that's also a bit messed up because it's duplicated in a few places and doesn't really inspire confidence.
Also Cabal's cabalFilePath gets passed to what I understand is the Hooks API (haddockCabalFilePath, hscolourCabalFilePath, copyCabalFilePath, installCabalFilePath, regCabalFilePath, cleanCabalFilePath, ...) and there's some warning in the code about breaking that API.
fgaz commentedon Jul 4, 2023
From cabal-install. Yes I think we can just hide it
Mikolaj commentedon Dec 9, 2023
The ticket got closed via the excellent PR by @andreabedini. Is there anything left here to do? If so, maybe let's move it to other tickets with clear scopes?