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

Option giving the project root directory #8037

Closed
andreasabel opened this issue Mar 9, 2022 · 5 comments · Fixed by #8454
Closed

Option giving the project root directory #8037

andreasabel opened this issue Mar 9, 2022 · 5 comments · Fixed by #8454
Labels
re: project root Concerning what cabal considers the root of the project type: discussion type: enhancement

Comments

@andreasabel
Copy link
Member

I think it would be good if one could override the current working directory with a flag, similar to make -C <root-dir>. I'd want this e.g. for executing an non-installed agda living in source tree /agda-root/ from some wd /bar/.

/bar/$ cabal run --project-root=/agda-root agda -- someFile.agda

The name of this option could be bikeshed, e.g. --project-root, --projectdir, --directory (good old make).
We already have option --project-file, but there are projects that do not have such a file (just a .cabal file).

@cydparser
Copy link
Collaborator

I've implemented this in PR #8454

Please feel free to discuss/bikeshed in the PR.

@Mikolaj
Copy link
Member

Mikolaj commented Oct 17, 2022

Could I ask for help reviewing the PR fixing this issue (#8454)? Even a cursory look and a comment whether this might fix your use case (bonus points for checking out and confirming) would be very much appreciated.

@Mikolaj
Copy link
Member

Mikolaj commented Nov 23, 2022

A new proposal dropped at #8454. Could you kindly voice your opinion?

@mergify mergify bot closed this as completed in #8454 Mar 1, 2023
@andreasabel
Copy link
Member Author

PR #8454 has not addressed the OP, at least with the latest cabal (3.12.1.0) cabal run --project-root=... does not work:

$ cabal run --project-root=$HOME/play/haskell/cabal-clean
Error: cabal: unrecognized 'run' option
`--project-root=/Users/abel/play/haskell/cabal-clean'

@andreasabel
Copy link
Member Author

Sorry, the option name is --project-dir, and that works (since 3.12).
Thanks!

@andreasabel andreasabel added this to the Considered for 3.12 milestone Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
re: project root Concerning what cabal considers the root of the project type: discussion type: enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants