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 install does not accept relative dirs in --store-dir (but cabal build does) #7812

Open
andreasabel opened this issue Nov 11, 2021 · 2 comments
Labels
can-workaround There is a (maybe partial) workaround for the issue or missing feature re: store-dir On local nix store (option `--store-dir`) type: enhancement

Comments

@andreasabel
Copy link
Member

andreasabel commented Nov 11, 2021

Installation aborts in the middle when a relative path is passed to --store-dir:

$ cabal --store-dir=. install hello
...
In order, the following will be built (use -v for more details):
 - hello-1.0.0.2 (exe:hello) (requires build)
...
Configuring hello-1.0.0.2...
Error: cabal: expected an absolute directory name for --prefix:
./ghc-9.2.1/hll-1.0.0.2-1e2f3837

Error: cabal: Failed to build hello-1.0.0.2. The failure occurred during the
configure step.

$ tree
.
└── ghc-9.2.1
    └── package.db
        ├── package.cache
        └── package.cache.lock

In contrast.

$ cabal --store-dir=$PWD install hello

succeeds.

Would a simple fix be to turn the --store-dir into an absolute path just after parsing this command line argument?

This issue came up before, see #7130 (comment); in #7130 (comment) @phadej invites PRs. A systematic fix has been started in #6667 but is unfinished.

UPDATE: looks like I duplicated #7760.

@jneira
Copy link
Member

jneira commented Nov 12, 2021

Dont worry, closing mine. there we also linked as related #6977 and #4097.
I reproduced the error in windows with cabal-3.6.2.0 but any cabal version would do afaiu

@jneira
Copy link
Member

jneira commented Nov 12, 2021

Well i liked the title of mine one but whatever: cabal install does not accept relative dirs in --store-dir (but cabal build does)

@andreasabel andreasabel added the can-workaround There is a (maybe partial) workaround for the issue or missing feature label Nov 12, 2021
@andreasabel andreasabel changed the title Turn --store-dir argument into absolute path? cabal install does not accept relative dirs in --store-dir (but cabal build does) Nov 12, 2021
@gbaz gbaz added this to the Considered for 3.4 milestone Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
can-workaround There is a (maybe partial) workaround for the issue or missing feature re: store-dir On local nix store (option `--store-dir`) type: enhancement
Projects
None yet
Development

No branches or pull requests

3 participants