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 v2-install does not modify the environment file when using --write-ghc-environment=always #7230

Closed
eed551 opened this issue Jan 8, 2021 · 2 comments

Comments

@eed551
Copy link

eed551 commented Jan 8, 2021

cabal v2-install does not modify the environment variable.

Steps to reproduce the behavior:
$cabal v2-install name_of_package --write-ghc-environment=always --package-env=def.env --overwrite-policy=always

Up to date

However, the file def.env is not modified. I can check that if I introduce a syntactical error in the def.env file I get the following message:

Warning: The environment file current_path/def.env is unparsable.
Libraries cannot be installed.

By the way I do not know why it is said "Up to date" since the package does not appear in the default environment variable and, if I try to use it to install another Cabal package, it is said that is is "unknown".

I was expecting that the def.env file would be modified.

  • Operating system: Ubuntu 20
  • `Cabal version 3.4.0.0
  • ghc version 8.10.3

The motivation for my question is that my packages that are "installed" with Cabal do not appear in the default environment (and not in the ghc-pkg list either) and are "unknown" when I try to install other packages that depend on them. I wanted to enforce Cabal to register them.

@fgaz
Copy link
Member

fgaz commented Jan 20, 2021

I think you may want --lib instead of -write-ghc-environment=always. cabal install without --lib is for exes. also beware that cabal install --lib does not work as well as it should, and there's discussion going on about a replacement: #6481

@fgaz fgaz changed the title cabal v2-install does not modify the environment variable cabal v2-install does not modify the environment file when using --write-ghc-environment=always Jan 20, 2021
@gbaz
Copy link
Collaborator

gbaz commented Mar 21, 2021

At this point I think the question was resolved and I'm going to close this ticket.

@gbaz gbaz closed this as completed Mar 21, 2021
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

3 participants