pin pnpm version to be installed as rln dep

This commit is contained in:
stubbsta 2025-12-08 11:09:02 +02:00
parent cfa7f51bb1
commit 12f795e04d
No known key found for this signature in database
3 changed files with 42 additions and 6 deletions

View File

@ -120,6 +120,8 @@ endif
.PHONY: deps libbacktrace .PHONY: deps libbacktrace
FOUNDRY_VERSION := 1.4.2 FOUNDRY_VERSION := 1.4.2
PNPM_VERSION := 10.0.0
rustup: rustup:
ifeq (, $(shell which cargo)) ifeq (, $(shell which cargo))
@ -130,7 +132,7 @@ ifeq (, $(shell which cargo))
endif endif
rln-deps: rustup rln-deps: rustup
./scripts/install_rln_tests_dependencies.sh $(FOUNDRY_VERSION) ./scripts/install_rln_tests_dependencies.sh $(FOUNDRY_VERSION) $(PNPM_VERSION)
deps: | deps-common nat-libs waku.nims deps: | deps-common nat-libs waku.nims

View File

@ -1,8 +1,41 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Install pnpm # Install pnpm
if ! command -v pnpm &> /dev/null; then
echo "pnpm is not installed, installing it now..." REQUIRED_PNPM_VERSION="$1"
npm i pnpm --global
if command -v pnpm &> /dev/null; then
# pnpm is already installed; check the current version.
CURRENT_PNPM_VERSION=$(pnpm --version 2>/dev/null)
if [ -n "$CURRENT_PNPM_VERSION" ]; then
# Compare CURRENT_PNPM_VERSION < REQUIRED_PNPM_VERSION using sort -V
lower_version=$(printf '%s\n%s\n' "$CURRENT_PNPM_VERSION" "$REQUIRED_PNPM_VERSION" | sort -V | head -n1)
if [ "$lower_version" != "$REQUIRED_PNPM_VERSION" ]; then
echo "pnpm is already installed with version $CURRENT_PNPM_VERSION, which is older than the required $REQUIRED_PNPM_VERSION. Please update pnpm manually if needed."
fi
fi
else
# Install pnpm using the standalone installer
if [ -n "$REQUIRED_PNPM_VERSION" ]; then
echo "Installing pnpm version $REQUIRED_PNPM_VERSION..."
curl -fsSL https://get.pnpm.io/install.sh | env PNPM_VERSION=$REQUIRED_PNPM_VERSION sh -
else
echo "Installing latest pnpm..."
curl -fsSL https://get.pnpm.io/install.sh | sh -
fi
# Add pnpm to PATH for this script session
export PNPM_HOME="${PNPM_HOME:-$HOME/.local/share/pnpm}"
export PATH="$PNPM_HOME:$PATH"
# Verify pnpm was installed
if ! command -v pnpm >/dev/null 2>&1; then
echo "Error: pnpm installation failed"
exit 1
fi
echo "pnpm successfully installed: $(pnpm --version)"
fi fi

View File

@ -4,5 +4,6 @@
FOUNDRY_VERSION="$1" FOUNDRY_VERSION="$1"
./scripts/install_anvil.sh "$FOUNDRY_VERSION" ./scripts/install_anvil.sh "$FOUNDRY_VERSION"
#Install pnpm # Install pnpm
./scripts/install_pnpm.sh PNPM_VERSION="$2"
./scripts/install_pnpm.sh "$PNPM_VERSION"