From 521217ea3338dadbddc587f97ddea0167e723c3d Mon Sep 17 00:00:00 2001 From: pavel-raykov <165708424+pavel-raykov@users.noreply.github.com> Date: Wed, 26 Feb 2025 11:41:58 +0100 Subject: [PATCH] Remove bash wrappers and invoke solidity compilation directly. (#16568) * Minor * Minor --- .changeset/wet-suits-worry.md | 5 +++ .../generation/compile_contracts.sh | 32 ----------------- .../generation/compile_event_mock_contract.sh | 34 ------------------- core/gethwrappers/go_generate.go | 6 ++-- 4 files changed, 8 insertions(+), 69 deletions(-) create mode 100644 .changeset/wet-suits-worry.md delete mode 100755 core/gethwrappers/generation/compile_contracts.sh delete mode 100755 core/gethwrappers/generation/compile_event_mock_contract.sh diff --git a/.changeset/wet-suits-worry.md b/.changeset/wet-suits-worry.md new file mode 100644 index 00000000000..3ce904a90d3 --- /dev/null +++ b/.changeset/wet-suits-worry.md @@ -0,0 +1,5 @@ +--- +"chainlink": minor +--- + +#removed Remove bash wrappers and call solidity compilation directly. diff --git a/core/gethwrappers/generation/compile_contracts.sh b/core/gethwrappers/generation/compile_contracts.sh deleted file mode 100755 index 627e0d52b57..00000000000 --- a/core/gethwrappers/generation/compile_contracts.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash - -echo "compiling contracts" - -CDIR="$(dirname "$0")" -COMPILE_COMMAND="$CDIR/../../../contracts/scripts/native_solc_compile_all" - - -# Only print compilation output on failure. -OUT="$(bash -c "${COMPILE_COMMAND}" 2>&1)" -ERR="$?" - -# shellcheck disable=SC2181 -if [ "$ERR" != "0" ]; then - echo - echo "↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓" - echo "Error while compiling solidity contracts. See below for output." - echo "You can reproduce this error directly by running the command" - echo - echo " " "$COMPILE_COMMAND" - echo - echo "in the directory $SOLIDITY_DIR" - echo - echo "This is probably a problem with a solidity contract, under the" - echo "directory contracts/src/." - echo "↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑" - echo - echo "$OUT" - exit 1 -fi - -echo "finished compilation" diff --git a/core/gethwrappers/generation/compile_event_mock_contract.sh b/core/gethwrappers/generation/compile_event_mock_contract.sh deleted file mode 100755 index a576a16adf6..00000000000 --- a/core/gethwrappers/generation/compile_event_mock_contract.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -echo "compiling contracts" - -CDIR="$(dirname "$0")" -COMPILE_COMMAND="$CDIR/../../../contracts/scripts/native_solc_compile_all_events_mock" - - -# Only print compilation output on failure. -OUT="$(bash -c "${COMPILE_COMMAND}" 2>&1)" -ERR="$?" - -# shellcheck disable=SC2181 -if [ "$ERR" != "0" ]; then - echo - echo "↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓" - echo "Error while compiling solidity contracts. See below for output." - echo "You can reproduce this error directly by running the command" - echo - echo " " "$COMPILE_COMMAND" - echo - echo "in the directory $SOLIDITY_DIR" - echo - echo "This is probably a problem with a solidity contract, under the" - echo "directory contracts/src/." - echo "↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑" - echo - echo "$OUT" - exit 1 -fi - -echo "finished compilation" diff --git a/core/gethwrappers/go_generate.go b/core/gethwrappers/go_generate.go index 339c27d98d5..506a214b5cb 100644 --- a/core/gethwrappers/go_generate.go +++ b/core/gethwrappers/go_generate.go @@ -3,7 +3,7 @@ package gethwrappers // Make sure solidity compiler artifacts are up-to-date. Only output stdout on failure. -//go:generate ./generation/compile_contracts.sh +//go:generate ../../contracts/scripts/native_solc_compile_all //go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.19/Operator/Operator.abi ../../contracts/solc/v0.8.19/Operator/Operator.bin Operator operator_wrapper //go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.19/OperatorFactory/OperatorFactory.abi ../../contracts/solc/v0.8.19/OperatorFactory/OperatorFactory.bin OperatorFactory operator_factory @@ -161,6 +161,6 @@ package gethwrappers // The flow is as follows: // 1. Compile all non events mock contracts. // 2. Generate events mock .sol files based on ABI of compiled contracts. -// 3. Compile events mock contracts. ./generation/compile_event_mock_contract.sh calls contracts/scripts/native_solc_compile_all_events_mock to compile events mock contracts. +// 3. Compile mocks by calling contracts/scripts/native_solc_compile_all_events_mock to compile events mock contracts. // 4. Generate wrappers for events mock contracts. -//go:generate ./generation/compile_event_mock_contract.sh +//go:generate ../../contracts/scripts/native_solc_compile_all_events_mock