`cabalProject'`: Consider `cabalProjectLocal` even if `cabalProject` argument is null
I haven't tested this.
Motivation?
Sometimes you want to use cabalProjectLocal without cabalProject?
This is just a plain bug, no?
Yes this is a bug. I thought it only affected hackage-project based things (that is where I found it annoying). Can you please remove the old work around here? I'm pretty sure this change will make that redundant.
Does cabal accept a cabal.project.local without cabal.project?
Does cabal accept a
cabal.project.localwithoutcabal.project?
It does (with a warning):
[nix-shell:~/iohk/hello-1.0.0.2]$ cabal --version
cabal-install version 3.6.2.0
compiled using version 3.6.2.0 of the Cabal library
[nix-shell:~/iohk/hello-1.0.0.2]$ ls -l cabal.project
ls: cannot access 'cabal.project': No such file or directory
[nix-shell:~/iohk/hello-1.0.0.2]$ cat cabal.project.local
packages: test
[nix-shell:~/iohk/hello-1.0.0.2]$ cabal build all
Warning: both implicit and explicit configuration is present.When using configuration(s) from /Users/hamish/iohk/hello-1.0.0.2/cabal.project.local, the following errors occurred:
The package location 'test' does not exist.
Do we want the same Warning: both implicit and explicit configuration is present. warning when cabalProjectLocal is set and not cabalProject? (rather than just ignore cabalProjectLocal like this PR does?)
cabal only seems to print that warning when there is an error. I think we could write the cabalProjectLocal to cabal.project.local to get the same behaviour. That is a bigger change though as it would require we correctly handle source-repository-package blocks in both files (rather than just combining them and parsing once).
Good. Then please include a note explaining that this behaviour matches cabal and we tested it.
I've updated the PR
bors try
bors try is all green now.