diff --git a/ci/publish-solana-tar.sh b/ci/publish-solana-tar.sh index 2e4aae840a..9de2ad441c 100755 --- a/ci/publish-solana-tar.sh +++ b/ci/publish-solana-tar.sh @@ -43,8 +43,7 @@ echo --- Creating tarball git rev-parse HEAD ) > solana-release/version.txt - scripts/cargo-install-all.sh --root solana-release - scripts/install-native-programs.sh solana-release/bin/deps/ release + scripts/cargo-install-all.sh solana-release ./fetch-perf-libs.sh # shellcheck source=/dev/null diff --git a/net/net.sh b/net/net.sh index 9113063255..48e3f7cc0a 100755 --- a/net/net.sh +++ b/net/net.sh @@ -145,9 +145,7 @@ build() { fi $MAYBE_DOCKER bash -c " set -ex - export NDEBUG=1 - scripts/cargo-install-all.sh --features=$cargoFeatures --root farf - scripts/install-native-programs.sh farf/bin/deps/ release + scripts/cargo-install-all.sh farf \"$cargoFeatures\" " ) echo "Build took $SECONDS seconds" diff --git a/scripts/cargo-install-all.sh b/scripts/cargo-install-all.sh index b30900bbb9..61d7d3914d 100755 --- a/scripts/cargo-install-all.sh +++ b/scripts/cargo-install-all.sh @@ -1,13 +1,27 @@ #!/usr/bin/env bash # # |cargo install| of the top-level crate will not install binaries for -# other workspace creates. +# other workspace crates or native program crates. set -e -cd "$(dirname "$0")/.." + +if [[ -z $1 ]]; then + echo Install directory not specified + exit 1 +fi +installDir="$(mkdir -p "$1"; cd "$1"; pwd)" +cargoFeatures="$2" +echo "Install location: $installDir" + +cd "$(dirname "$0")"/.. SECONDS=0 -CRATES=( +( + set -x + cargo build --all --release --features="$cargoFeatures" +) + +BIN_CRATES=( drone keygen fullnode @@ -18,11 +32,23 @@ CRATES=( ledger-tool wallet ) -for crate in "${CRATES[@]}"; do + +for crate in "${BIN_CRATES[@]}"; do ( set -x - cargo install --path "$crate" "$@" + cargo install --force --path "$crate" --root "$installDir" --features="$cargoFeatures" ) done +for dir in programs/native/*; do + for program in echo target/release/deps/lib{,solana_}"$(basename "$dir")"{,_program}.{so,dylib,dll}; do + if [[ -f $program ]]; then + mkdir -p "$installDir/bin/deps" + rm -f "$installDir/bin/deps/$(basename "$program")" + cp -v "$program" "$installDir"/bin/deps + fi + done +done + +du -a "$installDir" echo "Done after $SECONDS seconds" diff --git a/scripts/install-native-programs.sh b/scripts/install-native-programs.sh deleted file mode 100755 index 1646b09457..0000000000 --- a/scripts/install-native-programs.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash -# -# Installs native programs as |cargo install| doesn't know about them -# -set -e - -here=$(dirname "$0") -SOLANA_ROOT="$(cd "$here"/..; pwd)" - -installDir=$1 -variant=${2:-release} - -if [[ -z $installDir ]]; then - echo Install directory not specified - exit 1 -fi - -for dir in "$SOLANA_ROOT"/programs/native/*; do - for program in echo "$SOLANA_ROOT"/target/"$variant"/deps/lib{,solana_}"$(basename "$dir")"{,_program}.{so,dylib,dll}; do - if [[ -f $program ]]; then - mkdir -p "$installDir" - rm -f "$installDir/$(basename "$program")" - cp -v "$program" "$installDir" - fi - done -done - diff --git a/sdk/docker-solana/build.sh b/sdk/docker-solana/build.sh index 5bf6ac59ff..1e8a42979e 100755 --- a/sdk/docker-solana/build.sh +++ b/sdk/docker-solana/build.sh @@ -18,11 +18,9 @@ if [[ -z $CHANNEL ]]; then fi rm -rf usr/ -../../ci/docker-run.sh solanalabs/rust:1.31.0 bash -c " - set -ex - scripts/cargo-install-all.sh --root sdk/docker-solana/usr - scripts/install-native-programs.sh sdk/docker-solana/usr/bin/deps/ release -" +../../ci/docker-run.sh solanalabs/rust:1.31.0 \ + scripts/cargo-install-all.sh sdk/docker-solana/usr + cp -f entrypoint.sh usr/bin/solana-entrypoint.sh docker build -t solanalabs/solana:$CHANNEL . diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index e81ce53a96..9c16e21e0c 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -91,8 +91,7 @@ parts: - scripts override-build: | # Build/install all programs - scripts/cargo-install-all.sh --root $SNAPCRAFT_PART_INSTALL --bins - scripts/install-native-programs.sh $SNAPCRAFT_PART_INSTALL/bin/deps/ release + scripts/cargo-install-all.sh $SNAPCRAFT_PART_INSTALL # Install multinode-demo/ mkdir -p $SNAPCRAFT_PART_INSTALL/multinode-demo/