From 7cde85dc8b9d204bbaf59214222834a2a27bfa18 Mon Sep 17 00:00:00 2001 From: Bailey Pearson Date: Wed, 4 Dec 2024 14:57:59 -0700 Subject: [PATCH] Revert "chore(NODE-6603): set errexit in install script and download prebuilt windows zstd (#51)" This reverts commit 0063c4e82a3c6b2476e0c96e69dc51347c27838f. --- .github/workflows/test.yml | 2 +- binding.gyp | 5 +---- etc/install-zstd.sh | 27 ++------------------------- 3 files changed, 4 insertions(+), 30 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 762f5b8..57413b7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -28,7 +28,7 @@ jobs: run: npm run install-zstd shell: bash - - name: install dependencies and compile + - name: install dependencies and compmile run: npm install --loglevel verbose shell: bash diff --git a/binding.gyp b/binding.gyp index 75c6fec..3da1b99 100644 --- a/binding.gyp +++ b/binding.gyp @@ -23,12 +23,9 @@ { 'link_settings': { 'libraries': [ - '<(module_root_dir)/deps/zstd/static/zstd_static.lib' + '<(module_root_dir)/deps/zstd/build/cmake/lib/Debug/zstd_static.lib' ] }, - 'include_dirs': [ - '<(module_root_dir)/deps/zstd/include' - ], }, { # macos and linux 'link_settings': { diff --git a/etc/install-zstd.sh b/etc/install-zstd.sh index 852165a..d9ba539 100644 --- a/etc/install-zstd.sh +++ b/etc/install-zstd.sh @@ -1,39 +1,16 @@ #!/bin/sh set -o xtrace -set -o errexit clean_deps() { rm -rf deps } -download_windows() { - # windows does not support symlinks, so we must download the `win64` build specifically - curl -L -o zstd.zip "https://github.com/facebook/zstd/releases/download/v$ZSTD_VERSION/zstd-v$ZSTD_VERSION-win64.zip" - # unlike tar, unzip does not have a "strip components" option. so we unzip the file, copy all the contents to the correct location, - # and then delete both the .zip and the unziped content. - unzip zstd.zip - cp -r zstd-v$ZSTD_VERSION-win64/* deps/zstd - rm zstd.zip - rm -rf zstd-v$ZSTD_VERSION-win64 -} - download_zstd() { mkdir -p deps/zstd ZSTD_VERSION=$(node -p "require('./package.json')['mongodb:zstd_version']") - is_windows=$(node -p "process.platform === 'win32'") - if [ "$is_windows" == "true" ]; then - download_windows - exit 0 # no need to build windows - else - # tar flags - # -C specifies the output location - # --strip-components removes one level of directory nesting - # curl flags - # -L follows redirects - curl -L "https://github.com/facebook/zstd/releases/download/v$ZSTD_VERSION/zstd-$ZSTD_VERSION.tar.gz" \ - | tar -zxf - -C deps/zstd --strip-components 1 - fi + curl -L "https://github.com/facebook/zstd/releases/download/v$ZSTD_VERSION/zstd-$ZSTD_VERSION.tar.gz" \ + | tar -zxf - -C deps/zstd --strip-components 1 } build_zstd() {