Merge bitcoin/bitcoin#32209: test: Preserve llvm profile path
Some checks failed
CI / test each commit (push) Has been cancelled
CI / macOS 14 native, arm64, no depends, sqlite only, gui (push) Has been cancelled
CI / macOS 14 native, arm64, fuzz (push) Has been cancelled
CI / Windows native, VS 2022 (push) Has been cancelled
CI / Windows native, fuzz, VS 2022 (push) Has been cancelled
CI / Linux->Windows cross, no tests (push) Has been cancelled
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Has been cancelled
CI / Windows, test cross-built (push) Has been cancelled

c5a7ffd1e8 preserve llvm profile env (Prabhat Verma)

Pull request description:

  While generating `profraw` for fuzz tests using steps in [PR 32206](https://github.com/bitcoin/bitcoin/pull/32206) , the profraw was not being built at the desired location and only one `default.profraw` was being created which was being overwritten for multiple fuzz targets. This PR fixes that.

ACKs for top commit:
  maflcko:
    lgtm ACK c5a7ffd1e8
  mabu44:
    ACK c5a7ffd1e8

Tree-SHA512: 11f74caa8cba6f841aa899a5e294f658aed1b6a3d4cf68992609ea99fadb4a092b2350ffacea5c2d5eb377eb10082de018f27a1d6486a72460cb3905aaa15664
This commit is contained in:
merge-script 2025-04-04 15:42:52 +08:00
commit 65dcbec756
No known key found for this signature in database
GPG key ID: 2EEB9F5CC09526C1

View file

@ -11,7 +11,6 @@ import argparse
import configparser import configparser
import logging import logging
import os import os
import platform
import random import random
import subprocess import subprocess
import sys import sys
@ -19,7 +18,7 @@ import sys
def get_fuzz_env(*, target, source_dir): def get_fuzz_env(*, target, source_dir):
symbolizer = os.environ.get('LLVM_SYMBOLIZER_PATH', "/usr/bin/llvm-symbolizer") symbolizer = os.environ.get('LLVM_SYMBOLIZER_PATH', "/usr/bin/llvm-symbolizer")
fuzz_env = { fuzz_env = os.environ | {
'FUZZ': target, 'FUZZ': target,
'UBSAN_OPTIONS': 'UBSAN_OPTIONS':
f'suppressions={source_dir}/test/sanitizer_suppressions/ubsan:print_stacktrace=1:halt_on_error=1:report_error_type=1', f'suppressions={source_dir}/test/sanitizer_suppressions/ubsan:print_stacktrace=1:halt_on_error=1:report_error_type=1',
@ -28,9 +27,6 @@ def get_fuzz_env(*, target, source_dir):
'ASAN_SYMBOLIZER_PATH': symbolizer, 'ASAN_SYMBOLIZER_PATH': symbolizer,
'MSAN_SYMBOLIZER_PATH': symbolizer, 'MSAN_SYMBOLIZER_PATH': symbolizer,
} }
if platform.system() == "Windows":
# On Windows, `env` option must include valid `SystemRoot`.
fuzz_env = {**fuzz_env, 'SystemRoot': os.environ.get('SystemRoot')}
return fuzz_env return fuzz_env