Support for dist-newstyle outside of project directory #8809
Labels
cabal-install: nix-local-build
re: builddir
re: config-file
Concerning the cabal configuration file and the `--config-file` option
status: consider closing
type: enhancement
Uh oh!
There was an error while loading. Please reload this page.
This is a feature request, and if it's out of scope for this project, just shoot it down, but I wanted to get it out there because I don't see that this request has come up before. First I'll describe an analogous feature that the vim text editor has, and then I'll describe how this might look for cabal and why it would be useful.
Vim
Vim has a feature that lets the user control where
swp
files. By default, aswp
file is in the same directory as the text file that it refers to. For example, if I open a file at/home/andrewthad/docs/prose.txt
, vim creates/home/andrewthad/docs/.prose.txt.swp
. However, in vim, this behavior is configurable. With the commandThe same
swp
file would then be created at/home/andrewthad/.vim/swap_files/home/andrewthad/docs/.prose.txt.swp
. That is, vim recreates the absolute path underneath a base directory.Cabal
For cabal, the analogous feature that I envision gives the user greater control over the location of
dist-newstyle
. Why is this useful?.gitignore
files (although this is pretty common in grep replacements), and even for those that are aware will not understand that they should ignore thedist-newstyle
directory in a project that was copied to the local filesystem withcabal unpack
instead ofgit clone
.It is mostly possible for users to accomplish all of these with the right shell scripts and tooling (except in cases where someone passes something odd to
--builddir
, but I usually use names likedist-8.10.7
to make it clear what's going on), but all of these become trivial if cabal directly supports a feature to keep build artifacts out of projects.The way I imagine that this would work is that a directory for build artifacts would be specified in
~/.cabal/config
(maybe the name for this setting would bebuild-artifacts-directory
), and this could not be overridden at the CLI.I'm not familiar with cabal's code, so there might be compelling technical reasons to not do this. Or this might just be out of scope because of difficulty maintaining it or the confusion resulting from users having different setups. But if it seems worthwhile, I could look into implementing this.
The text was updated successfully, but these errors were encountered: