From c8be8fa79fa06630396ab1ce2174fe4f1a370ae7 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Mon, 20 Feb 2023 14:14:46 +0000 Subject: [PATCH] ci: fix rbe initialization failing in windows job (#49142) The RBE init script from dev-infra is using ES2020 but the image NodeJS version does not support e.g. nullish coalescing. PR Close #49142 --- .circleci/config.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b8fef07ec9d..85ce662dd3c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -595,22 +595,15 @@ jobs: executor: windows-executor steps: - checkout - - save_month_to_file - - capture_patches_for_cache_key - - init_environment # Setup the proper NodeJS version. The image comes pre-installed with `nvm-windows`. + # Note: This happens immediately after checkout because environment initialization logic + # might rely on Node and shouldn't use the older image-provided NodeJS version. - run: name: Install NodeJS version from `.nvmrc`. command: | nvm install $(cat .nvmrc) nvm use $(cat .nvmrc) - - - restore_cache: - keys: - - *cache_key_win - - *cache_key_win_fallback - - run: name: Debug information for flakiness of Windows job command: | @@ -621,6 +614,14 @@ jobs: echo "Path: $PATH" yarn node -v + - save_month_to_file + - capture_patches_for_cache_key + - init_environment + - restore_cache: + keys: + - *cache_key_win + - *cache_key_win_fallback + # Install project dependencies, and install Bazelisk globally. This is necessary as # Windows might error when `bazel` is invoked from the project node modules. The Bazel # invocation might modify the symlinked project `node_modules` again, causing failures.