mirror of
https://github.com/facebook/sapling.git
synced 2024-12-29 08:02:24 +03:00
eden: regenerate Cargo.lock on each cargo invocation
Summary: When using our vendored set of crates, cmake doesn't have any dependency information to use to invalidate the Cargo.lock file when we update crate versions. In addition, since we're vendoring from a local directory, cargo itself doesn't seem to want to re-assess the dependencies in that same situation, leading to confusing error messages like this when we want to build rust targets: ``` error: failed to select a version for the requirement `anyhow = "= 1.0.26"` candidate versions found which didn't match: 1.0.28 ``` This commit addresses this issue by removing the `Cargo.lock` that may be alongside the `Cargo.toml` prior to invoking `cargo`. `cargo` is pretty quick at recomputing the deps so this has neglible overhead. Reviewed By: xavierd Differential Revision: D21394363 fbshipit-source-id: 547db2e2395a47aed77d9597e659eb2d96e274dd
This commit is contained in:
parent
8dd0a11354
commit
b4f725330e
@ -102,6 +102,8 @@ function(rust_static_library TARGET)
|
||||
|
||||
add_custom_target(
|
||||
${cargo_target}
|
||||
COMMAND
|
||||
"${CMAKE_COMMAND}" -E remove -f "${CMAKE_CURRENT_SOURCE_DIR}/Cargo.lock"
|
||||
COMMAND
|
||||
"${CMAKE_COMMAND}" -E env
|
||||
"CARGO_TARGET_DIR=${CMAKE_CURRENT_BINARY_DIR}"
|
||||
@ -157,6 +159,8 @@ function(rust_executable TARGET)
|
||||
add_custom_target(
|
||||
${cargo_target}
|
||||
ALL
|
||||
COMMAND
|
||||
"${CMAKE_COMMAND}" -E remove -f "${CMAKE_CURRENT_SOURCE_DIR}/Cargo.lock"
|
||||
COMMAND
|
||||
"${CMAKE_COMMAND}" -E env
|
||||
"CARGO_TARGET_DIR=${CMAKE_CURRENT_BINARY_DIR}"
|
||||
|
Loading…
Reference in New Issue
Block a user