haskell / haskell/cabal

Remove the need to hardcode absolute paths for some entries in `.cabal/config`: support xdg home variables

Open
#1,857 15 comments 3 reactions 0 assignees View on GitHub
attention: pr-welcome cabal-install: other re: xdg type: enhancement
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

Hi!

I keep all my configuration files on github to have an easily reproducible environment on all my machines. I keep my `.cabal/config` file in there as well, and don't like the fact that some absolute paths have to be hardcoded (e.g. `remote-repo-cache`, `world-file` and `build-summary`). This is inconvenient if `$HOME` happens to be different on various machines (e.g. work vs home).

Some possible solutions (which could be wrong):
- Expand `~` in paths.
- Expand environment variables from the shell (perhaps even very specific ones)
- Allow usage of `$prefix` in all paths

If one of the above suggestions is worthwhile, I'd be up for implementing it. Just let me know :smile:

Thank you!

Contributor guide

Open the contributing guide

Research direction

Start by reviewing how .cabal/config handles remote-repo-cache, world-file, and build-summary paths. Compare the proposed ~, shell environment variables, and $prefix forms, then determine which path-expansion behavior is appropriate. Done means the selected form works without machine-specific absolute paths and is documented and tested.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
build-system, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.