CARGO_LIB_CDYLIB_<name> #8193
Labels
A-environment-variables
Area: environment variables
C-feature-request
Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Command-test
S-triage
Status: This issue is waiting on initial triage.
Describe the problem you are trying to solve
The integration test for my
cdylib
doesn't have a clean way to know where to find the library file itself. My cdylib is actually a PostgreSQL extension (essentially a plugin), so the only way to test it is by actually running PostgreSQL and loading the library. To do that, the integration test needs to know the location of the library file (e.g....../target/debug/libxyz.so
).Describe the solution you'd like
I want cargo to set a new environment variable,
CARGO_LIB_CDYLIB_<name>
, similar toCARGO_BIN_EXE_<name>
, that would allow the integration test to find the library in a platform-independent way (and that works regardless of the profile used to build it).I would like this variable always available, not just for test runs. The reason is that I also have a
[[bin]]
target that installs the library into PostgreSQL'slib
directory (kind of like doingmake install
for a postgresql extension written in C), so that it can be easily installed.Notes
Unit tests are not practical in my case, because the plugin accesses lots of Postgres APIs that require a running server.
The text was updated successfully, but these errors were encountered: