mirror of
https://github.com/OISF/suricata.git
synced 2026-06-09 00:42:45 -04:00
ci: rustc wrapper to disable coverage for external crates
To keep the disk usage good even when we use new crates
This commit is contained in:
parent
a1ff7424e4
commit
7d806dc7b7
2 changed files with 18 additions and 4 deletions
8
.github/workflows/builds.yml
vendored
8
.github/workflows/builds.yml
vendored
|
|
@ -645,15 +645,15 @@ jobs:
|
|||
path: prep
|
||||
- run: tar xf prep/suricata-update.tar.gz
|
||||
- run: ./autogen.sh
|
||||
- run: ./configure --enable-warnings --disable-shared
|
||||
- run: RUSTC_WRAPPER="$(pwd)/scripts/rustc.py" ./configure --enable-warnings --disable-shared
|
||||
env:
|
||||
CC: "clang"
|
||||
RUSTFLAGS: "-C instrument-coverage"
|
||||
RUSTFLAGS: "-Cinstrument-coverage"
|
||||
CFLAGS: "-fprofile-instr-generate -fcoverage-mapping -O0"
|
||||
- run: make -j ${{ env.CPUS }}
|
||||
- run: RUSTC_WRAPPER="$(pwd)/scripts/rustc.py" make -j ${{ env.CPUS }}
|
||||
env:
|
||||
CC: "clang"
|
||||
RUSTFLAGS: "-C instrument-coverage"
|
||||
RUSTFLAGS: "-Cinstrument-coverage"
|
||||
CFLAGS: "-fprofile-instr-generate -fcoverage-mapping -O0"
|
||||
- name: Extracting suricata-verify
|
||||
run: tar xf prep/suricata-verify.tar.gz
|
||||
|
|
|
|||
14
scripts/rustc.py
Executable file
14
scripts/rustc.py
Executable file
|
|
@ -0,0 +1,14 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
import subprocess
|
||||
|
||||
# RUSTC_WRAPPER to disable coverage for external crates
|
||||
# and so save disk space when running suricata-verify with many profraw files
|
||||
if len(sys.argv) > 4 and sys.argv[2] == '--crate-name' and not sys.argv[3].startswith("suricata"):
|
||||
try:
|
||||
sys.argv.remove("-Cinstrument-coverage")
|
||||
except:
|
||||
pass
|
||||
result = subprocess.run(sys.argv[1:])
|
||||
sys.exit(result.returncode)
|
||||
Loading…
Reference in a new issue