Skip to content

Add support for CABAL_PROJECT_FILE environment variable #6051

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

Open
fghibellini opened this issue May 18, 2019 · 2 comments
Open

Add support for CABAL_PROJECT_FILE environment variable #6051

fghibellini opened this issue May 18, 2019 · 2 comments

Comments

@fghibellini
Copy link

The v2 API of Cabal uses cabal.project files to specify configuration, but this file currently has to be supplied through the --project-file flag.

This is painful as new-config doesn't persist this flag so the user has to supply it on each invocation of new-build. Environment variables are also easier to set from "virtual environment" providing tools like nix-shell.

My specific usecase is having a default cabal.project containing source-repository-package sections which is used for a normal cabal-resolved build, while at the same time having a second cabal.project file in a different folder having no such references since all the package overrides would be handled by Nix (see note in my haskell nix tutorial).

I am willing to implement it myself (or at least try).

@danwdart
Copy link

I love this idea. We can set the env in the nix file or in a .env with an .envrc with use env.
How far has it got?

@ulysses4ever
Copy link
Collaborator

@danwdart seems like nowhere but it did sound like a good feature to have

@ulysses4ever ulysses4ever added the re: project-file Concerning cabal.project files label May 29, 2025
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

4 participants