Skip to content

Commit

Permalink
Merge pull request #2 from dmakarov/v1.1
Browse files Browse the repository at this point in the history
Bump to Rust 1.50
  • Loading branch information
dmakarov authored Mar 9, 2021
2 parents 9939346 + 1624e00 commit e73b2ec
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 36 deletions.
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ if [ "$(uname)" == "Darwin" ]; then
cp osx/out/solana-bpf-tools-osx.tar.bz2 deploy
else
echo Warning: Local machine not a Mac, cannot build osx variant, skipping
fi
fi
6 changes: 3 additions & 3 deletions linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ RUN cargo --version
# ADD scripts /tmp/scripts

# Checkout the source code
RUN git clone --single-branch --branch solana-1.46 https://github.com/solana-labs/rust.git && \
RUN git clone --single-branch --branch solana-1.50 https://github.com/solana-labs/rust.git && \
echo "$( cd rust && git rev-parse HEAD ) https://github.com/solana-labs/rust.git" >> ../rust_version.md
RUN git clone --single-branch --branch rust-1.49.0 https://github.com/rust-lang/cargo.git && \
RUN git clone --single-branch --branch rust-1.50.0 https://github.com/rust-lang/cargo.git && \
echo "$( cd cargo && git rev-parse HEAD ) https://github.com/rust-lang/cargo.git" >> ../cargo_version.md

RUN cd rust && \
Expand All @@ -88,7 +88,7 @@ COPY --from=builder cargo/target/release/cargo /usr/local/rust/bin
run mkdir -p /usr/local/llvm/bin
COPY --from=builder /rust/build/x86_64-unknown-linux-gnu/llvm/build/bin/clang /usr/local/llvm/bin
COPY --from=builder /rust/build/x86_64-unknown-linux-gnu/llvm/build/bin/clang++ /usr/local/llvm/bin
COPY --from=builder /rust/build/x86_64-unknown-linux-gnu/llvm/build/bin/clang-10 /usr/local/llvm/bin
COPY --from=builder /rust/build/x86_64-unknown-linux-gnu/llvm/build/bin/clang-11 /usr/local/llvm/bin
COPY --from=builder /rust/build/x86_64-unknown-linux-gnu/llvm/build/bin/clang-cl /usr/local/llvm/bin
COPY --from=builder /rust/build/x86_64-unknown-linux-gnu/llvm/build/bin/clang-cpp /usr/local/llvm/bin
COPY --from=builder /rust/build/x86_64-unknown-linux-gnu/llvm/build/bin/ld.lld /usr/local/llvm/bin
Expand Down
3 changes: 1 addition & 2 deletions linux/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ mkdir -p deploy/rust/lib/rustlib/x86_64-unknown-linux-gnu/bin # Needed by xargo
mkdir -p deploy/llvm/bin
docker cp "$id":/usr/local/llvm/bin/clang deploy/llvm/bin
docker cp "$id":/usr/local/llvm/bin/clang++ deploy/llvm/bin
docker cp "$id":/usr/local/llvm/bin/clang-10 deploy/llvm/bin
docker cp "$id":/usr/local/llvm/bin/clang-11 deploy/llvm/bin
docker cp "$id":/usr/local/llvm/bin/clang-cl deploy/llvm/bin
docker cp "$id":/usr/local/llvm/bin/clang-cpp deploy/llvm/bin
docker cp "$id":/usr/local/llvm/bin/ld.lld deploy/llvm/bin
Expand All @@ -42,4 +42,3 @@ docker cp "$id":/usr/local/llvm/lib deploy/llvm
docker rm -v "$id"

tar -C deploy -jcf solana-bpf-tools-linux.tar.bz2 .

60 changes: 30 additions & 30 deletions osx/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,54 +3,54 @@ set -ex

cd "$(dirname "$0")"

# rm -rf out
# mkdir -p out
rm -rf out
mkdir -p out
cd out

# git clone --single-branch --branch solana-1.46 https://github.com/solana-labs/rust.git
# echo "$( cd rust && git rev-parse HEAD ) https://github.com/solana-labs/rust.git" >> version.md
git clone --single-branch --branch solana-1.50 https://github.com/solana-labs/rust.git
echo "$( cd rust && git rev-parse HEAD ) https://github.com/solana-labs/rust.git" >> version.md

# # note, branch v1.46.0, v1.47.0, and v1.48.0 fail to build
# git clone --single-branch --branch rust-1.49.0 https://github.com/rust-lang/cargo.git
# echo "$( cd cargo && git rev-parse HEAD ) https://github.com/rust-lang/cargo.git" >> version.md
git clone --single-branch --branch rust-1.50.0 https://github.com/rust-lang/cargo.git
echo "$( cd cargo && git rev-parse HEAD ) https://github.com/rust-lang/cargo.git" >> version.md

# pushd rust
# ./build.sh --llvm
# popd
pushd rust
./build.sh --llvm
popd

# pushd cargo
# export OPENSSL_STATIC=1
# cargo build --release
# popd
pushd cargo
export OPENSSL_STATIC=1
cargo build --release
popd

# TODO remove
rm -rf deploy

# Copy rust build products
mkdir -p deploy/rust/bin
cp version.md deploy
cp -rf rust/build/x86_64-apple-darwin/stage1/* deploy/rust
cp -R rust/build/x86_64-apple-darwin/stage1 deploy/rust
cp cargo/target/release/cargo deploy/rust/bin/
mkdir -p deploy/rust/lib/rustlib/x86_64-apple-darwin/bin # Needed by xargo

# Copy llvm build products
mkdir -p deploy/llvm/bin
cp -rf rust/build/x86_64-apple-darwin/llvm/build/bin/clang deploy/llvm/bin
cp -rf rust/build/x86_64-apple-darwin/llvm/build/bin/clang++ deploy/llvm/bin
cp -rf rust/build/x86_64-apple-darwin/llvm/build/bin/clang-10 deploy/llvm/bin
cp -rf rust/build/x86_64-apple-darwin/llvm/build/bin/clang-cl deploy/llvm/bin
cp -rf rust/build/x86_64-apple-darwin/llvm/build/bin/clang-cpp deploy/llvm/bin
cp -rf rust/build/x86_64-apple-darwin/llvm/build/bin/ld.lld deploy/llvm/bin
cp -rf rust/build/x86_64-apple-darwin/llvm/build/bin/ld64.lld deploy/llvm/bin
cp -rf rust/build/x86_64-apple-darwin/llvm/build/bin/llc deploy/llvm/bin
cp -rf rust/build/x86_64-apple-darwin/llvm/build/bin/lld deploy/llvm/bin
cp -rf rust/build/x86_64-apple-darwin/llvm/build/bin/lld-link deploy/llvm/bin
cp -rf rust/build/x86_64-apple-darwin/llvm/build/bin/llvm-ar deploy/llvm/bin
cp -rf rust/build/x86_64-apple-darwin/llvm/build/bin/llvm-objcopy deploy/llvm/bin
cp -rf rust/build/x86_64-apple-darwin/llvm/build/bin/llvm-objdump deploy/llvm/bin
cp -rf rust/build/x86_64-apple-darwin/llvm/build/bin/llvm-readelf deploy/llvm/bin
cp -rf rust/build/x86_64-apple-darwin/llvm/build/bin/llvm-readobj deploy/llvm/bin
cp -R rust/build/x86_64-apple-darwin/llvm/build/bin/clang deploy/llvm/bin/
cp -R rust/build/x86_64-apple-darwin/llvm/build/bin/clang++ deploy/llvm/bin/
cp -R rust/build/x86_64-apple-darwin/llvm/build/bin/clang-11 deploy/llvm/bin/
cp -R rust/build/x86_64-apple-darwin/llvm/build/bin/clang-cl deploy/llvm/bin/
cp -R rust/build/x86_64-apple-darwin/llvm/build/bin/clang-cpp deploy/llvm/bin/
cp -R rust/build/x86_64-apple-darwin/llvm/build/bin/ld.lld deploy/llvm/bin/
cp -R rust/build/x86_64-apple-darwin/llvm/build/bin/ld64.lld deploy/llvm/bin/
cp -R rust/build/x86_64-apple-darwin/llvm/build/bin/llc deploy/llvm/bin/
cp -R rust/build/x86_64-apple-darwin/llvm/build/bin/lld deploy/llvm/bin/
cp -R rust/build/x86_64-apple-darwin/llvm/build/bin/lld-link deploy/llvm/bin/
cp -R rust/build/x86_64-apple-darwin/llvm/build/bin/llvm-ar deploy/llvm/bin/
cp -R rust/build/x86_64-apple-darwin/llvm/build/bin/llvm-objcopy deploy/llvm/bin/
cp -R rust/build/x86_64-apple-darwin/llvm/build/bin/llvm-objdump deploy/llvm/bin/
cp -R rust/build/x86_64-apple-darwin/llvm/build/bin/llvm-readelf deploy/llvm/bin/
cp -R rust/build/x86_64-apple-darwin/llvm/build/bin/llvm-readobj deploy/llvm/bin/
mkdir -p deploy/llvm/lib
cp -rf rust/build/x86_64-apple-darwin/llvm/build/lib/clang deploy/llvm/lib
cp -R rust/build/x86_64-apple-darwin/llvm/build/lib/clang deploy/llvm/lib/

tar -C deploy -jcf solana-bpf-tools-osx.tar.bz2 .

0 comments on commit e73b2ec

Please sign in to comment.