Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add helper script to compile solana artifacts locally #16180

Merged
merged 3 commits into from
Feb 5, 2025
Merged

Conversation

tt-cll
Copy link
Contributor

@tt-cll tt-cll commented Jan 31, 2025

@tt-cll
Copy link
Contributor Author

tt-cll commented Jan 31, 2025

abbrevieated output:

ttata@MB-KN79CFQTC4 deployment % ./setup_solana_for_tests.sh
Cloning chainlink-ccip...
Cloning into '/var/folders/pm/1lgv9cnn42bds51rvgs7kmdm0000gp/T/tmp.ghoLuIBlRr'...
remote: Enumerating objects: 11443, done.
remote: Counting objects: 100% (3155/3155), done.
remote: Compressing objects: 100% (973/973), done.
remote: Total 11443 (delta 2787), reused 2191 (delta 2180), pack-reused 8288 (from 4)
Receiving objects: 100% (11443/11443), 4.05 MiB | 695.00 KiB/s, done.
Resolving deltas: 100% (7920/7920), done.
Checking out commit 9b02e505b268...
Note: switching to '9b02e505b268'.

<anchor build output removed for brevity>

   Compiling ccip_invalid_receiver v0.0.0-dev (/private/var/folders/pm/1lgv9cnn42bds51rvgs7kmdm0000gp/T/tmp.ghoLuIBlRr/chains/solana/contracts/programs/ccip-invalid-receiver)
    Finished release [optimized] target(s) in 0.71s
Copying compiled artifacts to /Users/ttata/dev/chainlink/deployment/ccip/changeset/internal/solana_contracts...
Script completed successfully.
Cleaning up...

artifacts populated and subsequent tests pass

AnieeG
AnieeG previously approved these changes Jan 31, 2025
Copy link
Contributor

github-actions bot commented Jan 31, 2025

AER Report: CI Core ran successfully ✅

aer_workflow , commit

AER Report: Operator UI CI ran successfully ✅

aer_workflow , commit

Comment on lines 28 to 50
# Parse the go.mod file for the specific entry
MOD_ENTRY=$(grep -E 'github\.com/smartcontractkit/chainlink-ccip/chains/solana\s+v[0-9]+\.[0-9]+\.[0-9]+-[0-9]+-[a-f0-9]+' "$GO_MOD_FILE")
if [[ -z "$MOD_ENTRY" ]]; then
echo "Error: Could not find the required entry in go.mod."
exit 1
fi

# Extract repo URL and pseudo-version
PSEUDO_VERSION=$(echo "$MOD_ENTRY" | awk '{print $2}')

# Extract commit SHA from pseudo-version (last 12 characters)
COMMIT_SHA=$(echo "$PSEUDO_VERSION" | grep -oE '[a-f0-9]{12}$')
if [[ -z "$COMMIT_SHA" ]]; then
echo "Error: Could not extract commit SHA from pseudo-version: $PSEUDO_VERSION"
exit 1
fi

echo "Cloning chainlink-ccip..."
git clone https://github.com/smartcontractkit/chainlink-ccip.git "$TEMP_REPO_DIR"

echo "Checking out commit $COMMIT_SHA..."
cd "$TEMP_REPO_DIR"
git checkout "$COMMIT_SHA"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok we can avoid all these steps (and additional cloning etc) by using the dependency fetched by go mod:

SOLANA_DIR=$(go list -m -f "{{.Dir}}" github.com/smartcontractkit/chainlink-ccip/chains/solana)
cd SOLANA_DIR
make docker-build-contracts

You might have some issues with the files being marked read-only, we could get around that by specifying $TARGET_DIR (solana_contracts) as the mount for target/deploy

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very clever! Let me see how easy this is

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

smartcontractkit/chainlink-ccip#554 it was easier to just mount all of target

@tt-cll tt-cll requested review from archseer and AnieeG February 4, 2025 19:13
@tt-cll tt-cll changed the title add helper script to compile sol artifacts locally add helper script to compile solana artifacts locally Feb 4, 2025
@cl-sonarqube-production
Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@archseer archseer enabled auto-merge February 5, 2025 01:44
@archseer archseer added this pull request to the merge queue Feb 5, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 5, 2025
@tt-cll tt-cll added this pull request to the merge queue Feb 5, 2025
Merged via the queue into develop with commit aed9754 Feb 5, 2025
103 of 104 checks passed
@tt-cll tt-cll deleted the tt/solHelper branch February 5, 2025 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants