Skip to content

Commit

Permalink
build: Add justfile
Browse files Browse the repository at this point in the history
Signed-off-by: Francisco Javier Honduvilla Coto <javierhonduco@gmail.com>
  • Loading branch information
javierhonduco committed Aug 20, 2023
1 parent 9de4269 commit 90a65a2
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
with:
toolchain: ${{matrix.rust}}
components: rust-src, rustfmt
- uses: extractions/setup-just@v1
- name: Install build system dependencies
run: |
export DEBIAN_FRONTEND=noninteractive
Expand All @@ -36,8 +37,7 @@ jobs:
cargo build
- name: Static build
run: |
export RUSTFLAGS='-L /usr/lib/x86_64-linux-gnu -C target-feature=+crt-static'
cargo build --target x86_64-unknown-linux-gnu
just build
lint:
name: Lint
runs-on: ubuntu-22.04
Expand Down
26 changes: 26 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
export RUST_BACKTRACE := "1"
BASE_RUSTFLAGS := "-C force-frame-pointers=y -L " + absolute_path("") / "target/static-libs"
RUSTFLAGS_STATIC := BASE_RUSTFLAGS + " -C target-feature=+crt-static"
RUSTFLAGS_ASAN := BASE_RUSTFLAGS + " -Zsanitizer=address"

build: build-native-libraries
RUSTFLAGS="{{BASE_RUSTFLAGS}}" cargo build

test: build-native-libraries
RUSTFLAGS="{{BASE_RUSTFLAGS}}" cargo test

build-release: build-native-libraries
RUSTFLAGS="{{RUSTFLAGS_STATIC}}" cargo build --release --target x86_64-unknown-linux-gnu

xtask: build-native-libraries
RUSTFLAGS="{{BASE_RUSTFLAGS}}" cargo xtask

# Note that the native dependencies are not instrumented.
build-asan: build-native-libraries
RUSTFLAGS="{{RUSTFLAGS_ASAN}}" cargo +nightly build -Zbuild-std --target x86_64-unknown-linux-gnu

test-asan: build-native-libraries
RUSTFLAGS="{{RUSTFLAGS_ASAN}}" cargo +nightly test -Zbuild-std --target x86_64-unknown-linux-gnu

build-native-libraries:
./tools/build_deps

0 comments on commit 90a65a2

Please sign in to comment.