Skip to content

cabal update creates dist-newstyle folder in $PWD #8589

Closed

Description

@Mistuke

Describe the bug
When cabal update is run this creates a new folder dist-newstyle in PWD.
This seems wrong as the command shouldn't pollute my PWD and will also
fail if ran in a read-only directory

To Reproduce
Steps to reproduce the behavior:

PS C:\Users\WDAGUtilityAccount\Desktop> mkdir temp

    Directory: C:\Users\WDAGUtilityAccount\Desktop

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----        11/13/2022   9:51 PM                temp


PS C:\Users\WDAGUtilityAccount\Desktop> cd .\temp\
PS C:\Users\WDAGUtilityAccount\Desktop\temp> cabal v2-update
Downloading the latest package list from hackage.haskell.org
Package list of hackage.haskell.org is up to date.
The index-state is set to 2022-11-13T17:52:14Z.
PS C:\Users\WDAGUtilityAccount\Desktop\temp> ls


    Directory: C:\Users\WDAGUtilityAccount\Desktop\temp


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----        11/13/2022   9:51 PM                dist-newstyle

Expected behavior
I don't expect this folder to be created. cabal update updates global state, so I don't understand the need for local storage.

System information

  • Operating system: Windows 11
  • cabal 3.8.1.0

Activity

  1. ulysses4ever commented on Nov 13, 2022

    @ulysses4ever
    Collaborator

    cabal repl -b suffers similarly: #8550

  2. gbaz commented on Nov 14, 2022

    @gbaz
    Collaborator

    expect this may be fixed by #8358 ?

  3. ulysses4ever commented on Nov 14, 2022

    @ulysses4ever
    Collaborator

    expect this may be fixed by #8358?

    No. See #8550 for discussion.

  4. added this to the Considered for 3.10 milestone on Dec 1, 2022
  5. arrowd commented on Jan 4, 2023

    @arrowd
    Collaborator

    I hope this will end up in the next 3.8 release.

  6. Mikolaj commented on Jan 5, 2023

    @Mikolaj
    Member

    @arrowd: 3.10 branch is about to be cut and this is intended to make it there. Unlikely to make it into a future 3.8 release, if any. (cc @andreasabel)

  7. juhp commented on Jan 6, 2024

    @juhp
    Collaborator

    Worthy of a backport I would say - it's a pretty bad 3.8 regression

    Looks like it is non-trivial though (ie #8627 doesn't apply to 3.8)

  8. gbaz commented on Jan 6, 2024

    @gbaz
    Collaborator

    the combination of #8358 and #8627 should prevent the creation of dist-newstyle in a directory with no package or project. In the case you run cabal update and there is a package, then dist-newstyle is still created, but I think this is fine.

    That said, I do not think we have further plans for a new 3.8 release, so I'm not sure of what the purpose of a backport would be...

  9. juhp commented on Jan 6, 2024

    @juhp
    Collaborator

    I created a backport intended for Fedora 39, which seems to work

  10. juhp commented on Jan 6, 2024

    @juhp
    Collaborator

    That said, I do not think we have further plans for a new 3.8 release,

    As I expected ;-(

    so I'm not sure of what the purpose of a backport would be...

    It is easier to pick commits from a stable branch than hunting around the project and then backporting...

    There are quite a few distros shipping 3.8 currently...

  11. gbaz commented on Jan 6, 2024

    @gbaz
    Collaborator

    In that case, I think a backport to the 3.8 branch would be welcome.

  12. juhp commented on Jan 6, 2024

    @juhp
    Collaborator

    Let me try then - anyway thanks #8358 and #8627 together indeed apply (my patch above basically just added the minimum from 8358)

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions