Skip to content

Commit 30c55d1

Browse files
committed
Remove dependency on corrosion.
We no longer need to keep the C++/Rust builds in sync, as the Rust build now depends on the static library libcprover.x.y.z.a being present anywhere in the user's computer, thus corrosion brings no benefits, and ties us down to keeping two build systems in sync when we don't need to, along with waisting time building the rust project twice when we want to run the tests. To build the Rust project, please do from the src/libcprover-rust/ directory, using `cargo`, based on the information present on its own directory.
1 parent 13a6a33 commit 30c55d1

File tree

2 files changed

+2
-31
lines changed

2 files changed

+2
-31
lines changed

.github/workflows/pull-request-check-rust-api.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
# local experiments on the same platform, but it seems to be doing no harm to the build overall
5353
# and allows us to test the Rust API on Linux without issues.
5454
- name: Configure using CMake
55-
run: cmake -S. -B${{env.default_build_dir}} -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_C_COMPILER=/usr/bin/clang-13 -DCMAKE_CXX_COMPILER=/usr/bin/clang++-13 -DWITH_RUST_API=ON
55+
run: cmake -S. -B${{env.default_build_dir}} -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_C_COMPILER=/usr/bin/clang-13 -DCMAKE_CXX_COMPILER=/usr/bin/clang++-13
5656
- name: Build with CMake
5757
run: cmake --build ${{env.default_build_dir}} -j2
5858
- name: Print ccache stats
@@ -92,7 +92,7 @@ jobs:
9292
- name: Zero ccache stats and limit in size
9393
run: ccache -z --max-size=500M
9494
- name: Configure using CMake
95-
run: cmake -S. -B${{env.default_build_dir}} -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DWITH_RUST_API=ON
95+
run: cmake -S. -B${{env.default_build_dir}} -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++
9696
- name: Build with Ninja
9797
run: cd ${{env.default_build_dir}}; ninja -j3
9898
- name: Print ccache stats

CMakeLists.txt

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -257,33 +257,4 @@ if(WITH_JBMC)
257257
add_subdirectory(jbmc)
258258
endif()
259259

260-
option(WITH_RUST_API "Build with the CPROVER Rust API" OFF)
261-
if(${CMAKE_VERSION} VERSION_LESS "3.19.0" AND WITH_RUST_API)
262-
message("Unable to build the Rust API without version CMake 3.19.0")
263-
message(FATAL_ERROR "(The Rust build depends on CMake plugins with dependencies on CMake 3.19.0 and above)")
264-
else()
265-
if(WITH_RUST_API)
266-
include(FetchContent)
267-
268-
FetchContent_Declare(
269-
Corrosion
270-
GIT_REPOSITORY https://github.com/corrosion-rs/corrosion.git
271-
GIT_TAG v0.3.1
272-
)
273-
274-
FetchContent_MakeAvailable(Corrosion)
275-
276-
corrosion_import_crate(MANIFEST_PATH src/libcprover-rust/Cargo.toml)
277-
list(JOIN sat_impl " " sat_impl_str)
278-
corrosion_set_env_vars(cprover-api-rust CBMC_LIB_DIR=${CMAKE_BINARY_DIR} CBMC_VERSION=${CBMC_VERSION})
279-
corrosion_link_libraries(cprover-api-rust cprover-api-cpp)
280-
install(TARGETS cprover-api-rust RUNTIME DESTINATION lib)
281-
# NOTE: We want to rename to a name consistent with the name of the
282-
# rest of the static libraries built as a result of a build. The reason
283-
# we cannot set the target name directly is that Cargo doesn't support
284-
# hyphens in names of packages, so it builds the name by default with
285-
# an underscore.
286-
endif()
287-
endif()
288-
289260
include(cmake/packaging.cmake)

0 commit comments

Comments
 (0)