haskell / haskell/cabal

Relative paths in cabal.project files don't work as expected

Open
#5,881 2 comments 1 reaction 0 assignees View on GitHub
documentation type: discussion
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

I want to pass some options to a dependency. So I added the flags to my cabal.project file as follows.

```
package groups
ghc-options: -fwrite-ide-info -hiedir=./test/hie-files
```

However, now `groups` is rebuilt but the `hie` files are not in the directory I specified and nor are they anywhere to be seen at all! I can't find them anywhere in my home directory.

If I write an absolute path it works fine.

Why I consider this a bug, if I `cabal get groups`, modify the cabal file to add the ghc-options and add it as a local dependency then the path is resolved relative to the cabal file.

Contributor guide

Open the contributing guide

Research direction

Start with the cabal.project package stanza containing ghc-options and compare how relative paths are handled for a local dependency versus the external groups dependency obtained with cabal get. Reproduce the -hiedir behavior, then confirm that the generated HIE files appear in the documented relative location without requiring an absolute path.

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
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.