-
Notifications
You must be signed in to change notification settings - Fork 3
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
Per-package hooks which can modify the config #58
Comments
On the topic of per-package hooks, I have a very hacky hook system implemented using the post install hook. |
Another use of hooks, which requires modification of the config at runtime, is creating fake choco package entries if software is pre-installed. I am doing that for AppVeyor CI, as it has a lot of pre-installed software https://www.appveyor.com/docs/windows-images-software/ , increasing the speed of the setup, and sometimes it isnt even possible to install the choco package over the top of the pre-installed software. I am doing that using an AppVeyor specific Fudgefile which uses locally created fake nupkg with package names matching the entries which will be processed by the real Fudgefile , which causes Fudge/choco to process those very quickly as it is a no-op. It would be nice to inline that logic a hook which runs before each package which would replace the entry source with the built nupkg if the host is AppVeyor. |
A related problem, perhaps worth of a separate issue, is that hook |
I have found that the current hook system does implicitly provide However, I believe the So it would be nice if the What would be even better is if the data structures were completely mutable, so that new attributes could be added to the dicts. In the context of per-package hooks, if they are implemented the same way, I guess "$package" would be an implicitly available variable which again would be mutable, in addition to "$config" being available. |
Spawned from #42 (comment)
The pnpmfile.js approach is very powerful. At each layer of the package tree, the data structure is given to the hook which can modify it, and pnpm uses the modified structure. For context, in pnpm this is critical as npm authors often forget to declare a direct dependency because it is installed by another declared dependency. In a flat node_modules it doesnt matter, but it breaks pnpm. However I see the same underlying problem in choco -- the packages are often poorly maintained, and either we create our own packages for everything or fix them at runtime. The latter approach has a lower ongoing maintenance cost, and it isolates the problems and the fixes needed, so it is easy to then report bugs with solutions upstream.
At the moment, Fudge only has two levels of nesting - the top level, and then each entry in the Fudgefile. I expect that will change to three levels when dependency tracking is added. nuspec format already describes dependencies so that could be added quite easily. For real choco dependencies, it gets a bit more tricky #57 .
The text was updated successfully, but these errors were encountered: