haskell / haskell/cabal

Configuration file not found when using --project-file

Open
#9,704 2 comments 0 reactions 0 assignees View on GitHub
needs triage type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

**Describe the bug**

`cabal` says it cannot find a file that exists.

**To Reproduce**

Create a file called "repos.config" and add the following configuration in it:

```cabal
repository hackage.haskell.org
url: https://hackage.haskell.org/
secure: True
```

Then run:

```bash
$ cabal -v3 --project-file=repos.config update
Warning: this is a debug build of cabal-install with assertions enabled.
The given project file 'repos.config' does not exist.
```

```
❯ file repos.config
repos.config: ASCII text
❯ cat repos.config
───────┬─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ File: repos.config
───────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
1 │ repository hackage.haskell.org
2 │ url: https://hackage.haskell.org/
3 │ secure: True
───────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
❯ cabal --project-file=repos.config update
Warning: this is a debug build of cabal-install with assertions enabled.
The given project file 'repos.config' does not exist.
```

**System information**
- OS: Fedora 39
- `cabal`: 3.11.0.0 (HEAD)

I might be missing something but I can't see it right now.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing `cabal --project-file=repos.config update` with the configuration shown, then trace how the CLI resolves the project-file path before checking whether it exists. Done means an existing `repos.config` is accepted and the update command proceeds without the incorrect missing-file warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.