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 repl doesn't respect flag constraints for dependencies #7017

Closed
turion opened this issue Aug 22, 2020 · 4 comments
Closed

cabal repl doesn't respect flag constraints for dependencies #7017

turion opened this issue Aug 22, 2020 · 4 comments

Comments

@turion
Copy link

turion commented Aug 22, 2020

Describe the bug

The bug was originally discovered in a special case here: turion/essence-of-live-coding-tutorial#3
In that case, the application has a dependency to gloss, which has the flags GLUT and GLFW. We tried setting these flags with cabal repl --constraint="gloss +GLFW -GLUT" and by writing them down in cabal.project.local. Nevertheless, always the GLUT backend is selected.

A clear and concise description of what the bug is.

To Reproduce

git clone https://github.com/turion/essence-of-live-coding-tutorial/
cd essence-of-live-coding-tutorial
nix-shell # or instead install GLFW, GLUT, OpenGL
cabal v2-repl --constraint="gloss +GLFW -GLUT"
:livelaunch
# Exit the repl by pressing Ctrl+D

You will see an error message saying something with GLUT.

@hvr
Copy link
Member

hvr commented Aug 22, 2020 via email

@turion
Copy link
Author

turion commented Aug 22, 2020

Thank you for trying to reproduce! This is the behaviour I would expect. Then it must be an interaction with Nix. The nix-shell supplies a particular version of gloss to GHC, namely one built with default flags (-GLFW +GLUT), and it seems like cabal repl (or in fact all of cabal? not sure) doesn't try to do anything about that.

@hvr
Copy link
Member

hvr commented Aug 22, 2020 via email

@turion
Copy link
Author

turion commented Aug 23, 2020

Yes, that resolves the cabal issue! Thanks

@turion turion closed this as completed Aug 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants