mirror of
https://github.com/isar/rusqlite.git
synced 2025-02-01 06:00:51 +08:00
Run asan in CI. Fixes #713
This commit is contained in:
parent
4abc8a4fdd
commit
185899eab1
18
.github/workflows/main.yml
vendored
18
.github/workflows/main.yml
vendored
@ -68,6 +68,24 @@ jobs:
|
||||
set RUSTFLAGS=-Ctarget-feature=+crt-static
|
||||
cargo build --features bundled
|
||||
|
||||
sanitizer:
|
||||
name: Address Sanitizer
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
# Need nightly rust.
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: nightly
|
||||
override: true
|
||||
components: rust-src
|
||||
- name: Tests with asan
|
||||
env:
|
||||
RUSTFLAGS: -Zsanitizer=address
|
||||
RUSTDOCFLAGS: -Zsanitizer=address
|
||||
run: cargo -Z build-std test --features 'bundled-full session buildtime_bindgen with-asan' --target x86_64-unknown-linux-gnu
|
||||
|
||||
# Ensure clippy doesn't complain.
|
||||
clippy:
|
||||
name: Clippy
|
||||
|
@ -57,6 +57,8 @@ extra_check = []
|
||||
modern_sqlite = ["libsqlite3-sys/bundled_bindings"]
|
||||
in_gecko = ["modern_sqlite", "libsqlite3-sys/in_gecko"]
|
||||
bundled-windows = ["libsqlite3-sys/bundled-windows"]
|
||||
# Build bundled sqlite with -fsanitize=address
|
||||
with-asan = ["libsqlite3-sys/with-asan"]
|
||||
|
||||
# Helper feature for enabling both `bundled` and most non-build-related optional
|
||||
# features or dependencies. This is useful for running tests / clippy / etc. New
|
||||
|
@ -31,6 +31,7 @@ preupdate_hook = []
|
||||
# 3.13.0
|
||||
session = ["preupdate_hook"]
|
||||
in_gecko = []
|
||||
with-asan = []
|
||||
|
||||
[build-dependencies]
|
||||
bindgen = { version = "0.53", optional = true, default-features = false, features = ["runtime"] }
|
||||
|
@ -80,6 +80,11 @@ mod build_bundled {
|
||||
.flag("-DSQLITE_USE_URI")
|
||||
.flag("-DHAVE_USLEEP=1")
|
||||
.warnings(false);
|
||||
|
||||
if cfg!(feature = "with-asan") {
|
||||
cfg.flag("-fsanitize=address");
|
||||
}
|
||||
|
||||
// Older versions of visual studio don't support c99 (including isnan), which
|
||||
// causes a build failure when the linker fails to find the `isnan`
|
||||
// function. `sqlite` provides its own implmentation, using the fact
|
||||
|
Loading…
x
Reference in New Issue
Block a user