mirror of
https://github.com/monero-project/monero.git
synced 2025-06-07 17:42:40 -04:00
ci: introduce rust toolchain
Co-authored-by: Luke Parker <lukeparker5132@gmail.com>
This commit is contained in:
parent
13002ddd4b
commit
ef509e1c08
2 changed files with 32 additions and 3 deletions
14
.github/workflows/build.yml
vendored
14
.github/workflows/build.yml
vendored
|
@ -15,7 +15,7 @@ env:
|
||||||
REMOVE_BUNDLED_PACKAGES : sudo rm -rf /usr/local
|
REMOVE_BUNDLED_PACKAGES : sudo rm -rf /usr/local
|
||||||
# ARCH="default" (not "native") ensures, that a different execution host can execute binaries compiled elsewhere.
|
# 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'
|
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: |
|
APT_SET_CONF: |
|
||||||
tee -a /etc/apt/apt.conf.d/80-custom << EOF
|
tee -a /etc/apt/apt.conf.d/80-custom << EOF
|
||||||
Acquire::Retries "3";
|
Acquire::Retries "3";
|
||||||
|
@ -72,7 +72,7 @@ jobs:
|
||||||
- uses: msys2/setup-msys2@v2
|
- uses: msys2/setup-msys2@v2
|
||||||
with:
|
with:
|
||||||
update: true
|
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
|
- uses: ./.github/actions/set-make-job-count
|
||||||
- name: build
|
- name: build
|
||||||
run: |
|
run: |
|
||||||
|
@ -86,7 +86,7 @@ jobs:
|
||||||
image: archlinux:latest
|
image: archlinux:latest
|
||||||
steps:
|
steps:
|
||||||
- name: install dependencies
|
- 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
|
- name: configure git
|
||||||
run: git config --global --add safe.directory '*'
|
run: git config --global --add safe.directory '*'
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
@ -113,6 +113,14 @@ jobs:
|
||||||
run: apt update
|
run: apt update
|
||||||
- name: install monero dependencies
|
- name: install monero dependencies
|
||||||
run: ${{env.APT_INSTALL_LINUX}}
|
run: ${{env.APT_INSTALL_LINUX}}
|
||||||
|
- name: install rust
|
||||||
|
# Debian 10 ships Rust 1.41.1. We need >=1.69 to build FCMP++.
|
||||||
|
run: |
|
||||||
|
curl -O https://static.rust-lang.org/rustup/archive/1.27.1/x86_64-unknown-linux-gnu/rustup-init
|
||||||
|
echo "6aeece6993e902708983b209d04c0d1dbb14ebb405ddb87def578d41f920f56d rustup-init" | sha256sum -c
|
||||||
|
chmod +x rustup-init
|
||||||
|
./rustup-init -y --default-toolchain 1.69
|
||||||
|
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
||||||
- name: configure git
|
- name: configure git
|
||||||
run: git config --global --add safe.directory '*'
|
run: git config --global --add safe.directory '*'
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
21
.github/workflows/depends.yml
vendored
21
.github/workflows/depends.yml
vendored
|
@ -36,40 +36,61 @@ jobs:
|
||||||
toolchain:
|
toolchain:
|
||||||
- name: "RISCV 64bit"
|
- name: "RISCV 64bit"
|
||||||
host: "riscv64-linux-gnu"
|
host: "riscv64-linux-gnu"
|
||||||
|
rust_host: "riscv64gc-unknown-linux-gnu"
|
||||||
packages: "g++-riscv64-linux-gnu"
|
packages: "g++-riscv64-linux-gnu"
|
||||||
- name: "ARM v7"
|
- name: "ARM v7"
|
||||||
host: "arm-linux-gnueabihf"
|
host: "arm-linux-gnueabihf"
|
||||||
|
rust_host: "armv7-unknown-linux-gnueabihf"
|
||||||
packages: "g++-arm-linux-gnueabihf"
|
packages: "g++-arm-linux-gnueabihf"
|
||||||
- name: "ARM v8"
|
- name: "ARM v8"
|
||||||
host: "aarch64-linux-gnu"
|
host: "aarch64-linux-gnu"
|
||||||
|
rust_host: "aarch64-unknown-linux-gnu"
|
||||||
packages: "g++-aarch64-linux-gnu"
|
packages: "g++-aarch64-linux-gnu"
|
||||||
- name: "i686 Linux"
|
- name: "i686 Linux"
|
||||||
host: "i686-pc-linux-gnu"
|
host: "i686-pc-linux-gnu"
|
||||||
|
rust_host: "i686-unknown-linux-gnu"
|
||||||
packages: "g++-multilib"
|
packages: "g++-multilib"
|
||||||
- name: "Win64"
|
- name: "Win64"
|
||||||
host: "x86_64-w64-mingw32"
|
host: "x86_64-w64-mingw32"
|
||||||
|
rust_host: "x86_64-pc-windows-gnu"
|
||||||
packages: "g++-mingw-w64-x86-64"
|
packages: "g++-mingw-w64-x86-64"
|
||||||
- name: "x86_64 Linux"
|
- name: "x86_64 Linux"
|
||||||
host: "x86_64-unknown-linux-gnu"
|
host: "x86_64-unknown-linux-gnu"
|
||||||
|
rust_host: "x86_64-unknown-linux-gnu"
|
||||||
- name: "Cross-Mac x86_64"
|
- name: "Cross-Mac x86_64"
|
||||||
host: "x86_64-apple-darwin"
|
host: "x86_64-apple-darwin"
|
||||||
|
rust_host: "x86_64-apple-darwin"
|
||||||
packages: "clang"
|
packages: "clang"
|
||||||
- name: "Cross-Mac aarch64"
|
- name: "Cross-Mac aarch64"
|
||||||
host: "arm64-apple-darwin"
|
host: "arm64-apple-darwin"
|
||||||
|
rust_host: "aarch64-apple-darwin"
|
||||||
packages: "clang"
|
packages: "clang"
|
||||||
- name: "x86_64 Freebsd"
|
- name: "x86_64 Freebsd"
|
||||||
host: "x86_64-unknown-freebsd"
|
host: "x86_64-unknown-freebsd"
|
||||||
|
rust_host: "x86_64-unknown-freebsd"
|
||||||
packages: "clang"
|
packages: "clang"
|
||||||
- name: "ARMv7 Android"
|
- name: "ARMv7 Android"
|
||||||
host: "arm-linux-android"
|
host: "arm-linux-android"
|
||||||
|
rust_host: "armv7-linux-androideabi"
|
||||||
- name: "ARMv8 Android"
|
- name: "ARMv8 Android"
|
||||||
host: "aarch64-linux-android"
|
host: "aarch64-linux-android"
|
||||||
|
rust_host: "aarch64-linux-android"
|
||||||
name: ${{ matrix.toolchain.name }}
|
name: ${{ matrix.toolchain.name }}
|
||||||
steps:
|
steps:
|
||||||
- name: set apt conf
|
- name: set apt conf
|
||||||
run: ${{env.APT_SET_CONF}}
|
run: ${{env.APT_SET_CONF}}
|
||||||
- name: install dependencies
|
- 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 }}
|
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 -O https://static.rust-lang.org/rustup/archive/1.27.1/x86_64-unknown-linux-gnu/rustup-init
|
||||||
|
echo "6aeece6993e902708983b209d04c0d1dbb14ebb405ddb87def578d41f920f56d rustup-init" | sha256sum -c
|
||||||
|
chmod +x rustup-init
|
||||||
|
./rustup-init -y --default-toolchain 1.69 --target ${{ matrix.toolchain.rust_host }}
|
||||||
|
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
||||||
- name: configure git
|
- name: configure git
|
||||||
run: git config --global --add safe.directory '*'
|
run: git config --global --add safe.directory '*'
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue