@@ -270,6 +270,53 @@ commands:
270270 $bashLine = 'export PATH="' + $bashPath + ':$PATH"'
271271 [System.IO.File]::AppendAllText($bashEnvScript, $bashLine + "`n", (New-Object System.Text.UTF8Encoding $false))
272272
273+ # Minimal Windows toolchain for COMPILING the CLI: Node, Python, Make only.
274+ # Excludes .NET/Maven/Gradle (needed only by acceptance tests), which keeps
275+ # this cache small and fast to restore compared to the full tools cache.
276+ install-deps-windows-native-build-min :
277+ steps :
278+ - run :
279+ name : Ensure tools cache directory
280+ shell : powershell
281+ command : |
282+ $cacheDir = '<< pipeline.parameters.windows_cache_dir >>'
283+ if (-not (Test-Path $cacheDir)) {
284+ New-Item -ItemType Directory -Path $cacheDir | Out-Null
285+ }
286+ - restore_cache :
287+ name : Restoring Windows build tools cache
288+ keys :
289+ - windows-build-tools-cache-v2-{{ arch }}-{{ checksum ".nvmrc" }}
290+ - run :
291+ name : Install Node.js (native)
292+ shell : powershell
293+ command : |
294+ .\scripts\windows\install-node.ps1
295+ - run :
296+ name : Install Python 3.12.8 (native)
297+ shell : powershell
298+ command : |
299+ .\scripts\windows\install-python3.ps1
300+ - run :
301+ name : Install GNU Make 4.4.1 (native)
302+ shell : powershell
303+ command : |
304+ .\scripts\windows\install-make.ps1
305+ - run :
306+ name : Ensure Python and uv
307+ shell : powershell
308+ command : |
309+ if (Test-Path '<< pipeline.parameters.windows_cache_dir >>/<< pipeline.parameters.windows_env_script >>') { . '<< pipeline.parameters.windows_cache_dir >>/<< pipeline.parameters.windows_env_script >>' }
310+ .\scripts\windows\ensure-python-uv.ps1
311+ - save_cache :
312+ name : Saving Windows build tools cache
313+ key : windows-build-tools-cache-v2-{{ arch }}-{{ checksum ".nvmrc" }}
314+ paths :
315+ - << pipeline.parameters.windows_cache_dir >>
316+ - C:\ProgramData\nvm
317+ - C:\tools\make
318+ - C:\Program Files\Python312
319+
273320 install-deps-windows-native-build :
274321 steps :
275322 - run :
@@ -283,7 +330,7 @@ commands:
283330 - restore_cache :
284331 name : Restoring Windows tools cache
285332 keys :
286- - windows-tools-cache-v5 -{{ arch }}-{{ checksum ".nvmrc" }}
333+ - windows-tools-cache-v7 -{{ arch }}-{{ checksum ".nvmrc" }}
287334 - run :
288335 name : Install Node.js (native)
289336 shell : powershell
@@ -322,10 +369,14 @@ commands:
322369 .\scripts\windows\ensure-python-uv.ps1
323370 - save_cache :
324371 name : Saving Windows tools cache
325- key : windows-tools-cache-v5 -{{ arch }}-{{ checksum ".nvmrc" }}
372+ key : windows-tools-cache-v7 -{{ arch }}-{{ checksum ".nvmrc" }}
326373 paths :
327374 - << pipeline.parameters.windows_cache_dir >>
328375 - C:\ProgramData\nvm
376+ - C:\tools\maven
377+ - C:\tools\make
378+ - C:\Program Files\dotnet
379+ - C:\Program Files\Python312
329380
330381 install-deps-windows-native-full-signing :
331382 steps :
@@ -386,6 +437,19 @@ commands:
386437 name : No dependencies to install
387438 command : echo all done!
388439
440+ setup-go-build-cache :
441+ description : >-
442+ Pin GOMODCACHE and GOCACHE to workspace paths so CircleCI cache
443+ restore/save works on Linux, macOS, and Windows executors.
444+ steps :
445+ - run :
446+ name : Configure Go module and build cache paths
447+ shell : bash
448+ command : |
449+ mkdir -p .go-cache/mod .go-cache/build
450+ echo "export GOMODCACHE=\"$(pwd)/.go-cache/mod\"" >> "$BASH_ENV"
451+ echo "export GOCACHE=\"$(pwd)/.go-cache/build\"" >> "$BASH_ENV"
452+
389453 setup-go-private-modules :
390454 description : >-
391455 Configure git and Go to fetch private snyk modules using the
@@ -829,12 +893,11 @@ workflows:
829893 go_arch : amd64
830894 go_download_base_url : << pipeline.parameters.fips_go_download_base_url >>
831895 go_version : << pipeline.parameters.fips_go_version >>
832- make_target : build clean-golang build -fips BUILD_MODE=private
833- install_deps_extension : windows-native-full-signing
896+ make_target : build build-fips verify -fips-artifacts BUILD_MODE=private
897+ install_deps_extension : windows-native-build-min
834898 install_path : ' C:\'
835899 executor : win-server2022-amd64
836900 context :
837- - snyk-windows-signing
838901 - iac-cli
839902 - go-private-modules
840903 requires :
@@ -1729,17 +1792,24 @@ jobs:
17291792 go_version : << parameters.go_version >>
17301793 extraction_path : << parameters.install_path >>
17311794 - setup-go-private-modules
1795+ - setup-go-build-cache
17321796 - restore_cache :
1733- key : go-build-{{ arch }}-{{ checksum "cliv2/go.sum" }}
1797+ name : Restoring Go module and build cache
1798+ keys :
1799+ - go-build-v2-{{ arch }}-{{ checksum "cliv2/go.sum" }}
1800+ - go-build-v2-{{ arch }}-
17341801 - make-binary :
17351802 static : << parameters.static_binary >>
17361803 go_arch : << parameters.go_arch >>
17371804 go_target_os : << parameters.go_target_os >>
17381805 make_target : << parameters.make_target >>
17391806 c_compiler : << parameters.c_compiler >>
17401807 - save_cache :
1741- key : go-build-{{ arch }}-{{ checksum "cliv2/go.sum" }}
1742- paths : [/home/circleci/go/pkg/mod]
1808+ name : Saving Go module and build cache
1809+ key : go-build-v2-{{ arch }}-{{ checksum "cliv2/go.sum" }}
1810+ paths :
1811+ - .go-cache/mod
1812+ - .go-cache/build
17431813 - store_artifacts :
17441814 path : binary-releases
17451815 - persist_to_workspace :
@@ -1856,7 +1926,11 @@ jobs:
18561926 - install-deps-<< parameters.install_deps_extension >>
18571927 - run :
18581928 name : Signing << parameters.go_os >> artifact
1859- command : make << parameters.make_target >> GOOS=<< parameters.go_os >> GOARCH=<< parameters.go_arch >>
1929+ shell : bash
1930+ command : |
1931+ # Load Windows $Env:Path values of tools necessary for signing (like make).
1932+ if [ -f "/c/tools-cache/<< pipeline.parameters.windows_bash_env_script >>" ]; then source "/c/tools-cache/<< pipeline.parameters.windows_bash_env_script >>"; fi
1933+ make << parameters.make_target >> GOOS=<< parameters.go_os >> GOARCH=<< parameters.go_arch >>
18601934 - store_artifacts :
18611935 path : ./binary-releases
18621936 - persist_to_workspace :
0 commit comments