Skip to content

Commit

Permalink
Merge pull request #737 from ethereum/fix-pnpm-lockfile
Browse files Browse the repository at this point in the history
Fix pnpm broken lockfile
  • Loading branch information
cameel authored Apr 19, 2024
2 parents d61cd57 + 40a39ac commit 95b79a6
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,6 @@ commands:
name: Install pnpm
command: sudo npm install -g pnpm

update-npm:
steps:
- run:
name: Update globally available npm to the latest version
# Note: We need npm >= 8.3 which supports 'overrides' in package.json
command: sudo npm update npm --location=global

install-dependencies:
parameters:
cache-id:
Expand All @@ -85,22 +78,22 @@ commands:
steps:
- restore_cache:
name: "Restoring <<parameters.cache-id>> cache"
key: <<parameters.cache-id>>-dependency-cache-v4-{{ .Environment.CIRCLE_JOB }}-{{ checksum "<<parameters.path>>/<<parameters.dependency-file>>" }}
key: <<parameters.cache-id>>-dependency-cache-v5-{{ .Environment.CIRCLE_JOB }}-{{ checksum "<<parameters.path>>/<<parameters.dependency-file>>" }}
- run:
name: "<<parameters.package-manager>> install in <<parameters.path>>"
command: |
cd "<<parameters.path>>"
if [[ ! -e node_modules/ ]]; then
if [[ "<<parameters.package-manager>>" == "pnpm" ]]; then
# Create a flat node_modules without symlinks. Same as the node_modules created by npm or Yarn.
<<parameters.package-manager>> install --node-linker=hoisted
<<parameters.package-manager>> install --no-frozen-lockfile --node-linker=hoisted
else
<<parameters.package-manager>> install
fi
fi
- save_cache:
name: "Saving <<parameters.cache-id>> cache"
key: <<parameters.cache-id>>-dependency-cache-v4-{{ .Environment.CIRCLE_JOB }}-{{ checksum "<<parameters.path>>/<<parameters.dependency-file>>" }}
key: <<parameters.cache-id>>-dependency-cache-v5-{{ .Environment.CIRCLE_JOB }}-{{ checksum "<<parameters.path>>/<<parameters.dependency-file>>" }}
paths:
- "<<parameters.path>>/node_modules/"

Expand Down Expand Up @@ -134,7 +127,7 @@ commands:
if [[ "<<parameters.package-manager>>" == "pnpm" ]]; then
<<parameters.package-manager>> install --no-frozen-lockfile --node-linker=hoisted
else
<<parameters.package-manager>> install --no-frozen-lockfile
<<parameters.package-manager>> install
fi
- run:
name: "Sanity check: all transitive dependencies successfully replaced with the tarball"
Expand Down Expand Up @@ -276,7 +269,7 @@ jobs:
# The install command is required again here to create the correct symlinks under the hardhat-core/node_modules
# In our case that is something like: solc -> ../../../node_modules/.pnpm/file+..+solc-js.tgz/node_modules/solc
# See: https://pnpm.io/symlinked-node-modules-structure
pnpm install
pnpm install --no-frozen-lockfile
# TODO: temporarily set hardhat stack traces tests to use cancun hardfork
# Remove this when hardhat switch to cancun by default: https://github.com/NomicFoundation/hardhat/issues/4851
sed -i 's/hardfork: "shanghai",/hardfork: "cancun",/' test/internal/hardhat-network/stack-traces/execution.ts
Expand All @@ -300,7 +293,7 @@ jobs:
export HARDHAT_TESTS_SOLC_PATH HARDHAT_TESTS_SOLC_VERSION
cd packages/hardhat-core/
pnpm install
pnpm install --no-frozen-lockfile
# TODO: temporarily set hardhat stack traces tests to use cancun hardfork
# Remove this when hardhat switch to cancun by default: https://github.com/NomicFoundation/hardhat/issues/4851
sed -i 's/hardfork: "shanghai",/hardfork: "cancun",/' test/internal/hardhat-network/stack-traces/execution.ts
Expand Down

0 comments on commit 95b79a6

Please sign in to comment.