Skip to content

Commit

Permalink
Fix github CI
Browse files Browse the repository at this point in the history
Signed-off-by: Petr Shumilov <[email protected]>
  • Loading branch information
PetrShumilov committed Jan 28, 2025
1 parent 42032b9 commit bec636f
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
- name: Add git safe directory
run: docker exec kphp-build-container-${{matrix.os}} bash -c
"git config --global --add safe.directory ${{env.kphp_root_dir}}"
"git config --global --add safe.directory '*'"

- name: Build all
run: docker exec kphp-build-container-${{matrix.os}} bash -c
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
brew install [email protected] re2c cmake coreutils openssl libiconv re2 pcre yaml-cpp zstd googletest shivammathur/php/[email protected]
brew link --overwrite --force shivammathur/php/[email protected]
/opt/homebrew/opt/[email protected]/libexec/bin/python -m pip install --upgrade pip --break-system-packages && /opt/homebrew/opt/[email protected]/libexec/bin/pip install --break-system-packages jsonschema
- name: Run cmake
run: cmake -DCMAKE_CXX_COMPILER=${{matrix.compiler}} -DCMAKE_CXX_STANDARD=${{matrix.cpp}} -DDOWNLOAD_MISSING_LIBRARIES=On -S $GITHUB_WORKSPACE -B ${{runner.workspace}}/build

Expand Down
11 changes: 7 additions & 4 deletions cmake/utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,15 @@ function(update_git_submodules)

# Update submodules
execute_process(
COMMAND git submodule update --init --recursive
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive
WORKING_DIRECTORY ${BASE_DIR}
RESULT_VARIABLE update_result
ERROR_QUIET
OUTPUT_VARIABLE out1
ERROR_VARIABLE err1
#ERROR_QUIET
)

message("out='${out1}'")
message("err='${err1}'")
if(NOT update_result EQUAL 0)
message(FATAL_ERROR "Failed to update Git submodules.")
endif()
Expand Down
2 changes: 1 addition & 1 deletion compiler/compiler-settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ void append_3dparty_lib(std::string &ld_flags, const std::string &path_to_3dpart
ld_flags += " " + path_to_3dparty + "lib/lib" + libname + ".a";
}

void append_curl([[maybe_unused]] std::string &cxx_flags, std::string &ld_flags, const std::string &path_to_3dparty) noexcept {
void append_curl([[maybe_unused]] std::string &cxx_flags, std::string &ld_flags, [[maybe_unused]] const std::string &path_to_3dparty) noexcept {
if (!contains_lib(ld_flags, "curl")) {
#if defined(__APPLE__)
ld_flags += " -lcurl";
Expand Down
2 changes: 1 addition & 1 deletion runtime/runtime.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ target_link_libraries(kphp-full-runtime PUBLIC ${RUNTIME_LIBS})
set_target_properties(kphp-full-runtime PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${OBJS_DIR})

prepare_cross_platform_libs(RUNTIME_LINK_TEST_LIBS pcre nghttp2 kphp-timelib)
set(RUNTIME_LINK_TEST_LIBS vk::flex_data_static CURL::curl OpenSSL::SSL ${NUMA_LIB} ${RUNTIME_LINK_TEST_LIBS} ${EPOLL_SHIM_LIB} ${ICONV_LIB} ${RT_LIB})
set(RUNTIME_LINK_TEST_LIBS vk::flex_data_static CURL::curl OpenSSL::SSL ${NUMA_LIB} ${RUNTIME_LINK_TEST_LIBS} ${EPOLL_SHIM_LIB} ${ICONV_LIB} ${RT_LIB} dl)

if (PDO_DRIVER_MYSQL)
list(APPEND RUNTIME_LINK_TEST_LIBS mysqlclient)
Expand Down
13 changes: 11 additions & 2 deletions third-party/curl-cmake/curl.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
execute_process(
COMMAND ${GIT_EXECUTABLE} submodule update --remote third-party/curl
WORKING_DIRECTORY ${BASE_DIR}
)

set(CURL_INSTALL_DIR ${CMAKE_BINARY_DIR}/third-party/curl)
file(MAKE_DIRECTORY ${CURL_INSTALL_DIR})

set(CURL_COMPILE_FLAGS "-Wno-deprecated-declarations")
if(COMPILER_CLANG)
set(CURL_COMPILE_FLAGS "${CURL_COMPILE_FLAGS} -Wno-string-plus-int")
endif()

ExternalProject_Add(
curl
SOURCE_DIR ${THIRD_PARTY_DIR}/curl
Expand All @@ -21,8 +31,7 @@ ExternalProject_Add(
-DCMAKE_INSTALL_PREFIX=${CURL_INSTALL_DIR}
-DCMAKE_INSTALL_LIBDIR=${CURL_INSTALL_DIR}/lib/
-DCMAKE_INSTALL_INCLUDEDIR=${CURL_INSTALL_DIR}/include
-DCMAKE_CXX_FLAGS="-Wno-deprecated-declarations"
-DCMAKE_C_FLAGS="-Wno-deprecated-declarations"
-DCMAKE_C_FLAGS=${CURL_COMPILE_FLAGS}
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIG>
INSTALL_COMMAND
${CMAKE_COMMAND} --install . --config $<CONFIG> &&
Expand Down
5 changes: 5 additions & 0 deletions third-party/openssl-cmake/openssl.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
execute_process(
COMMAND ${GIT_EXECUTABLE} submodule update --remote third-party/openssl
WORKING_DIRECTORY ${BASE_DIR}
)

set(OPENSSL_INSTALL_DIR ${CMAKE_BINARY_DIR}/third-party/openssl)
file(MAKE_DIRECTORY ${OPENSSL_INSTALL_DIR})

Expand Down

0 comments on commit bec636f

Please sign in to comment.