Cabal puts builddir on the PATH without escaping colons
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- haskell
- Domain
- build-system
Research direction
Start by searching Cabal's build code for where the --builddir path is added to the module search path, then check how that path is formed on Unix and Windows. Reproduce with the attached package using make build and --builddir=foo:bar; done means the generated module resolves with colon-containing paths on Unix and semicolon-containing paths on Windows.
Written by the indexing model from the issue text.
Description
Describe the bug
Cabal fails to resolve generated modules when the build directory contains :'s. For instance, let's assume we've got a package cabal-builddir-bug, which uses its Paths_cabal_builddir_bug module. Then:
# The following build command works file:
cabal build
# The following build command fails...
cabal build --builddir=foo:bar # fails with:
# ...with:
# <no location info>: error: [GHC-82272]
# module ‘Paths_cabal_builddir_bug’ cannot be found locally
Presumably, Cabal adds the argument to --builddir to the search path without escaping :'s.
To Reproduce
I've attached a reproducer which comes with a Makefile such that make build runs the failing build command. Steps to reproduce:
- Unpack the attached tarball.
- Run
make build.
cabal-builddir-bug-0.1.0.0.tar.gz
Expected behavior
I'd expect Cabal to escape :'s in the path on Unix systems. Presumably, Cabal should also escape ;'s in the path on Windows.
System information
- macOS 15
- Cabal 3.16.1.0
- Dominant language
- Haskell
- Stars
- 1.8k
- Forks
- 766
- Avg merge
- 5d 21h
- Merged PRs (30d)
- 27
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from haskell/cabal
-
needs triage type: enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 3 days
-
needs triage type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
haskell/cabal#12568 · 1 comment ·
Maintainers usually reply within 3 days
-
needs triage type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
haskell/cabal#12525 · 3 comments · 1 reaction ·
Maintainers usually reply within 3 days
-
Required version of `cabal-install` to build CabalPossibly taken @philderbeast claimed this 24 days ago. Opendocumentation type: discussion
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
haskell/cabal#12477 · 2 comments · 1 assignee ·
Maintainers usually reply within 3 days
-
Document which are our LTS releasesPossibly taken @KeuqS claimed this 41 days ago. Opendocumentation type: discussion
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
haskell/cabal#12373 · 2 comments ·
Maintainers usually reply within 3 days
Similar issues
-
bug desktop
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
simplex-chat/simplex-chat#8291 ·
Maintainers usually reply within 1 day
-
[BUG]: C# programs with top-level statements fail to compilePossibly taken @AsyncNigam claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
compiler-explorer/compiler-explorer#9625 · 1 comment ·
Maintainers usually reply within 1 day
-
reflex-0.10Open
Difficulty 1/5 Under an hour Newbie friendliness 62/100
commercialhaskell/stackage#8180 ·
Maintainers usually reply within 1 day
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
OpenZeppelin/canton-contracts#140 ·
Maintainers usually reply within 1 day
-
takeInterval yields nothing, dropInterval drops nothingPossibly taken @GuillaumedeVolpiano claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
composewell/streamly#3271 ·