bazel-contrib / rules_fuzzing

Bazel Starlark extensions for defining fuzz tests in Bazel projects
Apache License 2.0
87 stars 20 forks source link

Support executing fuzz tests with custom environment variables #223

Open zhenyudg opened 1 year ago

zhenyudg commented 1 year ago

Requested Behavior

Specifying an env dictionary of environment variables in a cc_fuzz_test causes the regression test and fuzz test to execute with the environment variables set.

Actual Behavior

Specifying an env dictionary of environment variables currently has no effect on the regression and fuzz tests.

Motivation

We use environment variables to configure sanitizers (e.g., where to look for runtime suppressions, UBSan should crash upon finding UB, print a stack trace).

I'm presently working on extending rules_fuzzing to support env.

zhenyudg commented 1 year ago

I'll also try to add support for env_inherit at the save time as well

sfc-gh-ebrossard commented 7 months ago

Edit: I take it back, actually. I'm passing ASAN_OPTIONS and ASAN_SYMBOLIZER_PATH as part of env for the cc_fuzz_test and both do seem to be picked up correctly. I was mislead by LLVMSymbolizer: error reading file: No such file or directory in the output but apparently this is just a bad error message in llvm-symbolizer that was fixed in https://reviews.llvm.org/D148032. Are you seeing different behavior?

zhenyudg commented 4 months ago

@sfc-gh-ebrossard So sorry for the long delay in responding; I am no longer an active user of rules_fuzzing, so I'm afraid that I am no longer in a position to provide assistance (at least for now).