Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
Revert "Update build downstream projects script (#35262)" (#35272)
Browse files Browse the repository at this point in the history
This reverts commit 4022434.
  • Loading branch information
steviez authored Feb 21, 2024
1 parent cd4cf81 commit 86b5f3c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 33 deletions.
45 changes: 20 additions & 25 deletions scripts/build-downstream-anchor-projects.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,27 +68,25 @@ anchor() {
cd "$solana_dir"/target/downstream-projects-anchor
}

openbook() {
# Openbook-v2 is still using cargo 1.70.0, which is not compatible with the latest main
rm -rf openbook-v2
git clone https://github.com/openbook-dex/openbook-v2.git
cd openbook-v2
update_solana_dependencies . "$solana_ver"
patch_crates_io_solana Cargo.toml "$solana_dir"
$cargo_build_sbf --features enable-gpl
cd programs/openbook-v2
$cargo_test_sbf --features enable-gpl
}

mango() {
(
set -x
rm -rf mango-v4
git clone https://github.com/blockworks-foundation/mango-v4.git
cd mango-v4
rm -rf mango-v3
git clone https://github.com/blockworks-foundation/mango-v3
# copy toolchain file to use solana's rust version
cp "$solana_dir"/rust-toolchain.toml mango-v3/
cd mango-v3

update_solana_dependencies . "$solana_ver"
patch_crates_io_solana_no_header Cargo.toml "$solana_dir"
$cargo_test_sbf --features enable-gpl
update_anchor_dependencies . "$anchor_ver"
patch_crates_io_solana Cargo.toml "$solana_dir"
patch_crates_io_anchor Cargo.toml "$anchor_dir"

cd program
$cargo build
$cargo test
$cargo_build_sbf
$cargo_test_sbf
)
}

Expand All @@ -99,21 +97,18 @@ metaplex() {
git clone https://github.com/metaplex-foundation/mpl-token-metadata
# copy toolchain file to use solana's rust version
cp "$solana_dir"/rust-toolchain.toml mpl-token-metadata/
cd mpl-token-metadata
./configs/program-scripts/dump.sh ./programs/bin
ROOT_DIR=$(pwd)
cd programs/token-metadata
cd mpl-token-metadata/programs/token-metadata/program

update_solana_dependencies . "$solana_ver"
patch_crates_io_solana Cargo.toml "$solana_dir"

OUT_DIR="$ROOT_DIR"/programs/bin
export SBF_OUT_DIR="$OUT_DIR"
$cargo_test_sbf --sbf-out-dir "${OUT_DIR}"
$cargo build
$cargo test
$cargo_build_sbf
$cargo_test_sbf
)
}

_ anchor
#_ metaplex
#_ mango
#_ openbook
8 changes: 0 additions & 8 deletions scripts/patch-crates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,6 @@ patch_crates_io_solana() {
declare solana_dir="$2"
cat >> "$Cargo_toml" <<EOF
[patch.crates-io]
EOF
patch_crates_io_solana_no_header Cargo_toml solana_dir
}

patch_crates_io_solana_no_header() {
declare Cargo_toml="$1"
declare solana_dir="$2"
cat >> "$Cargo_toml" <<EOF
solana-account-decoder = { path = "$solana_dir/account-decoder" }
solana-clap-utils = { path = "$solana_dir/clap-utils" }
solana-client = { path = "$solana_dir/client" }
Expand Down

0 comments on commit 86b5f3c

Please sign in to comment.