build variations in CI to keep track of what works
This commit is contained in:
parent
406ec84577
commit
d4716c4bc6
71
.github/workflows/rust.yml
vendored
71
.github/workflows/rust.yml
vendored
|
@ -13,32 +13,77 @@ env:
|
||||||
RUSTFLAGS: "-Dwarnings"
|
RUSTFLAGS: "-Dwarnings"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build-gnu-apt:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Update repos
|
- name: Update repos
|
||||||
run: sudo apt-get update -qq
|
run: sudo apt-get update -qq
|
||||||
- name: Install rust toolchain
|
- name: Install toolchain
|
||||||
run: sudo apt-get install -qy cargo rust-clippy
|
run: sudo apt-get install -qy cargo rust-clippy liblzma-dev gcc make pkgconf
|
||||||
- name: install lzma
|
|
||||||
run: sudo apt-get install -qy liblzma-dev
|
|
||||||
- name: install gcc
|
|
||||||
run: sudo apt-get install -qy gcc make
|
|
||||||
|
|
||||||
- name: Run Clippy
|
- name: Run Clippy
|
||||||
run: cargo clippy
|
run: cargo clippy
|
||||||
|
|
||||||
|
- name: build
|
||||||
|
run: cargo build
|
||||||
|
|
||||||
- name: generate bindings
|
- name: generate bindings
|
||||||
run: ./generate-binding.sh
|
run: ./generate-binding.sh
|
||||||
- name: check that generated files did not change
|
- name: check that generated files did not change
|
||||||
run: output=$(git status --porcelain) && [ -z "$output" ]
|
run: output=$(git status --porcelain) && [ -z "$output" ]
|
||||||
|
|
||||||
- name: build
|
- name: build example -- glibc release
|
||||||
run: cargo build
|
run: cd example && make clean && make TARGET=aarch64-unknown-linux-gnu PROFILE=release
|
||||||
|
- name: build example -- glibc debug
|
||||||
|
run: cd example && make clean && make TARGET=aarch64-unknown-linux-gnu PROFILE=debug
|
||||||
|
|
||||||
- name: build example
|
# this _should_ have been -stable, but there is a bug when running in the container ("Invalid cross-device link")
|
||||||
run: cd example && make
|
build-musl-beta:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Update repos
|
||||||
|
run: sudo apt-get update -qq
|
||||||
|
- name: Install toolchain
|
||||||
|
run: sudo apt-get install -qy liblzma-dev gcc make pkgconf musl-dev musl-tools rustup
|
||||||
|
- name: install rust target
|
||||||
|
run: rustup default beta && rustup target add aarch64-unknown-linux-musl && rustup component add rust-src && rustup update
|
||||||
|
|
||||||
|
- name: build example -- musl release
|
||||||
|
run: cd example && make clean && make TARGET=aarch64-unknown-linux-musl PROFILE=release MUSL=1 CARGO="rustup run beta cargo"
|
||||||
|
- name: build example -- musl debug
|
||||||
|
run: cd example && make clean && make TARGET=aarch64-unknown-linux-musl PROFILE=debug MUSL=1 CARGO="rustup run beta cargo"
|
||||||
|
|
||||||
|
build-size-gnu-unstable:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Update repos
|
||||||
|
run: sudo apt-get update -qq
|
||||||
|
- name: Install toolchain
|
||||||
|
run: sudo apt-get install -qy liblzma-dev gcc make pkgconf rustup
|
||||||
|
- name: install rust targets
|
||||||
|
run: rustup toolchain install nightly -t aarch64-unknown-linux-gnu -c rust-src --no-self-update
|
||||||
|
|
||||||
|
- name: build example -- glibc size-optimized
|
||||||
|
run: cd example && make clean && make TARGET=aarch64-unknown-linux-gnu PROFILE=size-optimized CARGO="rustup run nightly cargo" LTO=1
|
||||||
|
|
||||||
|
|
||||||
|
build-size-musl-unstable:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Update repos
|
||||||
|
run: sudo apt-get update -qq
|
||||||
|
- name: Install toolchain
|
||||||
|
run: sudo apt-get install -qy liblzma-dev gcc make pkgconf musl-dev musl-tools rustup
|
||||||
|
- name: install rust targets
|
||||||
|
run: rustup toolchain install nightly -t aarch64-unknown-linux-musl -c rust-src --no-self-update
|
||||||
|
|
||||||
|
- name: build example -- musl size-optimized
|
||||||
|
run: cd example && make clean && make TARGET=aarch64-unknown-linux-musl PROFILE=size-optimized MUSL=1 LTO=1 CARGO="rustup run nightly cargo"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
CARGO ?= cargo
|
CARGO ?= cargo
|
||||||
STRIP ?= strip
|
STRIP ?= strip
|
||||||
|
|
||||||
FEATURES :=
|
FEATURES := ""
|
||||||
|
|
||||||
THIS_DIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))
|
THIS_DIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))
|
||||||
REPO_ROOT := $(realpath $(THIS_DIR)/..)
|
REPO_ROOT := $(realpath $(THIS_DIR)/..)
|
||||||
|
@ -10,7 +10,7 @@ export SERVICEPOINT_HEADER_OUT := $(REPO_ROOT)/include
|
||||||
override CFG_MUSL := $(if $(CFG_MUSL),$(CFG_MUSL),$(if $(MUSL),$(MUSL),0))
|
override CFG_MUSL := $(if $(CFG_MUSL),$(CFG_MUSL),$(if $(MUSL),$(MUSL),0))
|
||||||
override CFG_PROFILE := $(if $(CFG_PROFILE),$(CFG_PROFILE),$(if $(PROFILE),$(PROFILE),release))
|
override CFG_PROFILE := $(if $(CFG_PROFILE),$(CFG_PROFILE),$(if $(PROFILE),$(PROFILE),release))
|
||||||
|
|
||||||
CCFLAGS += -Wall -fwhole-program
|
CCFLAGS += -Wall -fwhole-program -fPIE -pie
|
||||||
|
|
||||||
STRIPFLAGS := -s --strip-unneeded -R .comment -R .gnu.version -R .note -R .note.gnu.build-id -R .note.ABI-tag
|
STRIPFLAGS := -s --strip-unneeded -R .comment -R .gnu.version -R .note -R .note.gnu.build-id -R .note.ABI-tag
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ ifeq ($(CFG_MUSL), 1)
|
||||||
TARGET ?= x86_64-unknown-linux-musl
|
TARGET ?= x86_64-unknown-linux-musl
|
||||||
CC ?= musl-gcc
|
CC ?= musl-gcc
|
||||||
CCFLAGS += -static -lservicepoint_binding_c
|
CCFLAGS += -static -lservicepoint_binding_c
|
||||||
RUSTFLAGS += --crate-type=staticlib
|
RUSTFLAGS += --crate-type=staticlib -Ctarget-feature=-crt-static
|
||||||
else
|
else
|
||||||
TARGET ?= x86_64-unknown-linux-gnu
|
TARGET ?= x86_64-unknown-linux-gnu
|
||||||
CC ?= gcc
|
CC ?= gcc
|
||||||
|
|
Loading…
Reference in a new issue