Repository navigation
Description
NB: I want to emphasize, this is about the default folder name which the user can always override in their ~/.cabal/config, (in future) via cabal.project, or via CLI; tooling must not assume the folder to be named in a certain way unless it either a) forces a specific folder name or b) infers the currently active name (ideally by querying cabal)
When cabal new-build premiered in cabal 1.24, the provisional name dist-newstyle/ for the new-build specific dist/ folder (i.e. the default --builddir) was chosen in order to reduce the likelihood of old-build / new-build stepping on each others toes when mixing the command families.
However, now the time has come (since cabal 3.0 will be disruptive anyway by changing what cabal build means in the UI -- NB: #5800 switch defaults to v2 got merged to master already!) to rename the dist-newstyle to its final name;
Ideally the name should be reasonably short (to reduce risk of PATH_MAX issues as well make the output less noisy) and it should be a name that is reasonably unlikely to clash with filenames users would want to place into their cabal package folders.
So here's some ideas to start the bikeshedding:
dist/dist.v2/(ordist-v2/orv2-dist/)builddir/dist/v2(suggested in RFC: Renamedist-newstyle/#5731 (comment))
Prefixing with a . would reduce the likelihood of clashes as well as get them out of sight for unix shell users:
.dist/.build/.builddir/.cabal/
For Windows, the above could instead use _s (this scheme is somewhat popular in the Python ecosystem iirc):
_dist/_build/_builddir/_cabal/
PS: Additional things to consider:
- @23Skidoo brought up that people will have to modify their
.gitignores distmight be considered a misnomer asdist/isn't so much about generating artifacts for distribution but it's really more about being a build dir (NB: it can be controlled by the--builddirflag! There is no--distdirflag) where cabal stores its caches and compile output (and also sdists); it's not clear whydist/was chosen as the default builddir originally many years agocabal v2-sdist allcurrently places its files intodist-newstyle/sdist/*.tar.gz- Tooling that needs to locate the
--builddirfolder needs to take into account that the default builddir can be tweaked via~/.cabal/configand so either needs to query the current default builddir (we might need acabal path ...command or something) or if it invokescabalset it explicitly via--builddir
Activity
typedrat commentedon Nov 26, 2018
+1 for
dist/orv2-dist/, with our currentdist/becomingv1-dist/.phadej commentedon Jan 8, 2019
I'm strongly against anything without
distprefix.Somehow
.gitignoreis prettier than variants (IMHO). (I do also use a lot of custom named, yetdist-something matching--builddirs ).23Skidoo commentedon Jan 8, 2019
How about
dist/v2?Mistuke commentedon Jan 8, 2019
Personally I prefer
.buildas I never really understood why it's called adist, always been rather confusing especially since cabal sdist doesn't put things in dist (off the top of my head). Though I'm fine withdist/v2/anddist/2/fommil commentedon Jan 8, 2019
I prefer
dist(or something under it) so that existing.gitignoreconfigurations continue to work and we don't clash with any directory names that anybody may be using in their projects.If breaking is acceptable, I prefer
.cabal23Skidoo commentedon Jan 15, 2019
.cabalwould clash with~/.cabal, I'd prefer something like.cabal-buildor.cabal-workif we were to ditchdist.hvr commentedon Jan 15, 2019
btw, why is that a problem? what scenario are you worried about?
23Skidoo commentedon Jan 16, 2019
Someone running
cabal cleanin the home directory for example.hvr commentedon Jan 16, 2019
I see... btw, that can already cause problems if you configure
builddir: .cabalyourself in~/.cabal/config...Even if we don't go for
builddir: .cabalwe should IMO add some sanity check to cabal which checks for whetherbuilddirpoints to the basedir ofCABAL_CONFIG's current path, unless there's a legitimate scenario where you'd want to place your cabal config file into cabal's work folder.btw, we could also go for a folder
.cbl(would be as short asdist), or a versioned.cabal3or._cabal(so weirdly named it surely won't clash with anything) :-)23Skidoo commentedon Jan 16, 2019
Yeah, but most people stick to defaults. Agreed that more sanity checking is never bad.
chshersh commentedon Apr 13, 2019
I would like to add couple thoughts to the discussion. I don't think that having different names for Linux and Windows is a good idea. This will make harder for people to help beginners, because you can't just tell look at this
directory. Also, I don't think that.cabalis a good name. I usually refer topackage-name.cabalfile as simply.cabalfile by referring to the extension and omitting name of the package. Having.cabaldirectory will complicate things.P.S. Sorry, fat-fingered
51 remaining items
jneira commentedon Dec 3, 2022
and there is a small advantage: it is more probable to not reach the windows path limit
I guess some packages uploaded before v2 chose its name to not reach it
orome commentedon Dec 3, 2022
It could be called anything, but if it's going to be in
~on macOS, it should be hidden by default. Our policies here delete it along with any other visible cruft in~as part of routine maintenance.andreasabel commentedon Dec 4, 2022
@orome: Isn't there a misunderstanding? The discussion here is not about
~/.cabal.What is the scenario that
dist-newstyleends up directly under~?orome commentedon Dec 4, 2022
That's where I see it. If it were under
~/.cabalthere would be no issue.emilypi commentedon Dec 4, 2022
Except then you've got package build data bleeding into the home user space and it severely overcomplicates things, because you also need a project directory indexing convention and it mixes concerns with other install/caching objects. I'd be extremely opposed to that.
orome commentedon Dec 4, 2022
@emilypi Not sure what you mean. Should I be seeing it under
~or should I be using it under~/.cabalIt shouldn't be under~(at least not if it's visible), I agree. But it is. I have no idea why. I've done everything by the book.emilypi commentedon Dec 4, 2022
@orome: I'm not sure what you're referring to at this point. You need to clarify what you mean by "seeing it". What's "it"?
dist-newstyle? If so, defaulting to buildingdist-newstyleobjects in~never been the specification unless you're building a project from a.cabalfile specified in~. In which case, stop that if you don't like it - you're specifiying the project root to be~! The convention is thatdist-newstylealways occurs in the project root namespace, which doesn't require~to function: it can be in/for all Cabal cares. As long as that's the project root specified by the build file.dist-newstyleobjects always default to being built relative to the project root.orome commentedon Dec 4, 2022
@emilypi I'm not so sure myself. All I know is that it appears when I run
cabal updatein~. If that's not what I'm supposed to do for user global, then where should I be running it? If it is, then that's the problem: it should not add a visible file there.andreasabel commentedon Dec 4, 2022
@orome: The problem you describe is discussed there:
Here it is only about the naming of
dist-newstyle, which of course should not end up in~in usual circumstances.emilypi commentedon Dec 4, 2022
Aha! Glad we dug down into your issue @orome.
jeltsch commentedon Feb 16, 2024
I’ve been seeing the naming
dist-newstyleas an issue for quite a long time, but I’ve found this GitHub issue only now. Interesting to skim through the comments.An argument that has been brought forward several times is more or less that a change of this name would cause too much effort for thousands of packages for a purely cosmetic change. I don’t really share this argument, for two reasons:
dist-newstylegives completely wrong suggestions, as it essentially implies that the contents of this directory are about distribution and that they belong to a specific style that is still new.So I still see a change in naming of said directory worth considering. For the time being, I’ll at least create my own little corner of beauty on my laptop with a wrapper script that invokes
cabal --builddir=.build-products "$@".andreasabel commentedon Feb 17, 2024
Note that renaming
dist-newstylewould essentially force third-party tools to support bothdist-newstyleand the new name because not all of the world switches cabal version in a single moment (you'll have years of transition...).@jeltsch wrote:
So you would impose this busy-work on all these projects and developers for the sake of removing a wart that violates your sense of aesthetics?
I think this is the way to go until a majority does so as well, and then this majority can collect the funds to pay for the cosmetic surgery.
Sorry to put it so bluntly.
jeltsch commentedon Feb 24, 2024
In my previous comment, I argued precisely why this is not just a cosmetic issue and also why this is not just a personal issue of mine (there are objective reasons against the name
dist-newstyle).Feel free to react bluntly, but please read carefully the message you react to. 🙂
mouse07410 commentedon Feb 24, 2024
IMHO, there are great many places and efforts that works benefit the community far more than this (IMHO, misguided) suggestion. I'm strongly against it.
Besides, I don't see how a change on a project would be cheaper if it impacts/hurts not a few but many - e.g., if you break a leg, would you feel any less pain if you knew that 10000 of other developers suffered the same?
Finally, yes - I agree: it would be good for everybody to read carefully what they're responding to. That includes the author of the previous comment.