hs-source-dirs in combination with exposed-modules doesn't support colon in directory names
- Dominant language
- Haskell
- Stars
- 1.7k
- Forks
- 750
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 28
Description
**Describe the bug**
It seems to be impossible to specify a directory with a colon in the name among the `hs-source-dirs` for a library.
**To Reproduce**
Steps to reproduce the behavior:
Create the following file hierarchy:
```
==> test.cabal <==
cabal-version: 3.4
name: test
version: 1
library Lib
build-depends: base
exposed-modules: Module
hs-source-dirs: li:b
==> li:b/Module.hs <==
module Module where
one = 1
```
```
$ cabal v2-build Lib
Warning: No remote package servers have been specified. Usually you would have
one specified in the config file.
Resolving dependencies...
Build profile: -w ghc-9.2.5 -O1
In order, the following will be built (use -v for more details):
- test-1 (lib:Lib) (configuration changed)
Configuring library 'Lib' for test-1..
Preprocessing library 'Lib' for test-1..
Building library 'Lib' for test-1..
: error: module ‘Module’ cannot be found locally
```
I've also tried double quoting the directory name, `"li:b"`, it makes no difference.
Note that such directories do not seem to be a problem among the `hs-source-dirs` for executable or test-suite stanzas.
**Expected behavior**
Any valid path for a directory should be acceptable among `hs-source-dirs`.
**System information**
- Operating system: macOS 10.13.6
- ```
$ cabal --version
cabal-install version 3.8.1.0
compiled using version 3.8.1.0 of the Cabal library
```
- ```
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 9.2.5
```
Contributor guide
Research direction
Start with the minimal test.cabal and li:b/Module.hs hierarchy, then run cabal v2-build Lib to reproduce the missing Module error. Investigate how hs-source-dirs is handled for library stanzas with exposed-modules and compare it with executable or test-suite stanzas. Done means a library source directory containing a colon is accepted and Module.hs builds successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 38/100