You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cabal update creates dist-newstyle folder in $PWD #8589
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.
@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)
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...
Activity
ulysses4ever commentedon Nov 13, 2022
cabal repl -bsuffers similarly: #8550gbaz commentedon Nov 14, 2022
expect this may be fixed by #8358 ?
ulysses4ever commentedon Nov 14, 2022
No. See #8550 for discussion.
arrowd commentedon Jan 4, 2023
I hope this will end up in the next 3.8 release.
Mikolaj commentedon 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 commentedon 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 commentedon 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 updateand 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 commentedon Jan 6, 2024
I created a backport intended for Fedora 39, which seems to work
juhp commentedon Jan 6, 2024
As I expected ;-(
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 commentedon Jan 6, 2024
In that case, I think a backport to the 3.8 branch would be welcome.
juhp commentedon 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)