Skip to content

Commit

Permalink
platform-tools-solana: Add action for building Solana Platform toolchain
Browse files Browse the repository at this point in the history
  • Loading branch information
vadorovsky committed Nov 2, 2023
1 parent c605f7c commit 8761558
Show file tree
Hide file tree
Showing 2 changed files with 600 additions and 2 deletions.
46 changes: 44 additions & 2 deletions .github/workflows/platform-tools-solana.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,29 +49,71 @@ jobs:
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
echo -e deb http://apt.llvm.org/focal/ llvm-toolchain-focal-${{ env.LLVM_VERSION }} main | sudo tee /etc/apt/sources.list.d/llvm.list
sudo apt update
sudo apt -y install clang-${{ env.LLVM_VERSION }} cmake lld-${{ env.LLVM_VERSION }} ninja-build
sudo apt -y install \
clang-${{ env.LLVM_VERSION }} \
cmake \
lld-${{ env.LLVM_VERSION }} \
ninja-build
echo /usr/lib/llvm-${{ env.LLVM_VERSION }}/bin >> $GITHUB_PATH
- name: Install dependencies
if: startsWith(matrix.os, 'macos')
run: |
brew install cmake ninja
- name: Install musl
if: matrix.target == 'aarch64-unknown-linux-musl'
run: |
sudo sed -i 's/^deb /deb [arch=amd64] /g' /etc/apt/sources.list
sudo tee -a /etc/apt/sources.list << EOF
deb [arch=arm64] http://ports.ubuntu.com/ jammy main restricted universe multiverse
deb [arch=arm64] http://ports.ubuntu.com/ jammy-security main restricted universe multiverse
deb [arch=arm64] http://ports.ubuntu.com/ jammy-updates main restricted universe multiverse
deb [arch=arm64] http://ports.ubuntu.com/ jammy-backports main restricted universe multiverse
EOF
sudo dpkg --add-architecture arm64
sudo apt update
sudo apt -y musl-dev:arm64
- name: Install musl
if: matrix.target == 'x86_64-unknown-linux-gnu'
run: |
sudo apt -y musl-dev
- name: Checkout code
uses: actions/checkout@v2
with:
path: binaries

- name: Checkout Rust code
uses: actions/checkout@v2
with:
path: rust
repository: solana-labs/rust
ref: solana-tools-${{ steps.extract_version.outputs.version }}

- name: Build Rust
run: |
cd rust
cp ../binaries/platform-tools-solana/config.toml .
./x.py build --stage 1 --target ${{ matrix.target }},sbf-solana-solana
- name: Setup tmate session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3

- name: Checkout Cargo code
uses: actions/checkout@v2
with:
repository: solana-labs/caego
path: cargo
repository: solana-labs/cargo
ref: solana-tools-${{ steps.extract_version.outputs.version }}

- name: Build Cargo
env:
OPENSSL_STATIC: 1
run: |
cd cargo
cargo build --release
- name: Copy Rust build products
Expand Down
Loading

0 comments on commit 8761558

Please sign in to comment.