-
Notifications
You must be signed in to change notification settings - Fork 697
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
Supporting builddir in cabal.project and global config #5271
Comments
I think it won't be that easy. There is a knot:
So |
Maybe we should bite the bullet and stop caching of |
Well, we can just parse the cabal.project, check what the builddir is, THEN check with the cache if anything changed and things need to be rerun. Sure, that introduces a redundant read/parse of cabal.project if the config hasn't changed, but I doubt reading and parsing cabal.project is so slow that it will noticeably impact the speed of any cabal command. |
@merijn the problem is that you're assuming that we've already fully implemented all features; but there's more planned, like file-globbing |
I think the ability to specify a builddir loses most of it's value if you can't do it per-project and you have to always specify it on the commandline for each command. At that point, why even support specifying a custom builddir at all? |
Looks like it's not certain we actually want to implement this, so labeled as "discussion". |
I've also had issues with the stored (outdated) config overwriting command line settings for store-dir. I have not opened a Ticket on that yet as it's not quite clear to me when that happens. |
I had a brief discussion with @alexbiehl for two potential pragmatic workarounds; either,
The latter approach could be implemented as follows: The key/value pair
we can validate this easily when doing a full parse of the Then scanning is very cheap, assuming that
|
I lean towards the second solution. |
The second approach feels very restrictive. I can imagine someone asking for
why one would like to do that? So one can access Parsing
And if that will become a problem, we can cache the parsed |
As #6849 was closed as duplicate of this I'd like to bring in some points mentioned there.
|
The core problem is that So having TL;DR it's not as simple as adding a field to config. The |
Renaming the issue to include global config, as #6849, mentioning it, was closed as duplicate of this |
See also #7924 for a much more modest related task. |
Why do some users even want to change the name of the build directory? At least I want to change it because the current name is bad in several ways:
Maybe just switch to a better name, like |
By the way, from experiments I get the impression that the |
@jeltsch that is common misconception that Even |
Interesting! What are actually the cabal-install subcommands that do not accept |
To the best of my knowledge,
new-X
don't currently obeybuilddir
entries in cabal.project. There was some speculation that there was a technical reason for this, but at first glance of the code it just seems the problem is laziness. That is, all code paths dealing with computing the DistDirLayout try and resolve the cabal.project path and builddir in a single step.It seems fairly straightforward* to split this into two steps, first looking up cabal.project and the project path, then checking establishing the DistDirLayout after that. I would assume that the logical priority for determining builddir would be:
--builddir
flagdist-newstyle
If no one has any theoretical objections I'll try and see if I can get it working as straightforwardly as I hope it to be :p
[*] - Famous last words.
The text was updated successfully, but these errors were encountered: