Skip to content

Commit

Permalink
Repairing MacOs build on develop (#3977)
Browse files Browse the repository at this point in the history
* Turn macos on on CI

Signed-off-by: safinsaf <[email protected]>

* Debug matrix

Signed-off-by: safinsaf <[email protected]>

* Check comment body

Signed-off-by: safinsaf <[email protected]>

* Check new line

Signed-off-by: safinsaf <[email protected]>

* Check new line

Signed-off-by: safinsaf <[email protected]>

* Check new line

Signed-off-by: safinsaf <[email protected]>

* Remove debug data

Signed-off-by: safinsaf <[email protected]>

* Try gcc for mac

Signed-off-by: safinsaf <[email protected]>

* Try gcc-10

Signed-off-by: safinsaf <[email protected]>

* Debug macos

Signed-off-by: safinsaf <[email protected]>

* Update gen matrix file

Signed-off-by: safinsaf <[email protected]>

* Added patch which is fixing vcpkg dependency build of GTest library on MacOS by removing -Werror flag

Signed-off-by: Grzegorz Bazior (Yodiss PSA) <[email protected]>

* Disabled compilation of iroha-lib for MacOS

Signed-off-by: Grzegorz Bazior (Yodiss PSA) <[email protected]>

* Move to clang

Signed-off-by: safinsaf <[email protected]>

---------

Signed-off-by: safinsaf <[email protected]>
Signed-off-by: Grzegorz Bazior (Yodiss PSA) <[email protected]>
Co-authored-by: safinsaf <[email protected]>
Co-authored-by: Grzegorz Bazior (Yodiss PSA) <[email protected]>
  • Loading branch information
3 people authored Oct 20, 2023
1 parent 8ba7fc3 commit 80c0636
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 42 deletions.
5 changes: 3 additions & 2 deletions .github/build-iroha1.src.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,10 @@ jobs:
true
else
#echo >/tmp/comment_body "/build debug; /build ubuntu release debug normal"
echo >/tmp/comment_body "/build ubuntu debug release normal gcc-10"
echo >/tmp/comment_body "/build ubuntu debug release normal gcc-10"$'\n' "/build macos debug clang"
fi ;;
push) commit_message_body_build_spec >/tmp/comment_body || {
echo "/build macos ubuntu debug release normal gcc-10"
echo "/build ubuntu debug release normal gcc-10"
} >/tmp/comment_body ;;
workflow_dispatch) echo >/tmp/comment_body "${{github.event.inputs.build_spec}}" ;;
*) echo >&2 "::error::Unexpected event"; false ;;
Expand All @@ -221,6 +221,7 @@ jobs:
id: matrixes
run: |
set -x
cat /tmp/comment_body
cat /tmp/comment_body | .github/chatops-gen-matrix.sh
echo "::set-output name=matrix_ubuntu::$(cat matrix_ubuntu)"
echo "::set-output name=matrix_ubuntu_release::$(cat matrix_ubuntu_release)"
Expand Down
2 changes: 1 addition & 1 deletion .github/chatops-gen-matrix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ echoerr(){
readonly ALL_oses="ubuntu macos windows" ALL_build_types="Debug Release" ALL_cmake_opts="normal burrow ursa" ALL_compilers="gcc-9 gcc-10 clang-10 clang llvm msvc"
readonly DEFAULT_oses="ubuntu macos windows" DEFAULT_build_types="Debug" DEFAULT_cmake_opts="normal burrow ursa"
readonly DEFAULT_ubuntu_compilers="gcc-9" AVAILABLE_ubuntu_compilers="gcc-9 gcc-10 clang-10"
readonly DEFAULT_macos_compilers="clang" AVAILABLE_macos_compilers="clang" ## Also "llvm gcc-10" but they fail
readonly DEFAULT_macos_compilers="clang" AVAILABLE_macos_compilers="clang gcc-10" ## Also "llvm gcc-10" but they fail
readonly DEFAULT_windows_compilers="msvc" AVAILABLE_windows_compilers="msvc" ## Also "clang mingw cygwin" but they are redundant

--help-buildspec(){
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/build-iroha1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,10 @@ jobs:
true
else
#echo >/tmp/comment_body "/build debug; /build ubuntu release debug normal"
echo >/tmp/comment_body "/build ubuntu debug release normal gcc-10"
echo >/tmp/comment_body "/build ubuntu debug release normal gcc-10"$'\n' "/build macos debug clang"
fi ;;
push) commit_message_body_build_spec >/tmp/comment_body || {
echo "/build macos ubuntu debug release normal gcc-10"
echo "/build ubuntu debug release normal gcc-10"
} >/tmp/comment_body ;;
workflow_dispatch) echo >/tmp/comment_body "${{github.event.inputs.build_spec}}" ;;
*) echo >&2 "::error::Unexpected event"; false ;;
Expand All @@ -235,6 +235,7 @@ jobs:
id: matrixes
run: |
set -x
cat /tmp/comment_body
cat /tmp/comment_body | .github/chatops-gen-matrix.sh
echo "::set-output name=matrix_ubuntu::$(cat matrix_ubuntu)"
echo "::set-output name=matrix_ubuntu_release::$(cat matrix_ubuntu_release)"
Expand Down
78 changes: 41 additions & 37 deletions iroha-lib/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,51 +1,55 @@
####### irohalib_tx_example:
add_executable(irohalib_tx_example
TxExample.cpp
)
if (APPLE)
message("iroha-lib does not support MacOS currently!")
else()
###### irohalib_tx_example:
add_executable(irohalib_tx_example
TxExample.cpp
)

target_link_libraries(irohalib_tx_example
iroha_lib_model
logger_manager
)
target_link_libraries(irohalib_tx_example
iroha_lib_model
logger_manager
)

add_install_step_for_bin(irohalib_tx_example)
add_install_step_for_bin(irohalib_tx_example)


####### irohalib_batch_example:
add_executable(irohalib_batch_example
BatchExample.cpp
)
###### irohalib_batch_example:
add_executable(irohalib_batch_example
BatchExample.cpp
)

target_link_libraries(irohalib_batch_example
iroha_lib_model
logger_manager
)
target_link_libraries(irohalib_batch_example
iroha_lib_model
logger_manager
)

add_install_step_for_bin(irohalib_batch_example)
add_install_step_for_bin(irohalib_batch_example)


####### irohalib_query_example:
add_executable(irohalib_query_example
QueryExample.cpp
)
###### irohalib_query_example:
add_executable(irohalib_query_example
QueryExample.cpp
)

target_link_libraries(irohalib_query_example
iroha_lib_model
logger_manager
)
target_link_libraries(irohalib_query_example
iroha_lib_model
logger_manager
)

add_install_step_for_bin(irohalib_query_example)
add_install_step_for_bin(irohalib_query_example)


####### irohalib_domainassetcreation_example:
add_executable(irohalib_domainassetcreation_example
DomainAssetCreation.cpp
)
###### irohalib_domainassetcreation_example:
add_executable(irohalib_domainassetcreation_example
DomainAssetCreation.cpp
)

target_link_libraries(irohalib_domainassetcreation_example
iroha_lib_model
logger_manager
gflags
)
target_link_libraries(irohalib_domainassetcreation_example
iroha_lib_model
logger_manager
gflags
)

add_install_step_for_bin(irohalib_domainassetcreation_example)
add_install_step_for_bin(irohalib_domainassetcreation_example)
endif()
38 changes: 38 additions & 0 deletions vcpkg/patches/0014-gtest-remove-werror-compile-flag.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
diff --git a/ports/gtest/portfile.cmake b/ports/gtest/portfile.cmake
index 11ac1140a..5226367cd 100644
--- a/ports/gtest/portfile.cmake
+++ b/ports/gtest/portfile.cmake
@@ -12,6 +12,7 @@ vcpkg_from_github(
0002-Fix-z7-override.patch
fix-main-lib-path.patch
fix-build-failure-in-gcc-11.patch
+ removing-werror-compiler-flag.patch
)

string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "dynamic" GTEST_FORCE_SHARED_CRT)
diff --git a/ports/gtest/removing-werror-compiler-flag.patch b/ports/gtest/removing-werror-compiler-flag.patch
new file mode 100644
index 000000000..2b7339da4
--- /dev/null
+++ b/ports/gtest/removing-werror-compiler-flag.patch
@@ -0,0 +1,20 @@
+diff --git a/googletest/cmake/internal_utils.cmake b/googletest/cmake/internal_utils.cmake
+index 4439cb9..e385a5a 100644
+--- a/googletest/cmake/internal_utils.cmake
++++ b/googletest/cmake/internal_utils.cmake
+@@ -82,13 +82,13 @@ macro(config_compiler_and_linker)
+ # http://stackoverflow.com/questions/3232669 explains the issue.
+ set(cxx_base_flags "${cxx_base_flags} -wd4702")
+ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+- set(cxx_base_flags "-Wall -Wshadow -Werror -Wconversion")
++ set(cxx_base_flags "-Wall -Wshadow -Wconversion")
+ set(cxx_exception_flags "-fexceptions")
+ set(cxx_no_exception_flags "-fno-exceptions")
+ set(cxx_strict_flags "-W -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wredundant-decls")
+ set(cxx_no_rtti_flags "-fno-rtti")
+ elseif (CMAKE_COMPILER_IS_GNUCXX)
+- set(cxx_base_flags "-Wall -Wshadow -Werror")
++ set(cxx_base_flags "-Wall -Wshadow")
+ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0.0)
+ set(cxx_base_flags "${cxx_base_flags} -Wno-error=dangling-else")
+ endif()

0 comments on commit 80c0636

Please sign in to comment.