You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Should be possible to define builddir in cabal.config #2484
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.
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).
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.
@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.
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.
Activity
ttuegel commentedon May 14, 2015
Another use case: I would like to put
into my
$HOME/.cabal/configto 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).mietek commentedon May 15, 2015
👍
ttuegel commentedon May 15, 2015
Actually, it's impossible to implement my request because doing the
PathTemplatesubstitution requires having theLocalBuildInfoavailable, but it won't be available until thebuilddiris known.Get 'builddir' from cabal.config or CABAL_BUILDDIR
psibi commentedon May 24, 2015
@edsko I have a working version for this requirement. It reads the
builddirattribute from project's cabal file and then builds them in that directory. These are the files which are under the directory as mentioned inbuilddirattribute:Note that it doesn't have the directory named
distwhich I guess is produced duringcabal configurestep. If you can confirm that this is the use-case you were looking for, I can submit a pull request.CC: @23Skidoo @ttuegel
Get 'builddir' from cabal.config or CABAL_BUILDDIR
ttuegel commentedon May 24, 2015
I just opened #2608 with the patch I've been using for this. It reads
builddireither from thecabal.configor from theCABAL_BUILDDIRenvironment variable. (Or from the command-line, of course.) If that's not sufficient for anyone's needs, let me know.Get 'builddir' from cabal.config or CABAL_BUILDDIR
Get 'builddir' from cabal.config or CABAL_BUILDDIR
Get 'builddir' from cabal.config or CABAL_BUILDDIR