-
Notifications
You must be signed in to change notification settings - Fork 16
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
PATH order is not correct #10
Comments
It prepends them after the action. Each path given to Though perhaps GitHub adds the entries from that file in reverse order?
I'm not sure I follow the suggestion here. The action has to treat path specially since GitHub uses a different API to set path values vs other kinds of environment variables. |
Yes, that seems to be what's happening. The docs suggest: So if vsdevcmd generates a
I don't think anything actually stops you calling |
Would be open to a PR to fix this. I'll get to it eventually, but it's low-priority for me so far. (Frankly, I wish Microsoft would just release their own microsoft/setup-vsdev Action so I can deprecate this one...) |
The `addPath` will invert the path ordering as each entry is appended to the environment file, which is then reversed and prepended to the environment at the end of the action. This results in the additions being in reverse order. However, since we know that `vsdevcmd` will adjust the path on both ends, simply prefer to use the `exportVariable` rather than try to be clever to adjust the path via `addPath`. Fixes: seanmiddleditch#10.
The `addPath` will invert the path ordering as each entry is appended to the environment file, which is then reversed and prepended to the environment at the end of the action. This results in the additions being in reverse order. However, since we know that `vsdevcmd` will adjust the path on both ends, simply prefer to use the `exportVariable` rather than try to be clever to adjust the path via `addPath`. Fixes: seanmiddleditch#10.
The `addPath` will invert the path ordering as each entry is appended to the environment file, which is then reversed and prepended to the environment at the end of the action. This results in the additions being in reverse order. However, since we know that `vsdevcmd` will adjust the path on both ends, simply prefer to use the `exportVariable` rather than try to be clever to adjust the path via `addPath`. Fixes: seanmiddleditch#10.
The `addPath` will invert the path ordering as each entry is appended to the environment file, which is then reversed and prepended to the environment at the end of the action. This results in the additions being in reverse order. However, since we know that `vsdevcmd` will adjust the path on both ends, simply prefer to use the `exportVariable` rather than try to be clever to adjust the path via `addPath`. Fixes: seanmiddleditch#10.
The `addPath` will invert the path ordering as each entry is appended to the environment file, which is then reversed and prepended to the environment at the end of the action. This results in the additions being in reverse order. However, since we know that `vsdevcmd` will adjust the path on both ends, simply prefer to use the `exportVariable` rather than try to be clever to adjust the path via `addPath`. Fixes: seanmiddleditch#10.
The `addPath` will invert the path ordering as each entry is appended to the environment file, which is then reversed and prepended to the environment at the end of the action. This results in the additions being in reverse order. However, since we know that `vsdevcmd` will adjust the path on both ends, simply prefer to use the `exportVariable` rather than try to be clever to adjust the path via `addPath`. Fixes: seanmiddleditch#10.
The `addPath` will invert the path ordering as each entry is appended to the environment file, which is then reversed and prepended to the environment at the end of the action. This results in the additions being in reverse order. However, since we know that `vsdevcmd` will adjust the path on both ends, simply prefer to use the `exportVariable` rather than try to be clever to adjust the path via `addPath`. Fixes: seanmiddleditch#10.
The `addPath` will invert the path ordering as each entry is appended to the environment file, which is then reversed and prepended to the environment at the end of the action. This results in the additions being in reverse order. However, since we know that `vsdevcmd` will adjust the path on both ends, simply prefer to use the `exportVariable` rather than try to be clever to adjust the path via `addPath`. Fixes: seanmiddleditch#10.
The `addPath` will invert the path ordering as each entry is appended to the environment file, which is then reversed and prepended to the environment at the end of the action. This results in the additions being in reverse order. However, since we know that `vsdevcmd` will adjust the path on both ends, simply prefer to use the `exportVariable` rather than try to be clever to adjust the path via `addPath`. Fixes: seanmiddleditch#10.
The `addPath` will invert the path ordering as each entry is appended to the environment file, which is then reversed and prepended to the environment at the end of the action. This results in the additions being in reverse order. However, since we know that `vsdevcmd` will adjust the path on both ends, simply prefer to use the `exportVariable` rather than try to be clever to adjust the path via `addPath`. Fixes: seanmiddleditch#10.
The `addPath` will invert the path ordering as each entry is appended to the environment file, which is then reversed and prepended to the environment at the end of the action. This results in the additions being in reverse order. However, since we know that `vsdevcmd` will adjust the path on both ends, simply prefer to use the `exportVariable` rather than try to be clever to adjust the path via `addPath`. Fixes: seanmiddleditch#10.
The `addPath` will invert the path ordering as each entry is appended to the environment file, which is then reversed and prepended to the environment at the end of the action. This results in the additions being in reverse order. However, since we know that `vsdevcmd` will adjust the path on both ends, simply prefer to use the `exportVariable` rather than try to be clever to adjust the path via `addPath`. Fixes: seanmiddleditch#10.
Seems that I am doing something incorrectly as no matter what change I do it doesn't seem to take effect (e.g. added logging has no impact). |
The `addPath` will invert the path ordering as each entry is appended to the environment file, which is then reversed and prepended to the environment at the end of the action. This results in the additions being in reverse order. However, since we know that `vsdevcmd` will adjust the path on both ends, simply prefer to use the `exportVariable` rather than try to be clever to adjust the path via `addPath`. Fixes: seanmiddleditch#10.
The `addPath` will invert the path ordering as each entry is appended to the environment file, which is then reversed and prepended to the environment at the end of the action. This results in the additions being in reverse order. However, since we know that `vsdevcmd` will adjust the path on both ends, simply prefer to use the `exportVariable` rather than try to be clever to adjust the path via `addPath`. Fixes: seanmiddleditch#10.
The `addPath` will invert the path ordering as each entry is appended to the environment file, which is then reversed and prepended to the environment at the end of the action. This results in the additions being in reverse order. However, since we know that `vsdevcmd` will adjust the path on both ends, simply prefer to use the `exportVariable` rather than try to be clever to adjust the path via `addPath`. Fixes: seanmiddleditch#10.
The `addPath` will invert the path ordering as each entry is appended to the environment file, which is then reversed and prepended to the environment at the end of the action. This results in the additions being in reverse order. However, since we know that `vsdevcmd` will adjust the path on both ends, simply prefer to use the `exportVariable` rather than try to be clever to adjust the path via `addPath`. Fixes: seanmiddleditch#10.
The `addPath` will invert the path ordering as each entry is appended to the environment file, which is then reversed and prepended to the environment at the end of the action. This results in the additions being in reverse order. However, since we know that `vsdevcmd` will adjust the path on both ends, simply prefer to use the `exportVariable` rather than try to be clever to adjust the path via `addPath`. Fixes: seanmiddleditch#10.
The `addPath` will invert the path ordering as each entry is appended to the environment file, which is then reversed and prepended to the environment at the end of the action. This results in the additions being in reverse order. However, since we know that `vsdevcmd` will adjust the path on both ends, simply prefer to use the `exportVariable` rather than try to be clever to adjust the path via `addPath`. Fixes: seanmiddleditch#10.
The `addPath` will invert the path ordering as each entry is appended to the environment file, which is then reversed and prepended to the environment at the end of the action. This results in the additions being in reverse order. However, since we know that `vsdevcmd` will adjust the path on both ends, simply prefer to use the `exportVariable` rather than try to be clever to adjust the path via `addPath`. Fixes: seanmiddleditch#10.
The `addPath` will invert the path ordering as each entry is appended to the environment file, which is then reversed and prepended to the environment at the end of the action. This results in the additions being in reverse order. However, since we know that `vsdevcmd` will adjust the path on both ends, simply prefer to use the `exportVariable` rather than try to be clever to adjust the path via `addPath`. Fixes: seanmiddleditch#10.
The `addPath` will invert the path ordering as each entry is appended to the environment file, which is then reversed and prepended to the environment at the end of the action. This results in the additions being in reverse order. However, since we know that `vsdevcmd` will adjust the path on both ends, simply prefer to use the `exportVariable` rather than try to be clever to adjust the path via `addPath`. Fixes: seanmiddleditch#10.
The `addPath` will invert the path ordering as each entry is appended to the environment file, which is then reversed and prepended to the environment at the end of the action. This results in the additions being in reverse order. However, since we know that `vsdevcmd` will adjust the path on both ends, simply prefer to use the `exportVariable` rather than try to be clever to adjust the path via `addPath`. Fixes: seanmiddleditch#10.
The `addPath` will invert the path ordering as each entry is appended to the environment file, which is then reversed and prepended to the environment at the end of the action. This results in the additions being in reverse order. However, since we know that `vsdevcmd` will adjust the path on both ends, simply prefer to use the `exportVariable` rather than try to be clever to adjust the path via `addPath`. Fixes: seanmiddleditch#10.
The `addPath` will invert the path ordering as each entry is appended to the environment file, which is then reversed and prepended to the environment at the end of the action. This results in the additions being in reverse order. However, since we know that `vsdevcmd` will adjust the path on both ends, simply prefer to use the `exportVariable` rather than try to be clever to adjust the path via `addPath`. Fixes: seanmiddleditch#10.
The `addPath` will invert the path ordering as each entry is appended to the environment file, which is then reversed and prepended to the environment at the end of the action. This results in the additions being in reverse order. However, since we know that `vsdevcmd` will adjust the path on both ends, simply prefer to use the `exportVariable` rather than try to be clever to adjust the path via `addPath`. Fixes: seanmiddleditch#10.
For reference, there's an upstream bug and PR about the behavior, actions/toolkit#270, for a long-term fix (... if it ever gets merged/accepted) |
Well, at least the right compiler gets invoked with #12. I'll see if I get the motivation to update the docs for developers like me who aren't particularly comfortable with npm. Realized later that I needed to use |
The `addPath` will invert the path ordering as each entry is appended to the environment file, which is then reversed and prepended to the environment at the end of the action. This results in the additions being in reverse order. However, since we know that `vsdevcmd` will adjust the path on both ends, simply prefer to use the `exportVariable` rather than try to be clever to adjust the path via `addPath`. Fixes: #10.
As of v3, this GitHub action does not add entries to PATH in the right order, because it iterates over the PATH entries set by VsDevCmd and calls
core.addPath()
for each one. This reverses their order --core.addPath
prepends PATH entries!)One result of this is that if you request the x64_x86 toolchain (host_arch=x64 arch=x86), you get the following entries in PATH:
\path\to\VC\Tools\MSVC\14.28.29333\bin\HostX64\x64;\path\to\VC\Tools\MSVC\14.28.29333\bin\HostX64\x86
These entries are back to front, and this causes the wrong cl.exe being found.
Also, it's important to note that VsDevCmd also both appends and prepends entries to PATH. cl.exe and friends go the front, but other tools like the Visual Studio-bundled CMake and Ninja are appended at the end (so existing installs take precedence).
I suspect this action shouldn't be special-casing PATH, and should instead respect the value set by the vsdevcmd script.
The text was updated successfully, but these errors were encountered: