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
bundle lock
commands do not run hooks such as after-install-all
#7542
Comments
My understanding is that we do not fire any hooks with "install" in their name when you run I would expect install hooks to contain code that examines gems that have actually been installed, and expect those hooks to be run whenever someone runs Can you say more about what are you trying to accomplish? Why do you want an install hook to fire when no gems have been installed? |
That makes sense. I'm certainly open to adding an additional hook for this issue. Essentially my plugin needs to trigger anytime the Gemfile.lock changes via a Bundler command. |
What does your plugin do? What user need it is satisfying? If we know that, we can suggest approaches or add another hook if necessary. |
It ensures that changes to the lockfile are made to corresponding child lockfiles. As a basic example think of a project with a default Gemfile and Gemfile.lock but also a set in |
Ah cool, that makes sense. That sounds like a hook more like |
That makes sense to me. I like I do wonder whether managing multiple Gemfile + Gemfile.lock duples should be something builtin? I'm thinking some kind of Just wondering since we have to change Bundler anyways to allow for this. |
I'd love to merge in a workspaces plugin in the future, but I'd feel most comfortable if it was something we could prototype and test and get user feedback on via a plugin first. @joe-sharp if you're interested, we could potentially work with you to announce the plugin, blog about it, link to it from the official docs, and that kind of thing once it's ready for users but you're still refining how it works. |
@indirect @deivid-rodriguez , I am getting really close to a public release of the plugin. Just FYI I had to hack around this issue: #6630 but I haven't tried just installing it as a gem and seeing what else I need to do to trigger its functionality. |
Describe the problem as clearly as you can
bundle lock
commands, including--update
don't seem to work with any registered hooks. I could see them having a different set of hooks or simply applying the existing ones since many of the operations end up having a similar effect asbundle update
andbundle install
.Did you try upgrading rubygems & bundler?
I am running the latest Bundler (2.5.7 as of this posting)
Post steps to reproduce the problem
I just looked through the source code, but if you created a simple plugin that registered an
after-install-all
hook you can see that it runs in most operations, but notbundle lock
Which command did you run?
bundle lock --add-platform
bundle lock --update=rake --conservative
What were you expecting to happen?
I expect a registered
after-install-all
hook to run after updating gems (andbefore-install-all
to run before) or really even after any change to the lockfile is made. However, in the latter case, I just expect that hooks of some kind are available for plugins to use. So, I am not against additional events being added and run duringbundle lock
operations.Example with
bundle update
:What actually happened?
The
after-install-all
hook doesn't run. (No other hooks do either.)Example with
bundle lock
:It doesn't mention it, but this command does in fact change the Gemfile.lock to use rake 13.1.0, just like the first example using
bundle update
.If not included with the output of your command, run
bundle env
and paste the output belowEnvironment
Bundler Build Metadata
Bundler settings
The text was updated successfully, but these errors were encountered: