Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cabal repl and the Paths_mypackage module #1842

Open
copumpkin opened this issue May 4, 2014 · 3 comments
Open

cabal repl and the Paths_mypackage module #1842

copumpkin opened this issue May 4, 2014 · 3 comments

Comments

@copumpkin
Copy link
Member

I'm not sure if this is intended behavior, but I'd expect the Paths_<mypackage> module to point somewhere meaningful when I'm running in cabal repl. It seems to point to my user directory when I'd expect it to point to the current package root.

@samdoshi
Copy link

samdoshi commented May 4, 2014

Just to say that cabal run works fine, but cabal repl doesn't.

As a temporary work around you can set the enviroment variable <mypackage>_datadir, e.g.

$ export <mypackage>_datadir=$PWD
$ cabal repl

or

$ <mypackage>_datadir=$PWD cabal repl

(replace $PWD with the location of your data directory if it is not the current working dir)

@david-christiansen
Copy link
Contributor

I just tried this out, and it's now pointing at the directory in my sandbox where cabal install puts files. The paths module points at the project root (or data dir) when using cabal run. I would expect those to agree, typically.

@ttuegel ttuegel added this to the Cabal-1.24 milestone Apr 24, 2015
@Ericson2314
Copy link
Collaborator

The trick works for cabal repl for me. But I too get something dist-related for cabal run, so I assume that cabal run also sets the environment variable.

cc @kmicklas

@23Skidoo 23Skidoo modified the milestones: Cabal 1.24, Cabal 1.26 Feb 21, 2016
@ezyang ezyang modified the milestone: Cabal 2.0 Sep 6, 2016
lspitzner added a commit to lspitzner/ghcid that referenced this issue Jul 9, 2020
cabal repl switches current directory for subpackages of
a project, resulting in error paths relative to some
subdirectory. This confuses downstream tooling.

Related cabal tickets are
haskell/cabal#5001
haskell/cabal#1842

Gated behind the newly added flag --force-absolute-paths
lspitzner added a commit to lspitzner/ghcid that referenced this issue Jul 9, 2020
cabal repl switches current directory for subpackages of
a project, resulting in error paths relative to some
subdirectory. This confuses downstream tooling.

Related cabal tickets are
haskell/cabal#5001
haskell/cabal#1842

Gated behind the newly added flag --force-absolute-paths
lspitzner added a commit to lspitzner/ghcid that referenced this issue Apr 16, 2021
cabal repl switches current directory for subpackages of
a project, resulting in error paths relative to some
subdirectory. This confuses downstream tooling.

Related cabal tickets are
haskell/cabal#5001
haskell/cabal#1842

Gated behind the newly added flag --force-absolute-paths
lspitzner added a commit to lspitzner/ghcid that referenced this issue Mar 14, 2022
cabal repl switches current directory for subpackages of
a project, resulting in error paths relative to some
subdirectory. This confuses downstream tooling.

Related cabal tickets are
haskell/cabal#5001
haskell/cabal#1842

Gated behind the newly added flag --force-absolute-paths
lspitzner added a commit to lspitzner/ghcid that referenced this issue Mar 1, 2024
cabal repl switches current directory for subpackages of
a project, resulting in error paths relative to some
subdirectory. This confuses downstream tooling.

Related cabal tickets are
haskell/cabal#5001
haskell/cabal#1842

Gated behind the newly added flag --force-absolute-paths
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants