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 list-bin doesn't suppress stdout from other phases #9911

Closed
hasufell opened this issue Apr 19, 2024 · 2 comments
Closed

cabal list-bin doesn't suppress stdout from other phases #9911

hasufell opened this issue Apr 19, 2024 · 2 comments

Comments

@hasufell
Copy link
Member

Describe the bug

cabal list-bin doesn't suppress stdout from internal cabal phases, leading to broken behavior when you want to save the result in a variable.

To Reproduce

  1. git clone [email protected]:hasufell/list-bin.git
  2. cd list-bin
  3. cabal build
  4. foo=$(cabal list-bin exe:list-bin)
  5. ${foo}

Resulting in:

bash: Downloading: command not found

Expected behavior

The only thing sent to stdout is the binary location.

System information

  • Operating system: Fedora 39
  • cabal: 3.10.3.0
@fendor
Copy link
Collaborator

fendor commented Apr 19, 2024

Related issues: #8870, #7790, #4652

This seems like a long-standing issue in multiple cabal commands. Perhaps we should take inspiration from other project build tools and try to come up with a fix once and for all? E.g., cargo seems to printing everything to stderr (rustc errors, progress notifications, etc...).

A disadvantage of sending all output to stderr is that we probably break someone's scripts.

@ulysses4ever
Copy link
Collaborator

Duplicate, as mentioned above.

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

3 participants