Commit c590134
committed
test(ffi): build the cdylib in c_smoke instead of linking a stale one
The C smoke test linked whatever libsandlock_ffi.so already existed in
target/, but Cargo does not treat the cdylib as a build prerequisite of an
integration test (tests link the rlib). So `cargo test` never (re)builds
the .so, and CI linked a stale artifact missing newer symbols
(undefined reference to sandlock_action_set_inject_bytes).
Build the cdylib from within the test via `cargo build -p sandlock-ffi
--lib` before locating and linking it, so the C test always links the
current artifact. The recursive cargo invocation is safe — the outer build
lock is released before tests run. Verified by deleting the .so and
re-running: the test rebuilds it and passes.
Signed-off-by: Cong Wang <cwang@multikernel.io>1 parent 05958fd commit c590134
1 file changed
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
15 | 31 | | |
16 | 32 | | |
17 | 33 | | |
| |||
0 commit comments