chore: run asan with recompiled and instrumented Rust std library

https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/sanitizer.html#instrumentation-of-external-dependencies-and-std
This commit is contained in:
messense 2022-01-22 12:33:44 +08:00
parent a109c54918
commit 97a1b1504a
2 changed files with 3 additions and 7 deletions

View file

@ -35,6 +35,7 @@ jobs:
with:
toolchain: nightly
profile: minimal
components: rust-src
override: true
- name: Generate Cargo.lock
@ -66,15 +67,9 @@ jobs:
- name: 'Build TypeScript'
run: yarn build
- name: Check build
uses: actions-rs/cargo@v1
with:
command: check
args: --all --bins --examples --tests -vvv
- name: Unit tests with address sanitizer
run: |
yarn build:test
yarn build:test:asan
LD_PRELOAD=/usr/lib/gcc/x86_64-linux-gnu/9/libasan.so yarn test
env:
RUST_TARGET: x86_64-unknown-linux-gnu

View file

@ -20,6 +20,7 @@
"build:bench": "yarn --cwd ./bench build",
"build:memory": "yarn --cwd ./memory-testing build",
"build:test": "yarn --cwd ./examples/napi-compat-mode build && yarn --cwd ./examples/napi build",
"build:test:asan": "yarn --cwd ./examples/napi-compat-mode build --cargo-flags='-Zbuild-std' && yarn --cwd ./examples/napi build --cargo-flags='-Zbuild-std'",
"build:test:aarch64": "yarn --cwd ./examples/napi-compat-mode build-aarch64 && yarn --cwd ./examples/napi build-aarch64",
"build:test:android": "yarn --cwd ./examples/napi-compat-mode build --target aarch64-linux-android && yarn --cwd ./examples/napi build --target aarch64-linux-android",
"build:test:android:armv7": "yarn --cwd ./examples/napi-compat-mode build --target armv7-linux-androideabi && yarn --cwd ./examples/napi build --target armv7-linux-androideabi",