Fix RERUN_C_BUILD_ARTIFACT
path value if CARGO_BUILD_TARGET
env variable is set
#5547
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
When building the conda-forge package for the C++ bindings for rerun-sdk, I encountered a failure of the following type (see conda-forge/staged-recipes#25648 (comment)):
It turned out that this was due to some rust activation script in conda-forge, that defined the
CARGO_BUILD_TARGET
env variable, and that apparently changed the location of thelibrerun_c.a
library generated by cargo. To handle this, I modified the CMake code as reported in this PR. If theCARGO_BUILD_TARGET
env variable is not defined,$ENV{CARGO_BUILD_TARGET}
evalutes to an empty string, and the behaviour is exactly the same that you have before this PR.I am not sure if it make sense to have this patch upstream, but I guess even to just ask that it was more efficient to open a PR rather than to open an issue to ask if it could make sense to open a PR. If you think it is better no to have this change upstream, feel free to close the PR, we can just keep the patch locally in https://github.com/conda-forge/librerun-sdk-feedstock/blob/main/recipe/fixrerun_c_location.patch .
Checklist
main
build: app.rerun.ionightly
build: app.rerun.io