Skip to content

Option giving the project root directory #8037

Closed

Description

@andreasabel

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).

Activity

  1. added
    re: project root
    on Aug 19, 2022
  2. cydparser commented on Sep 6, 2022

    @cydparser
    Collaborator

    I've implemented this in PR #8454

    Please feel free to discuss/bikeshed in the PR.

  3. Mikolaj commented on Oct 17, 2022

    @Mikolaj
    Member

    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.

  4. Mikolaj commented on Nov 23, 2022

    @Mikolaj
    Member

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

  5. andreasabel commented on Aug 27, 2024

    @andreasabel
    MemberAuthor

    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'
    
  6. andreasabel commented on Aug 27, 2024

    @andreasabel
    MemberAuthor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    re: project roottype: discussiontype: enhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions