|
|
@@ -96,36 +96,41 @@ if [[ $CI_OS_NAME = windows ]]; then
|
|
|
solana-test-validator
|
|
|
solana-tokens
|
|
|
)
|
|
|
+ DCOU_BINS=()
|
|
|
else
|
|
|
./fetch-perf-libs.sh
|
|
|
|
|
|
BINS=(
|
|
|
solana
|
|
|
- solana-bench-tps
|
|
|
solana-faucet
|
|
|
solana-genesis
|
|
|
solana-gossip
|
|
|
agave-install
|
|
|
solana-keygen
|
|
|
- agave-ledger-tool
|
|
|
solana-log-analyzer
|
|
|
solana-net-shaper
|
|
|
agave-validator
|
|
|
rbpf-cli
|
|
|
)
|
|
|
+ DCOU_BINS=(
|
|
|
+ agave-ledger-tool
|
|
|
+ solana-bench-tps
|
|
|
+ )
|
|
|
|
|
|
# Speed up net.sh deploys by excluding unused binaries
|
|
|
if [[ -z "$validatorOnly" ]]; then
|
|
|
BINS+=(
|
|
|
cargo-build-sbf
|
|
|
cargo-test-sbf
|
|
|
- solana-dos
|
|
|
agave-install-init
|
|
|
solana-stake-accounts
|
|
|
solana-test-validator
|
|
|
solana-tokens
|
|
|
agave-watchtower
|
|
|
)
|
|
|
+ DCOU_BINS+=(
|
|
|
+ solana-dos
|
|
|
+ )
|
|
|
fi
|
|
|
fi
|
|
|
|
|
|
@@ -134,12 +139,52 @@ for bin in "${BINS[@]}"; do
|
|
|
binArgs+=(--bin "$bin")
|
|
|
done
|
|
|
|
|
|
+dcouBinArgs=()
|
|
|
+for bin in "${DCOU_BINS[@]}"; do
|
|
|
+ dcouBinArgs+=(--bin "$bin")
|
|
|
+done
|
|
|
+
|
|
|
+source "$SOLANA_ROOT"/scripts/dcou-tainted-packages.sh
|
|
|
+
|
|
|
+excludeArgs=()
|
|
|
+for package in "${dcou_tainted_packages[@]}"; do
|
|
|
+ excludeArgs+=(--exclude "$package")
|
|
|
+done
|
|
|
+
|
|
|
mkdir -p "$installDir/bin"
|
|
|
|
|
|
+# Some binaries (like the notable agave-ledger-tool) need to acitivate
|
|
|
+# the dev-context-only-utils feature flag to build.
|
|
|
+# Build those binaries separately to avoid the unwanted feature unification.
|
|
|
+# Note that `--workspace --exclude <dcou tainted packages>` is needed to really
|
|
|
+# inhibit the feature unification due to a cargo bug. Otherwise, feature
|
|
|
+# unification happens even if cargo build is run only with `--bin` targets
|
|
|
+# which don't depend on dcou as part of dependencies at all.
|
|
|
(
|
|
|
set -x
|
|
|
- # shellcheck disable=SC2086 # Don't want to double quote $rust_version
|
|
|
- "$cargo" $maybeRustVersion build $buildProfileArg "${binArgs[@]}"
|
|
|
+ # Make sure dcou is really disabled by peeking the (unstable) build plan
|
|
|
+ # output after turning rustc into the nightly mode with RUSTC_BOOTSTRAP=1.
|
|
|
+ # In this way, additional requirement of nightly rustc toolchian is avoided.
|
|
|
+ # Note that `cargo tree` can't be used, because it doesn't support `--bin`.
|
|
|
+ # shellcheck disable=SC2086 # Don't want to double quote $maybeRustVersion
|
|
|
+ if (RUSTC_BOOTSTRAP=1 \
|
|
|
+ "$cargo" $maybeRustVersion build \
|
|
|
+ -Z unstable-options --build-plan \
|
|
|
+ $buildProfileArg "${binArgs[@]}" --workspace "${excludeArgs[@]}" | \
|
|
|
+ grep -q -F '"feature=\"dev-context-only-utils\""'); then
|
|
|
+ echo 'dcou feature activation is incorrctly activated!' && \
|
|
|
+ exit 1
|
|
|
+ fi
|
|
|
+
|
|
|
+ # Build our production binaries without dcou.
|
|
|
+ # shellcheck disable=SC2086 # Don't want to double quote $maybeRustVersion
|
|
|
+ "$cargo" $maybeRustVersion build \
|
|
|
+ $buildProfileArg "${binArgs[@]}" --workspace "${excludeArgs[@]}"
|
|
|
+
|
|
|
+ # Finally, build the remaining dev tools with dcou.
|
|
|
+ # shellcheck disable=SC2086 # Don't want to double quote $maybeRustVersion
|
|
|
+ "$cargo" $maybeRustVersion build \
|
|
|
+ $buildProfileArg "${dcouBinArgs[@]}"
|
|
|
|
|
|
# Exclude `spl-token` binary for net.sh builds
|
|
|
if [[ -z "$validatorOnly" ]]; then
|
|
|
@@ -155,7 +200,7 @@ mkdir -p "$installDir/bin"
|
|
|
fi
|
|
|
)
|
|
|
|
|
|
-for bin in "${BINS[@]}"; do
|
|
|
+for bin in "${BINS[@]}" "${DCOU_BINS[@]}"; do
|
|
|
cp -fv "target/$buildProfile/$bin" "$installDir"/bin
|
|
|
done
|
|
|
|