Closed doctorpangloss closed 1 year ago
This seems to be one of those edge cases where something in Windows takes exception to forward slashes in environment variables.
Try starting your shell with the -X
option or -o winxp
. Or put set -o winxp
in your .profile
.
sh -X
resolves the issue. But do I really want to run with that? I feel like this will break my shell scripts which use forward slashes everywhere.
If you can give me an insight as to what should be fixed in choco
I'll ticket it there.
sh -X resolves the issue. But do I really want to run with that? I feel like this will break my shell scripts which use forward slashes everywhere.
It should be fine. Your scripts can still use forward slashes. The built-in tools, like basename
and dirname
, will work regardless of the type of slash. Just don't try parsing paths from variables by hand in your scripts without allowing for backslashes.
If you can give me an insight as to what should be fixed in choco I'll ticket it there.
It seems the only variable that has to contain backslashes for choco
to work is CHOCOLATEYINSTALL
.
Since it's set up that way by the installer I fully expect the choco
developers to say it isn't their problem.
Since it's set up that way by the installer I fully expect the
choco
developers to say it isn't their problem.
Not sure I follow.
Are you saying that CHOCOLATEYINSTALL must have backslashes to work correctly, but the choko framework sets it with forward slashes?
EDIT, oh, they set correctly hence not their problem, yes?
they set correctly hence not their problem, yes?
Yes.
What is the significance of seeing \\?\
at the beginning of paths? I see this in other places too. For example, node says it can't find a file that is indeed at the path it says, but the path it's looking up starts with \\?\
. Will that all be resolved by sh -X
?
anyway sh -ilX
works well for me as the startup task in Windows Terminal, so I am closing this. thank you!
Reproduction:
In an administrative powershell shell, try installing multiple choco packages:
Observe this completes successfully.
In an administrative busybox sh shell, try installing multiple choco packages:
Observe the following failures:
Busybox version:
BusyBox v1.37.0-PRE-5188-gac9ff15e2 (2023-08-24 16:01:05 BST)
Choco version: 2.2.2\Note that despite the logs, the installation was not successful.