haskell / haskell/cabal

option `--enable-relocatable` ignored in `new-build`

Open
#5,551 8 comments 0 reactions 0 assignees View on GitHub
cabal-install: v2-build system type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

**Report**: after building with `--enable-relocatable` I expect packages built in my cabal store (`~/.cabal`) to only contain relative paths. This is not the case. For example, `~/.cabal/store/ghc-8.4.3/package.db/async-2.2.1-f6fb9f5a60e7ad9ce092fee6ef572c10f40bde7d58e9da909b9bc7ccddb27749.conf` mentions:

```
import-dirs: /home/martijn/.cabal/store/ghc-8.4.3/async-2.2.1-f6fb9f5a60e7ad9ce092fee6ef572c10f40bde7d58e9da909b9bc7ccddb27749/lib
```

I believe either the documentation should be more explicit about what the flag tries to achieve, or cabal should produce relative paths.

**Use case**: I need to ship packages bundled with a program I'm trying to package as a snap/flatpack/deb. It's not enough to simply incorporate the library files in the binary, as I explicitly need the packages themselves. Right now, I'm trying to manually rewrite the paths mentioned in `~/.cabal`. If there's a better way, I'd love to hear it.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing `new-build --enable-relocatable` and inspect the generated package `.conf` files under `~/.cabal/store`, especially `import-dirs`. Determine whether the expected outcome is relative paths or clearer documentation; done means the behavior matches the clarified expectation and the reported package-store case is covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
build-system, cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.