diff --git a/.github/workflows/node-gyp-workaround.sh b/.github/workflows/node-gyp-workaround.sh deleted file mode 100644 index 128f3c646..000000000 --- a/.github/workflows/node-gyp-workaround.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env bash - -# This is a workaround for a node-gyp bug that has not fully been investigated -# due to problems reproducing it outside of CI environments (even though it -# occurs both in evergreen and github actions). -# Something seems to go wrong when node-gyp extracts the Node.js header tarball, -# on Windows specifically (this is most likely because node-tar treats -# the overwriting of existing files differently on Windows than on other OS -- -# for good reasons, but still). -# The most likely cause of this issue is that node-gyp somehow extracts the -# same headers tarball twice, in parallel, in the same location, with race -# conditions in the tar extraction code leading to issues. -# The extraction result ends up in %LOCALAPPDATA%\node-gyp\Cache. -# Manually extracting the tarballs will solve this issue, so we're doing that -# here. -# For actually resolving the bug, we would probably need somebody with a local -# reproduction. However, it seems likely that other people will also encounter -# this issue, so there's also a good chance that this workaround will just -# not be needed with a future node-gyp version. - -if [ x"$NODE_JS_VERSION" = x"" ]; then - if node -v; then - export NODE_JS_VERSION=$(node -p 'process.version.slice(1)') - else - echo "Need NODE_JS_VERSION to be set or Node.js to be installed for node-gyp bug workaround script" - exit 1 - fi -fi - -if [ x"$LOCALAPPDATA" = x"" ]; then - echo "No LOCALAPPDATA set, ignoring node-gyp bug workaround script" - exit -fi - -set -x -CACHEDIR="$LOCALAPPDATA/node-gyp/Cache" -rm -rvf "$CACHEDIR" -mkdir -p "$CACHEDIR/$NODE_JS_VERSION" -cd "$CACHEDIR/$NODE_JS_VERSION" -curl -sSfLO "https://nodejs.org/download/release/v$NODE_JS_VERSION/node-v$NODE_JS_VERSION-headers.tar.gz" -tar --strip-components=1 -xvzf "node-v$NODE_JS_VERSION-headers.tar.gz" -for arch in x64 x86 arm64; do - mkdir $arch - pushd $arch - curl -sSfLO "https://nodejs.org/download/release/v$NODE_JS_VERSION/win-$arch/node.lib" || echo "no $arch v$NODE_JS_VERSION .lib file" - popd -done - -# Finally, store the right installVersion value for current node-gyp versions -echo 9 > installVersion diff --git a/.github/workflows/publish-release.yaml b/.github/workflows/publish-release.yaml index dad0f7a99..f690a32b6 100644 --- a/.github/workflows/publish-release.yaml +++ b/.github/workflows/publish-release.yaml @@ -12,14 +12,14 @@ jobs: - name: Setup Node.js Environment uses: actions/setup-node@v2.1.2 with: - node-version: ^14.17.3 + node-version: ^14.17.5 - name: Install npm@7 - run: npm install -g npm@7 + run: npm install -g npm@8.3.1 - name: Run node-gyp bug workaround script run: | - bash .github/workflows/node-gyp-workaround.sh + curl -sSfLO https://raw.githubusercontent.com/mongodb-js/compass/42e6142ae08be6fec944b80ff6289e6bcd11badf/.evergreen/node-gyp-bug-workaround.sh && bash node-gyp-bug-workaround.sh - name: Install VSCode publishing dependencies run: npm install -g vsce diff --git a/.github/workflows/test-and-build.yaml b/.github/workflows/test-and-build.yaml index 1cd4017a8..a07612c0d 100644 --- a/.github/workflows/test-and-build.yaml +++ b/.github/workflows/test-and-build.yaml @@ -45,7 +45,7 @@ jobs: - name: Run node-gyp bug workaround script run: | - bash .github/workflows/node-gyp-workaround.sh + curl -sSfLO https://raw.githubusercontent.com/mongodb-js/compass/42e6142ae08be6fec944b80ff6289e6bcd11badf/.evergreen/node-gyp-bug-workaround.sh && bash node-gyp-bug-workaround.sh - name: Install npm@8.3.1 run: npm install -g npm@8.3.1