Skip to content
  • Paul Gschwendtner's avatar
    ci: avoid failures when yarn unlinks bazelisk in windows jobs (#43365) · 01d2f03d
    Paul Gschwendtner authored
    Windows disallows removal of files which are currently being used.
    i.e. have active handles. This currently can result in permission denied
    failures on the Windows CI jobs where `yarn bazel` resolves to the local
    bazelisk installation that can be unlinked by `yarn_install` repository
    fetching as part of the Bazel invocation, resulting in errors like:
    
    ```
    ERROR: An error occurred during the fetch of repository 'npm':
       yarn_install failed: $ node tools/yarn/check-yarn.js
    ...
    [4/5] Linking dependencies...
    info If you think this is a bug, please open a bug report with the information provided in "C:\\users\\circleci\\ng\\yarn-error.log".
    info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
     (warning " > tsickle@0.34.3" has incorrect peer dependency "typescript@~3.3.1".
    error An unexpected error occurred: "EPERM: operation not permitted, unlink 'C:\\users\\circleci\\ng\\node_modules\\@bazel\\bazel-win32_x64\\bazel-0.27.0-windows-x86_64.exe'".
    Process stalled
    Active handles:
      - Socket
      - Socket
      - Socket
    )
    ```
    
    We workarund this in order to improve CI stability in case the node modules are
    being invalidated by Bazel, or through Yarns integrity checking.
    
    PR Close #43365
    01d2f03d