forked from haskell/cabal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make cabal check warn about missing directories in globs
This also significantly improves the error when trying to refer to missing directories, hopefully making it clear that it's coming from Cabal. haskell#5318 and snowleopard/hadrian#634 are two bugs which manifested as Cabal trying to glob in a non-existent directory and both took some debugging because of the obscurity of the error.
- Loading branch information
1 parent
9668baf
commit e9afb5e
Showing
17 changed files
with
142 additions
and
50 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
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
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 @@ | ||
foo = True |
9 changes: 9 additions & 0 deletions
9
cabal-testsuite/PackageTests/Check/MissingGlobDirectory/cabal.out
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 check | ||
Warning: The package will not build sanely due to these errors: | ||
Warning: This package description follows version 2.4 of the Cabal specification. This tool only supports up to version 2.3.0.0. | ||
Warning: The following errors will cause portability problems on other environments: | ||
Warning: In 'data-files': the pattern 'another-non-existent-directory/**/*.dat' attempts to match files in the directory 'another-non-existent-directory', but there is no directory by that name. | ||
Warning: In 'extra-doc-files': the pattern 'non-existent-directory/*.html' attempts to match files in the directory 'non-existent-directory', but there is no directory by that name. | ||
Warning: In 'extra-doc-files': the pattern 'present/present/missing/*.tex' attempts to match files in the directory 'present/present/missing', but there is no directory by that name. | ||
Warning: In 'extra-source-files': the pattern 'file-not-a-directory/*.js' attempts to match files in the directory 'file-not-a-directory', but there is no directory by that name. | ||
Warning: Hackage would reject this package. |
3 changes: 3 additions & 0 deletions
3
cabal-testsuite/PackageTests/Check/MissingGlobDirectory/cabal.test.hs
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 @@ | ||
import Test.Cabal.Prelude | ||
main = cabalTest $ | ||
fails $ cabal "check" [] |
1 change: 1 addition & 0 deletions
1
cabal-testsuite/PackageTests/Check/MissingGlobDirectory/data/hello.dat
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 @@ | ||
hello.dat |
1 change: 1 addition & 0 deletions
1
cabal-testsuite/PackageTests/Check/MissingGlobDirectory/file-not-a-directory
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 @@ | ||
This is not a directory. |
21 changes: 21 additions & 0 deletions
21
cabal-testsuite/PackageTests/Check/MissingGlobDirectory/pkg.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,21 @@ | ||
cabal-version: 2.4 | ||
name: pkg | ||
version: 0 | ||
extra-doc-files: | ||
non-existent-directory/*.html | ||
present/present/missing/*.tex | ||
extra-source-files: | ||
file-not-a-directory/*.js | ||
data-dir: | ||
data | ||
data-files: | ||
another-non-existent-directory/**/*.dat | ||
category: example | ||
maintainer: [email protected] | ||
synopsis: synopsis | ||
description: description | ||
license: BSD-3-Clause | ||
|
||
library | ||
exposed-modules: Foo | ||
default-language: Haskell2010 |
1 change: 1 addition & 0 deletions
1
cabal-testsuite/PackageTests/Check/MissingGlobDirectory/present/present/hello
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 @@ | ||
This file only exists so that Git will create its two parent directories. |
1 change: 1 addition & 0 deletions
1
cabal-testsuite/PackageTests/Check/MissingGlobDirectory2/Foo.hs
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 @@ | ||
foo = True |
6 changes: 6 additions & 0 deletions
6
cabal-testsuite/PackageTests/Check/MissingGlobDirectory2/cabal.out
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,6 @@ | ||
# cabal check | ||
Warning: The package will not build sanely due to these errors: | ||
Warning: This package description follows version 2.4 of the Cabal specification. This tool only supports up to version 2.3.0.0. | ||
Warning: The following errors will cause portability problems on other environments: | ||
Warning: In 'data-files': the pattern 'non-existent-directory/**/*.dat' attempts to match files in the directory 'non-existent-directory', but there is no directory by that name. | ||
Warning: Hackage would reject this package. |
3 changes: 3 additions & 0 deletions
3
cabal-testsuite/PackageTests/Check/MissingGlobDirectory2/cabal.test.hs
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 @@ | ||
import Test.Cabal.Prelude | ||
main = cabalTest $ | ||
fails $ cabal "check" [] |
14 changes: 14 additions & 0 deletions
14
cabal-testsuite/PackageTests/Check/MissingGlobDirectory2/pkg.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,14 @@ | ||
cabal-version: 2.4 | ||
name: pkg | ||
version: 0 | ||
data-files: | ||
non-existent-directory/**/*.dat | ||
category: example | ||
maintainer: [email protected] | ||
synopsis: synopsis | ||
description: description | ||
license: BSD-3-Clause | ||
|
||
library | ||
exposed-modules: Foo | ||
default-language: Haskell2010 |