Commit e90693e
committed
setup-go-toolchain: own the Windows PATH for cgo
The toolchain action's contract should be "after this action, Go
and cgo work in any shell on this runner." But on Windows we were
still asking each caller to do
if [ "$RUNNER_OS" = "Windows" ]; then
export PATH=$(cygpath -u "$MSYS2_LOCATION"/ucrt64/bin):"$PATH"
fi
inline before invoking go test, plus thread MSYS2_LOCATION through
as an env var sourced from the action's msys2-location output.
That leaks msys2 implementation details into every workflow that
runs cgo builds in shell: bash on Windows.
Move the PATH addition into the action: a new "Add MSYS2 to PATH
(Windows)" step writes the cygpath-converted UCRT64 bin dir to
$GITHUB_PATH after the msys2 install. Callers using shell: bash on
Windows now find gcc and the ICU libs without ceremony. Workflows
using shell: 'msys2 {0}' (e.g. ci-bats-windows.yaml's build) are
unaffected — that shell sets up its own environment.
Drop the now-unused msys2-location output and the corresponding
env-var threading from ci-go-tests.yaml.1 parent a8b1190 commit e90693e
2 files changed
Lines changed: 7 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
| 2 | + | |
8 | 3 | | |
9 | 4 | | |
10 | 5 | | |
| |||
29 | 24 | | |
30 | 25 | | |
31 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
54 | 53 | | |
55 | 54 | | |
56 | 55 | | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | 56 | | |
61 | 57 | | |
62 | 58 | | |
63 | 59 | | |
64 | | - | |
65 | | - | |
0 commit comments