Skip to content
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

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

Closed
Mistuke opened this issue Nov 13, 2022 · 11 comments · Fixed by #8627
Closed

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

Mistuke opened this issue Nov 13, 2022 · 11 comments · Fixed by #8627

Comments

@Mistuke
Copy link
Collaborator

Mistuke commented Nov 13, 2022

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
@ulysses4ever
Copy link
Collaborator

cabal repl -b suffers similarly: #8550

@gbaz
Copy link
Collaborator

gbaz commented Nov 14, 2022

expect this may be fixed by #8358 ?

@ulysses4ever
Copy link
Collaborator

expect this may be fixed by #8358?

No. See #8550 for discussion.

@arrowd
Copy link
Collaborator

arrowd commented Jan 4, 2023

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

@Mikolaj
Copy link
Member

Mikolaj commented Jan 5, 2023

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

@juhp
Copy link
Collaborator

juhp commented Jan 6, 2024

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)

@gbaz
Copy link
Collaborator

gbaz commented Jan 6, 2024

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

@juhp
Copy link
Collaborator

juhp commented Jan 6, 2024

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

@juhp
Copy link
Collaborator

juhp commented Jan 6, 2024

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

@gbaz
Copy link
Collaborator

gbaz commented Jan 6, 2024

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

@juhp
Copy link
Collaborator

juhp commented Jan 6, 2024

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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants