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

running 'cabal build' in an empty directory creates directories before erroring. #9390

Closed
julialongtin opened this issue Nov 3, 2023 · 5 comments

Comments

@julialongtin
Copy link
Contributor

To Reproduce
Steps to reproduce the behavior:

$ cabal build

Expected behavior
The production of the normal error output, and no dist-newstyle folder created.

Undesired behavior

$ find dist-newstyle/
dist-newstyle/
dist-newstyle/cache
dist-newstyle/cache/compiler

System information

  • debian unstable
  • cabal 3.8.1.0, ghc 9.4.6
@geekosaur
Copy link
Collaborator

geekosaur commented Nov 3, 2023

I can't reproduce with cabal 3.10.1.0 and ghc 9.6.3:

skkukuk Z$ ls
skkukuk Z$ cabal build 
Error: cabal: There is no <pkgname>.cabal package file or cabal.project file.
To build packages locally you need at minimum a <pkgname>.cabal file. You can
use 'cabal init' to create one.

For non-trivial projects you will also want a cabal.project file in the root
directory of your project. This file lists the packages in your project and
all other build configuration. See the Cabal user guide for full details.

zsh: exit 1     cabal build
skkukuk Z$ find .
.

@geekosaur
Copy link
Collaborator

I can't easily test 3.8.1.0 because I use XDG paths and I have a dummy file ~/.cabal in place for those rare times when I have to reinstall ghcup (I run a prerelease) and it switches me back to the "recommended" version.

@ulysses4ever
Copy link
Collaborator

ulysses4ever commented Nov 3, 2023

I have a feeling that’s a dup of an old issue that was subsequently fixed. Let’s close until there’s a reproducer with the latest release?

@gbaz
Copy link
Collaborator

gbaz commented Nov 3, 2023

indeed should be fixed by #8627

@ffaf1
Copy link
Collaborator

ffaf1 commented Nov 3, 2023

f@x270:/tmp/prova$ cabal build
Warning: this is a debug build of cabal-install with assertions enabled.
Error: [Cabal-7136]
There is no <pkgname>.cabal package file or cabal.project file. To build packages locally you need at minimum a <pkgname>.cabal file. You can use 'cabal init' to create one.

For non-trivial projects you will also want a cabal.project file in the root directory of your project. This file lists the packages in your project and all other build configuration. See the Cabal user guide for full details.

f@x270:/tmp/prova$ cabal --version
cabal-install version 3.11
compiled using version 3.11.0.0 of the Cabal library
f@x270:/tmp/prova$

So it should be ok in master. I am closing this, reopen if needed.

@ffaf1 ffaf1 closed this as completed Nov 3, 2023
@ffaf1 ffaf1 closed this as not planned Won't fix, can't repro, duplicate, stale Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants