cargo test
from cmake add_test (in CI)
#630
Replies: 2 comments
-
Usually these kinds of issues are easiest to debug if you can try the commands locally in the docker container (to avoid waiting on CI results). Given some of the errors you got I would recommend looking into the environment variables corrosion sets, and trying to do the same (e.g. setting the environment variables to use a specific cargo / rustc tooolchain). |
Beta Was this translation helpful? Give feedback.
-
Hi, thank you for your answer. I tried that a bit, but couldn't figure out anything obvious, and fallback to running |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am wondering if anyone has successfully managed to run
cargo test
from cmake. I couldn't find a corrosion function for that, so I tried to do it manually:I tried many variant, including adding
-E env CARGO_TARGET_DIR=${CMAKE_BINARY_DIR}/cargo/build
to reuse the same build, or even changing the location of rust cache, but no matter what I do I get all kind of errors (ranging from failure for rustc to find a toolchain, cargo failing to download...).I should add that this fails only a CI, but works when I run locally with
make test
. I use Gitlab CI, not sure if that is the issue 🤔 I am wondering if anyone has a successful example of addingcargo test
to cmake that they can share and run in a CI that use docker?Beta Was this translation helpful? Give feedback.
All reactions