-
Notifications
You must be signed in to change notification settings - Fork 696
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
All the functions used in Paths modules are defined
The functions `splitFileNAme` and `minusFileName` are now defined in the same conditional block, ensuring that they cannot be used without being defined. This fix a bug occurring when generating a Paths_ module with --enable-relocatable.
- Loading branch information
1 parent
91a343f
commit 6c79621
Showing
8 changed files
with
106 additions
and
47 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
8 changes: 8 additions & 0 deletions
8
cabal-testsuite/PackageTests/PathsModule/Executable-Relocatable/Main.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,8 @@ | ||
module Main where | ||
|
||
import Paths_PathsModule (getBinDir) | ||
|
||
main :: IO () | ||
main = do | ||
_ <- getBinDir | ||
return () |
16 changes: 16 additions & 0 deletions
16
cabal-testsuite/PackageTests/PathsModule/Executable-Relocatable/my.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,16 @@ | ||
name: PathsModule | ||
version: 0.1 | ||
license: BSD3 | ||
author: Johan Tibell | ||
stability: stable | ||
category: PackageTests | ||
build-type: Simple | ||
Cabal-version: >= 1.2 | ||
|
||
description: | ||
Check that the generated paths module compiles. | ||
|
||
Executable TestPathsModule | ||
main-is: Main.hs | ||
other-modules: Paths_PathsModule | ||
build-depends: base |
5 changes: 5 additions & 0 deletions
5
cabal-testsuite/PackageTests/PathsModule/Executable-Relocatable/setup.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,5 @@ | ||
# Setup configure | ||
Configuring PathsModule-0.1... | ||
# Setup build | ||
Preprocessing executable 'TestPathsModule' for PathsModule-0.1.. | ||
Building executable 'TestPathsModule' for PathsModule-0.1.. |
5 changes: 5 additions & 0 deletions
5
cabal-testsuite/PackageTests/PathsModule/Executable-Relocatable/setup.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,5 @@ | ||
# Setup configure | ||
Configuring PathsModule-0.1... | ||
# Setup build | ||
Preprocessing executable 'TestPathsModule' for PathsModule-0.1.. | ||
Building executable 'TestPathsModule' for PathsModule-0.1.. |
7 changes: 7 additions & 0 deletions
7
cabal-testsuite/PackageTests/PathsModule/Executable-Relocatable/setup.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,7 @@ | ||
import Test.Cabal.Prelude | ||
-- Test that Paths module is generated and usable when relocatable is turned on. | ||
|
||
main = setupAndCabalTest $ do | ||
skipIfWindows | ||
skipUnlessGhcVersion ">= 8.0" | ||
setup_build ["--enable-relocatable"] |
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,12 @@ | ||
synopsis: Fix generation of Path_ modules with relocatable | ||
packages: Cabal | ||
prs: #8220 | ||
issues: #8219 | ||
description: { | ||
|
||
The generation of the functions `minusFileName` and `splitFileName` | ||
are now in the same conditional block as their call, | ||
preventing generation of inconsistent Paths_ files | ||
where those functions are used but not defined. | ||
|
||
} |
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