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

Should show error if setting --flag for package in the snapshot database #611

Closed
radix opened this issue Jul 16, 2015 · 10 comments
Closed

Comments

@radix
Copy link
Contributor

radix commented Jul 16, 2015

As mentioned on #594, we can't do stack install --flag hakyll:-previewServer --flag hakyll:-watchServer hakyll, which is something that would allow me to install hakyll without the optional dependencies that it has on fsnotify. The --flag parameter seems to just be ignored with install.

@borsboom borsboom added this to the 0.2.0.0 milestone Jul 21, 2015
@borsboom
Copy link
Contributor

@radix: Is this resolved with the new stack build --copy-bins way to install executables?

@borsboom
Copy link
Contributor

(nevermind, I should have read the original issue first -- clearly stack build --copy-bins won't help)

@borsboom
Copy link
Contributor

From #594:

It's expected to not work currently, because we don't ever modify the snapshot plan. The argument could be made that, when explicitly choosing a package on the command line, it should be considered a local package whose flags can be modified. Probably worth opening an issue for discussing that change.

So the issue isn't that the --flag option is ignored by stack install, but that it's ignored for any snapshot packages for any command (e.g., same thing with stack build). --flag does work if you're running stack install for a local package.

@borsboom borsboom removed this from the 0.2.0.0 milestone Jul 21, 2015
@radix
Copy link
Contributor Author

radix commented Jul 21, 2015

Yeah, I think this may be a significant design decision. I guess changing flags for snapshot packages can potentially "corrupt" a build database, since it would give you a way to change a package that's different but still installed to the same global package database, causing other software to not be able to build? Is my understanding right?

I think at the least, passing a --flag that sets a flag for a package in a snapshot should become an error, if it's to continue being unsupported by slack.

@snoyberg
Copy link
Contributor

You're correct about that. If we allow flags to be changed on a snapshot package, it should at the minimum implicitly move it to extra-deps so that the package and all that things that depend on it are in the local database.

But I'd prefer to just give an error message, and if this is the behavior that a user actually wants, the user can explicitly add the package to extra-deps. Does that sound reasonable?

@radix
Copy link
Contributor Author

radix commented Jul 21, 2015

Yes, your proposal sounds good to me.

@borsboom borsboom changed the title stack install --flag doesn't work Should show error if setting --flag for package in the snapshot database Jul 21, 2015
@borsboom
Copy link
Contributor

I've adjusted the title of this issue to reflect the discussed proposal. Also very much related to #617 (Make stack build --flag print warning when flag or package is unknown), probably should be taken care of at the same time.

@borsboom borsboom added this to the 0.2.0.0 milestone Jul 21, 2015
@snoyberg
Copy link
Contributor

Is there any difference between this and #617?

@borsboom
Copy link
Contributor

I think they're slightly different, or at least should print a different warning or error message to avoid confusion. But I think the two could be merged.

@borsboom
Copy link
Contributor

Ok, let's close this in favour of #617.

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