-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Detect implicit cabal cradle in the absence of cabal.project (#221)
* Detect implicit cabal cradle in the absence of cabal.project A cabal cradle doesn't need a cabal.project file and isn't guaranteed to have one either. This improves the implicit cradle search for cabal by falling back to finding .cabal files if hie-bios couldn't find any cabal.project files. Because it falls back, if hie-bios tries to query a multi-package cabal project with a nested cabal package, it will still find use the "larger" cradle with the upper cabal.project file. See the implicit-cabal-deep-project test project for an example of this. * Copy test projects over to temporary directory This prevents the cabal.project/hie.yaml of hie-bios's source tree from interfering with the cradle stuff
- Loading branch information
Showing
13 changed files
with
160 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
main = pure () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Here we are testing that if we have a nested cabal package but a cabal.project | ||
a directory above it, hie-bios will implicitly pick up the cabal.project and | ||
NOT the nested cabal package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
packages: . | ||
foo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
main = pure () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
cabal-version: >=1.10 | ||
name: foo | ||
version: 0.1.0.0 | ||
build-type: Simple | ||
|
||
executable foo | ||
main-is: Main.hs | ||
build-depends: base >=4 | ||
default-language: Haskell2010 |
8 changes: 8 additions & 0 deletions
8
tests/projects/implicit-cabal-deep-project/implicit-cabal-deep-project.cabal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
cabal-version: >=1.10 | ||
name: implicit-cabal-deep-project | ||
version: 0.1.0.0 | ||
build-type: Simple | ||
executable foo | ||
main-is: Main.hs | ||
build-depends: base >=4 | ||
default-language: Haskell2010 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
main = pure () |
8 changes: 8 additions & 0 deletions
8
tests/projects/implicit-cabal-no-project/implicit-cabal-no-project.cabal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
cabal-version: >=1.10 | ||
name: implicit-cabal-no-project | ||
version: 0.1.0.0 | ||
build-type: Simple | ||
executable foo | ||
main-is: Main.hs | ||
build-depends: base >=4 | ||
default-language: Haskell2010 |