Ship native programs

This commit is contained in:
Michael Vines 2018-10-09 15:54:15 -07:00
parent 5f8cbf359e
commit 5c523716aa
4 changed files with 34 additions and 0 deletions

View File

@ -20,6 +20,7 @@ rm -rf usr/
../docker-run.sh solanalabs/rust:1.29.1 \
cargo install --path . --root ci/docker-solana/usr
cp -f entrypoint.sh usr/bin/solana-entrypoint.sh
../../scripts/install-native-programs.sh usr/bin/
docker build -t solanalabs/solana:$CHANNEL .

View File

@ -110,6 +110,7 @@ build() {
set -x
rm -rf farf
$MAYBE_DOCKER cargo install --features="$cargoFeatures" --root farf
./scripts/install-native-programs.sh farf/
)
echo "Build took $SECONDS seconds"
}

View File

@ -0,0 +1,29 @@
#!/bin/bash -e
#
# Installs native programs as |cargo install| doesn't know about them
#
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
if [[ ! -d $installDir ]]; then
echo "Not a directory: $installDir"
exit 1
fi
for dir in "$SOLANA_ROOT"/programs/native/*; do
for program in "$SOLANA_ROOT/target/$variant/deps/lib$(basename "$dir")".{so,dylib,dll}; do
if [[ -f $program ]]; then
cp -v "$program" "$installDir"
fi
done
done

View File

@ -117,6 +117,9 @@ parts:
# Build/install all other programs
cargo install --root $SNAPCRAFT_PART_INSTALL --bins
# TODO: install native programs when they are ready for public use
#./scripts/install-native-programs.sh $SNAPCRAFT_PART_INSTALL/bin/
# Install multinode-demo/
mkdir -p $SNAPCRAFT_PART_INSTALL/multinode-demo/
cp -av multinode-demo/* $SNAPCRAFT_PART_INSTALL/multinode-demo/