-
Notifications
You must be signed in to change notification settings - Fork 913
install/upgrade: Add --no-shim option to allow skipping creation of shims from user side #1670
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
Comments
I would also like this - the shims for mingw cause issues with |
@AndrewGaspar might not be a bad idea to provide that feedback to the folks maintaining the MinGW packages so that they can look for an alternate place to set those binaries (and not in the packaging). That way they won't get shimmed. @Badgerati I like this. I think it would be a good feature add. Sorry I'm just now coming across this issue, my email is a little on the full side. |
@ferventcoder Sent an email to the maintainers with a link here. The executables are also in a "bin" folder for the package already - the problem is if clang sees multiple paths to the gnu executables, it doesn't know where to find includes, libs, etc., and it also can't find them from the shim path. |
Seems to be a dup of #1105 , which was closed as feature chocolatey/home#213 is how it was envisaged to be solved. |
While I agree that chocolatey/home#213 might be a better way of making this work; it's also been open since 2015 with no progress 🤔 . A |
@ferventcoder I'm willing to give this a shot - if no one else is working on it. |
The --noshims and --noshimsglobal options allow the user to stop shims being created for either the package, or the package and its dependencies. In addition to this new behaviour, the implementation handles the creation and removal of shims more robustly, so that shims from other packages (or the same package) cannot be unintentionally overwritten or removed. The new ShimRegistry class keeps track of the currently installed shims and their corresponding packages. It does this by examining all the exe files in the shim directory (note that old-style .bat and unixy shims are not supported) and extracting the target file from the binary. If this target path contains the lib folder, then the package name can be obtained. ShimRegistry is updated for each package, just before the Powershell scripts are run, using `ShimGenerationService::take_snapshot`. When ShimGenerationService installs the package, ShimRegistry provides its existing shim files (ie. those that were not modified or removed since the last update) so that they can be deleted prior to installing any new ones. To stop shims being added from Install-BinFile, a new environment variable `chocolateyNoShims` is used when running the Powershell scripts. If a package sets a shim this way, but then forgets to call Uninstall-BinFile when uninstalling, the shim will be removed anyway if its target is in the package folder.
The --noshims and --noshimsglobal options allow the user to stop shims being created for either the package, or the package and its dependencies. In addition to this new behaviour, the implementation handles the creation and removal of shims more robustly, so that shims from other packages (or the same package) cannot be unintentionally overwritten or removed. The new ShimRegistry class keeps track of the currently installed shims and their corresponding packages. It does this by examining all the exe files in the shim directory (so old-style .bat and unixy shims are not supported) and extracting the target file from the binary. If this target path contains the lib folder, then the package name can be obtained. ShimRegistry is updated for each package, just before the Powershell scripts are run, using `ShimGenerationService::take_snapshot`. When ShimGenerationService installs any shims for the package, ShimRegistry provides its existing shim files (ie. those that were not modified or removed since the last update) so that they can be deleted prior to installing any new ones. To stop shims being added from Install-BinFile, a new environment variable `chocolateyNoShims` is used when running the Powershell scripts. If a package sets a shim this way, but then forgets to call Uninstall-BinFile when uninstalling, the shim will be removed anyway if its target is in the package folder.
Assigned to @johnstevenson as he has provided a PR. Thanks for doing that! |
@Badgerati We write capture things we want to do here. Dates are a non-issue. 😉 |
Hit enter on that last one too fast. We have things we are just getting complete that have been in my head since 2011. I also have hundreds of little things I've captured here, on sticky notes, on a notepad waking up in the middle of the night, so basically we write it all down and let priorities and community help us figure out what is important to implement and at what time. HTH provide more clarity for my comment. |
Is there a possibility of having a new
--no-shim
option oninstall
andupgrade
, to completely skip shimming altogether?I'm aware that creating a
.ignore
file will stop an exe from being shimmed, but for massive packages the process of scanning for exes can take quite a long time. It would be nice if there were a CLI option to skip it altogether.The text was updated successfully, but these errors were encountered: