Skip to content

Commit

Permalink
ci: introduce rust toolchain
Browse files Browse the repository at this point in the history
Co-authored-by: Luke Parker <[email protected]>
  • Loading branch information
tobtoht and kayabaNerve committed Feb 9, 2025
1 parent 4e15e5e commit fb77f11
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ env:
REMOVE_BUNDLED_PACKAGES : sudo rm -rf /usr/local
# ARCH="default" (not "native") ensures, that a different execution host can execute binaries compiled elsewhere.
BUILD_DEFAULT_LINUX: 'cmake -S . -B build -D ARCH="default" -D BUILD_TESTS=ON -D CMAKE_BUILD_TYPE=Release && cmake --build build --target all && cmake --build build --target wallet_api'
APT_INSTALL_LINUX: 'apt -y install build-essential cmake libboost-all-dev miniupnpc libunbound-dev graphviz doxygen libunwind8-dev pkg-config libssl-dev libzmq3-dev libsodium-dev libhidapi-dev libusb-1.0-0-dev libprotobuf-dev protobuf-compiler ccache git'
APT_INSTALL_LINUX: 'apt -y install build-essential cargo cmake libboost-all-dev miniupnpc libunbound-dev graphviz doxygen libunwind8-dev pkg-config libssl-dev libzmq3-dev libsodium-dev libhidapi-dev libusb-1.0-0-dev libprotobuf-dev protobuf-compiler ccache curl git'
APT_SET_CONF: |
tee -a /etc/apt/apt.conf.d/80-custom << EOF
Acquire::Retries "3";
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
- uses: msys2/setup-msys2@v2
with:
update: true
install: mingw-w64-x86_64-toolchain make mingw-w64-x86_64-cmake mingw-w64-x86_64-ccache mingw-w64-x86_64-boost mingw-w64-x86_64-openssl mingw-w64-x86_64-zeromq mingw-w64-x86_64-libsodium mingw-w64-x86_64-hidapi mingw-w64-x86_64-protobuf mingw-w64-x86_64-libusb mingw-w64-x86_64-unbound git pkg-config
install: mingw-w64-x86_64-toolchain make mingw-w64-x86_64-cmake mingw-w64-x86_64-ccache mingw-w64-x86_64-boost mingw-w64-x86_64-openssl mingw-w64-x86_64-zeromq mingw-w64-x86_64-libsodium mingw-w64-x86_64-hidapi mingw-w64-x86_64-protobuf mingw-w64-x86_64-libusb mingw-w64-x86_64-unbound mingw-w64-x86_64-rust git pkg-config
- uses: ./.github/actions/set-make-job-count
- name: build
run: |
Expand All @@ -87,7 +87,7 @@ jobs:
image: archlinux:latest
steps:
- name: install dependencies
run: pacman -Syyu --noconfirm base-devel git cmake boost openssl zeromq unbound libsodium readline expat gtest python3 doxygen graphviz hidapi libusb protobuf
run: pacman -Syyu --noconfirm base-devel git rust cmake boost openssl zeromq unbound libsodium readline expat gtest python3 doxygen graphviz hidapi libusb protobuf
- name: configure git
run: git config --global --add safe.directory '*'
- uses: actions/checkout@v4
Expand All @@ -114,6 +114,14 @@ jobs:
run: apt update
- name: install monero dependencies
run: ${{env.APT_INSTALL_LINUX}}
- name: install rust
# Debian 10 ships Rust 1.41.1. We need >=1.69 to build FCMP++.
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
export PATH="$HOME/.cargo/bin:$PATH"
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
rustup toolchain install 1.69
rustup default 1.69
- name: configure git
run: git config --global --add safe.directory '*'
- uses: actions/checkout@v4
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/depends.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,40 +36,62 @@ jobs:
toolchain:
- name: "RISCV 64bit"
host: "riscv64-linux-gnu"
rust_host: "riscv64gc-unknown-linux-gnu"
packages: "g++-riscv64-linux-gnu"
- name: "ARM v7"
host: "arm-linux-gnueabihf"
rust_host: "armv7-unknown-linux-gnueabihf"
packages: "g++-arm-linux-gnueabihf"
- name: "ARM v8"
host: "aarch64-linux-gnu"
rust_host: "aarch64-unknown-linux-gnu"
packages: "g++-aarch64-linux-gnu"
- name: "i686 Linux"
host: "i686-pc-linux-gnu"
rust_host: "i686-unknown-linux-gnu"
packages: "g++-multilib"
- name: "Win64"
host: "x86_64-w64-mingw32"
rust_host: "x86_64-pc-windows-gnu"
packages: "g++-mingw-w64-x86-64"
- name: "x86_64 Linux"
host: "x86_64-unknown-linux-gnu"
rust_host: "x86_64-unknown-linux-gnu"
- name: "Cross-Mac x86_64"
host: "x86_64-apple-darwin"
rust_host: "x86_64-apple-darwin"
packages: "clang"
- name: "Cross-Mac aarch64"
host: "arm64-apple-darwin"
rust_host: "aarch64-apple-darwin"
packages: "clang"
- name: "x86_64 Freebsd"
host: "x86_64-unknown-freebsd"
rust_host: "x86_64-unknown-freebsd"
packages: "clang"
- name: "ARMv7 Android"
host: "arm-linux-android"
rust_host: "armv7-linux-androideabi"
- name: "ARMv8 Android"
host: "aarch64-linux-android"
rust_host: "aarch64-linux-android"
name: ${{ matrix.toolchain.name }}
steps:
- name: set apt conf
run: ${{env.APT_SET_CONF}}
- name: install dependencies
run: apt update; apt -y install build-essential libtool cmake autotools-dev automake pkg-config python3 gperf bsdmainutils curl git ca-certificates unzip ccache ${{ matrix.toolchain.packages }}
- name: install rust
# We can't use the latest Rust due to LLVM 17 not working with old `ld`s (such as in Ubuntu 20.04) for RISC-V
# We could update ld (a pain), update Ubuntu (requires a large amount of changes), or downgrade Rust
# We can't use Rust 1.70 due to LLVM 16 requiring ld >= 2.40 when building for Windows
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
export PATH="$HOME/.cargo/bin:$PATH"
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
rustup toolchain install 1.69
rustup default 1.69
rustup target add ${{ matrix.toolchain.rust_host }}
- name: configure git
run: git config --global --add safe.directory '*'
- uses: actions/checkout@v4
Expand Down

0 comments on commit fb77f11

Please sign in to comment.