Skip to content

Commit

Permalink
ZIL-5326: remove dependency on Python3 & boost::filesystem (#3770) (#…
Browse files Browse the repository at this point in the history
…3773)

* Update vcpkg tag to 2023.07.21.
* Remove some 3rd party dependencies.
* Use vcpkg binary caching.
  • Loading branch information
yaron-zilliqa committed Sep 11, 2023
1 parent 9c163f7 commit 65b7e0f
Show file tree
Hide file tree
Showing 16 changed files with 166 additions and 531 deletions.
14 changes: 5 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,15 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
#
# check dependencies
#
find_package(jsoncpp REQUIRED)
find_package(mongocxx REQUIRED)
find_package(bsoncxx REQUIRED)
find_package(websocketpp REQUIRED)
find_package(leveldb REQUIRED)
find_package(jsoncpp CONFIG REQUIRED)
find_package(mongocxx CONFIG REQUIRED)
find_package(bsoncxx CONFIG REQUIRED)
find_package(leveldb CONFIG REQUIRED)
find_package(g3log REQUIRED)
find_package(g3sinks REQUIRED)
#TODO: upgrade to OpenSSL 1.1.1a
find_package(OpenSSL REQUIRED)

include(FindProtobuf)
set(protobuf_MODULE_COMPATIBLE TRUE)
find_package(Protobuf REQUIRED)
find_package(protobuf CONFIG REQUIRED)

set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
Expand Down
10 changes: 9 additions & 1 deletion daemon/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
add_executable(zilliqad ZilliqaDaemon.cpp ZilliqaUpdater.cpp)

target_include_directories(zilliqad PRIVATE ${CMAKE_SOURCE_DIR}/src)
target_link_libraries (zilliqad PRIVATE Boost::program_options jsoncpp_lib g3log Constants OpenSSL::Crypto Utils Updater)
target_link_libraries (zilliqad
PRIVATE
Boost::program_options
$<IF:$<TARGET_EXISTS:jsoncpp_lib_static>,jsoncpp_lib_static,jsoncpp_lib>
g3log
Constants
OpenSSL::Crypto
Utils
Updater)

file(COPY run.sh DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(COPY run_local.sh DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
Expand Down
10 changes: 9 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#

ARG SCILLA_VERSION=v0.13.3
ARG SCILLA_VERSION=v0.13.4
ARG SCILLA_IMAGE=zilliqa/scilla:${SCILLA_VERSION}

# Common dependencies of the builder and runner stages.
Expand Down Expand Up @@ -246,6 +246,14 @@ RUN python3 -m pip install --upgrade pip setuptools wheel \
&& python3 -m pip install --no-cache-dir -r requirements3.txt \
&& rm requirements3.txt

RUN apt update -y \
&& apt install -y apt-transport-https ca-certificates gnupg curl \
&& echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list \
&& curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - \
&& apt update -y && apt install -y google-cloud-cli && pip3 uninstall crcmod && pip3 install --no-cache-dir -U crcmod

RUN python3 -m pip install leveldb
COPY scripts/ /zilliqa/scripts
ENV LD_LIBRARY_PATH=/usr/local/lib

ENTRYPOINT ["/bin/bash"]
11 changes: 2 additions & 9 deletions src/cmd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ add_custom_command(TARGET zilliqa
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:genkeypair> ${CMAKE_BINARY_DIR}/tests/Zilliqa)
target_include_directories(genkeypair PUBLIC ${CMAKE_SOURCE_DIR}/src)
target_link_libraries(genkeypair PUBLIC ${Schnorr_LIBRARY} Utils -s)
target_link_libraries(genkeypair PUBLIC ${Schnorr_LIBRARY} Utils)

add_executable(gentxn gentxn.cpp)
add_custom_command(TARGET zilliqa
Expand Down Expand Up @@ -70,7 +70,7 @@ add_custom_command(TARGET zilliqa
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:validateDB> ${CMAKE_BINARY_DIR}/tests/Zilliqa)
target_include_directories(validateDB PUBLIC ${CMAKE_SOURCE_DIR}/src)
target_link_libraries(validateDB PUBLIC Node Mediator Validator -s)
target_link_libraries(validateDB PUBLIC Node Mediator Validator)

add_executable(genTxnBodiesFromS3 genTxnBodiesFromS3.cpp)
add_custom_command(TARGET zilliqa
Expand All @@ -86,13 +86,6 @@ add_custom_command(TARGET zilliqa
target_include_directories(isolatedServer PUBLIC ${CMAKE_SOURCE_DIR}/src)
target_link_libraries(isolatedServer PUBLIC AccountStore AccountData Mediator Persistence Server Validator Boost::program_options)

add_executable(websocketsubscriber websocketsubscriber.cpp)
add_custom_command(TARGET zilliqa
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:websocketsubscriber> ${CMAKE_BINARY_DIR}/tests/Zilliqa)
target_include_directories(websocketsubscriber PUBLIC ${CMAKE_SOURCE_DIR}/src)
target_link_libraries(websocketsubscriber PUBLIC Utils Server AccountStore Boost::program_options)

add_executable(buildTxBlockHashesToNums buildTxBlockHashesToNums.cpp)
add_custom_command(TARGET zilliqa
POST_BUILD
Expand Down
Loading

0 comments on commit 65b7e0f

Please sign in to comment.