haskell / haskell/cabal

Issue warning if new-build called and current directory has cabal file but it is not mentioned in cabal.project

Open
#4,524 14 comments 1 reaction 0 assignees View on GitHub
cabal-install: v2-build system re: error-message re: project-file type: enhancement
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

I using git commit 967a64e3 (TueMay 16 22:17:46 2017 +0200 )

If I run `cabal new-build` in a directory with a cabal file I get:
```
> cabal new-build
cabal: No targets given and there is no package in the current directory. Use
the target 'all' for all packages in the project or specify packages or
components by name or location. See 'cabal build --help' for more details on
target options.
```
but there very definitely *is* a cabal file in the current directory, and `cabal build` at least tries to build it but can't because there's no sandbox.

In addition `cabal new-build` with cabal-install version 1.24.0.2 at least partially works (builds the library, but not the executable mentioned in the cabal file).

Contributor guide

Open the contributing guide

Research direction

Reproduce with cabal new-build in a directory containing a cabal file that is absent from cabal.project, and compare cabal build behavior. Trace the cabal new-build target-selection path; done means it warns clearly about the unlisted cabal file and preserves the expected package and executable handling.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
build-system, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.