Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- This commit sets the ProjectRoot consistently for both absolute and relative --project-file pats. The ProjectRoot is set as the directory where the --project-file is located. - Before this change relative project files are rooted to where the project file is resolved, when recursively searching upward from the current directory, and not where it is located. Previous behaviour is as follows, gitpod ~/0/1/2/foo $ tree ~/0 /home/gitpod/0 └── 1 ├── 2 │ └── foo │ ├── app │ │ └── Main.hs │ ├── CHANGELOG.md │ └── foo.cabal └── cabal.project and inside foo let's run $ pwd /home/gitpod/0/1/2/foo $ cabal build all --project-file ../cabal.project which builds the project setting the project root at 2 using the project file at 1 $ ls ~/0/1 ~/0/1/2 /home/gitpod/0/1: 2 cabal.project /home/gitpod/0/1/2: dist-newstyle foo However, if the cabal.project file was instead in 0 directory, cabal would fail to build since the resolved project root is at 1 and cabal fails to find a package at 1/foo gitpod ~/0/1/2/foo $ mv ~/0/1/cabal.project ~/0/ gitpod ~/0/1/2/foo $ cabal build all --project-file ../cabal.project When using configuration(s) from /home/gitpod/0/1/../cabal.project, the following errors occurred: The package location 'foo' does not exist. This beaviour is almost never what we want.
- Loading branch information