Skip to content

RFC: Rename dist-newstyle/ #5731

Closed as not planned
Closed as not planned

Description

@hvr

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:

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
  • dist might be considered a misnomer as dist/ 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 --builddir flag! There is no --distdir flag) where cabal stores its caches and compile output (and also sdists); it's not clear why dist/ was chosen as the default builddir originally many years ago
  • cabal v2-sdist all currently places its files into dist-newstyle/sdist/*.tar.gz
  • Tooling that needs to locate the --builddir folder needs to take into account that the default builddir can be tweaked via ~/.cabal/config and so either needs to query the current default builddir (we might need a cabal path ... command or something) or if it invokes cabal set it explicitly via --builddir

Activity

  1. added
    cabal-install: v2-build system
    on Nov 26, 2018
  2. added this to the 3.0 milestone on Nov 26, 2018
  3. typedrat commented on Nov 26, 2018

    @typedrat
    Collaborator

    +1 for dist/ or v2-dist/, with our current dist/ becoming v1-dist/.

  4. phadej commented on Jan 8, 2019

    @phadej
    Collaborator

    I'm strongly against anything without dist prefix.

    Somehow

    dist
    dist-*
    

    .gitignore is prettier than variants (IMHO). (I do also use a lot of custom named, yet dist-something matching --builddirs ).

  5. 23Skidoo commented on Jan 8, 2019

    @23Skidoo
    Member

    How about dist/v2?

  6. Mistuke commented on Jan 8, 2019

    @Mistuke
    Collaborator

    Personally I prefer .build as I never really understood why it's called a dist, always been rather confusing especially since cabal sdist doesn't put things in dist (off the top of my head). Though I'm fine with dist/v2/ and dist/2/

  7. fommil commented on Jan 8, 2019

    @fommil
    Contributor

    I prefer dist (or something under it) so that existing .gitignore configurations 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 .cabal

  8. 23Skidoo commented on Jan 15, 2019

    @23Skidoo
    Member

    .cabal would clash with ~/.cabal, I'd prefer something like .cabal-build or .cabal-work if we were to ditch dist.

  9. hvr commented on Jan 15, 2019

    @hvr
    MemberAuthor

    .cabal would clash with ~/.cabal

    btw, why is that a problem? what scenario are you worried about?

  10. 23Skidoo commented on Jan 16, 2019

    @23Skidoo
    Member

    Someone running cabal clean in the home directory for example.

  11. hvr commented on Jan 16, 2019

    @hvr
    MemberAuthor

    I see... btw, that can already cause problems if you configure builddir: .cabal yourself in ~/.cabal/config...

    Even if we don't go for builddir: .cabal we should IMO add some sanity check to cabal which checks for whether builddir points to the basedir of CABAL_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 as dist), or a versioned .cabal3 or ._cabal (so weirdly named it surely won't clash with anything) :-)

  12. 23Skidoo commented on Jan 16, 2019

    @23Skidoo
    Member

    btw, that can already cause problems if you configure builddir: .cabal yourself in ~/.cabal/config...

    Yeah, but most people stick to defaults. Agreed that more sanity checking is never bad.

  13. chshersh commented on Apr 13, 2019

    @chshersh
    Member

    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 .cabal is a good name. I usually refer to package-name.cabal file as simply .cabal file by referring to the extension and omitting name of the package. Having .cabal directory will complicate things.

    P.S. Sorry, fat-fingered

  14. 51 remaining items

  15. jneira commented on Dec 3, 2022

    @jneira
    Member

    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

  16. orome commented on Dec 3, 2022

    @orome

    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.

  17. andreasabel commented on Dec 4, 2022

    @andreasabel
    Member

    @orome: Isn't there a misunderstanding? The discussion here is not about ~/.cabal.
    What is the scenario that dist-newstyle ends up directly under ~?

  18. orome commented on Dec 4, 2022

    @orome

    What is the scenario that dist-newstyle ends up directly under ~?

    That's where I see it. If it were under ~/.cabal there would be no issue.

  19. emilypi commented on Dec 4, 2022

    @emilypi
    Member

    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.

  20. orome commented on Dec 4, 2022

    @orome

    @emilypi Not sure what you mean. Should I be seeing it under ~ or should I be using it under ~/.cabal It 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.

  21. emilypi commented on Dec 4, 2022

    @emilypi
    Member

    @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 building dist-newstyle objects in ~ never been the specification unless you're building a project from a .cabal file specified in ~. In which case, stop that if you don't like it - you're specifiying the project root to be ~! The convention is that dist-newstyle always 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-newstyle objects always default to being built relative to the project root.

  22. orome commented on Dec 4, 2022

    @orome

    @emilypi I'm not so sure myself. All I know is that it appears when I run cabal update in ~. 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.

  23. andreasabel commented on Dec 4, 2022

    @andreasabel
    Member

    @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.

  24. emilypi commented on Dec 4, 2022

    @emilypi
    Member

    Aha! Glad we dug down into your issue @orome.

  25. jeltsch commented on Feb 16, 2024

    @jeltsch

    I’ve been seeing the naming dist-newstyle as 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:

    • The changes would be spread across many projects and developers, so that the effort per project or person would be rather small.
    • Cosmetics or, more general, beauty is important.
    • It’s not only about cosmetics but also about comprehensibility. The name dist-newstyle gives 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 "$@".

  26. andreasabel commented on Feb 17, 2024

    @andreasabel
    Member

    Note that renaming dist-newstyle would essentially force third-party tools to support both dist-newstyle and the new name because not all of the world switches cabal version in a single moment (you'll have years of transition...).

    @jeltsch wrote:

    • The changes would be spread across many projects and developers, so that the effort per project or person would be rather small.

    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’ll at least create my own little corner of beauty on my laptop with a wrapper script that invokes cabal --builddir=.build-products "$@".

    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.

  27. jeltsch commented on Feb 24, 2024

    @jeltsch

    for the sake of removing a wart that violates your sense of aesthetics

    the cosmetic surgery

    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).

    Sorry to put it so bluntly.

    Feel free to react bluntly, but please read carefully the message you react to. 🙂

  28. mouse07410 commented on Feb 24, 2024

    @mouse07410
    Collaborator

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cabal-install: v2-build systemresolution: wontfixtype: RFCtype: discussion

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions