-
Notifications
You must be signed in to change notification settings - Fork 39
add proxy lib tests without LD_PRELOAD #1480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
604b7aa
to
dbd9999
Compare
dbd9999
to
96333d2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds tests that verify the proxy library functionality works correctly without requiring LD_PRELOAD, implementing additional runtime detection mechanisms for the proxy library and cleaning up initialization patterns.
- Adds proxy library detection via dlopen() in addition to LD_PRELOAD environment variable checking
- Simplifies constructor/destructor priorities and consolidates logger initialization to use a single initialization pattern
- Enhances CI testing to validate both proxy library usage scenarios
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
test/utils/utils_log.cpp | Updates test expectations to reflect renamed logging function |
src/utils/utils_log.c | Implements single logger initialization pattern with thread-safety |
src/utils/utils_load_library.c | Adds debug logging for library open/close operations |
src/utils/utils_common.h | Adds dlopen-based proxy library detection alongside LD_PRELOAD check |
src/proxy_lib/proxy_lib_linux.c | Removes constructor/destructor priority specifications |
src/coarse/coarse.c | Simplifies logger initialization by removing platform-specific patterns |
.github/workflows/reusable_proxy_lib.yml | Adds test run without proxy library to CI workflow |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
src/utils/utils_common.h
Outdated
@@ -79,6 +81,15 @@ static inline int utils_env_var_has_str(const char *envvar, const char *str) { | |||
|
|||
// check if we are running in the proxy library | |||
static inline int utils_is_running_in_proxy_lib(void) { | |||
// check if the proxy library is loaded using dlopen() | |||
void *proxy_lib_handle = | |||
utils_open_library("libumf_proxy.so", UMF_UTIL_OPEN_LIBRARY_NO_LOAD); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hardcoded library name "libumf_proxy.so" makes this code platform-specific to Linux. Consider using a platform-specific macro or variable to support different operating systems (e.g., "libumf_proxy.dll" on Windows).
Copilot uses AI. Check for mistakes.
96333d2
to
46e66a2
Compare
46e66a2
to
220aa29
Compare
add proxy lib tests without LD_PRELOAD + needed fixes