Skip to content

Should be possible to define builddir in cabal.config #2484

Closed

Description

@edsko

Currently the only way we can pass builddir is through a command line option. Since I use different build directories for dfiferent versions of GHC, it would be very convenient if I could specify

builddir: <something>

in my project-local cabal.config file, and then specify a different cabal.config file using the CABAL_CONFIG environment variable (cabal.config-7.8.4, say). Currently specifying builddir in config file is explicit disallowed (configFieldDescriptions in Config.hs); I tried removing this and that stopped cabal from complaining about an unrecognized builddir option, but it still didn't take it into account either. I don't know cabal's command line/config option system well enough to fix this.

Activity

  1. added this to the milestone on Apr 25, 2015
  2. ttuegel commented on May 14, 2015

    @ttuegel
    Member

    Another use case: I would like to put

    builddir: /tmp/cabal-dist-$pkgid
    

    into my $HOME/.cabal/config to keep in-tree builds off my SSD. Why? All my in-tree builds are for development purposes; I'm never actually interested in keeping the build artifacts across rebuilds. I have tmpfs mounted at /tmp, and it's faster to keep such things in RAM (less wear on my drive, too).

  3. mietek commented on May 15, 2015

    @mietek
    Contributor

    👍

  4. ttuegel commented on May 15, 2015

    @ttuegel
    Member

    Actually, it's impossible to implement my request because doing the PathTemplate substitution requires having the LocalBuildInfo available, but it won't be available until the builddir is known.

  5. added a commit that references this issue on May 16, 2015
    1bff553
  6. psibi commented on May 24, 2015

    @psibi

    @edsko I have a working version for this requirement. It reads the builddir attribute from project's cabal file and then builds them in that directory. These are the files which are under the directory as mentioned in builddir attribute:

    $ ls
    setup  setup-config
    

    Note that it doesn't have the directory named dist which I guess is produced during cabal configure step. If you can confirm that this is the use-case you were looking for, I can submit a pull request.

    CC: @23Skidoo @ttuegel

  7. added a commit that references this issue on May 24, 2015
    fce6c6b
  8. ttuegel commented on May 24, 2015

    @ttuegel
    Member

    I just opened #2608 with the patch I've been using for this. It reads builddir either from the cabal.config or from the CABAL_BUILDDIR environment variable. (Or from the command-line, of course.) If that's not sufficient for anyone's needs, let me know.

  9. added a commit that references this issue on May 25, 2015
    2fd2a71
  10. added 2 commits that reference this issue on Jun 21, 2015
    ac5e0d2
    2b3282f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions