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

Way to pass custom options to hook script #3625

Closed
ezyang opened this issue Jul 25, 2016 · 4 comments
Closed

Way to pass custom options to hook script #3625

ezyang opened this issue Jul 25, 2016 · 4 comments

Comments

@ezyang
Copy link
Contributor

ezyang commented Jul 25, 2016

On IRC, akegalj asked if there was a way to pass arguments to a hook specifically. I don't think there is any way to do this. It seems like a good thing to offer, but I don't know how to integrate it smoothly into existing hooks. See also #3600

@akegalj
Copy link

akegalj commented Aug 16, 2016

Looks like there is a way to do this.

We can declare some flag in cabal with

Flag FlagName
  Default:     False

and then from UserHooks (for example postReg http://hackage.haskell.org/package/Cabal-1.24.0.0/docs/Distribution-Simple-UserHooks.html#v:postReg) we can use LocalBuildInfo.configFlags.configConfigurationsFlags http://hackage.haskell.org/package/Cabal-1.24.0.0/docs/Distribution-PackageDescription.html#t:FlagAssignment . FlagName should appear in this list.

We should close this issue.

@ezyang
Copy link
Contributor Author

ezyang commented Aug 16, 2016

Note: you probably want to declare the flag as manual.

What if you want to pass a string? But if you're not asking for that, yes, let's close this.

@akegalj
Copy link

akegalj commented Aug 16, 2016

What if you want to pass a string?

I guess it is a valid use case but we don't have it. Using LocalBuildInfo.configFlags.configConfigurationsFlags solves our problems.

You might still want to keep this issue if you find that feature like that should be implemented.

@ezyang
Copy link
Contributor Author

ezyang commented Aug 16, 2016

OK I'm closing this. If someone else wants it they can shout.

@ezyang ezyang closed this as completed Aug 16, 2016
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

2 participants