From 02c10266a339df6e2261ef1d9d3bdb440cdaec4a Mon Sep 17 00:00:00 2001 From: Super Genius Date: Thu, 7 Dec 2023 21:53:42 -0800 Subject: [PATCH 001/114] Updating references for lib submodules --- libs/assigner | 2 +- libs/blueprint | 2 +- libs/circifier | 2 +- libs/crypto3 | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/assigner b/libs/assigner index b1f7c1b7..2a52137c 160000 --- a/libs/assigner +++ b/libs/assigner @@ -1 +1 @@ -Subproject commit b1f7c1b74cab77086bf6ea87164ad05bdfa504ea +Subproject commit 2a52137ca42b18b06325bd4495a3f608c1463753 diff --git a/libs/blueprint b/libs/blueprint index 9080d9a8..0cbb80dc 160000 --- a/libs/blueprint +++ b/libs/blueprint @@ -1 +1 @@ -Subproject commit 9080d9a86fbadff21598a0704b8fcf2d0685ed1d +Subproject commit 0cbb80dcae7e546f619d77ee7b2c664eba43dc89 diff --git a/libs/circifier b/libs/circifier index 24d5bcfb..1b5d1ccd 160000 --- a/libs/circifier +++ b/libs/circifier @@ -1 +1 @@ -Subproject commit 24d5bcfbadd120e806cf04a126b7339e2cc5087f +Subproject commit 1b5d1ccdb41cfac9eeb64efe275f23054ffa2ed9 diff --git a/libs/crypto3 b/libs/crypto3 index d8635597..5ec8651e 160000 --- a/libs/crypto3 +++ b/libs/crypto3 @@ -1 +1 @@ -Subproject commit d86355978662431a2aed99fdf67412d16fd72975 +Subproject commit 5ec8651eeb450a02e9802627068719f05cfad90e From 928fdc81672ce272c9b549f4b4d11dfc89ce6815 Mon Sep 17 00:00:00 2001 From: Henrique A Klein Date: Thu, 1 Aug 2024 11:37:46 -0300 Subject: [PATCH 002/114] Adding fork to submodules for now --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 82da3a01..2ee8bdbb 100644 --- a/.gitmodules +++ b/.gitmodules @@ -21,4 +21,4 @@ url = ../../NilFoundation/zkllvm-rslang.git [submodule "libs/crypto3"] path = libs/crypto3 - url = ../../NilFoundation/crypto3.git + url = ../../GeniusVentures/crypto3.git From 70a17850c32dcfbbe3b187c2b0adbe57512a349e Mon Sep 17 00:00:00 2001 From: Henrique A Klein Date: Thu, 1 Aug 2024 14:58:27 -0300 Subject: [PATCH 003/114] Fix: Building after changing submodule to our fork --- libs/crypto3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/crypto3 b/libs/crypto3 index e74da0f4..970afe1f 160000 --- a/libs/crypto3 +++ b/libs/crypto3 @@ -1 +1 @@ -Subproject commit e74da0f4feccb81678ccc0e7bf5179828cde575d +Subproject commit 970afe1f0af8bcf2dc5e1268f61adbb312fac53e From ecc590a3e489e3e8e023c14a17a9c6614469e620 Mon Sep 17 00:00:00 2001 From: Henrique A Klein Date: Thu, 15 Aug 2024 16:51:47 -0300 Subject: [PATCH 004/114] Chore: Latest sha of crypto3 --- libs/crypto3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/crypto3 b/libs/crypto3 index 970afe1f..b9bf5d2c 160000 --- a/libs/crypto3 +++ b/libs/crypto3 @@ -1 +1 @@ -Subproject commit 970afe1f0af8bcf2dc5e1268f61adbb312fac53e +Subproject commit b9bf5d2c341020a63be2cd0b8457755b69fef81c From efcc9cd1395141785df18959722be4b0cb12b914 Mon Sep 17 00:00:00 2001 From: Henrique A Klein Date: Tue, 20 Aug 2024 21:23:54 -0300 Subject: [PATCH 005/114] WIP: Fixing forked submodules --- libs/crypto3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/crypto3 b/libs/crypto3 index b9bf5d2c..5fcb4d47 160000 --- a/libs/crypto3 +++ b/libs/crypto3 @@ -1 +1 @@ -Subproject commit b9bf5d2c341020a63be2cd0b8457755b69fef81c +Subproject commit 5fcb4d4723147d1d49110fe9ebee84ca13b17fc7 From b53aca6f1391588f55b3cc1c51b03e962201a12f Mon Sep 17 00:00:00 2001 From: Henrique A Klein Date: Wed, 4 Sep 2024 15:40:55 -0300 Subject: [PATCH 006/114] Fix: Building assigned and compiler. Transpiler still not OK --- libs/crypto3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/crypto3 b/libs/crypto3 index 5fcb4d47..9edec670 160000 --- a/libs/crypto3 +++ b/libs/crypto3 @@ -1 +1 @@ -Subproject commit 5fcb4d4723147d1d49110fe9ebee84ca13b17fc7 +Subproject commit 9edec670b7893b726b6e45ece17b4ba937876c45 From c8e9a55f263318c2e0cb164c8f4427f7f5b63fef Mon Sep 17 00:00:00 2001 From: Henrique A Klein Date: Thu, 5 Sep 2024 13:44:29 -0300 Subject: [PATCH 007/114] Fix: Hash submodule fixed to build both assigner and transpiler --- libs/crypto3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/crypto3 b/libs/crypto3 index 9edec670..2747f424 160000 --- a/libs/crypto3 +++ b/libs/crypto3 @@ -1 +1 @@ -Subproject commit 9edec670b7893b726b6e45ece17b4ba937876c45 +Subproject commit 2747f4244e6349c129ddfe6e16d9f7aec821c087 From d90498bb8507071a48d346d70a7a4cc1272cbebb Mon Sep 17 00:00:00 2001 From: Henrique A Klein Date: Fri, 6 Sep 2024 09:00:26 -0300 Subject: [PATCH 008/114] Chore: Last SHA of crypto3 --- libs/crypto3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/crypto3 b/libs/crypto3 index 2747f424..9d01f2e3 160000 --- a/libs/crypto3 +++ b/libs/crypto3 @@ -1 +1 @@ -Subproject commit 2747f4244e6349c129ddfe6e16d9f7aec821c087 +Subproject commit 9d01f2e3f6f07ab56f10dcbbf1352133f3d5912d From 7c9dc53913fa14cfcb163a917c372a4a152a41e3 Mon Sep 17 00:00:00 2001 From: Henrique A Klein Date: Fri, 20 Sep 2024 11:54:10 -0300 Subject: [PATCH 009/114] Chore: Adding our fork of circifier to zkllvm --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 2ee8bdbb..f2782864 100644 --- a/.gitmodules +++ b/.gitmodules @@ -6,7 +6,7 @@ url = ../../NilFoundation/zkllvm-assigner.git [submodule "zkllvm-circifier"] path = libs/circifier - url = ../../NilFoundation/zkllvm-circifier.git + url = ../../GeniusVentures/zkllvm-circifier.git [submodule "zkllvm-blueprint"] path = libs/blueprint url = ../../NilFoundation/zkllvm-blueprint.git From 17bba4ef6bf8febed27c9bc6873f3bb6eed66d0e Mon Sep 17 00:00:00 2001 From: Henrique A Klein Date: Fri, 20 Sep 2024 14:07:53 -0300 Subject: [PATCH 010/114] Fix: Updating circifier --- libs/circifier | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/circifier b/libs/circifier index a425ae93..1213f543 160000 --- a/libs/circifier +++ b/libs/circifier @@ -1 +1 @@ -Subproject commit a425ae939cbdc88d861dbc27ad9adce5da68cf94 +Subproject commit 1213f543302b18e4294e3d7dec76ddc5cc1d10dc From f28477181954edc719347c3553621dea1aeb8e06 Mon Sep 17 00:00:00 2001 From: Henrique A Klein Date: Wed, 25 Sep 2024 11:01:23 -0300 Subject: [PATCH 011/114] Chore: Pointing to our fork --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index f2782864..e9ff6990 100644 --- a/.gitmodules +++ b/.gitmodules @@ -12,7 +12,7 @@ url = ../../NilFoundation/zkllvm-blueprint.git [submodule "libs/stdlib"] path = libs/stdlib - url = ../../NilFoundation/zkllvm-stdlib.git + url = ../../GeniusVentures/zkllvm-stdlib.git [submodule "libs/transpiler"] path = libs/transpiler url = ../../NilFoundation/zkllvm-transpiler.git From 74d6a16dcf74a5d4bb43475f590f6f506ff175e5 Mon Sep 17 00:00:00 2001 From: Henrique A Klein Date: Wed, 25 Sep 2024 11:09:41 -0300 Subject: [PATCH 012/114] Feat: Adding compilation of stdlib using external circuit function definition --- libs/stdlib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/stdlib b/libs/stdlib index 27978853..9a02a4bc 160000 --- a/libs/stdlib +++ b/libs/stdlib @@ -1 +1 @@ -Subproject commit 279788538e8b6d4a7a58aa3cdbed9fff9c790e0e +Subproject commit 9a02a4bc0b86b8a8648d18e2895b8814abcb5e78 From 2903799d114d7485a7636b7fdbdb802cd7222e13 Mon Sep 17 00:00:00 2001 From: Henrique A Klein Date: Mon, 30 Sep 2024 10:58:40 -0300 Subject: [PATCH 013/114] Chore: Changed blueprint to fork --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index e9ff6990..dd813b6e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -9,7 +9,7 @@ url = ../../GeniusVentures/zkllvm-circifier.git [submodule "zkllvm-blueprint"] path = libs/blueprint - url = ../../NilFoundation/zkllvm-blueprint.git + url = ../../GeniusVentures/zkllvm-blueprint.git [submodule "libs/stdlib"] path = libs/stdlib url = ../../GeniusVentures/zkllvm-stdlib.git From 52ea18d70a8c0e2164316c2a5e8395a1c697106a Mon Sep 17 00:00:00 2001 From: Henrique A Klein Date: Mon, 30 Sep 2024 12:03:26 -0300 Subject: [PATCH 014/114] Chore: Changing assigner to fork --- .gitmodules | 2 +- libs/blueprint | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index dd813b6e..87f7227b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -3,7 +3,7 @@ url = ../../BoostCMake/cmake_modules.git [submodule "zkllvm-assigner"] path = libs/assigner - url = ../../NilFoundation/zkllvm-assigner.git + url = ../../GeniusVentures/zkllvm-assigner.git [submodule "zkllvm-circifier"] path = libs/circifier url = ../../GeniusVentures/zkllvm-circifier.git diff --git a/libs/blueprint b/libs/blueprint index c2c7bc85..1a5c21f1 160000 --- a/libs/blueprint +++ b/libs/blueprint @@ -1 +1 @@ -Subproject commit c2c7bc8534c4f3d4dabf0c4e0356002dd22530cd +Subproject commit 1a5c21f110729f0ae0cbac472c8a941c8f856bd5 From a39c6598d0aaac89a283c321fa10ca2a530fb758 Mon Sep 17 00:00:00 2001 From: Henrique A Klein Date: Mon, 30 Sep 2024 12:12:40 -0300 Subject: [PATCH 015/114] Chore: Updating assigner to latest SHA with fix for duplicated symbols --- libs/assigner | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/assigner b/libs/assigner index 7aac86bf..79302c0b 160000 --- a/libs/assigner +++ b/libs/assigner @@ -1 +1 @@ -Subproject commit 7aac86bf735a048e21013c6b80d1d5330cb434b4 +Subproject commit 79302c0b6b892af61fb8e80f0c8a24e9b6065b6a From 375e01414e6caa8ebf17146b7297e284bbfd8a03 Mon Sep 17 00:00:00 2001 From: Henrique A Klein Date: Thu, 3 Oct 2024 16:23:13 -0300 Subject: [PATCH 016/114] Feat: Assigner now accepts parsing from buffer and not only file --- libs/assigner | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/assigner b/libs/assigner index 79302c0b..0bed3260 160000 --- a/libs/assigner +++ b/libs/assigner @@ -1 +1 @@ -Subproject commit 79302c0b6b892af61fb8e80f0c8a24e9b6065b6a +Subproject commit 0bed3260fd4e589f280e25fbb4b12da5f5b648da From a1c9a97df50ef3beae4f0efc5cd12832b8823f8d Mon Sep 17 00:00:00 2001 From: Eduardo Menges Mattje Date: Tue, 8 Oct 2024 09:00:35 -0300 Subject: [PATCH 017/114] Updated crypto3 --- libs/crypto3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/crypto3 b/libs/crypto3 index 9d01f2e3..cb9079f6 160000 --- a/libs/crypto3 +++ b/libs/crypto3 @@ -1 +1 @@ -Subproject commit 9d01f2e3f6f07ab56f10dcbbf1352133f3d5912d +Subproject commit cb9079f60e0b5e573a0a4ca7db03984aa91cc4be From 9ebe7e16d6072894f5aa35c3b41c031ba0660228 Mon Sep 17 00:00:00 2001 From: Henrique A Klein Date: Mon, 21 Oct 2024 15:50:12 -0300 Subject: [PATCH 018/114] Chore: Updating crypto3 --- libs/crypto3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/crypto3 b/libs/crypto3 index cb9079f6..b1a9f7b4 160000 --- a/libs/crypto3 +++ b/libs/crypto3 @@ -1 +1 @@ -Subproject commit cb9079f60e0b5e573a0a4ca7db03984aa91cc4be +Subproject commit b1a9f7b4b414918c0fe2cd77638973e2effe2373 From a1fc372d904c2facbcc753a7691a59ac274e53fc Mon Sep 17 00:00:00 2001 From: Henrique A Klein Date: Fri, 25 Oct 2024 13:06:15 -0300 Subject: [PATCH 019/114] Feat: Install path now configurable --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f4e788a..5fd92a7f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -141,7 +141,9 @@ configure_file("${CMAKE_CURRENT_LIST_DIR}/cmake/zkllvm.conf.in" "${CMAKE_CURRENT_BINARY_DIR}/zkllvm.conf" NO_SOURCE_PERMISSIONS @ONLY) -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/zkllvm.conf" DESTINATION /etc/ld.so.conf.d) +set(CMAKE_INSTALL_PREFIX "/etc/ld.so.conf.d" CACHE STRING "Default install path") + +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/zkllvm.conf" DESTINATION ${CMAKE_INSTALL_PREFIX}) set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_LIST_DIR}/cmake/triggers") set(CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION TRUE) From f095fb0dd6d7e25722e8c3d54a67b32f7bc2a4e4 Mon Sep 17 00:00:00 2001 From: Henrique A Klein Date: Fri, 25 Oct 2024 13:10:42 -0300 Subject: [PATCH 020/114] Fix: Circifier rolled back to crypto3 before all libs centralized] --- libs/circifier | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/circifier b/libs/circifier index 1213f543..a2a9b4ea 160000 --- a/libs/circifier +++ b/libs/circifier @@ -1 +1 @@ -Subproject commit 1213f543302b18e4294e3d7dec76ddc5cc1d10dc +Subproject commit a2a9b4ea6612966ecab02ba78121c45aeef834ba From 5364812346e81cf6e5e0bca8f249c53f8b9a5069 Mon Sep 17 00:00:00 2001 From: Eduardo Menges Mattje Date: Tue, 29 Oct 2024 17:01:47 -0300 Subject: [PATCH 021/114] Updated crypto3 --- libs/crypto3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/crypto3 b/libs/crypto3 index b1a9f7b4..b26cc655 160000 --- a/libs/crypto3 +++ b/libs/crypto3 @@ -1 +1 @@ -Subproject commit b1a9f7b4b414918c0fe2cd77638973e2effe2373 +Subproject commit b26cc65542f479888ffce6940d14beac7d83ffde From 332c229b815e4f01bc1ce2ccbce53dacb4e8f887 Mon Sep 17 00:00:00 2001 From: Henrique A Klein Date: Tue, 5 Nov 2024 09:11:02 -0300 Subject: [PATCH 022/114] Fix: circifier changes to enable build in Android --- libs/circifier | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/circifier b/libs/circifier index a2a9b4ea..bb61f6c6 160000 --- a/libs/circifier +++ b/libs/circifier @@ -1 +1 @@ -Subproject commit a2a9b4ea6612966ecab02ba78121c45aeef834ba +Subproject commit bb61f6c609a5d0cbac9b2b05d1e194ae946c6aff From b452f0c88a3775d15a781b3c78eb94b83be35bdb Mon Sep 17 00:00:00 2001 From: Henrique A Klein Date: Thu, 7 Nov 2024 14:46:20 -0300 Subject: [PATCH 023/114] Feat: Adding cmake flags to select which parts of zkllvm to build --- CMakeLists.txt | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5fd92a7f..36c5bcbb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,6 +47,10 @@ set(ZKLLVM_DEV_ENVIRONMENT TRUE) set(RSLANG_BUILD_STAGE "2" CACHE STRING "Stage to build (see --stage)") set(RSLANG_CONFIG ${CMAKE_CURRENT_BINARY_DIR}/libs/rslang/config.toml CACHE STRING "Path to Rust config file") set(RSLANG_BUILD_TOOLS "" CACHE STRING "Rust tools to build (see build.tools)") +set(ZKLLVM_BUILD_TRANSPILER_LIB TRUE CACHE BOOL "Build the transpiler library") +set(ZKLLVM_BUILD_EXAMPLES TRUE CACHE BOOL "Build the examples folder") +set(ZKLLVM_BUILD_STD_LIB TRUE CACHE BOOL "Build modified stdlib for circuit generation") +set(ZKLLVM_BUILD_EXECUTABLES TRUE CACHE BOOL "Build the bin folder") include(TargetArchitecture) include(CircuitCompile) @@ -79,17 +83,23 @@ add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/libs/crypto3") add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/libs/blueprint") add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/libs/assigner") -add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/libs/transpiler") +if (ZKLLVM_BUILD_TRANSPILER_LIB) + add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/libs/transpiler") +endif() set(LLVM_ENABLE_PROJECTS "clang" CACHE STRING "Additional llvm projects") add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/libs/circifier/llvm") -add_subdirectory(examples) +if (ZKLLVM_BUILD_EXAMPLES) + add_subdirectory(examples) +endif() if(BUILD_TESTS) add_subdirectory(tests) endif() -add_subdirectory(libs/stdlib) +if (ZKLLVM_BUILD_STD_LIB) + add_subdirectory(libs/stdlib) +endif() install(FILES cmake/CircuitCompile.cmake DESTINATION share/zkllvm) @@ -154,7 +164,9 @@ install(SCRIPT cmake/create-symlinks.cmake) include(CPack) -add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/bin") +if (ZKLLVM_BUILD_EXECUTABLES) + add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/bin") +endif() find_package(Python3 REQUIRED COMPONENTS Interpreter) From a5ae9e43265e7b02643cb3f92d660f014631197a Mon Sep 17 00:00:00 2001 From: Henrique A Klein Date: Tue, 12 Nov 2024 10:49:34 -0300 Subject: [PATCH 024/114] Chore: updating circifier to try and fix CI --- libs/circifier | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/circifier b/libs/circifier index bb61f6c6..e1827ec9 160000 --- a/libs/circifier +++ b/libs/circifier @@ -1 +1 @@ -Subproject commit bb61f6c609a5d0cbac9b2b05d1e194ae946c6aff +Subproject commit e1827ec9e06efbe9a4a1962d37d1ae2bd6a76be9 From 2bbfc65d568c27b55bef275661b3827434350994 Mon Sep 17 00:00:00 2001 From: Henrique A Klein Date: Wed, 13 Nov 2024 13:06:33 -0300 Subject: [PATCH 025/114] Fix: Replaced check run with check compile so it works on cross OSX build --- cmake/CheckAVX.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/CheckAVX.cmake b/cmake/CheckAVX.cmake index d7782c0a..6079e3e8 100644 --- a/cmake/CheckAVX.cmake +++ b/cmake/CheckAVX.cmake @@ -1,4 +1,5 @@ include(CheckCXXSourceRuns) +include(CheckCXXSourceCompiles) set(AVX_CODE " #include @@ -66,7 +67,7 @@ macro(check_avx_type type flags) foreach(__FLAG ${flags}) if(NOT CXX_${type}_FOUND) set(CMAKE_REQUIRED_FLAGS ${__FLAG}) - check_cxx_source_runs("${${type}_CODE}" HAS_${type}_${__FLAG_I}) + check_cxx_source_compiles("${${type}_CODE}" HAS_${type}_${__FLAG_I}) if(HAS_${type}_${__FLAG_I}) set(CXX_${type}_FOUND TRUE CACHE BOOL "${type} support") set(CXX_${type}_FLAGS "${__FLAG}" CACHE STRING "${type} flags") From 25e86c67d6a69a09d34fefba0dbdb9e86bc9a9b3 Mon Sep 17 00:00:00 2001 From: Henrique A Klein Date: Fri, 15 Nov 2024 11:42:25 -0300 Subject: [PATCH 026/114] Fix: Circifier had rt removed on apple --- libs/circifier | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/circifier b/libs/circifier index e1827ec9..8bf64236 160000 --- a/libs/circifier +++ b/libs/circifier @@ -1 +1 @@ -Subproject commit e1827ec9e06efbe9a4a1962d37d1ae2bd6a76be9 +Subproject commit 8bf64236582b270c2361636287b2644296fd71b2 From 26c82f0ef2a5f9689df72be39148569455e87c32 Mon Sep 17 00:00:00 2001 From: Super Genius Date: Sat, 16 Nov 2024 18:50:15 -0800 Subject: [PATCH 027/114] this allows zkLLVM to be build as a fat binary --- CMakeLists.txt | 19 ++++++++++++++----- cmake/TargetArchitecture.cmake | 7 +++++++ 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 36c5bcbb..10b552bf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,6 +14,10 @@ cmake_policy(SET CMP0028 NEW) cmake_policy(SET CMP0057 NEW) cmake_policy(SET CMP0063 NEW) +if (ZKLLVM_BUILD_OSX_FAT_BINARY) + set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE STRING "OSX Target build architecture" FORCE) +endif() + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake" "${CMAKE_CURRENT_LIST_DIR}/cmake/packages" "${CMAKE_CURRENT_LIST_DIR}/cmake/modules/share/modules/cmake") @@ -23,6 +27,7 @@ include(CMSetupVersion) cm_workspace(zkllvm) + macro(cm_find_package NAME) if(NOT "${NAME}" MATCHES "^${CMAKE_WORKSPACE_NAME}_.*$" AND NOT "${NAME}" STREQUAL CM) find_package(${ARGV}) @@ -40,17 +45,19 @@ option(BUILD_TESTS "Build unit tests" FALSE) option(BUILD_DOCS "Build with configuring Doxygen documentation compiler" TRUE) option(CIRCUIT_BINARY_OUTPUT "Emit circuit IR as binary file" FALSE) option(RSLANG_BUILD_EXTENDED "Build Rust tools (see build.extended)" FALSE) +option(ZKLLVM_BUILD_RSLANG "Build Rust tools" TRUE) -set(BUILD_WITH_TARGET_ARCHITECTURE "" CACHE STRING "Target build architecture") +set(BUILD_WITH_TARGET_ARCHITECTURE "assigner" CACHE STRING "Target build architecture") set(DOXYGEN_OUTPUT_DIR "${CMAKE_CURRENT_LIST_DIR}/docs" CACHE STRING "Specify doxygen output directory") set(ZKLLVM_DEV_ENVIRONMENT TRUE) set(RSLANG_BUILD_STAGE "2" CACHE STRING "Stage to build (see --stage)") set(RSLANG_CONFIG ${CMAKE_CURRENT_BINARY_DIR}/libs/rslang/config.toml CACHE STRING "Path to Rust config file") set(RSLANG_BUILD_TOOLS "" CACHE STRING "Rust tools to build (see build.tools)") -set(ZKLLVM_BUILD_TRANSPILER_LIB TRUE CACHE BOOL "Build the transpiler library") -set(ZKLLVM_BUILD_EXAMPLES TRUE CACHE BOOL "Build the examples folder") -set(ZKLLVM_BUILD_STD_LIB TRUE CACHE BOOL "Build modified stdlib for circuit generation") -set(ZKLLVM_BUILD_EXECUTABLES TRUE CACHE BOOL "Build the bin folder") +set(ZKLLVM_BUILD_TRANSPILER_LIB FALSE CACHE BOOL "Build the transpiler library") +set(ZKLLVM_BUILD_EXAMPLES FALSE CACHE BOOL "Build the examples folder") +set(ZKLLVM_BUILD_STD_LIB FALSE CACHE BOOL "Build modified stdlib for circuit generation") +set(ZKLLVM_BUILD_EXECUTABLES FALSE CACHE BOOL "Build the bin folder") +set(LLVM_TARGETS_TO_BUILD "assigner" CACHE STRING "Build the assigner only") include(TargetArchitecture) include(CircuitCompile) @@ -170,6 +177,7 @@ endif() find_package(Python3 REQUIRED COMPONENTS Interpreter) +if (ZKLLVM_BUILD_RSLANG) message(STATUS "Configuring rslang") execute_process(COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/detect-platform.py @@ -235,3 +243,4 @@ add_custom_target(rslang_dist COMMENT "Building rslang distribution package" USES_TERMINAL WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/libs/rslang) +endif() \ No newline at end of file diff --git a/cmake/TargetArchitecture.cmake b/cmake/TargetArchitecture.cmake index afaaa727..c2239954 100644 --- a/cmake/TargetArchitecture.cmake +++ b/cmake/TargetArchitecture.cmake @@ -103,6 +103,8 @@ function(target_architecture OUTPUT_ARCHITECTURE) set(osx_arch_x86_64 TRUE) elseif("${osx_arch}" STREQUAL "ppc64" AND ppc_support) set(osx_arch_ppc64 TRUE) + elseif("${osx_arch}" STREQUAL "arm64") + set(osx_arch_arm64 TRUE) else() message(FATAL_ERROR "Invalid OS X arch name: ${osx_arch}") endif() @@ -124,6 +126,11 @@ function(target_architecture OUTPUT_ARCHITECTURE) if(osx_arch_ppc64) list(APPEND ARCH ppc64) endif() + + if(osx_arch_arm64) + list(APPEND ARCH arm64) + endif() + else() file(WRITE "${CMAKE_BINARY_DIR}/arch.c" "${archdetect_c_code}") From 27aae7e38bc17a9301a32237fd8e76f742379929 Mon Sep 17 00:00:00 2001 From: Super Genius Date: Sat, 16 Nov 2024 20:25:20 -0800 Subject: [PATCH 028/114] Updating crypto3 library with correct list check and updated to work to only build Assigner and on OSX fat-binary --- CMakeLists.txt | 5 +++-- libs/crypto3 | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 10b552bf..a690bd57 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,7 +47,7 @@ option(CIRCUIT_BINARY_OUTPUT "Emit circuit IR as binary file" FALSE) option(RSLANG_BUILD_EXTENDED "Build Rust tools (see build.extended)" FALSE) option(ZKLLVM_BUILD_RSLANG "Build Rust tools" TRUE) -set(BUILD_WITH_TARGET_ARCHITECTURE "assigner" CACHE STRING "Target build architecture") +set(BUILD_WITH_TARGET_ARCHITECTURE "" CACHE STRING "Target build architecture") set(DOXYGEN_OUTPUT_DIR "${CMAKE_CURRENT_LIST_DIR}/docs" CACHE STRING "Specify doxygen output directory") set(ZKLLVM_DEV_ENVIRONMENT TRUE) set(RSLANG_BUILD_STAGE "2" CACHE STRING "Stage to build (see --stage)") @@ -57,7 +57,8 @@ set(ZKLLVM_BUILD_TRANSPILER_LIB FALSE CACHE BOOL "Build the transpiler library") set(ZKLLVM_BUILD_EXAMPLES FALSE CACHE BOOL "Build the examples folder") set(ZKLLVM_BUILD_STD_LIB FALSE CACHE BOOL "Build modified stdlib for circuit generation") set(ZKLLVM_BUILD_EXECUTABLES FALSE CACHE BOOL "Build the bin folder") -set(LLVM_TARGETS_TO_BUILD "assigner" CACHE STRING "Build the assigner only") +set(LLVM_TARGETS_TO_BUILD "Assigner" CACHE STRING "Build the assigner only") +#set(LLVM_EXPERIMENTAL_TARGETS_TO_BUILD "crypto3" CACHE STRING "Build the assigner only") include(TargetArchitecture) include(CircuitCompile) diff --git a/libs/crypto3 b/libs/crypto3 index b26cc655..cc9c5978 160000 --- a/libs/crypto3 +++ b/libs/crypto3 @@ -1 +1 @@ -Subproject commit b26cc65542f479888ffce6940d14beac7d83ffde +Subproject commit cc9c5978d44c6524472929602f5ac20a3fbcad0f From ef65ae09f7cc221671aa954d63e5d671809cbca4 Mon Sep 17 00:00:00 2001 From: Henrique A Klein Date: Mon, 18 Nov 2024 11:41:39 -0300 Subject: [PATCH 029/114] Fix: Set crypto3 to working state --- libs/crypto3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/crypto3 b/libs/crypto3 index cc9c5978..d5077f85 160000 --- a/libs/crypto3 +++ b/libs/crypto3 @@ -1 +1 @@ -Subproject commit cc9c5978d44c6524472929602f5ac20a3fbcad0f +Subproject commit d5077f852df02c5588e319e0ca47ff1ddd5b1d61 From 646363db38806572aac7743657191dc019adf597 Mon Sep 17 00:00:00 2001 From: Eduardo Menges Mattje Date: Mon, 18 Nov 2024 18:00:01 -0300 Subject: [PATCH 030/114] Removed duplicated crypto3 headers --- libs/crypto3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/crypto3 b/libs/crypto3 index d5077f85..749a23a9 160000 --- a/libs/crypto3 +++ b/libs/crypto3 @@ -1 +1 @@ -Subproject commit d5077f852df02c5588e319e0ca47ff1ddd5b1d61 +Subproject commit 749a23a9cfc66bba671d5c245715ede5f7ef98ad From 05df929d20d660461dec790343fc042242abcfab Mon Sep 17 00:00:00 2001 From: Henrique A Klein Date: Wed, 20 Nov 2024 10:14:44 -0300 Subject: [PATCH 031/114] Fix: Setting the default values to build full zkllvm. --- CMakeLists.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a690bd57..390f32f9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,7 @@ cmake_policy(SET CMP0057 NEW) cmake_policy(SET CMP0063 NEW) if (ZKLLVM_BUILD_OSX_FAT_BINARY) - set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE STRING "OSX Target build architecture" FORCE) + set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64") endif() list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake" @@ -53,12 +53,12 @@ set(ZKLLVM_DEV_ENVIRONMENT TRUE) set(RSLANG_BUILD_STAGE "2" CACHE STRING "Stage to build (see --stage)") set(RSLANG_CONFIG ${CMAKE_CURRENT_BINARY_DIR}/libs/rslang/config.toml CACHE STRING "Path to Rust config file") set(RSLANG_BUILD_TOOLS "" CACHE STRING "Rust tools to build (see build.tools)") -set(ZKLLVM_BUILD_TRANSPILER_LIB FALSE CACHE BOOL "Build the transpiler library") -set(ZKLLVM_BUILD_EXAMPLES FALSE CACHE BOOL "Build the examples folder") -set(ZKLLVM_BUILD_STD_LIB FALSE CACHE BOOL "Build modified stdlib for circuit generation") -set(ZKLLVM_BUILD_EXECUTABLES FALSE CACHE BOOL "Build the bin folder") +set(ZKLLVM_BUILD_TRANSPILER_LIB TRUE CACHE BOOL "Build the transpiler library") +set(ZKLLVM_BUILD_EXAMPLES TRUE CACHE BOOL "Build the examples folder") +set(ZKLLVM_BUILD_STD_LIB TRUE CACHE BOOL "Build modified stdlib for circuit generation") +set(ZKLLVM_BUILD_EXECUTABLES TRUE CACHE BOOL "Build the bin folder") set(LLVM_TARGETS_TO_BUILD "Assigner" CACHE STRING "Build the assigner only") -#set(LLVM_EXPERIMENTAL_TARGETS_TO_BUILD "crypto3" CACHE STRING "Build the assigner only") + include(TargetArchitecture) include(CircuitCompile) From e8758f786911080ea5a8f5aa2a7f3c414d05151e Mon Sep 17 00:00:00 2001 From: Henrique A Klein Date: Thu, 21 Nov 2024 10:59:05 -0300 Subject: [PATCH 032/114] Fix: Crypto3 install fixed --- libs/crypto3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/crypto3 b/libs/crypto3 index 749a23a9..311d1f01 160000 --- a/libs/crypto3 +++ b/libs/crypto3 @@ -1 +1 @@ -Subproject commit 749a23a9cfc66bba671d5c245715ede5f7ef98ad +Subproject commit 311d1f01ec6d1b2635fab09503c1e90d896edba6 From 4e423b50a4e7e5ab9d2e872945f7b5e510f3cabf Mon Sep 17 00:00:00 2001 From: Henrique A Klein Date: Thu, 21 Nov 2024 13:20:00 -0300 Subject: [PATCH 033/114] WIP: Fix iOS build --- libs/circifier | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/circifier b/libs/circifier index 8bf64236..152790e0 160000 --- a/libs/circifier +++ b/libs/circifier @@ -1 +1 @@ -Subproject commit 8bf64236582b270c2361636287b2644296fd71b2 +Subproject commit 152790e0d8eb1aa7d5f979bd7966886ea7937c8b From f9c338d3a621913a7d659967ae4e328ce85f60d4 Mon Sep 17 00:00:00 2001 From: Henrique A Klein Date: Thu, 21 Nov 2024 14:45:39 -0300 Subject: [PATCH 034/114] Chore: Updated circifier with ios fix --- libs/circifier | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/circifier b/libs/circifier index 152790e0..326200fc 160000 --- a/libs/circifier +++ b/libs/circifier @@ -1 +1 @@ -Subproject commit 152790e0d8eb1aa7d5f979bd7966886ea7937c8b +Subproject commit 326200fc77c8b15d73b1441fe224f466b15dbbc4 From 3d34f1267dcd69baab975153fa73a87187f39229 Mon Sep 17 00:00:00 2001 From: Eduardo Menges Mattje Date: Mon, 25 Nov 2024 17:52:44 -0300 Subject: [PATCH 035/114] Update circifier for iOS --- libs/circifier | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/circifier b/libs/circifier index 326200fc..0821f059 160000 --- a/libs/circifier +++ b/libs/circifier @@ -1 +1 @@ -Subproject commit 326200fc77c8b15d73b1441fe224f466b15dbbc4 +Subproject commit 0821f0591c27c64393184cdf390d36a6881843af From 5459fc04f2914eea2269b7bc4acf959f35d1fdad Mon Sep 17 00:00:00 2001 From: "Henrique A. Klein" Date: Fri, 10 Jan 2025 13:36:54 -0300 Subject: [PATCH 036/114] Chore: Updating crypto3 for MSVC fixes --- libs/crypto3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/crypto3 b/libs/crypto3 index 311d1f01..a4db9bbe 160000 --- a/libs/crypto3 +++ b/libs/crypto3 @@ -1 +1 @@ -Subproject commit 311d1f01ec6d1b2635fab09503c1e90d896edba6 +Subproject commit a4db9bbef7d223c58a688a229616540294fa0f4a From 11c17744d56cb41c4346ae6f20ae9a6180ec18fe Mon Sep 17 00:00:00 2001 From: "Henrique A. Klein" Date: Tue, 14 Jan 2025 14:55:34 -0300 Subject: [PATCH 037/114] Fix: crypto3 and circifier on MSVC --- libs/circifier | 2 +- libs/crypto3 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/circifier b/libs/circifier index 0821f059..18a771d9 160000 --- a/libs/circifier +++ b/libs/circifier @@ -1 +1 @@ -Subproject commit 0821f0591c27c64393184cdf390d36a6881843af +Subproject commit 18a771d9553d24808b3d9b1638ef1e2d8fe81d00 diff --git a/libs/crypto3 b/libs/crypto3 index a4db9bbe..3ff80105 160000 --- a/libs/crypto3 +++ b/libs/crypto3 @@ -1 +1 @@ -Subproject commit a4db9bbef7d223c58a688a229616540294fa0f4a +Subproject commit 3ff801050ea5d6f480742c797d993fbfea174c94 From 058714dd9d0eafe623626b90e9179ecc869bf91b Mon Sep 17 00:00:00 2001 From: Henrique A Klein Date: Wed, 15 Jan 2025 14:23:30 -0300 Subject: [PATCH 038/114] Fix: Crypto3 with more fixes to work with MSVC --- libs/crypto3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/crypto3 b/libs/crypto3 index 3ff80105..e1d75d29 160000 --- a/libs/crypto3 +++ b/libs/crypto3 @@ -1 +1 @@ -Subproject commit 3ff801050ea5d6f480742c797d993fbfea174c94 +Subproject commit e1d75d2948004c6e8e3be81a23a40aa25ab0a4c6 From cf3fd3fc428fa35f3436a5ba8aad18078c472eab Mon Sep 17 00:00:00 2001 From: "sariru@gmail.com" <89619301+itsafuu@users.noreply.github.com> Date: Tue, 21 Jan 2025 13:24:30 -0500 Subject: [PATCH 039/114] Add build subdir from cmake template --- .gitmodules | 3 +++ build | 1 + 2 files changed, 4 insertions(+) create mode 160000 build diff --git a/.gitmodules b/.gitmodules index 87f7227b..f5e76f65 100644 --- a/.gitmodules +++ b/.gitmodules @@ -22,3 +22,6 @@ [submodule "libs/crypto3"] path = libs/crypto3 url = ../../GeniusVentures/crypto3.git +[submodule "build"] + path = build + url = git@github.com:GeniusVentures/cmaketemplate.git diff --git a/build b/build new file mode 160000 index 00000000..15704b13 --- /dev/null +++ b/build @@ -0,0 +1 @@ +Subproject commit 15704b13d570af02c23e19e30c71ace040059b61 From 73e14854e3089ca1804f6a297c98f15dfd25eab2 Mon Sep 17 00:00:00 2001 From: "sariru@gmail.com" <89619301+itsafuu@users.noreply.github.com> Date: Tue, 21 Jan 2025 14:49:44 -0500 Subject: [PATCH 040/114] Cmake items for boost find --- cmake/CommonBuildParameters.cmake | 105 ++++++++++++++++++++++++++++++ cmake/CompilationFlags.cmake | 35 ++++++++++ cmake/config.cmake.in | 3 + cmake/functions.cmake | 69 ++++++++++++++++++++ 4 files changed, 212 insertions(+) create mode 100644 cmake/CommonBuildParameters.cmake create mode 100644 cmake/CompilationFlags.cmake create mode 100644 cmake/config.cmake.in create mode 100644 cmake/functions.cmake diff --git a/cmake/CommonBuildParameters.cmake b/cmake/CommonBuildParameters.cmake new file mode 100644 index 00000000..d25cb9b2 --- /dev/null +++ b/cmake/CommonBuildParameters.cmake @@ -0,0 +1,105 @@ +# BOOST VERSION TO USE +set(BOOST_MAJOR_VERSION "1" CACHE STRING "Boost Major Version") +set(BOOST_MINOR_VERSION "85" CACHE STRING "Boost Minor Version") +set(BOOST_PATCH_VERSION "0" CACHE STRING "Boost Patch Version") + +# convenience settings +set(BOOST_VERSION "${BOOST_MAJOR_VERSION}.${BOOST_MINOR_VERSION}.${BOOST_PATCH_VERSION}") +set(BOOST_VERSION_3U "${BOOST_MAJOR_VERSION}_${BOOST_MINOR_VERSION}_${BOOST_PATCH_VERSION}") +set(BOOST_VERSION_2U "${BOOST_MAJOR_VERSION}_${BOOST_MINOR_VERSION}") + +# Boost should be loaded before libp2p v0.1.2 +# Set config of Boost project +set(_BOOST_ROOT "${THIRDPARTY_BUILD_DIR}/boost/build/${CMAKE_SYSTEM_NAME}${ABI_SUBFOLDER_NAME}") +set(Boost_LIB_DIR "${_BOOST_ROOT}/lib") +set(Boost_INCLUDE_DIR "${_BOOST_ROOT}/include/boost-${BOOST_VERSION_2U}") +set(Boost_DIR "${Boost_LIB_DIR}/cmake/Boost-${BOOST_VERSION}") +set(boost_headers_DIR "${Boost_LIB_DIR}/cmake/boost_headers-${BOOST_VERSION}") +set(boost_random_DIR "${Boost_LIB_DIR}/cmake/boost_random-${BOOST_VERSION}") +set(boost_system_DIR "${Boost_LIB_DIR}/cmake/boost_system-${BOOST_VERSION}") +set(boost_filesystem_DIR "${Boost_LIB_DIR}/cmake/boost_filesystem-${BOOST_VERSION}") +set(boost_program_options_DIR "${Boost_LIB_DIR}/cmake/boost_program_options-${BOOST_VERSION}") +set(boost_date_time_DIR "${Boost_LIB_DIR}/cmake/boost_date_time-${BOOST_VERSION}") +set(boost_regex_DIR "${Boost_LIB_DIR}/cmake/boost_regex-${BOOST_VERSION}") +set(boost_atomic_DIR "${Boost_LIB_DIR}/cmake/boost_atomic-${BOOST_VERSION}") +set(boost_chrono_DIR "${Boost_LIB_DIR}/cmake/boost_chrono-${BOOST_VERSION}") +set(boost_log_DIR "${Boost_LIB_DIR}/cmake/boost_log-${BOOST_VERSION}") +set(boost_log_setup_DIR "${Boost_LIB_DIR}/cmake/boost_log_setup-${BOOST_VERSION}") +set(boost_thread_DIR "${Boost_LIB_DIR}/cmake/boost_thread-${BOOST_VERSION}") +set(Boost_USE_MULTITHREADED ON) +set(Boost_USE_STATIC_LIBS ON) +set(Boost_NO_SYSTEM_PATHS ON) +option(Boost_USE_STATIC_RUNTIME "Use static runtimes" ON) + +set(_BOOST_CACHE_ARGS + -DBOOST_ROOT:PATH=${_BOOST_ROOT} + -DBoost_DIR:PATH=${Boost_DIR} + -DBoost_INCLUDE_DIR:PATH=${Boost_INCLUDE_DIR} + -Dboost_headers_DIR:PATH=${boost_headers_DIR} + -Dboost_date_time_DIR:PATH=${boost_date_time_DIR} + -Dboost_filesystem_DIR:PATH=${boost_filesystem_DIR} + -Dboost_program_options_DIR:PATH=${boost_program_options_DIR} + -Dboost_random_DIR:PATH=${boost_random_DIR} + -Dboost_regex_DIR:PATH=${boost_regex_DIR} + -Dboost_system_DIR:PATH=${boost_system_DIR} + -DBoost_NO_SYSTEM_PATHS:BOOL=ON + -DBoost_USE_MULTITHREADED:BOOL=ON + -DBoost_USE_STATIC_LIBS:BOOL=ON + -DBoost_USE_STATIC_RUNTIME:BOOL=ON +) +message(STATUS "Boot ROOT: ${_BOOST_CACHE_ARGS}") + +# header only libraries must not be added here +#find_package(Boost REQUIRED COMPONENTS date_time filesystem random regex system thread log log_setup program_options) +#include_directories(${Boost_INCLUDE_DIRS}) +message(STATUS "Boot ROOT2: ${_BOOST_ROOT}") + +set(_ZKLLVM_EXTRA_PARAM + -DZKLLVM_BUILD_TRANSPILER_LIB:BOOL=OFF + -DZKLLVM_BUILD_EXAMPLES:BOOL=OFF + -DZKLLVM_BUILD_STD_LIB:BOOL=ON + -DZKLLVM_BUILD_EXECUTABLES:BOOL=OFF + -DLLVM_INCLUDE_UTILS:BOOL=OFF + -DLLVM_INCLUDE_TESTS:BOOL=OFF +) +include(ExternalProject) +ExternalProject_Add(zkLLVM + PREFIX zkLLVM + SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../zkLLVM/" + CMAKE_GENERATOR ${CMAKE_GENERATOR} + CONFIGURE_COMMAND + ${CMAKE_COMMAND} + -DCMAKE_INSTALL_PREFIX:PATH= + -DZKLLVM_STDLIB_DIR:PATH=lib + -DZKLLVM_DEV_ENVIRONMENT:BOOL=true + -DZKLLVM_VERSION:STRING=v0.1.18-22-gf095fb0 + -DLLVM_ENABLE_ZSTD:BOOL=FALSE + -DLLVM_INCLUDE_EXAMPLES:BOOL=OFF + -DZKLLVM_BUILD_RSLANG:BOOL=FALSE + ${_CMAKE_COMMON_CACHE_ARGS} + ${_BOOST_CACHE_ARGS} + ${_ZKLLVM_EXTRA_PARAM} + -DCMAKE_BUILD_TYPE=Release + BUILD_COMMAND ${CMAKE_COMMAND} --build --config Release + INSTALL_COMMAND ${CMAKE_COMMAND} --install . +) + +if(EXT_ZKSTDLIB) + ExternalProject_Add(stdlib + PREFIX stdlib + SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../zkLLVM/libs/stdlib" + CMAKE_CACHE_ARGS + -DCMAKE_INSTALL_PREFIX:PATH= + -DCMAKE_INSTALL_INCLUDEDIR:PATH= + -DZKLLVM_STDLIB_DIR:PATH=lib + -DPATH_TO_CIRCUIT_FUNCTION:PATH=${THIRDPARTY_DIR}/build/circuit_functions.cmake + -D_THIRDPARTY_BUILD_DIR:PATH=${CMAKE_CURRENT_BINARY_DIR} + -DZKLLVM_SRC_DIR:PATH=${THIRDPARTY_DIR}/zkLLVM + ${_CMAKE_COMMON_CACHE_ARGS} + ${_BOOST_CACHE_ARGS} + DEPENDS zkLLVM + ) +endif() + + + diff --git a/cmake/CompilationFlags.cmake b/cmake/CompilationFlags.cmake new file mode 100644 index 00000000..c456fc60 --- /dev/null +++ b/cmake/CompilationFlags.cmake @@ -0,0 +1,35 @@ +# conditionally applies flag. +function(add_flag flag) + check_cxx_compiler_flag(${flag} FLAG_${flag}) + if (FLAG_${flag} EQUAL 1) + add_compile_options(${flag}) + endif () +endfunction() + +if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "^(AppleClang|Clang|GNU)$") + # enable those flags + add_flag(-Wall) + add_flag(-Wextra) + add_flag(-Woverloaded-virtual) # warn if you overload (not override) a virtual function + add_flag(-Wformat=2) # warn on security issues around functions that format output (ie printf) + add_flag(-Wmisleading-indentation) # (only in GCC >= 6.0) warn if indentation implies blocks where blocks do not exist + add_flag(-Wduplicated-cond) # (only in GCC >= 6.0) warn if if / else chain has duplicated conditions + add_flag(-Wduplicated-branches) # (only in GCC >= 7.0) warn if if / else branches have duplicated code + add_flag(-Wnull-dereference) # (only in GCC >= 6.0) warn if a null dereference is detected + add_flag(-Wdouble-promotion) # (GCC >= 4.6, Clang >= 3.8) warn if float is implicit promoted to double + add_flag(-Wsign-compare) + add_flag(-Wtype-limits) # size_t - size_t >= 0 -> always true + add_flag(-Wnon-virtual-dtor) # warn the user if a class with virtual functions has a non-virtual destructor. This helps catch hard to track down memory errors + + # disable those flags + add_flag(-Wno-unused-command-line-argument) # clang: warning: argument unused during compilation: '--coverage' [-Wunused-command-line-argument] + add_flag(-Wno-unused-parameter) # prints too many useless warnings + add_flag(-Wno-format-nonliteral) # prints way too many warnings from spdlog + add_flag(-Wno-gnu-zero-variadic-macro-arguments) # https://stackoverflow.com/questions/21266380/is-the-gnu-zero-variadic-macro-arguments-safe-to-ignore + + # promote to errors + add_flag(-Werror-unused-lambda-capture) # error if lambda capture is unused + #add_flag(-Werror-return-type) # warning: control reaches end of non-void function [-Wreturn-type] + add_flag(-Werror-sign-compare) # warn the user if they compare a signed and unsigned numbers + add_flag(-Werror-reorder) # field '$1' will be initialized after field '$2' +endif() diff --git a/cmake/config.cmake.in b/cmake/config.cmake.in new file mode 100644 index 00000000..9c026e82 --- /dev/null +++ b/cmake/config.cmake.in @@ -0,0 +1,3 @@ +@PACKAGE_INIT@ + +include ( "${CMAKE_CURRENT_LIST_DIR}/GeniusSDKTargets.cmake" ) diff --git a/cmake/functions.cmake b/cmake/functions.cmake new file mode 100644 index 00000000..28aa3ba2 --- /dev/null +++ b/cmake/functions.cmake @@ -0,0 +1,69 @@ +function(disable_clang_tidy target) + set_target_properties(${target} PROPERTIES + C_CLANG_TIDY "" + CXX_CLANG_TIDY "" + ) +endfunction() + +function(addtest test_name) + add_executable(${test_name} ${ARGN}) + addtest_part(${test_name} ${ARGN}) + target_link_libraries(${test_name} + GTest::gtest_main + GTest::gmock_main + ) + file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/xunit) + set(xml_output "--gtest_output=xml:${CMAKE_BINARY_DIR}/xunit/xunit-${test_name}.xml") + add_test( + NAME ${test_name} + COMMAND $ ${xml_output} + ) + set_target_properties(${test_name} PROPERTIES + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/test_bin + ARCHIVE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/test_lib + LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/test_lib + ) + disable_clang_tidy(${test_name}) + + if(FORCE_MULTILE) + set_target_properties(${test_name} PROPERTIES LINK_FLAGS "${MULTIPLE_OPTION}") + endif() +endfunction() + +function(addtest_part test_name) + if (POLICY CMP0076) + cmake_policy(SET CMP0076 NEW) + endif () + target_sources(${test_name} PUBLIC + ${ARGN} + ) + target_link_libraries(${test_name} + GTest::gtest + ) +endfunction() + +# conditionally applies flag. +function(add_flag flag) + check_cxx_compiler_flag(${flag} FLAG_${flag}) + if (FLAG_${flag} EQUAL 1) + add_compile_options(${flag}) + endif () +endfunction() + +function(print) + message(STATUS "[${CMAKE_PROJECT_NAME}] ${ARGV}") +endfunction() + +# geniussdk_install should be called right after add_library(target) +function(geniussdk_install target) + install(TARGETS ${target} EXPORT GeniusSDKTargets + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FRAMEWORK DESTINATION ${CMAKE_INSTALL_PREFIX} + BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR} + ) +endfunction() + From 06dba337a5a2e54a06164513d3ceb363c4aab5f8 Mon Sep 17 00:00:00 2001 From: "sariru@gmail.com" <89619301+itsafuu@users.noreply.github.com> Date: Tue, 21 Jan 2025 14:54:55 -0500 Subject: [PATCH 041/114] Explicitly disabled shared libs --- cmake/CommonBuildParameters.cmake | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/cmake/CommonBuildParameters.cmake b/cmake/CommonBuildParameters.cmake index d25cb9b2..da80c0e6 100644 --- a/cmake/CommonBuildParameters.cmake +++ b/cmake/CommonBuildParameters.cmake @@ -47,12 +47,6 @@ set(_BOOST_CACHE_ARGS -DBoost_USE_STATIC_LIBS:BOOL=ON -DBoost_USE_STATIC_RUNTIME:BOOL=ON ) -message(STATUS "Boot ROOT: ${_BOOST_CACHE_ARGS}") - -# header only libraries must not be added here -#find_package(Boost REQUIRED COMPONENTS date_time filesystem random regex system thread log log_setup program_options) -#include_directories(${Boost_INCLUDE_DIRS}) -message(STATUS "Boot ROOT2: ${_BOOST_ROOT}") set(_ZKLLVM_EXTRA_PARAM -DZKLLVM_BUILD_TRANSPILER_LIB:BOOL=OFF @@ -76,6 +70,7 @@ ExternalProject_Add(zkLLVM -DLLVM_ENABLE_ZSTD:BOOL=FALSE -DLLVM_INCLUDE_EXAMPLES:BOOL=OFF -DZKLLVM_BUILD_RSLANG:BOOL=FALSE + -DBUILD_SHARED_LIBS:BOOL=OFF ${_CMAKE_COMMON_CACHE_ARGS} ${_BOOST_CACHE_ARGS} ${_ZKLLVM_EXTRA_PARAM} From 7d2c1013b8153e1bb8b1e528e0ce40d4676e692a Mon Sep 17 00:00:00 2001 From: "sariru@gmail.com" <89619301+itsafuu@users.noreply.github.com> Date: Tue, 21 Jan 2025 16:03:06 -0500 Subject: [PATCH 042/114] This has zkllvm compiling now --- build | 2 +- cmake/CommonBuildParameters.cmake | 22 +++++++++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/build b/build index 15704b13..2a41ef82 160000 --- a/build +++ b/build @@ -1 +1 @@ -Subproject commit 15704b13d570af02c23e19e30c71ace040059b61 +Subproject commit 2a41ef82bf1e1cd386981e7b84e9058feb95e84f diff --git a/cmake/CommonBuildParameters.cmake b/cmake/CommonBuildParameters.cmake index da80c0e6..461ebbba 100644 --- a/cmake/CommonBuildParameters.cmake +++ b/cmake/CommonBuildParameters.cmake @@ -56,6 +56,27 @@ set(_ZKLLVM_EXTRA_PARAM -DLLVM_INCLUDE_UTILS:BOOL=OFF -DLLVM_INCLUDE_TESTS:BOOL=OFF ) + +set(_CMAKE_COMMON_CACHE_ARGS + -DBUILD_SHARED_LIBS:BOOL=OFF + -DBUILD_TESTING:BOOL=OFF + -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} + -DCMAKE_C_FLAGS_DEBUG:STRING=${CMAKE_C_FLAGS_DEBUG} + -DCMAKE_C_FLAGS_RELEASE:STRING=${CMAKE_C_FLAGS_RELEASE} + -DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS} + -DCMAKE_CXX_FLAGS_DEBUG:STRING=${CMAKE_CXX_FLAGS_DEBUG} + -DCMAKE_CXX_FLAGS_RELEASE:STRING=${CMAKE_CXX_FLAGS_RELEASE} + -DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS} + -DCMAKE_CXX_STANDARD:STRING=${CMAKE_CXX_STANDARD} + -DCMAKE_FIND_PACKAGE_PREFER_CONFIG:BOOL=ON + -DCMAKE_POLICY_DEFAULT_CMP0057:STRING=NEW + -DCMAKE_POLICY_DEFAULT_CMP0074:STRING=NEW + -DCMAKE_POLICY_DEFAULT_CMP0144:STRING=NEW + -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON + -DCMAKE_VS_GLOBALS:STRING=${CMAKE_VS_GLOBALS} + -DCMAKE_MSVC_RUNTIME_LIBRARY:STRING=${MSVC_RUNTIME_LIBRARY_OPTION} +) + include(ExternalProject) ExternalProject_Add(zkLLVM PREFIX zkLLVM @@ -70,7 +91,6 @@ ExternalProject_Add(zkLLVM -DLLVM_ENABLE_ZSTD:BOOL=FALSE -DLLVM_INCLUDE_EXAMPLES:BOOL=OFF -DZKLLVM_BUILD_RSLANG:BOOL=FALSE - -DBUILD_SHARED_LIBS:BOOL=OFF ${_CMAKE_COMMON_CACHE_ARGS} ${_BOOST_CACHE_ARGS} ${_ZKLLVM_EXTRA_PARAM} From e6bc384bbb13a9f6f83a51cc93a94aa865794fcf Mon Sep 17 00:00:00 2001 From: "sariru@gmail.com" <89619301+itsafuu@users.noreply.github.com> Date: Tue, 21 Jan 2025 16:15:13 -0500 Subject: [PATCH 043/114] Remove workflows from zkllvm --- .github/workflows/build_linux.yml | 428 ---------------------------- .github/workflows/build_macos.yml | 192 ------------- .github/workflows/release_linux.yml | 170 ----------- .github/workflows/set_version.yml | 33 --- 4 files changed, 823 deletions(-) delete mode 100644 .github/workflows/build_linux.yml delete mode 100644 .github/workflows/build_macos.yml delete mode 100644 .github/workflows/release_linux.yml delete mode 100644 .github/workflows/set_version.yml diff --git a/.github/workflows/build_linux.yml b/.github/workflows/build_linux.yml deleted file mode 100644 index 99c15b9e..00000000 --- a/.github/workflows/build_linux.yml +++ /dev/null @@ -1,428 +0,0 @@ -name: build-linux - -on: - push: - branches: [ master ] - pull_request: - -concurrency: - # In master we want to run for every commit, in other branches — only for the last one - group: ${{ - ( github.ref == 'refs/heads/master' && - format('{0}/{1}/{2}', github.workflow, github.ref, github.sha) ) - || - format('{0}/{1}', github.workflow, github.ref) }} - cancel-in-progress: true - -jobs: - handle-syncwith: - if: github.event_name == 'pull_request' - name: Call Reusable SyncWith Handler - uses: NilFoundation/ci-cd/.github/workflows/reusable-handle-syncwith.yml@v1.1.2 - with: - ci-cd-ref: 'v1.1.2' - secrets: inherit - - build-and-test-linux: - name: Build zkLLVM, run local tests, prepare for integration testing - runs-on: [ self-hosted, Linux, X64, aws_autoscaling ] - needs: - - handle-syncwith - # Condition is needed to run it for push event (handle-syncwith is skipped) - if: | - always() && !cancelled() && - (needs.handle-syncwith.result == 'success' || needs.handle-syncwith.result == 'skipped') - outputs: - transpiler-artifact-name: ${{ steps.artifact-names.outputs.transpiler }} - examples-artifact-name: ${{ steps.artifact-names.outputs.examples }} - evm-targets: ${{ steps.get-targets.outputs.evm-targets }} - prover-targets: ${{ steps.get-targets.outputs.prover-targets }} - - env: - CONTAINER_TMP: /opt/ - HOST_TMP: /home/runner/work/_temp/ - DEBIAN_FRONTEND: noninteractive - BOOST_VERSION: "1.80.0" - INTEGRATION_TESTING_TARGETS: | - arithmetics_cpp_example - polynomial_cpp_example - poseidon_cpp_example - merkle_tree_poseidon_cpp_example - uint_remainder_cpp - uint_shift_left - uint_bit_decomposition - uint_bit_composition - compare_eq_cpp - private_input_cpp - - container: - image: ubuntu:22.04 - volumes: - - /home/runner/work/_temp/:/opt/ - - steps: - - name: Install dependencies - run: | - env && \ - apt update && \ - apt install -y \ - build-essential \ - libssl-dev \ - cmake \ - ninja-build \ - git \ - libicu-dev \ - curl \ - pkg-config - - - name: Print toolchain information - run: | - git --version - cc --version - cmake --version - ninja --version - - - name: Checkout sources - # We need full history, because during CMake config stage we are finding the nearest tag - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: false - - # Workaround: https://github.com/actions/checkout/issues/1169 - - name: Mark directory as safe - run: | - git config --system --add safe.directory $PWD - - - name: Checkout submodules - run: | - git submodule update --init --recursive --depth=1 - - - name: Checkout modules to specified refs - if: needs.handle-syncwith.outputs.prs-refs != '' - uses: NilFoundation/ci-cd/actions/recursive-checkout@v1.2.1 - # TODO: figure out the mapping of volumes and use variable here, not hardcoded path - with: - paths: | - /__w/zkLLVM/zkLLVM/** - !/__w/zkLLVM/zkLLVM/ - !/__w/zkLLVM/zkLLVM/**/.git/** - refs: ${{ needs.handle-syncwith.outputs.prs-refs }} - - - name: Clean index.lock files if checkout step was cancelled or failed - if: cancelled() || failure() - run: | - find .git -name 'index.lock' -exec rm -v {} \; - - - name: Install boost - uses: MarkusJx/install-boost@v2.4.1 - id: install-boost - with: - # A list of supported versions can be found here: - # https://github.com/MarkusJx/prebuilt-boost/blob/main/versions-manifest.json - boost_version: ${{ env.BOOST_VERSION }} - boost_install_dir: ${{ env.CONTAINER_TMP }} - platform_version: 22.04 - toolset: gcc - arch: x86 - - - name: Install Python - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - - - name: Configure CMake - env: - BOOST_ROOT: "${{ steps.install-boost.outputs.BOOST_ROOT }}" - run: | - cmake . \ - -G "Ninja" \ - -B build \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_TESTS=TRUE \ - -DRSLANG_BUILD_EXTENDED=TRUE \ - -DRSLANG_BUILD_TOOLS=cargo \ - -DGENERATE_EVM_VERIFIER=TRUE - - - name: Build zkllvm - run: | - cmake --build build -t assigner clang transpiler - - - name: Build IR of the C++ examples - run: | - cmake --build build -t compile_cpp_examples - ls -al ./build/examples/cpp - - - name: Build circuits(.crct) of the C++ examples - run: | - cmake --build build -t cpp_examples_generate_crct - ls -al ./build/examples/cpp - - - name: Build assignment tables(.tbl) of the C++ examples - run: | - cmake --build build -t cpp_examples_generate_tbl - ls -al ./build/examples/cpp - - - name: Run size estimation for C++ examples - run: | - cmake --build build -t cpp_examples_estimate_size - - - name: Copy examples' circuits and assignments for uploading - run: | - chmod +x ./examples/copy_artifacts.sh - ./examples/copy_artifacts.sh build/examples/cpp examples_output - - - name: Set aritfacts' names - id: artifact-names - run: | - echo "transpiler=transpiler-output" >> $GITHUB_OUTPUT - echo "examples=circuits-and-assignments" >> $GITHUB_OUTPUT - - - name: Upload examples' circuits and assignments artifact - uses: actions/upload-artifact@v3 - with: - name: ${{ steps.artifact-names.outputs.examples }} - path: | - examples_output - - - name: Compile tests as cpp code - run: | - cmake --build build -t all_tests_compile_as_cpp_code - - - name: Compile tests as circuits - run: | - cmake --build build -t all_tests_compile_as_circuits - - - name: Run tests as cpp code (expected res calculation) - run: | - cmake --build build -t all_tests_run_expected_res_calculation -j$(nproc) - - - name: Get transpiler output for integration testing - run: | - targets_str=$(echo "${{ env.INTEGRATION_TESTING_TARGETS }}" | awk 'NF {printf "-t %s_evm_verifier ", $0}' | sed 's/[[:space:]]*$//') - cmake --build build ${targets_str} - - - name: Upload examples' circuits and assignments artifact - uses: actions/upload-artifact@v3 - with: - name: ${{ steps.artifact-names.outputs.transpiler }} - path: | - build/examples/cpp/transpiler_output_* - - - name: Run tests as circuits (real res calculation) - run: | - cmake --build build -t all_tests_assign_circuits -j$(nproc) - - - name: Compare expected and real test results - run: | - chmod +x ./tests/run_test_results_comparison.sh - bash ./tests/run_test_results_comparison.sh - - - name: Run tests on faulty inputs - run: | - chmod +x ./tests/run_tests_faulty_input.sh - bash ./tests/run_tests_faulty_input.sh pallas - - - name: Run assigner unit tests - run: | - cmake --build build -t check-crypto3-assigner - - - name: Run assigner tests - run: | - cd libs/assigner/test - chmod +x run_tests.py - python3 run_tests.py ../../../build/bin/assigner/assigner - cd ../../../ - - - name: Build proof for the circuit of the C++ examples - run: | - cmake --build build -t prove_cpp_examples - - - name: Build recursive gen - run: | - cmake --build build -t recursive_gen - - - name: Build and run transpiler test - run: | - cmake --build build -t compile_and_run_transpiler_tests - - - name: Run recursive verifier single prover version - run: | - chmod +x ./gen_and_check.sh - bash ./gen_and_check.sh - - - name: Run recursive verifier multi prover version - run: | - chmod +x ./multi_gen_and_check.sh - bash ./multi_gen_and_check.sh - - - name: Build rslang - run: | - export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$(pwd)/build/libs/circifier/llvm/lib" - echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/build/libs/circifier/llvm/lib" >> $GITHUB_ENV - cmake --build build -t rslang - - - name: Build IR of the Rust examples - run: | - cmake --build build -t compile_rust_examples - ls -al ./build/examples/rust/target/assigner-unknown-unknown/release/examples - - - name: Build circuits(.crct) of the Rust examples - run: | - cmake --build build -t rust_examples_generate_crct - ls -al ./build/examples/cpp - - - name: Build assignment tables(.tbl) of the Rust examples - run: | - cmake --build build -t rust_examples_generate_tbl - ls -al ./build/examples/cpp - - - name: Build proof for the circuit of the Rust examples - run: | - cmake --build build -t prove_rust_examples - - - name: Set targets for integration testing - id: get-targets - run: | - targets_str=$(echo "${{ env.INTEGRATION_TESTING_TARGETS }}" | awk 'NF {print "transpiler_output_" $1}') - echo "evm-targets<> $GITHUB_OUTPUT - echo "${targets_str}" >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT - - echo "prover-targets<> $GITHUB_OUTPUT - echo "${{ env.INTEGRATION_TESTING_TARGETS }}" >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT - - - verify-zkllvm-proofs: - name: Verify built-it proofs with EVM-placeholder - needs: - - build-and-test-linux - - handle-syncwith - if: | - always() && !cancelled() && - (needs.handle-syncwith.result == 'success' || needs.handle-syncwith.result == 'skipped') && - needs.build-and-test-linux.result == 'success' - uses: NilFoundation/evm-placeholder-verification/.github/workflows/reusable-verify-proofs.yml@5bb7c4b0790f56b3a339e33ba442816fac17ab88 - with: - artifact-name: ${{ needs.build-and-test-linux.outputs.transpiler-artifact-name }} - evm-placeholder-verification-ref: 202fbd0402eda22ae91348800dea7366110b1501 - refs: ${{ needs.handle-syncwith.outputs.prs-refs }} - test-names: ${{ needs.build-and-test-linux.outputs.evm-targets }} - - - generate-proofs: - name: Generate proofs for cpp examples - needs: - - build-and-test-linux - - handle-syncwith - if: | - always() && !cancelled() && - (needs.handle-syncwith.result == 'success' || needs.handle-syncwith.result == 'skipped') && - needs.build-and-test-linux.result == 'success' - uses: NilFoundation/proof-producer/.github/workflows/reusable-generate-proofs-linux.yml@b1e380040b4714b6ad5fe9223555d854c49cf065 - with: - artifact-name: ${{ needs.build-and-test-linux.outputs.examples-artifact-name }} - # Update next line if you need new version of proof producer - proof-producer-ref: d6d8d18cd7a6e15dd9497140350efadb6af5179b - refs: ${{ needs.handle-syncwith.outputs.prs-refs }} - targets: ${{ needs.build-and-test-linux.outputs.prover-targets }} - - - merge-proofs-to-transpiler-output: - runs-on: ubuntu-22.04 - needs: - - generate-proofs - - build-and-test-linux - if: | - always() && !cancelled() && - needs.generate-proofs.result == 'success' && - needs.build-and-test-linux.result == 'success' - outputs: - merged-artifact-name: ${{ steps.artifact-name.outputs.merged }} - steps: - - name: Download artifact with proofs - uses: actions/download-artifact@v3 - with: - name: ${{ needs.generate-proofs.outputs.artifact-name }} - - - name: Download artifact with transpiler output - uses: actions/download-artifact@v3 - with: - name: ${{ needs.build-and-test-linux.outputs.transpiler-artifact-name }} - - - name: Merge proofs into transpiler output - run: | - copy_failed=0 - while read dir; do - base_name=${dir#./transpiler_output_} - - if [[ -d "$base_name" ]]; then - if ! cp "${base_name}/proof.bin" "${dir}/"; then - echo "Failed to copy proof.bin to ${dir}" >&2 - copy_failed=1 - else - echo "proof.bin added to ${dir}" - fi - else - echo "Error: No matching directory found for ${dir}" >&2 - fi - done < <(find . -type d -name "transpiler_output_*") - - if [ $copy_failed -eq 1 ]; then - echo "One or more copy operations failed." - exit 1 - fi - - - name: Set aritfact name - id: artifact-name - run: | - echo "merged=transpiler-output-merged-proofs" >> $GITHUB_OUTPUT - - - name: Upload merged artifact - uses: actions/upload-artifact@v3 - with: - name: ${{ steps.artifact-name.outputs.merged }} - path: | - transpiler_output_* - - - verify-proof-producer-proofs: - name: Verify proof-producer proofs with EVM-placeholder - needs: - - handle-syncwith - - merge-proofs-to-transpiler-output - - build-and-test-linux - if: | - always() && !cancelled() && - (needs.handle-syncwith.result == 'success' || needs.handle-syncwith.result == 'skipped') && - needs.build-and-test-linux.result == 'success' && - needs.merge-proofs-to-transpiler-output.result == 'success' - uses: NilFoundation/evm-placeholder-verification/.github/workflows/reusable-verify-proofs.yml@5bb7c4b0790f56b3a339e33ba442816fac17ab88 - with: - artifact-name: ${{ needs.merge-proofs-to-transpiler-output.outputs.merged-artifact-name }} - evm-placeholder-verification-ref: 202fbd0402eda22ae91348800dea7366110b1501 - refs: ${{ needs.handle-syncwith.outputs.prs-refs }} - test-names: ${{ needs.build-and-test-linux.outputs.evm-targets }} - - - cleanup-integration-testing: - # For now each artifact is 12 GB. Better clean it up to keep the space - name: Clean up after integration testing - needs: - - verify-proof-producer-proofs - - verify-zkllvm-proofs - - merge-proofs-to-transpiler-output - - build-and-test-linux - - generate-proofs - if: always() - runs-on: ubuntu-22.04 - steps: - - uses: geekyeggo/delete-artifact@v2 - with: - name: | - ${{ needs.merge-proofs-to-transpiler-output.outputs.merged-artifact-name }} - ${{ needs.generate-proofs.outputs.artifact-name }} diff --git a/.github/workflows/build_macos.yml b/.github/workflows/build_macos.yml deleted file mode 100644 index c54ab50f..00000000 --- a/.github/workflows/build_macos.yml +++ /dev/null @@ -1,192 +0,0 @@ -name: build-macos - -on: - push: - branches: [ master ] - pull_request: - -concurrency: - group: ${{ - ( github.ref == 'refs/heads/master' && - format('{0}/{1}', github.run_id, github.run_attempt) ) - || - format('{0}/{1}', github.workflow, github.ref) }} - cancel-in-progress: true - -jobs: - handle-syncwith: - if: github.event_name == 'pull_request' - name: Call Reusable SyncWith Handler - uses: NilFoundation/ci-cd/.github/workflows/reusable-handle-syncwith.yml@v1 - with: - ci-cd-ref: 'v1' - fetch-only: true - secrets: inherit - - build-macos: - runs-on: [ macos-11 ] - - needs: - - handle-syncwith - - steps: - - name: Install homebrew - run: > - /bin/bash -c "$(curl -fsSL - https://raw.githubusercontent.com/Homebrew/install/master/install.sh - )" - - - name: Run brew install - id: brew-install - run: | - brew install \ - boost@1.76 \ - cmake \ - ninja \ - icu4c \ - libiconv \ - openssl \ - curl \ - bash - - - name: Install Python - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - - name: Print toolchain information - run: | - git --version - cc --version - cmake --version - ninja --version - bash --version - python3 --version - which -a bash - echo PATH: $PATH - - - name: Checkout sources - # We need full history, because during CMake config stage we are finding the nearest tag - uses: actions/checkout@v3 - with: - fetch-depth: 0 - submodules: false - - - name: Checkout submodules - run: | - git submodule update --init --recursive --depth=1 - - - name: Checkout modules to specified refs - if: needs.handle-syncwith.outputs.prs-refs != '' - uses: NilFoundation/ci-cd/actions/recursive-checkout@v1.2.1 - with: - paths: | - ${{ github.workspace }}/** - !${{ github.workspace }} - !${{ github.workspace }}/**/.git/** - refs: ${{ needs.handle-syncwith.outputs.prs-refs }} - - - name: Enable ccache - uses: hendrikmuhs/ccache-action@v1.2 - with: - key: ${{ github.job }} - - - name: Configure CMake - env: - BOOST_ROOT: "/usr/local/opt/boost@1.76" - LDFLAGS: "-L/usr/local/opt/icu4c/lib" - CPPFLAGS: "-I/usr/local/opt/icu4c/include" - run: | - cmake -G "Ninja" \ - -B build \ - -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_SHARED_LIBS=FALSE \ - -DBUILD_TESTS=TRUE . - - - name: Build zkllvm - run: | - cmake --build build -t assigner clang transpiler - - - name: Build IR of the C++ examples - run: | - cmake --build build -t compile_cpp_examples - ls -al ./build/examples/cpp - - - name: Build circuits(.crct) of the C++ examples - run: | - cmake --build build -t cpp_examples_generate_crct - ls -al ./build/examples/cpp - - - name: Build assignment tables(.tbl) of the C++ examples - run: | - cmake --build build -t cpp_examples_generate_tbl - ls -al ./build/examples/cpp - - - name: Run size estimation for C++ examples - run: | - cmake --build build -t cpp_examples_estimate_size - - - name: Compile tests as cpp code - run: | - cmake --build build -t all_tests_compile_as_cpp_code - - - name: Compile tests as circuits - run: | - cmake --build build -t all_tests_compile_as_circuits - - - name: Run tests as cpp code (expected res calculation) - run: | - cmake --build build -t all_tests_run_expected_res_calculation - - - name: Run tests as circuits (real res calculation) - run: | - cmake --build build -t all_tests_assign_circuits - - - name: Compare expected and real test results - run: | - chmod +x ./tests/run_test_results_comparison.sh - bash ./tests/run_test_results_comparison.sh - - - name: Run tests on faulty inputs - run: | - chmod +x ./tests/run_tests_faulty_input.sh - bash ./tests/run_tests_faulty_input.sh pallas - - - name: Run assigner unit tests - run: | - cmake --build build -t check-crypto3-assigner - - - name: Run assigner tests - run: | - cd libs/assigner/test - chmod +x run_tests.py - python3 run_tests.py ../../../build/bin/assigner/assigner - cd ../../../ - - - name: Build proof for the circuit of the C++ examples - run: | - cmake --build build -t prove_cpp_examples - - - name: Build rslang - run: | - cmake --build build -t rslang - - - name: Build IR of the Rust examples - run: | - cmake --build build -t compile_rust_examples - ls -al ./build/examples/rust/target/assigner-unknown-unknown/release/examples - - - name: Build circuits(.crct) of the Rust examples - run: | - cmake --build build -t rust_examples_generate_crct - ls -al ./build/examples/cpp - - - name: Build assignment tables(.tbl) of the Rust examples - run: | - cmake --build build -t rust_examples_generate_tbl - ls -al ./build/examples/cpp - - - name: Build proofs for the circuits of the Rust examples - run: | - cmake --build build -t prove_rust_examples diff --git a/.github/workflows/release_linux.yml b/.github/workflows/release_linux.yml deleted file mode 100644 index 46529840..00000000 --- a/.github/workflows/release_linux.yml +++ /dev/null @@ -1,170 +0,0 @@ -name: Make release - -# Controls when the action will run. Workflow runs when manually triggered using the UI -# or API. -on: - workflow_dispatch: - inputs: - release_type: - type: choice - description: Release type - options: - - major - - minor - - patch - default: minor - -jobs: - make-release: - runs-on: [ self-hosted, Linux, X64, aws_autoscaling ] - environment: prod - - env: - CONTAINER_TMP: /opt/ - HOST_TMP: /home/runner/work/_temp/ - DEBIAN_FRONTEND: noninteractive - BOOST_VERSION: "1.80.0" - - container: - image: ubuntu:22.04 - volumes: - - /home/runner/work/_temp/:/opt/ - - steps: - - name: Install dependencies - run: | - env && \ - apt update && \ - apt install -y \ - build-essential \ - libssl-dev \ - cmake \ - git \ - curl \ - unzip \ - zstd \ - libicu-dev \ - pkg-config - - - name: Print toolchain information - run: | - git --version - cc --version - cmake --version - - - name: Checkout sources - uses: actions/checkout@v3 - with: - submodules: 'recursive' - fetch-depth: 0 - - # Workaround: https://github.com/actions/checkout/issues/1169 - - name: Mark directory as safe - run: | - git config --system --add safe.directory $PWD - - - name: Install boost - uses: MarkusJx/install-boost@v2.4.1 - id: install-boost - with: - # A list of supported versions can be found here: - # https://github.com/MarkusJx/prebuilt-boost/blob/main/versions-manifest.json - boost_version: ${{ env.BOOST_VERSION }} - boost_install_dir: ${{ env.CONTAINER_TMP }} - platform_version: 22.04 - toolset: gcc - arch: x86 - - - name: Install Python - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - - - name: Install aws tools - run: | - curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" - unzip awscliv2.zip - ./aws/install - pip3 install mkrepo - - - name: Compute release number - env: - RELEASE_TYPE: ${{ inputs.release_type }} - run: | - LATEST_TAG=`git describe --tags | cut -d'-' -f1 | tr -d v` - MAJOR=`echo $LATEST_TAG | cut -d'.' -f1` - MINOR=`echo $LATEST_TAG | cut -d'.' -f2` - PATCH=`echo $LATEST_TAG | cut -d'.' -f3` - - case $RELEASE_TYPE in - - major) - MAJOR=$((MAJOR+1)) - MINOR=0 - PATCH=0 - ;; - minor) - MINOR=$((MINOR+1)) - PATCH=0 - ;; - patch) - PATCH=$((PATCH+1)) - ;; - *) - echo "Unknown release type" - exit 1 - ;; - esac - echo "VERSION=$MAJOR.$MINOR.$PATCH" >> $GITHUB_ENV - echo "VERSION=$MAJOR.$MINOR.$PATCH" - - - name: Configure CMake - env: - BOOST_ROOT: "${{ steps.install-boost.outputs.BOOST_ROOT }}" - run: | - cmake -G "Unix Makefiles" \ - -B build \ - -DCMAKE_BUILD_TYPE=Release \ - -DZKLLVM_VERSION=${{ env.VERSION }} . - - - name: Build packages - run: | - make -C build package -j$(nproc) - - # TODO: we should consider distribution with dynamically linked LLVM - - name: Configure CMake for rslang - env: - BOOST_ROOT: "${{ steps.install-boost.outputs.BOOST_ROOT }}" - run: | - cmake -G "Unix Makefiles" \ - -B build_rslang \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_SHARED_LIBS=FALSE \ - -DZKLLVM_VERSION=${{ env.VERSION }} \ - -DRSLANG_BUILD_EXTENDED=TRUE \ - -DRSLANG_BUILD_TOOLS=cargo . - - - name: Build rslang distribution - run: | - make -C build_rslang rslang_dist -j$(nproc) - - - name: Create release - uses: ncipollo/release-action@v1 - with: - name: "zkllvm-v${{ env.VERSION }}" - tag: "v${{ env.VERSION }}" - artifacts: "build/zkllvm_*.deb,build/zkllvm-stdlib_*.deb,build_rslang/libs/rslang/build/dist/*" - - - name: Upload packages to repository - env: - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} - run: | - ZKLLVM_PACKAGE=`ls build/zkllvm_*.deb | cut -d'/' -f2` - POOL="ubuntu/pool/main/z/zkllvm" - aws s3api put-object --bucket deb.nil.foundation --key $POOL/$ZKLLVM_PACKAGE --body build/$ZKLLVM_PACKAGE - mkrepo s3://deb.nil.foundation/ubuntu/ diff --git a/.github/workflows/set_version.yml b/.github/workflows/set_version.yml deleted file mode 100644 index 1c34a260..00000000 --- a/.github/workflows/set_version.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Set version - -on: - # Triggers the workflow on push to master branch - push: - branches: [ master ] - -jobs: - set_version: - name: Set and tag version - runs-on: [ubuntu-latest] - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Set version - id: set_version - run: | - LATEST_TAG=`git describe --tags | cut -d'-' -f1` - MAJOR=`echo $LATEST_TAG | cut -d'.' -f1` - MINOR=`echo $LATEST_TAG | cut -d'.' -f2` - PATCH=`echo $LATEST_TAG | cut -d'.' -f3` - INCREMENTED=$((PATCH+1)) - echo "VERSION=$MAJOR.$MINOR.$INCREMENTED" >> $GITHUB_ENV - - name: Tag new version - run: git tag ${{ env.VERSION }} - - - name: Push tags - uses: ad-m/github-push-action@master - with: - tags: true From 57ad3a94486240e3d2702879564a9a664439ef3c Mon Sep 17 00:00:00 2001 From: "sariru@gmail.com" <89619301+itsafuu@users.noreply.github.com> Date: Tue, 21 Jan 2025 16:17:25 -0500 Subject: [PATCH 044/114] Remove workflows --- .github/workflows/build_linux.yml | 428 ---------------------------- .github/workflows/build_macos.yml | 192 ------------- .github/workflows/release_linux.yml | 170 ----------- .github/workflows/set_version.yml | 33 --- 4 files changed, 823 deletions(-) delete mode 100644 .github/workflows/build_linux.yml delete mode 100644 .github/workflows/build_macos.yml delete mode 100644 .github/workflows/release_linux.yml delete mode 100644 .github/workflows/set_version.yml diff --git a/.github/workflows/build_linux.yml b/.github/workflows/build_linux.yml deleted file mode 100644 index 99c15b9e..00000000 --- a/.github/workflows/build_linux.yml +++ /dev/null @@ -1,428 +0,0 @@ -name: build-linux - -on: - push: - branches: [ master ] - pull_request: - -concurrency: - # In master we want to run for every commit, in other branches — only for the last one - group: ${{ - ( github.ref == 'refs/heads/master' && - format('{0}/{1}/{2}', github.workflow, github.ref, github.sha) ) - || - format('{0}/{1}', github.workflow, github.ref) }} - cancel-in-progress: true - -jobs: - handle-syncwith: - if: github.event_name == 'pull_request' - name: Call Reusable SyncWith Handler - uses: NilFoundation/ci-cd/.github/workflows/reusable-handle-syncwith.yml@v1.1.2 - with: - ci-cd-ref: 'v1.1.2' - secrets: inherit - - build-and-test-linux: - name: Build zkLLVM, run local tests, prepare for integration testing - runs-on: [ self-hosted, Linux, X64, aws_autoscaling ] - needs: - - handle-syncwith - # Condition is needed to run it for push event (handle-syncwith is skipped) - if: | - always() && !cancelled() && - (needs.handle-syncwith.result == 'success' || needs.handle-syncwith.result == 'skipped') - outputs: - transpiler-artifact-name: ${{ steps.artifact-names.outputs.transpiler }} - examples-artifact-name: ${{ steps.artifact-names.outputs.examples }} - evm-targets: ${{ steps.get-targets.outputs.evm-targets }} - prover-targets: ${{ steps.get-targets.outputs.prover-targets }} - - env: - CONTAINER_TMP: /opt/ - HOST_TMP: /home/runner/work/_temp/ - DEBIAN_FRONTEND: noninteractive - BOOST_VERSION: "1.80.0" - INTEGRATION_TESTING_TARGETS: | - arithmetics_cpp_example - polynomial_cpp_example - poseidon_cpp_example - merkle_tree_poseidon_cpp_example - uint_remainder_cpp - uint_shift_left - uint_bit_decomposition - uint_bit_composition - compare_eq_cpp - private_input_cpp - - container: - image: ubuntu:22.04 - volumes: - - /home/runner/work/_temp/:/opt/ - - steps: - - name: Install dependencies - run: | - env && \ - apt update && \ - apt install -y \ - build-essential \ - libssl-dev \ - cmake \ - ninja-build \ - git \ - libicu-dev \ - curl \ - pkg-config - - - name: Print toolchain information - run: | - git --version - cc --version - cmake --version - ninja --version - - - name: Checkout sources - # We need full history, because during CMake config stage we are finding the nearest tag - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: false - - # Workaround: https://github.com/actions/checkout/issues/1169 - - name: Mark directory as safe - run: | - git config --system --add safe.directory $PWD - - - name: Checkout submodules - run: | - git submodule update --init --recursive --depth=1 - - - name: Checkout modules to specified refs - if: needs.handle-syncwith.outputs.prs-refs != '' - uses: NilFoundation/ci-cd/actions/recursive-checkout@v1.2.1 - # TODO: figure out the mapping of volumes and use variable here, not hardcoded path - with: - paths: | - /__w/zkLLVM/zkLLVM/** - !/__w/zkLLVM/zkLLVM/ - !/__w/zkLLVM/zkLLVM/**/.git/** - refs: ${{ needs.handle-syncwith.outputs.prs-refs }} - - - name: Clean index.lock files if checkout step was cancelled or failed - if: cancelled() || failure() - run: | - find .git -name 'index.lock' -exec rm -v {} \; - - - name: Install boost - uses: MarkusJx/install-boost@v2.4.1 - id: install-boost - with: - # A list of supported versions can be found here: - # https://github.com/MarkusJx/prebuilt-boost/blob/main/versions-manifest.json - boost_version: ${{ env.BOOST_VERSION }} - boost_install_dir: ${{ env.CONTAINER_TMP }} - platform_version: 22.04 - toolset: gcc - arch: x86 - - - name: Install Python - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - - - name: Configure CMake - env: - BOOST_ROOT: "${{ steps.install-boost.outputs.BOOST_ROOT }}" - run: | - cmake . \ - -G "Ninja" \ - -B build \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_TESTS=TRUE \ - -DRSLANG_BUILD_EXTENDED=TRUE \ - -DRSLANG_BUILD_TOOLS=cargo \ - -DGENERATE_EVM_VERIFIER=TRUE - - - name: Build zkllvm - run: | - cmake --build build -t assigner clang transpiler - - - name: Build IR of the C++ examples - run: | - cmake --build build -t compile_cpp_examples - ls -al ./build/examples/cpp - - - name: Build circuits(.crct) of the C++ examples - run: | - cmake --build build -t cpp_examples_generate_crct - ls -al ./build/examples/cpp - - - name: Build assignment tables(.tbl) of the C++ examples - run: | - cmake --build build -t cpp_examples_generate_tbl - ls -al ./build/examples/cpp - - - name: Run size estimation for C++ examples - run: | - cmake --build build -t cpp_examples_estimate_size - - - name: Copy examples' circuits and assignments for uploading - run: | - chmod +x ./examples/copy_artifacts.sh - ./examples/copy_artifacts.sh build/examples/cpp examples_output - - - name: Set aritfacts' names - id: artifact-names - run: | - echo "transpiler=transpiler-output" >> $GITHUB_OUTPUT - echo "examples=circuits-and-assignments" >> $GITHUB_OUTPUT - - - name: Upload examples' circuits and assignments artifact - uses: actions/upload-artifact@v3 - with: - name: ${{ steps.artifact-names.outputs.examples }} - path: | - examples_output - - - name: Compile tests as cpp code - run: | - cmake --build build -t all_tests_compile_as_cpp_code - - - name: Compile tests as circuits - run: | - cmake --build build -t all_tests_compile_as_circuits - - - name: Run tests as cpp code (expected res calculation) - run: | - cmake --build build -t all_tests_run_expected_res_calculation -j$(nproc) - - - name: Get transpiler output for integration testing - run: | - targets_str=$(echo "${{ env.INTEGRATION_TESTING_TARGETS }}" | awk 'NF {printf "-t %s_evm_verifier ", $0}' | sed 's/[[:space:]]*$//') - cmake --build build ${targets_str} - - - name: Upload examples' circuits and assignments artifact - uses: actions/upload-artifact@v3 - with: - name: ${{ steps.artifact-names.outputs.transpiler }} - path: | - build/examples/cpp/transpiler_output_* - - - name: Run tests as circuits (real res calculation) - run: | - cmake --build build -t all_tests_assign_circuits -j$(nproc) - - - name: Compare expected and real test results - run: | - chmod +x ./tests/run_test_results_comparison.sh - bash ./tests/run_test_results_comparison.sh - - - name: Run tests on faulty inputs - run: | - chmod +x ./tests/run_tests_faulty_input.sh - bash ./tests/run_tests_faulty_input.sh pallas - - - name: Run assigner unit tests - run: | - cmake --build build -t check-crypto3-assigner - - - name: Run assigner tests - run: | - cd libs/assigner/test - chmod +x run_tests.py - python3 run_tests.py ../../../build/bin/assigner/assigner - cd ../../../ - - - name: Build proof for the circuit of the C++ examples - run: | - cmake --build build -t prove_cpp_examples - - - name: Build recursive gen - run: | - cmake --build build -t recursive_gen - - - name: Build and run transpiler test - run: | - cmake --build build -t compile_and_run_transpiler_tests - - - name: Run recursive verifier single prover version - run: | - chmod +x ./gen_and_check.sh - bash ./gen_and_check.sh - - - name: Run recursive verifier multi prover version - run: | - chmod +x ./multi_gen_and_check.sh - bash ./multi_gen_and_check.sh - - - name: Build rslang - run: | - export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$(pwd)/build/libs/circifier/llvm/lib" - echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/build/libs/circifier/llvm/lib" >> $GITHUB_ENV - cmake --build build -t rslang - - - name: Build IR of the Rust examples - run: | - cmake --build build -t compile_rust_examples - ls -al ./build/examples/rust/target/assigner-unknown-unknown/release/examples - - - name: Build circuits(.crct) of the Rust examples - run: | - cmake --build build -t rust_examples_generate_crct - ls -al ./build/examples/cpp - - - name: Build assignment tables(.tbl) of the Rust examples - run: | - cmake --build build -t rust_examples_generate_tbl - ls -al ./build/examples/cpp - - - name: Build proof for the circuit of the Rust examples - run: | - cmake --build build -t prove_rust_examples - - - name: Set targets for integration testing - id: get-targets - run: | - targets_str=$(echo "${{ env.INTEGRATION_TESTING_TARGETS }}" | awk 'NF {print "transpiler_output_" $1}') - echo "evm-targets<> $GITHUB_OUTPUT - echo "${targets_str}" >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT - - echo "prover-targets<> $GITHUB_OUTPUT - echo "${{ env.INTEGRATION_TESTING_TARGETS }}" >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT - - - verify-zkllvm-proofs: - name: Verify built-it proofs with EVM-placeholder - needs: - - build-and-test-linux - - handle-syncwith - if: | - always() && !cancelled() && - (needs.handle-syncwith.result == 'success' || needs.handle-syncwith.result == 'skipped') && - needs.build-and-test-linux.result == 'success' - uses: NilFoundation/evm-placeholder-verification/.github/workflows/reusable-verify-proofs.yml@5bb7c4b0790f56b3a339e33ba442816fac17ab88 - with: - artifact-name: ${{ needs.build-and-test-linux.outputs.transpiler-artifact-name }} - evm-placeholder-verification-ref: 202fbd0402eda22ae91348800dea7366110b1501 - refs: ${{ needs.handle-syncwith.outputs.prs-refs }} - test-names: ${{ needs.build-and-test-linux.outputs.evm-targets }} - - - generate-proofs: - name: Generate proofs for cpp examples - needs: - - build-and-test-linux - - handle-syncwith - if: | - always() && !cancelled() && - (needs.handle-syncwith.result == 'success' || needs.handle-syncwith.result == 'skipped') && - needs.build-and-test-linux.result == 'success' - uses: NilFoundation/proof-producer/.github/workflows/reusable-generate-proofs-linux.yml@b1e380040b4714b6ad5fe9223555d854c49cf065 - with: - artifact-name: ${{ needs.build-and-test-linux.outputs.examples-artifact-name }} - # Update next line if you need new version of proof producer - proof-producer-ref: d6d8d18cd7a6e15dd9497140350efadb6af5179b - refs: ${{ needs.handle-syncwith.outputs.prs-refs }} - targets: ${{ needs.build-and-test-linux.outputs.prover-targets }} - - - merge-proofs-to-transpiler-output: - runs-on: ubuntu-22.04 - needs: - - generate-proofs - - build-and-test-linux - if: | - always() && !cancelled() && - needs.generate-proofs.result == 'success' && - needs.build-and-test-linux.result == 'success' - outputs: - merged-artifact-name: ${{ steps.artifact-name.outputs.merged }} - steps: - - name: Download artifact with proofs - uses: actions/download-artifact@v3 - with: - name: ${{ needs.generate-proofs.outputs.artifact-name }} - - - name: Download artifact with transpiler output - uses: actions/download-artifact@v3 - with: - name: ${{ needs.build-and-test-linux.outputs.transpiler-artifact-name }} - - - name: Merge proofs into transpiler output - run: | - copy_failed=0 - while read dir; do - base_name=${dir#./transpiler_output_} - - if [[ -d "$base_name" ]]; then - if ! cp "${base_name}/proof.bin" "${dir}/"; then - echo "Failed to copy proof.bin to ${dir}" >&2 - copy_failed=1 - else - echo "proof.bin added to ${dir}" - fi - else - echo "Error: No matching directory found for ${dir}" >&2 - fi - done < <(find . -type d -name "transpiler_output_*") - - if [ $copy_failed -eq 1 ]; then - echo "One or more copy operations failed." - exit 1 - fi - - - name: Set aritfact name - id: artifact-name - run: | - echo "merged=transpiler-output-merged-proofs" >> $GITHUB_OUTPUT - - - name: Upload merged artifact - uses: actions/upload-artifact@v3 - with: - name: ${{ steps.artifact-name.outputs.merged }} - path: | - transpiler_output_* - - - verify-proof-producer-proofs: - name: Verify proof-producer proofs with EVM-placeholder - needs: - - handle-syncwith - - merge-proofs-to-transpiler-output - - build-and-test-linux - if: | - always() && !cancelled() && - (needs.handle-syncwith.result == 'success' || needs.handle-syncwith.result == 'skipped') && - needs.build-and-test-linux.result == 'success' && - needs.merge-proofs-to-transpiler-output.result == 'success' - uses: NilFoundation/evm-placeholder-verification/.github/workflows/reusable-verify-proofs.yml@5bb7c4b0790f56b3a339e33ba442816fac17ab88 - with: - artifact-name: ${{ needs.merge-proofs-to-transpiler-output.outputs.merged-artifact-name }} - evm-placeholder-verification-ref: 202fbd0402eda22ae91348800dea7366110b1501 - refs: ${{ needs.handle-syncwith.outputs.prs-refs }} - test-names: ${{ needs.build-and-test-linux.outputs.evm-targets }} - - - cleanup-integration-testing: - # For now each artifact is 12 GB. Better clean it up to keep the space - name: Clean up after integration testing - needs: - - verify-proof-producer-proofs - - verify-zkllvm-proofs - - merge-proofs-to-transpiler-output - - build-and-test-linux - - generate-proofs - if: always() - runs-on: ubuntu-22.04 - steps: - - uses: geekyeggo/delete-artifact@v2 - with: - name: | - ${{ needs.merge-proofs-to-transpiler-output.outputs.merged-artifact-name }} - ${{ needs.generate-proofs.outputs.artifact-name }} diff --git a/.github/workflows/build_macos.yml b/.github/workflows/build_macos.yml deleted file mode 100644 index c54ab50f..00000000 --- a/.github/workflows/build_macos.yml +++ /dev/null @@ -1,192 +0,0 @@ -name: build-macos - -on: - push: - branches: [ master ] - pull_request: - -concurrency: - group: ${{ - ( github.ref == 'refs/heads/master' && - format('{0}/{1}', github.run_id, github.run_attempt) ) - || - format('{0}/{1}', github.workflow, github.ref) }} - cancel-in-progress: true - -jobs: - handle-syncwith: - if: github.event_name == 'pull_request' - name: Call Reusable SyncWith Handler - uses: NilFoundation/ci-cd/.github/workflows/reusable-handle-syncwith.yml@v1 - with: - ci-cd-ref: 'v1' - fetch-only: true - secrets: inherit - - build-macos: - runs-on: [ macos-11 ] - - needs: - - handle-syncwith - - steps: - - name: Install homebrew - run: > - /bin/bash -c "$(curl -fsSL - https://raw.githubusercontent.com/Homebrew/install/master/install.sh - )" - - - name: Run brew install - id: brew-install - run: | - brew install \ - boost@1.76 \ - cmake \ - ninja \ - icu4c \ - libiconv \ - openssl \ - curl \ - bash - - - name: Install Python - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - - name: Print toolchain information - run: | - git --version - cc --version - cmake --version - ninja --version - bash --version - python3 --version - which -a bash - echo PATH: $PATH - - - name: Checkout sources - # We need full history, because during CMake config stage we are finding the nearest tag - uses: actions/checkout@v3 - with: - fetch-depth: 0 - submodules: false - - - name: Checkout submodules - run: | - git submodule update --init --recursive --depth=1 - - - name: Checkout modules to specified refs - if: needs.handle-syncwith.outputs.prs-refs != '' - uses: NilFoundation/ci-cd/actions/recursive-checkout@v1.2.1 - with: - paths: | - ${{ github.workspace }}/** - !${{ github.workspace }} - !${{ github.workspace }}/**/.git/** - refs: ${{ needs.handle-syncwith.outputs.prs-refs }} - - - name: Enable ccache - uses: hendrikmuhs/ccache-action@v1.2 - with: - key: ${{ github.job }} - - - name: Configure CMake - env: - BOOST_ROOT: "/usr/local/opt/boost@1.76" - LDFLAGS: "-L/usr/local/opt/icu4c/lib" - CPPFLAGS: "-I/usr/local/opt/icu4c/include" - run: | - cmake -G "Ninja" \ - -B build \ - -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_SHARED_LIBS=FALSE \ - -DBUILD_TESTS=TRUE . - - - name: Build zkllvm - run: | - cmake --build build -t assigner clang transpiler - - - name: Build IR of the C++ examples - run: | - cmake --build build -t compile_cpp_examples - ls -al ./build/examples/cpp - - - name: Build circuits(.crct) of the C++ examples - run: | - cmake --build build -t cpp_examples_generate_crct - ls -al ./build/examples/cpp - - - name: Build assignment tables(.tbl) of the C++ examples - run: | - cmake --build build -t cpp_examples_generate_tbl - ls -al ./build/examples/cpp - - - name: Run size estimation for C++ examples - run: | - cmake --build build -t cpp_examples_estimate_size - - - name: Compile tests as cpp code - run: | - cmake --build build -t all_tests_compile_as_cpp_code - - - name: Compile tests as circuits - run: | - cmake --build build -t all_tests_compile_as_circuits - - - name: Run tests as cpp code (expected res calculation) - run: | - cmake --build build -t all_tests_run_expected_res_calculation - - - name: Run tests as circuits (real res calculation) - run: | - cmake --build build -t all_tests_assign_circuits - - - name: Compare expected and real test results - run: | - chmod +x ./tests/run_test_results_comparison.sh - bash ./tests/run_test_results_comparison.sh - - - name: Run tests on faulty inputs - run: | - chmod +x ./tests/run_tests_faulty_input.sh - bash ./tests/run_tests_faulty_input.sh pallas - - - name: Run assigner unit tests - run: | - cmake --build build -t check-crypto3-assigner - - - name: Run assigner tests - run: | - cd libs/assigner/test - chmod +x run_tests.py - python3 run_tests.py ../../../build/bin/assigner/assigner - cd ../../../ - - - name: Build proof for the circuit of the C++ examples - run: | - cmake --build build -t prove_cpp_examples - - - name: Build rslang - run: | - cmake --build build -t rslang - - - name: Build IR of the Rust examples - run: | - cmake --build build -t compile_rust_examples - ls -al ./build/examples/rust/target/assigner-unknown-unknown/release/examples - - - name: Build circuits(.crct) of the Rust examples - run: | - cmake --build build -t rust_examples_generate_crct - ls -al ./build/examples/cpp - - - name: Build assignment tables(.tbl) of the Rust examples - run: | - cmake --build build -t rust_examples_generate_tbl - ls -al ./build/examples/cpp - - - name: Build proofs for the circuits of the Rust examples - run: | - cmake --build build -t prove_rust_examples diff --git a/.github/workflows/release_linux.yml b/.github/workflows/release_linux.yml deleted file mode 100644 index 46529840..00000000 --- a/.github/workflows/release_linux.yml +++ /dev/null @@ -1,170 +0,0 @@ -name: Make release - -# Controls when the action will run. Workflow runs when manually triggered using the UI -# or API. -on: - workflow_dispatch: - inputs: - release_type: - type: choice - description: Release type - options: - - major - - minor - - patch - default: minor - -jobs: - make-release: - runs-on: [ self-hosted, Linux, X64, aws_autoscaling ] - environment: prod - - env: - CONTAINER_TMP: /opt/ - HOST_TMP: /home/runner/work/_temp/ - DEBIAN_FRONTEND: noninteractive - BOOST_VERSION: "1.80.0" - - container: - image: ubuntu:22.04 - volumes: - - /home/runner/work/_temp/:/opt/ - - steps: - - name: Install dependencies - run: | - env && \ - apt update && \ - apt install -y \ - build-essential \ - libssl-dev \ - cmake \ - git \ - curl \ - unzip \ - zstd \ - libicu-dev \ - pkg-config - - - name: Print toolchain information - run: | - git --version - cc --version - cmake --version - - - name: Checkout sources - uses: actions/checkout@v3 - with: - submodules: 'recursive' - fetch-depth: 0 - - # Workaround: https://github.com/actions/checkout/issues/1169 - - name: Mark directory as safe - run: | - git config --system --add safe.directory $PWD - - - name: Install boost - uses: MarkusJx/install-boost@v2.4.1 - id: install-boost - with: - # A list of supported versions can be found here: - # https://github.com/MarkusJx/prebuilt-boost/blob/main/versions-manifest.json - boost_version: ${{ env.BOOST_VERSION }} - boost_install_dir: ${{ env.CONTAINER_TMP }} - platform_version: 22.04 - toolset: gcc - arch: x86 - - - name: Install Python - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - - - name: Install aws tools - run: | - curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" - unzip awscliv2.zip - ./aws/install - pip3 install mkrepo - - - name: Compute release number - env: - RELEASE_TYPE: ${{ inputs.release_type }} - run: | - LATEST_TAG=`git describe --tags | cut -d'-' -f1 | tr -d v` - MAJOR=`echo $LATEST_TAG | cut -d'.' -f1` - MINOR=`echo $LATEST_TAG | cut -d'.' -f2` - PATCH=`echo $LATEST_TAG | cut -d'.' -f3` - - case $RELEASE_TYPE in - - major) - MAJOR=$((MAJOR+1)) - MINOR=0 - PATCH=0 - ;; - minor) - MINOR=$((MINOR+1)) - PATCH=0 - ;; - patch) - PATCH=$((PATCH+1)) - ;; - *) - echo "Unknown release type" - exit 1 - ;; - esac - echo "VERSION=$MAJOR.$MINOR.$PATCH" >> $GITHUB_ENV - echo "VERSION=$MAJOR.$MINOR.$PATCH" - - - name: Configure CMake - env: - BOOST_ROOT: "${{ steps.install-boost.outputs.BOOST_ROOT }}" - run: | - cmake -G "Unix Makefiles" \ - -B build \ - -DCMAKE_BUILD_TYPE=Release \ - -DZKLLVM_VERSION=${{ env.VERSION }} . - - - name: Build packages - run: | - make -C build package -j$(nproc) - - # TODO: we should consider distribution with dynamically linked LLVM - - name: Configure CMake for rslang - env: - BOOST_ROOT: "${{ steps.install-boost.outputs.BOOST_ROOT }}" - run: | - cmake -G "Unix Makefiles" \ - -B build_rslang \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_SHARED_LIBS=FALSE \ - -DZKLLVM_VERSION=${{ env.VERSION }} \ - -DRSLANG_BUILD_EXTENDED=TRUE \ - -DRSLANG_BUILD_TOOLS=cargo . - - - name: Build rslang distribution - run: | - make -C build_rslang rslang_dist -j$(nproc) - - - name: Create release - uses: ncipollo/release-action@v1 - with: - name: "zkllvm-v${{ env.VERSION }}" - tag: "v${{ env.VERSION }}" - artifacts: "build/zkllvm_*.deb,build/zkllvm-stdlib_*.deb,build_rslang/libs/rslang/build/dist/*" - - - name: Upload packages to repository - env: - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} - run: | - ZKLLVM_PACKAGE=`ls build/zkllvm_*.deb | cut -d'/' -f2` - POOL="ubuntu/pool/main/z/zkllvm" - aws s3api put-object --bucket deb.nil.foundation --key $POOL/$ZKLLVM_PACKAGE --body build/$ZKLLVM_PACKAGE - mkrepo s3://deb.nil.foundation/ubuntu/ diff --git a/.github/workflows/set_version.yml b/.github/workflows/set_version.yml deleted file mode 100644 index 1c34a260..00000000 --- a/.github/workflows/set_version.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Set version - -on: - # Triggers the workflow on push to master branch - push: - branches: [ master ] - -jobs: - set_version: - name: Set and tag version - runs-on: [ubuntu-latest] - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Set version - id: set_version - run: | - LATEST_TAG=`git describe --tags | cut -d'-' -f1` - MAJOR=`echo $LATEST_TAG | cut -d'.' -f1` - MINOR=`echo $LATEST_TAG | cut -d'.' -f2` - PATCH=`echo $LATEST_TAG | cut -d'.' -f3` - INCREMENTED=$((PATCH+1)) - echo "VERSION=$MAJOR.$MINOR.$INCREMENTED" >> $GITHUB_ENV - - name: Tag new version - run: git tag ${{ env.VERSION }} - - - name: Push tags - uses: ad-m/github-push-action@master - with: - tags: true From 93a3ef7d2b2188db1a7001ee9742ebf6f5921483 Mon Sep 17 00:00:00 2001 From: "sariru@gmail.com" <89619301+itsafuu@users.noreply.github.com> Date: Tue, 21 Jan 2025 16:34:26 -0500 Subject: [PATCH 045/114] A basic workflow to try --- .github/workflows/cmake.yml | 650 +++++++++++++++++++++++++++++++++++ .github/workflows/deploy.yml | 65 ++++ 2 files changed, 715 insertions(+) create mode 100644 .github/workflows/cmake.yml create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml new file mode 100644 index 00000000..8d93a016 --- /dev/null +++ b/.github/workflows/cmake.yml @@ -0,0 +1,650 @@ +name: Release Build CI + +# Controls when the workflow will run +# Triggers the workflow on push or pull request events and manually from the Actions tab +on: + push: + branches: + - develop + - main + pull_request: + branches: + - develop + - main + workflow_dispatch: + +jobs: + Windows: + runs-on: windows-latest + steps: + - name: Get branch name + id: branch-name + uses: tj-actions/branch-names@v6 + + - name: Install Windows host dependencies + run: | + choco install ccache -A + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: Checkout zkLLVM repository + uses: actions/checkout@v3 + with: + path: 'zkLLVM' + submodules: "recursive" + + - name: Download Prebuilt Boost from Thirdparty + uses: actions/download-release-asset@v1 + with: + repository: 'GeniusVentures/thirdparty' + tag: ${{ steps.branch-name.outputs.current_branch || 'develop' }} + asset_name: 'Boost-lib.tar.gz' + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract Prebuilt Boost + run: | + tar -xzvf Boost-lib.tar.gz -C ${{github.workspace}}/thirdparty/build/Windows/Release + + - name: Create Build Directory + run: cmake -E make_directory ${{github.workspace}}/zkLLVM/build/Windows/Release + + - name: Configure CMake + working-directory: ${{github.workspace}}/zkLLVM/build/Windows/Release + run: cmake -S .. -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty/ + + - name: Compile + working-directory: ${{github.workspace}}/zkLLVM/build/Windows/Release + run: cmake --build . --config Release -j + + - name: Create install directory + working-directory: ${{github.workspace}}/zkLLVM/build/Windows/Release + run: cmake --install . + + - name: Compressing Build Artifacts + working-directory: ${{github.workspace}}/zkLLVM + if: ${{ github.event_name == 'workflow_dispatch' }} + run: | + shopt -s extglob + rm -rf !(build) .[!.]* ..?* + cd build + rm -rf !(Windows) .[!.]* ..?* + cd Windows + rm -rf !(Release) .[!.]* ..?* + cd Release + rm -rf !(zkLLVM) .[!.]* ..?* + cd $GITHUB_WORKSPACE + tar -czvf zkLLVM.tar.gz zkLLVM/ + shell: bash + + - name: Set Release Variables + id: vars + if: ${{ github.event_name == 'workflow_dispatch' }} + run: | + OS_NAME=Windows + BRANCH_NAME=${GITHUB_REF#refs/heads/} + BUILD_TYPE=Release + FILE_NAME="${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}.tar.gz" + echo "RELEASE_TAG=${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}-${GITHUB_SHA::7}" >> $GITHUB_ENV + echo "RELEASE_NAME=${OS_NAME} ${BRANCH_NAME} ${BUILD_TYPE} (${GITHUB_SHA::7})" >> $GITHUB_ENV + echo "FILE_NAME=$FILE_NAME" >> $GITHUB_ENV + shell: bash + + - name: Rename Artifact + if: ${{ github.event_name == 'workflow_dispatch' }} + run: mv zkLLVM.tar.gz ${{ env.FILE_NAME }} + shell: bash + + - name: Create GitHub Release + if: ${{ github.event_name == 'workflow_dispatch' }} + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} + with: + tag_name: ${{ env.RELEASE_TAG }} + release_name: ${{ env.RELEASE_NAME }} + draft: false + prerelease: false + + - name: Upload Release Asset + if: ${{ github.event_name == 'workflow_dispatch' }} + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ${{ env.FILE_NAME }} + asset_name: ${{ env.FILE_NAME }} + asset_content_type: application/gzip + + # Linux: + # runs-on: ubuntu-latest + # steps: + # - name: Get branch name + # id: branch-name + # uses: tj-actions/branch-names@v6 + + # - name: Set clang as the default compiler + # run: | + # sudo update-alternatives --install /usr/bin/cc cc $(which clang) 100 + # sudo update-alternatives --install /usr/bin/c++ c++ $(which clang++) 100 + # sudo update-alternatives --set cc $(which clang) + # sudo update-alternatives --set c++ $(which clang++) + + # - name: Install Linux host dependencies + # run: | + # sudo apt install ccache ninja-build -y + # sudo apt install vulkan-tools vulkan-validationlayers-dev libvulkan-dev -y + # echo "CMAKE_GENERATOR=Ninja" >> $GITHUB_ENV + + # - name: Install bindgen + # run: cargo install cbindgen + + # - name: Add Rust wasm target + # run: rustup target add wasm32-unknown-emscripten + + # # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + # - uses: actions/checkout@v3 + # with: + # path: 'SuperGenius' + # submodules: "recursive" + + # - name: Check if branch exists in thirdparty + # id: check_branch + # uses: tj-actions/branch-names@v6 + # with: + # repo: 'GeniusVentures/thirdparty' + # branch: ${{ steps.branch-name.outputs.current_branch }} + + # - name: Check out thirdparty repository + # uses: actions/checkout@v3 + # with: + # repository: 'GeniusVentures/thirdparty' + # path: 'thirdparty' + # submodules: 'recursive' + # ref: ${{ steps.check_branch.outputs.branch_exists == 'true' && steps.branch-name.outputs.current_branch || 'develop' }} + + # - name: Thirdparty Create Build Directory + # run: cmake -E make_directory ${{github.workspace}}/thirdparty/build/Linux/Release + + # - name: Thirdparty Configure CMake + # working-directory: ${{github.workspace}}/thirdparty/build/Linux/Release + # run: cmake -S .. -DCMAKE_BUILD_TYPE=Release + + # - name: Thirdparty Compile + # working-directory: ${{github.workspace}}/thirdparty/build/Linux/Release + # run: cmake --build . --config Release -j + + # - name: Create Build Directory + # run: cmake -E make_directory ${{github.workspace}}/SuperGenius/build/Linux/Release + + # - name: Configure CMake + # working-directory: ${{github.workspace}}/SuperGenius/build/Linux/Release + # run: cmake -S .. -DCMAKE_BUILD_TYPE=Release -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty/ + + # - name: Compile + # working-directory: ${{github.workspace}}/SuperGenius/build/Linux/Release + # run: cmake --build . --config Release -j + + # - name: Install + # working-directory: ${{github.workspace}}/SuperGenius/build/Linux/Release + # run: cmake --install . + + # - name: Compressing Build Artifacts + # working-directory: ${{github.workspace}}/SuperGenius + # if: ${{ github.event_name == 'workflow_dispatch' }} + # run: | + # shopt -s extglob + # rm -rf !(build) .[!.]* ..?* + # cd build + # rm -rf !(Linux) .[!.]* ..?* + # cd Linux + # rm -rf !(Release) .[!.]* ..?* + # cd Release + # rm -rf !(SuperGenius) .[!.]* ..?* + # cd ${{github.workspace}} + # tar -czvf SuperGenius.tar.gz SuperGenius/ + + # - name: Set Release Variables + # id: vars + # if: ${{ github.event_name == 'workflow_dispatch' }} + # run: | + # OS_NAME=Linux + # BRANCH_NAME=${GITHUB_REF#refs/heads/} + # BUILD_TYPE=Release + # FILE_NAME="${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}.tar.gz" + # echo "RELEASE_TAG=${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}-${GITHUB_SHA::7}" >> $GITHUB_ENV + # echo "RELEASE_NAME=${OS_NAME} ${BRANCH_NAME} ${BUILD_TYPE} (${GITHUB_SHA::7})" >> $GITHUB_ENV + # echo "FILE_NAME=$FILE_NAME" >> $GITHUB_ENV + + # - name: Rename Artifact + # if: ${{ github.event_name == 'workflow_dispatch' }} + # run: mv SuperGenius.tar.gz ${{ env.FILE_NAME }} + + # - name: Create GitHub Release + # if: ${{ github.event_name == 'workflow_dispatch' }} + # id: create_release + # uses: actions/create-release@v1 + # env: + # GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} + # with: + # tag_name: ${{ env.RELEASE_TAG }} + # release_name: ${{ env.RELEASE_NAME }} + # draft: false + # prerelease: false + + # - name: Upload Release Asset + # if: ${{ github.event_name == 'workflow_dispatch' }} + # uses: actions/upload-release-asset@v1 + # env: + # GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} + # with: + # upload_url: ${{ steps.create_release.outputs.upload_url }} + # asset_path: ${{ env.FILE_NAME }} + # asset_name: ${{ env.FILE_NAME }} + # asset_content_type: application/gzip + + # Android: + # runs-on: ubuntu-latest + # env: + # ANDROID_NDK_HOME: ${{github.workspace}}/android-ndk/android-ndk-r25b + # ANDROID_TOOLCHAIN: ${{github.workspace}}/android-ndk/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin + # NDK_URL: "https://dl.google.com/android/repository/android-ndk-r25b-linux.zip" + # CC: clang + + # steps: + # - name: Get branch name + # id: branch-name + # uses: tj-actions/branch-names@v6 + + # # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + # - uses: actions/checkout@v3 + # with: + # path: 'SuperGenius' + # submodules: "recursive" + + # - name: Download Android NDK + # run: | + # mkdir "${{github.workspace}}/android-ndk" + # cd "${{github.workspace}}/android-ndk" + # curl -o ndk.zip ${{ env.NDK_URL }} + # unzip ndk.zip + # rm ndk.zip + + # - name: Install bindgen + # run: cargo install cbindgen + + # - name: Add Rust wasm target + # run: rustup target add wasm32-unknown-emscripten + + # - name: Add Android toolchain + # run: | + # rustup target add aarch64-linux-android + + # - name: Check if branch exists in thirdparty + # id: check_branch + # uses: tj-actions/branch-names@v6 + # with: + # repo: 'GeniusVentures/thirdparty' + # branch: ${{ steps.branch-name.outputs.current_branch }} + + # - name: Check out thirdparty repository + # uses: actions/checkout@v3 + # with: + # repository: 'GeniusVentures/thirdparty' + # path: 'thirdparty' + # submodules: 'recursive' + # ref: ${{ steps.check_branch.outputs.branch_exists == 'true' && steps.branch-name.outputs.current_branch || 'develop' }} + + # - name: Thirdparty Create Build Directory + # run: cmake -E make_directory ${{github.workspace}}/thirdparty/build/Android/Release/arm64-v8a + + # - name: Thirdparty Configure CMake + # working-directory: ${{github.workspace}}/thirdparty/build/Android/Release/arm64-v8a + # run: | + # export ANDROID_NDK=${{env.ANDROID_NDK_HOME}} + # export ANDROID_NDK_HOME=${{env.ANDROID_NDK_HOME}} + # export ANDROID_TOOLCHAIN=${{env.ANDROID_TOOLCHAIN}} + # export PATH=${{env.ANDROID_TOOLCHAIN}}:$PATH + # echo $PATH + # echo $CC + # ls -la $ANDROID_TOOLCHAIN + # echo "Check clang path:" + # which clang + # env + # cmake -S ../../ -DANDROID_ABI="arm64-v8a" -DCMAKE_ANDROID_NDK=$ANDROID_NDK -DANDROID_TOOLCHAIN=clang -DCMAKE_BUILD_TYPE=Release + + # - name: Thirdparty Compile + # working-directory: ${{github.workspace}}/thirdparty/build/Android/Release/arm64-v8a + # run: make -j8 + + # - name: Create Build Directory + # run: cmake -E make_directory ${{github.workspace}}/SuperGenius/build/Android/Release/arm64-v8a + + # - name: Configure CMake + # working-directory: ${{github.workspace}}/SuperGenius/build/Android/Release/arm64-v8a + # run: | + # export ANDROID_NDK=${{env.ANDROID_NDK_HOME}} + # export ANDROID_NDK_HOME=${{env.ANDROID_NDK_HOME}} + # export ANDROID_TOOLCHAIN=${{env.ANDROID_TOOLCHAIN}} + # export PATH=${{env.ANDROID_TOOLCHAIN}}:$PATH + # echo $PATH + # echo $CC + # ls -la $ANDROID_TOOLCHAIN + # echo "Check clang path:" + # which clang + # env + # cmake -S ../../ -DANDROID_ABI="arm64-v8a" -DCMAKE_BUILD_TYPE=Release -DCMAKE_ANDROID_NDK=$ANDROID_NDK -DANDROID_TOOLCHAIN=clang -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty/ + + # - name: Compile + # working-directory: ${{github.workspace}}/SuperGenius/build/Android/Release/arm64-v8a + # run: make -j8 + + # - name: Install + # working-directory: ${{github.workspace}}/SuperGenius/build/Android/Release/arm64-v8a + # run: cmake --install . + + # - name: Compressing Build Artifacts + # working-directory: ${{github.workspace}}/SuperGenius + # if: ${{ github.event_name == 'workflow_dispatch' }} + # run: | + # shopt -s extglob + # rm -rf !(build) .[!.]* ..?* + # cd build + # rm -rf !(Android) .[!.]* ..?* + # cd Android + # rm -rf !(Release) .[!.]* ..?* + # cd Release + # rm -rf !(arm64-v8a) .[!.]* ..?* + # cd arm64-v8a + # rm -rf !(SuperGenius) .[!.]* ..?* + # cd ${{github.workspace}} + # tar -czvf SuperGenius.tar.gz SuperGenius/ + + # - name: Set Release Variables + # id: vars + # if: ${{ github.event_name == 'workflow_dispatch' }} + # run: | + # OS_NAME=Android-arm64-v8a + # BRANCH_NAME=${GITHUB_REF#refs/heads/} + # BUILD_TYPE=Release + # FILE_NAME="${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}.tar.gz" + # echo "RELEASE_TAG=${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}-${GITHUB_SHA::7}" >> $GITHUB_ENV + # echo "RELEASE_NAME=${OS_NAME} ${BRANCH_NAME} ${BUILD_TYPE} (${GITHUB_SHA::7})" >> $GITHUB_ENV + # echo "FILE_NAME=$FILE_NAME" >> $GITHUB_ENV + + # - name: Rename Artifact + # if: ${{ github.event_name == 'workflow_dispatch' }} + # run: mv SuperGenius.tar.gz ${{ env.FILE_NAME }} + + # - name: Create GitHub Release + # if: ${{ github.event_name == 'workflow_dispatch' }} + # id: create_release + # uses: actions/create-release@v1 + # env: + # GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} + # with: + # tag_name: ${{ env.RELEASE_TAG }} + # release_name: ${{ env.RELEASE_NAME }} + # draft: false + # prerelease: false + + # - name: Upload Release Asset + # if: ${{ github.event_name == 'workflow_dispatch' }} + # uses: actions/upload-release-asset@v1 + # env: + # GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} + # with: + # upload_url: ${{ steps.create_release.outputs.upload_url }} + # asset_path: ${{ env.FILE_NAME }} + # asset_name: ${{ env.FILE_NAME }} + # asset_content_type: application/gzip + + + # MacOS: + # runs-on: macos-latest + # steps: + # - name: Get branch name + # id: branch-name + # uses: tj-actions/branch-names@v6 + + # # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + # - uses: actions/checkout@v3 + # with: + # path: 'SuperGenius' + # submodules: "recursive" + + # # Workaround for arm64 build + # - name: Ensure latest macOS SDK is used + # run: | + # sudo xcode-select --switch "$(find /Applications -mindepth 1 -maxdepth 1 ! -type l | grep "Xcode_[\.0-9]*app" | sort -V | tail -1)/Contents/Developer" + # sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/* + + # - name: Install bindgen + # run: cargo install cbindgen + + # - name: Add Rust wasm target + # run: rustup target add wasm32-unknown-emscripten + + # - name: Add Darwin rust toolchain + # run: rustup target add x86_64-apple-darwin + + # - name: Check if branch exists in thirdparty + # id: check_branch + # uses: tj-actions/branch-names@v6 + # with: + # repo: 'GeniusVentures/thirdparty' + # branch: ${{ steps.branch-name.outputs.current_branch }} + + # - name: Check out thirdparty repository + # uses: actions/checkout@v3 + # with: + # repository: 'GeniusVentures/thirdparty' + # path: 'thirdparty' + # submodules: 'recursive' + # ref: ${{ steps.check_branch.outputs.branch_exists == 'true' && steps.branch-name.outputs.current_branch || 'develop' }} + + # - name: Thirdparty Create Build Directory + # run: cmake -E make_directory ${{github.workspace}}/thirdparty/build/OSX/Release + + # - name: Thirdparty Configure CMake + # working-directory: ${{github.workspace}}/thirdparty/build/OSX/Release + # run: cmake -S .. -DCMAKE_BUILD_TYPE=Release + + # - name: Thirdparty Compile + # working-directory: ${{github.workspace}}/thirdparty/build/OSX/Release + # run: make -j8 + + # - name: Create Build Directory + # run: cmake -E make_directory ${{github.workspace}}/SuperGenius/build/OSX/Release + + # - name: Configure CMake + # working-directory: ${{github.workspace}}/SuperGenius/build/OSX/Release + # run: cmake -S .. -DCMAKE_BUILD_TYPE=Release -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty/ + + # - name: Compile + # working-directory: ${{github.workspace}}/SuperGenius/build/OSX/Release + # run: make -j8 + + # - name: Install + # working-directory: ${{github.workspace}}/SuperGenius/build/OSX/Release + # run: cmake --install . + + # - name: Compressing Build Artifacts + # working-directory: ${{github.workspace}}/SuperGenius + # if: ${{ github.event_name == 'workflow_dispatch' }} + # run: | + # shopt -s extglob + # rm -rf !(build) .[!.]* ..?* + # cd build + # rm -rf !(OSX) .[!.]* ..?* + # cd OSX + # rm -rf !(Release) .[!.]* ..?* + # cd Release + # rm -rf !(SuperGenius) .[!.]* ..?* + # cd ${{github.workspace}} + # tar -czvf SuperGenius.tar.gz SuperGenius/ + + # - name: Set Release Variables + # id: vars + # if: ${{ github.event_name == 'workflow_dispatch' }} + # run: | + # OS_NAME=OSX + # BRANCH_NAME=${GITHUB_REF#refs/heads/} + # BUILD_TYPE=Release + # FILE_NAME="${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}.tar.gz" + # echo "RELEASE_TAG=${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}-${GITHUB_SHA::7}" >> $GITHUB_ENV + # echo "RELEASE_NAME=${OS_NAME} ${BRANCH_NAME} ${BUILD_TYPE} (${GITHUB_SHA::7})" >> $GITHUB_ENV + # echo "FILE_NAME=$FILE_NAME" >> $GITHUB_ENV + + # - name: Rename Artifact + # if: ${{ github.event_name == 'workflow_dispatch' }} + # run: mv SuperGenius.tar.gz ${{ env.FILE_NAME }} + + # - name: Create GitHub Release + # if: ${{ github.event_name == 'workflow_dispatch' }} + # id: create_release + # uses: actions/create-release@v1 + # env: + # GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} + # with: + # tag_name: ${{ env.RELEASE_TAG }} + # release_name: ${{ env.RELEASE_NAME }} + # draft: false + # prerelease: false + + # - name: Upload Release Asset + # if: ${{ github.event_name == 'workflow_dispatch' }} + # uses: actions/upload-release-asset@v1 + # env: + # GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} + # with: + # upload_url: ${{ steps.create_release.outputs.upload_url }} + # asset_path: ${{ env.FILE_NAME }} + # asset_name: ${{ env.FILE_NAME }} + # asset_content_type: application/gzip + + # iOS: + # runs-on: macos-latest + # steps: + # - name: Get branch name + # id: branch-name + # uses: tj-actions/branch-names@v6 + + # # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + # - uses: actions/checkout@v3 + # with: + # path: 'SuperGenius' + # submodules: "recursive" + + # - name: Install Ninja + # run: | + # brew install ccache ninja + # echo "CMAKE_GENERATOR=Ninja" >> $GITHUB_ENV + + # - name: Install bindgen + # run: cargo install cbindgen + + # - name: Add Rust wasm target + # run: rustup target add wasm32-unknown-emscripten + + # - name: Add iOS toolchain + # run: | + # rustup toolchain install nightly-aarch64-apple-darwin + # rustup component add rust-src --toolchain nightly-aarch64-apple-darwin + # rustup target add aarch64-apple-ios + + # - name: Check if branch exists in thirdparty + # id: check_branch + # uses: tj-actions/branch-names@v6 + # with: + # repo: 'GeniusVentures/thirdparty' + # branch: ${{ steps.branch-name.outputs.current_branch }} + + # - name: Check out thirdparty repository + # uses: actions/checkout@v3 + # with: + # repository: 'GeniusVentures/thirdparty' + # path: 'thirdparty' + # submodules: 'recursive' + # ref: ${{ steps.check_branch.outputs.branch_exists == 'true' && steps.branch-name.outputs.current_branch || 'develop' }} + + # - name: Thirdparty Create Build Directory + # run: cmake -E make_directory ${{github.workspace}}/thirdparty/build/iOS/Release + + # - name: Thirdparty Configure CMake + # working-directory: ${{github.workspace}}/thirdparty/build/iOS/Release + # run: cmake -S .. -DCMAKE_BUILD_TYPE=Release -DPLATFORM=OS64 + + # - name: Thirdparty Compile + # working-directory: ${{github.workspace}}/thirdparty/build/iOS/Release + # run: cmake --build . -j --config Release + + # - name: Create Build Directory + # run: cmake -E make_directory ${{github.workspace}}/SuperGenius/build/iOS/Release + + # - name: Configure CMake + # working-directory: ${{github.workspace}}/SuperGenius/build/iOS/Release + # run: cmake -S .. -DCMAKE_BUILD_TYPE=Release -DPLATFORM=OS64 -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty/ + + # - name: Compile + # working-directory: ${{github.workspace}}/SuperGenius/build/iOS/Release + # run: cmake --build . -j --config Release + + # - name: Install + # working-directory: ${{github.workspace}}/SuperGenius/build/iOS/Release + # run: cmake --install . + + # - name: Compressing Build Artifacts + # working-directory: ${{github.workspace}}/SuperGenius + # if: ${{ github.event_name == 'workflow_dispatch' }} + # run: | + # shopt -s extglob + # rm -rf !(build) .[!.]* ..?* + # cd build + # rm -rf !(iOS) .[!.]* ..?* + # cd iOS + # rm -rf !(Release) .[!.]* ..?* + # cd Release + # rm -rf !(SuperGenius) .[!.]* ..?* + # cd ${{github.workspace}} + # tar -czvf SuperGenius.tar.gz SuperGenius/ + + # - name: Set Release Variables + # id: vars + # if: ${{ github.event_name == 'workflow_dispatch' }} + # run: | + # OS_NAME=iOS + # BRANCH_NAME=${GITHUB_REF#refs/heads/} + # BUILD_TYPE=Release + # FILE_NAME="${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}.tar.gz" + # echo "RELEASE_TAG=${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}-${GITHUB_SHA::7}" >> $GITHUB_ENV + # echo "RELEASE_NAME=${OS_NAME} ${BRANCH_NAME} ${BUILD_TYPE} (${GITHUB_SHA::7})" >> $GITHUB_ENV + # echo "FILE_NAME=$FILE_NAME" >> $GITHUB_ENV + + # - name: Rename Artifact + # if: ${{ github.event_name == 'workflow_dispatch' }} + # run: mv SuperGenius.tar.gz ${{ env.FILE_NAME }} + + # - name: Create GitHub Release + # if: ${{ github.event_name == 'workflow_dispatch' }} + # id: create_release + # uses: actions/create-release@v1 + # env: + # GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} + # with: + # tag_name: ${{ env.RELEASE_TAG }} + # release_name: ${{ env.RELEASE_NAME }} + # draft: false + # prerelease: false + + # - name: Upload Release Asset + # if: ${{ github.event_name == 'workflow_dispatch' }} + # uses: actions/upload-release-asset@v1 + # env: + # GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} + # with: + # upload_url: ${{ steps.create_release.outputs.upload_url }} + # asset_path: ${{ env.FILE_NAME }} + # asset_name: ${{ env.FILE_NAME }} + # asset_content_type: application/gzip + diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..0338a9c0 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,65 @@ +name: Deploy ZKLLVM + +on: + workflow_run: + workflows: ["Release Build CI"] + types: + - completed +env: + GH_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + # - name: Download Linux Build Artifacts + # uses: actions/download-artifact@v3 + # with: + # name: linux-build + # path: ${{github.workspace}}/linux-build + + - name: Download Windows Build Artifacts + uses: actions/download-artifact@v3 + with: + name: windows-build + path: ${{github.workspace}}/windows-build + + # - name: Download Android Build Artifacts + # uses: actions/download-artifact@v3 + # with: + # name: android-build + # path: ${{github.workspace}}/android-build + + # - name: Download OSX Build Artifacts + # uses: actions/download-artifact@v3 + # with: + # name: osx-build + # path: ${{github.workspace}}/osx-build + + # - name: Download iOS Build Artifacts + # uses: actions/download-artifact@v3 + # with: + # name: ios-build + # path: ${{github.workspace}}/ios-build + + + - name: Compress Windows Build Artifacts + run: tar -czvf windows-build.tar.gz -C ${{github.workspace}}/windows-build . + + # - name: Compress Linux Build Artifacts + # run: tar -czvf linux-build.tar.gz -C ${{github.workspace}}/linux-build . + + # - name: Compress Android Build Artifacts + # run: tar -czvf android-build.tar.gz -C ${{github.workspace}}/android-build . + + # - name: Compress MacOS Build Artifacts + # run: tar -czvf osx-build.tar.gz -C ${{github.workspace}}/osx-build . + + # - name: Compress iOS Build Artifacts + # run: tar -czvf ios-build.tar.gz -C ${{github.workspace}}/ios-build . + + + # - name: Deploy the compressed artifacts + # run: | + \ No newline at end of file From 61d2598398b6117f4e3752af716e20efbed853e0 Mon Sep 17 00:00:00 2001 From: "sariru@gmail.com" <89619301+itsafuu@users.noreply.github.com> Date: Tue, 21 Jan 2025 17:00:27 -0500 Subject: [PATCH 046/114] Try gh to download artifact --- .github/workflows/cmake.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 8d93a016..c9c58a90 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -32,13 +32,19 @@ jobs: path: 'zkLLVM' submodules: "recursive" + - name: Install GitHub CLI + run: | + choco install gh + + - name: Authenticate GitHub CLI + run: | + echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token + - name: Download Prebuilt Boost from Thirdparty - uses: actions/download-release-asset@v1 - with: - repository: 'GeniusVentures/thirdparty' - tag: ${{ steps.branch-name.outputs.current_branch || 'develop' }} - asset_name: 'Boost-lib.tar.gz' - token: ${{ secrets.GITHUB_TOKEN }} + run: | + gh release download --repo GeniusVentures/thirdparty \ + --tag ${{ steps.branch-name.outputs.current_branch || 'develop' }} \ + --name Boost-lib.tar.gz - name: Extract Prebuilt Boost run: | From 44bc0d72fd9b30e6f8f32d85fefa6f1fceade8ee Mon Sep 17 00:00:00 2001 From: "sariru@gmail.com" <89619301+itsafuu@users.noreply.github.com> Date: Tue, 21 Jan 2025 17:12:57 -0500 Subject: [PATCH 047/114] Change tag to forced develop. Moved above checkout because checkout is slow --- .github/workflows/cmake.yml | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index c9c58a90..9aaeda7a 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -24,14 +24,7 @@ jobs: - name: Install Windows host dependencies run: | choco install ccache -A - - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - name: Checkout zkLLVM repository - uses: actions/checkout@v3 - with: - path: 'zkLLVM' - submodules: "recursive" - + - name: Install GitHub CLI run: | choco install gh @@ -40,16 +33,30 @@ jobs: run: | echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token + - name: Define Release Tag + id: release-tag + run: echo "RELEASE_TAG=Windows-develop-Release" >> $GITHUB_ENV + - name: Download Prebuilt Boost from Thirdparty + shell: bash run: | gh release download --repo GeniusVentures/thirdparty \ - --tag ${{ steps.branch-name.outputs.current_branch || 'develop' }} \ + --tag ${{ env.RELEASE_TAG }} \ --name Boost-lib.tar.gz - name: Extract Prebuilt Boost run: | tar -xzvf Boost-lib.tar.gz -C ${{github.workspace}}/thirdparty/build/Windows/Release + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: Checkout zkLLVM repository + uses: actions/checkout@v3 + with: + path: 'zkLLVM' + submodules: "recursive" + + + - name: Create Build Directory run: cmake -E make_directory ${{github.workspace}}/zkLLVM/build/Windows/Release From f19f87046bbc3cef770f25f30bc24e69ec9e5d25 Mon Sep 17 00:00:00 2001 From: "sariru@gmail.com" <89619301+itsafuu@users.noreply.github.com> Date: Tue, 21 Jan 2025 17:15:34 -0500 Subject: [PATCH 048/114] Corrected GH cli --- .github/workflows/cmake.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 9aaeda7a..68e1ea3b 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -24,7 +24,7 @@ jobs: - name: Install Windows host dependencies run: | choco install ccache -A - + - name: Install GitHub CLI run: | choco install gh @@ -40,9 +40,10 @@ jobs: - name: Download Prebuilt Boost from Thirdparty shell: bash run: | - gh release download --repo GeniusVentures/thirdparty \ - --tag ${{ env.RELEASE_TAG }} \ - --name Boost-lib.tar.gz + gh release download \ + --repo GeniusVentures/thirdparty \ + ${{ env.RELEASE_TAG }} \ + --pattern Boost-lib.tar.gz - name: Extract Prebuilt Boost run: | From 3cfece26569b5eca44f9a00f73ccc821a6651060 Mon Sep 17 00:00:00 2001 From: "sariru@gmail.com" <89619301+itsafuu@users.noreply.github.com> Date: Tue, 21 Jan 2025 17:17:56 -0500 Subject: [PATCH 049/114] Create thirdparty dir --- .github/workflows/cmake.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 68e1ea3b..f5fe165f 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -44,6 +44,10 @@ jobs: --repo GeniusVentures/thirdparty \ ${{ env.RELEASE_TAG }} \ --pattern Boost-lib.tar.gz + + - name: Ensure Directory Exists + run: | + mkdir -p ${{github.workspace}}/thirdparty/build/Windows/Release - name: Extract Prebuilt Boost run: | From bcc02f71ad8a788a2244c39913be43c4ba055646 Mon Sep 17 00:00:00 2001 From: "sariru@gmail.com" <89619301+itsafuu@users.noreply.github.com> Date: Tue, 21 Jan 2025 17:32:48 -0500 Subject: [PATCH 050/114] Specify develop release tag for now --- .github/workflows/cmake.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index f5fe165f..ccc88f79 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -42,9 +42,9 @@ jobs: run: | gh release download \ --repo GeniusVentures/thirdparty \ - ${{ env.RELEASE_TAG }} \ + Windows-develop-Release \ --pattern Boost-lib.tar.gz - + - name: Ensure Directory Exists run: | mkdir -p ${{github.workspace}}/thirdparty/build/Windows/Release From 92281e825c1f9643d2bb9a965b2b6361884bd944 Mon Sep 17 00:00:00 2001 From: "sariru@gmail.com" <89619301+itsafuu@users.noreply.github.com> Date: Tue, 21 Jan 2025 20:07:10 -0500 Subject: [PATCH 051/114] Disable deploy file, doesn't seem to do anything --- .github/workflows/deploy.yml | 38 ++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 0338a9c0..6cb9ecd3 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,29 +1,29 @@ -name: Deploy ZKLLVM +# name: Deploy ZKLLVM -on: - workflow_run: - workflows: ["Release Build CI"] - types: - - completed -env: - GH_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} +# on: +# workflow_run: +# workflows: ["Release Build CI"] +# types: +# - completed +# env: +# GH_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} -jobs: - deploy: - runs-on: ubuntu-latest +# jobs: +# deploy: +# runs-on: ubuntu-latest - steps: +# steps: # - name: Download Linux Build Artifacts # uses: actions/download-artifact@v3 # with: # name: linux-build # path: ${{github.workspace}}/linux-build - - name: Download Windows Build Artifacts - uses: actions/download-artifact@v3 - with: - name: windows-build - path: ${{github.workspace}}/windows-build + # - name: Download Windows Build Artifacts + # uses: actions/download-artifact@v3 + # with: + # name: windows-build + # path: ${{github.workspace}}/windows-build # - name: Download Android Build Artifacts # uses: actions/download-artifact@v3 @@ -44,8 +44,8 @@ jobs: # path: ${{github.workspace}}/ios-build - - name: Compress Windows Build Artifacts - run: tar -czvf windows-build.tar.gz -C ${{github.workspace}}/windows-build . + # - name: Compress Windows Build Artifacts + # run: tar -czvf windows-build.tar.gz -C ${{github.workspace}}/windows-build . # - name: Compress Linux Build Artifacts # run: tar -czvf linux-build.tar.gz -C ${{github.workspace}}/linux-build . From d03c04473015abfa3e88bb7dd20540c40d5ad267 Mon Sep 17 00:00:00 2001 From: "sariru@gmail.com" <89619301+itsafuu@users.noreply.github.com> Date: Tue, 21 Jan 2025 20:34:07 -0500 Subject: [PATCH 052/114] Added additional platforms, added exclusions for src and tmp directories, may want to exclude more, will ask to make sure --- .github/workflows/cmake.yml | 975 ++++++++++++++++++------------------ 1 file changed, 475 insertions(+), 500 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index ccc88f79..8d6d00fb 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -60,8 +60,6 @@ jobs: path: 'zkLLVM' submodules: "recursive" - - - name: Create Build Directory run: cmake -E make_directory ${{github.workspace}}/zkLLVM/build/Windows/Release @@ -90,8 +88,11 @@ jobs: cd Release rm -rf !(zkLLVM) .[!.]* ..?* cd $GITHUB_WORKSPACE - tar -czvf zkLLVM.tar.gz zkLLVM/ + tar --exclude='zkLLVM/build/Windows/Release/zkLLVM/src' \ + --exclude='zkLLVM/build/Windows/Release/zkLLVM/tmp' \ + -czvf zkLLVM.tar.gz zkLLVM/ shell: bash + - name: Set Release Variables id: vars @@ -134,535 +135,509 @@ jobs: asset_name: ${{ env.FILE_NAME }} asset_content_type: application/gzip - # Linux: - # runs-on: ubuntu-latest - # steps: - # - name: Get branch name - # id: branch-name - # uses: tj-actions/branch-names@v6 - - # - name: Set clang as the default compiler - # run: | - # sudo update-alternatives --install /usr/bin/cc cc $(which clang) 100 - # sudo update-alternatives --install /usr/bin/c++ c++ $(which clang++) 100 - # sudo update-alternatives --set cc $(which clang) - # sudo update-alternatives --set c++ $(which clang++) - - # - name: Install Linux host dependencies - # run: | - # sudo apt install ccache ninja-build -y - # sudo apt install vulkan-tools vulkan-validationlayers-dev libvulkan-dev -y - # echo "CMAKE_GENERATOR=Ninja" >> $GITHUB_ENV - - # - name: Install bindgen - # run: cargo install cbindgen - - # - name: Add Rust wasm target - # run: rustup target add wasm32-unknown-emscripten - - # # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - # - uses: actions/checkout@v3 - # with: - # path: 'SuperGenius' - # submodules: "recursive" - - # - name: Check if branch exists in thirdparty - # id: check_branch - # uses: tj-actions/branch-names@v6 - # with: - # repo: 'GeniusVentures/thirdparty' - # branch: ${{ steps.branch-name.outputs.current_branch }} - - # - name: Check out thirdparty repository - # uses: actions/checkout@v3 - # with: - # repository: 'GeniusVentures/thirdparty' - # path: 'thirdparty' - # submodules: 'recursive' - # ref: ${{ steps.check_branch.outputs.branch_exists == 'true' && steps.branch-name.outputs.current_branch || 'develop' }} - - # - name: Thirdparty Create Build Directory - # run: cmake -E make_directory ${{github.workspace}}/thirdparty/build/Linux/Release + Linux: + runs-on: ubuntu-latest + steps: + - name: Get branch name + id: branch-name + uses: tj-actions/branch-names@v6 - # - name: Thirdparty Configure CMake - # working-directory: ${{github.workspace}}/thirdparty/build/Linux/Release - # run: cmake -S .. -DCMAKE_BUILD_TYPE=Release + - name: Set clang as the default compiler + run: | + sudo update-alternatives --install /usr/bin/cc cc $(which clang) 100 + sudo update-alternatives --install /usr/bin/c++ c++ $(which clang++) 100 + sudo update-alternatives --set cc $(which clang) + sudo update-alternatives --set c++ $(which clang++) + + - name: Install Linux host dependencies + run: | + sudo apt install ccache ninja-build -y + sudo apt install vulkan-tools vulkan-validationlayers-dev libvulkan-dev -y + echo "CMAKE_GENERATOR=Ninja" >> $GITHUB_ENV - # - name: Thirdparty Compile - # working-directory: ${{github.workspace}}/thirdparty/build/Linux/Release - # run: cmake --build . --config Release -j + - name: Install GitHub CLI + run: | + sudo apt install -y gh + + - name: Authenticate GitHub CLI + run: | + echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token + + - name: Define Release Tag + id: release-tag + run: echo "RELEASE_TAG=Linux-develop-Release" >> $GITHUB_ENV + + - name: Download Prebuilt Boost from Thirdparty + shell: bash + run: | + gh release download \ + --repo GeniusVentures/thirdparty \ + Linux-develop-Release \ + --pattern Boost-lib.tar.gz + + - name: Ensure Directory Exists + run: | + mkdir -p ${{github.workspace}}/thirdparty/build/Linux/Release + + - name: Extract Prebuilt Boost + run: | + tar -xzvf Boost-lib.tar.gz -C ${{github.workspace}}/thirdparty/build/Linux/Release + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + path: 'zkLLVM' + submodules: "recursive" - # - name: Create Build Directory - # run: cmake -E make_directory ${{github.workspace}}/SuperGenius/build/Linux/Release + - name: Create Build Directory + run: cmake -E make_directory ${{github.workspace}}/zkLLVM/build/Linux/Release - # - name: Configure CMake - # working-directory: ${{github.workspace}}/SuperGenius/build/Linux/Release - # run: cmake -S .. -DCMAKE_BUILD_TYPE=Release -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty/ + - name: Configure CMake + working-directory: ${{github.workspace}}/zkLLVM/build/Linux/Release + run: cmake -S .. -DCMAKE_BUILD_TYPE=Release -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty/ - # - name: Compile - # working-directory: ${{github.workspace}}/SuperGenius/build/Linux/Release - # run: cmake --build . --config Release -j + - name: Compile + working-directory: ${{github.workspace}}/zkLLVM/build/Linux/Release + run: cmake --build . --config Release -j - # - name: Install - # working-directory: ${{github.workspace}}/SuperGenius/build/Linux/Release - # run: cmake --install . + - name: Install + working-directory: ${{github.workspace}}/zkLLVM/build/Linux/Release + run: cmake --install . - # - name: Compressing Build Artifacts - # working-directory: ${{github.workspace}}/SuperGenius - # if: ${{ github.event_name == 'workflow_dispatch' }} - # run: | - # shopt -s extglob - # rm -rf !(build) .[!.]* ..?* - # cd build - # rm -rf !(Linux) .[!.]* ..?* - # cd Linux - # rm -rf !(Release) .[!.]* ..?* - # cd Release - # rm -rf !(SuperGenius) .[!.]* ..?* - # cd ${{github.workspace}} - # tar -czvf SuperGenius.tar.gz SuperGenius/ + - name: Compressing Build Artifacts + working-directory: ${{github.workspace}}/zkLLVM + if: ${{ github.event_name == 'workflow_dispatch' }} + run: | + shopt -s extglob + rm -rf !(build) .[!.]* ..?* + cd build + rm -rf !(Linux) .[!.]* ..?* + cd Linux + rm -rf !(Release) .[!.]* ..?* + cd Release + rm -rf !(zkLLVM) .[!.]* ..?* + cd ${{github.workspace}} + tar --exclude='zkLLVM/build/Linux/Release/zkLLVM/src' \ + --exclude='zkLLVM/build/Linux/Release/zkLLVM/tmp' \ + -czvf zkLLVM.tar.gz zkLLVM/ - # - name: Set Release Variables - # id: vars - # if: ${{ github.event_name == 'workflow_dispatch' }} - # run: | - # OS_NAME=Linux - # BRANCH_NAME=${GITHUB_REF#refs/heads/} - # BUILD_TYPE=Release - # FILE_NAME="${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}.tar.gz" - # echo "RELEASE_TAG=${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}-${GITHUB_SHA::7}" >> $GITHUB_ENV - # echo "RELEASE_NAME=${OS_NAME} ${BRANCH_NAME} ${BUILD_TYPE} (${GITHUB_SHA::7})" >> $GITHUB_ENV - # echo "FILE_NAME=$FILE_NAME" >> $GITHUB_ENV - - # - name: Rename Artifact - # if: ${{ github.event_name == 'workflow_dispatch' }} - # run: mv SuperGenius.tar.gz ${{ env.FILE_NAME }} - - # - name: Create GitHub Release - # if: ${{ github.event_name == 'workflow_dispatch' }} - # id: create_release - # uses: actions/create-release@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} - # with: - # tag_name: ${{ env.RELEASE_TAG }} - # release_name: ${{ env.RELEASE_NAME }} - # draft: false - # prerelease: false - - # - name: Upload Release Asset - # if: ${{ github.event_name == 'workflow_dispatch' }} - # uses: actions/upload-release-asset@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} - # with: - # upload_url: ${{ steps.create_release.outputs.upload_url }} - # asset_path: ${{ env.FILE_NAME }} - # asset_name: ${{ env.FILE_NAME }} - # asset_content_type: application/gzip + - name: Set Release Variables + id: vars + if: ${{ github.event_name == 'workflow_dispatch' }} + run: | + OS_NAME=Linux + BRANCH_NAME=${GITHUB_REF#refs/heads/} + BUILD_TYPE=Release + FILE_NAME="${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}.tar.gz" + echo "RELEASE_TAG=${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}-${GITHUB_SHA::7}" >> $GITHUB_ENV + echo "RELEASE_NAME=${OS_NAME} ${BRANCH_NAME} ${BUILD_TYPE} (${GITHUB_SHA::7})" >> $GITHUB_ENV + echo "FILE_NAME=$FILE_NAME" >> $GITHUB_ENV + + - name: Rename Artifact + if: ${{ github.event_name == 'workflow_dispatch' }} + run: mv zkLLVM.tar.gz ${{ env.FILE_NAME }} + + - name: Create GitHub Release + if: ${{ github.event_name == 'workflow_dispatch' }} + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} + with: + tag_name: ${{ env.RELEASE_TAG }} + release_name: ${{ env.RELEASE_NAME }} + draft: false + prerelease: false + + - name: Upload Release Asset + if: ${{ github.event_name == 'workflow_dispatch' }} + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ${{ env.FILE_NAME }} + asset_name: ${{ env.FILE_NAME }} + asset_content_type: application/gzip - # Android: - # runs-on: ubuntu-latest - # env: - # ANDROID_NDK_HOME: ${{github.workspace}}/android-ndk/android-ndk-r25b - # ANDROID_TOOLCHAIN: ${{github.workspace}}/android-ndk/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin - # NDK_URL: "https://dl.google.com/android/repository/android-ndk-r25b-linux.zip" - # CC: clang - - # steps: - # - name: Get branch name - # id: branch-name - # uses: tj-actions/branch-names@v6 - - # # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - # - uses: actions/checkout@v3 - # with: - # path: 'SuperGenius' - # submodules: "recursive" - - # - name: Download Android NDK - # run: | - # mkdir "${{github.workspace}}/android-ndk" - # cd "${{github.workspace}}/android-ndk" - # curl -o ndk.zip ${{ env.NDK_URL }} - # unzip ndk.zip - # rm ndk.zip - - # - name: Install bindgen - # run: cargo install cbindgen - - # - name: Add Rust wasm target - # run: rustup target add wasm32-unknown-emscripten + Android: + runs-on: ubuntu-latest + env: + ANDROID_NDK_HOME: ${{github.workspace}}/android-ndk/android-ndk-r25b + ANDROID_TOOLCHAIN: ${{github.workspace}}/android-ndk/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin + NDK_URL: "https://dl.google.com/android/repository/android-ndk-r25b-linux.zip" + CC: clang - # - name: Add Android toolchain - # run: | - # rustup target add aarch64-linux-android - - # - name: Check if branch exists in thirdparty - # id: check_branch - # uses: tj-actions/branch-names@v6 - # with: - # repo: 'GeniusVentures/thirdparty' - # branch: ${{ steps.branch-name.outputs.current_branch }} - - # - name: Check out thirdparty repository - # uses: actions/checkout@v3 - # with: - # repository: 'GeniusVentures/thirdparty' - # path: 'thirdparty' - # submodules: 'recursive' - # ref: ${{ steps.check_branch.outputs.branch_exists == 'true' && steps.branch-name.outputs.current_branch || 'develop' }} + steps: + - name: Get branch name + id: branch-name + uses: tj-actions/branch-names@v6 + + - name: Install GitHub CLI + run: | + sudo apt install -y gh + + - name: Authenticate GitHub CLI + run: | + echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token + + - name: Define Release Tag + id: release-tag + run: echo "RELEASE_TAG=Android-develop-Release" >> $GITHUB_ENV + + - name: Download Prebuilt Boost from Thirdparty + shell: bash + run: | + gh release download \ + --repo GeniusVentures/thirdparty \ + Android-develop-Release \ + --pattern Boost-lib.tar.gz + + - name: Ensure Directory Exists + run: | + mkdir -p ${{github.workspace}}/thirdparty/build/Android/Release + + - name: Extract Prebuilt Boost + run: | + tar -xzvf Boost-lib.tar.gz -C ${{github.workspace}}/thirdparty/build/Android/Release + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + path: 'zkLLVM' + submodules: "recursive" - # - name: Thirdparty Create Build Directory - # run: cmake -E make_directory ${{github.workspace}}/thirdparty/build/Android/Release/arm64-v8a - - # - name: Thirdparty Configure CMake - # working-directory: ${{github.workspace}}/thirdparty/build/Android/Release/arm64-v8a - # run: | - # export ANDROID_NDK=${{env.ANDROID_NDK_HOME}} - # export ANDROID_NDK_HOME=${{env.ANDROID_NDK_HOME}} - # export ANDROID_TOOLCHAIN=${{env.ANDROID_TOOLCHAIN}} - # export PATH=${{env.ANDROID_TOOLCHAIN}}:$PATH - # echo $PATH - # echo $CC - # ls -la $ANDROID_TOOLCHAIN - # echo "Check clang path:" - # which clang - # env - # cmake -S ../../ -DANDROID_ABI="arm64-v8a" -DCMAKE_ANDROID_NDK=$ANDROID_NDK -DANDROID_TOOLCHAIN=clang -DCMAKE_BUILD_TYPE=Release - - # - name: Thirdparty Compile - # working-directory: ${{github.workspace}}/thirdparty/build/Android/Release/arm64-v8a - # run: make -j8 - - # - name: Create Build Directory - # run: cmake -E make_directory ${{github.workspace}}/SuperGenius/build/Android/Release/arm64-v8a - - # - name: Configure CMake - # working-directory: ${{github.workspace}}/SuperGenius/build/Android/Release/arm64-v8a - # run: | - # export ANDROID_NDK=${{env.ANDROID_NDK_HOME}} - # export ANDROID_NDK_HOME=${{env.ANDROID_NDK_HOME}} - # export ANDROID_TOOLCHAIN=${{env.ANDROID_TOOLCHAIN}} - # export PATH=${{env.ANDROID_TOOLCHAIN}}:$PATH - # echo $PATH - # echo $CC - # ls -la $ANDROID_TOOLCHAIN - # echo "Check clang path:" - # which clang - # env - # cmake -S ../../ -DANDROID_ABI="arm64-v8a" -DCMAKE_BUILD_TYPE=Release -DCMAKE_ANDROID_NDK=$ANDROID_NDK -DANDROID_TOOLCHAIN=clang -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty/ + - name: Download Android NDK + run: | + mkdir "${{github.workspace}}/android-ndk" + cd "${{github.workspace}}/android-ndk" + curl -o ndk.zip ${{ env.NDK_URL }} + unzip ndk.zip + rm ndk.zip - # - name: Compile - # working-directory: ${{github.workspace}}/SuperGenius/build/Android/Release/arm64-v8a - # run: make -j8 + - name: Create Build Directory + run: cmake -E make_directory ${{github.workspace}}/zkLLVM/build/Android/Release/arm64-v8a + + - name: Configure CMake + working-directory: ${{github.workspace}}/zkLLVM/build/Android/Release/arm64-v8a + run: | + export ANDROID_NDK=${{env.ANDROID_NDK_HOME}} + export ANDROID_NDK_HOME=${{env.ANDROID_NDK_HOME}} + export ANDROID_TOOLCHAIN=${{env.ANDROID_TOOLCHAIN}} + export PATH=${{env.ANDROID_TOOLCHAIN}}:$PATH + echo $PATH + echo $CC + ls -la $ANDROID_TOOLCHAIN + echo "Check clang path:" + which clang + env + cmake -S ../../ -DANDROID_ABI="arm64-v8a" -DCMAKE_BUILD_TYPE=Release -DCMAKE_ANDROID_NDK=$ANDROID_NDK -DANDROID_TOOLCHAIN=clang -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty/ - # - name: Install - # working-directory: ${{github.workspace}}/SuperGenius/build/Android/Release/arm64-v8a - # run: cmake --install . - - # - name: Compressing Build Artifacts - # working-directory: ${{github.workspace}}/SuperGenius - # if: ${{ github.event_name == 'workflow_dispatch' }} - # run: | - # shopt -s extglob - # rm -rf !(build) .[!.]* ..?* - # cd build - # rm -rf !(Android) .[!.]* ..?* - # cd Android - # rm -rf !(Release) .[!.]* ..?* - # cd Release - # rm -rf !(arm64-v8a) .[!.]* ..?* - # cd arm64-v8a - # rm -rf !(SuperGenius) .[!.]* ..?* - # cd ${{github.workspace}} - # tar -czvf SuperGenius.tar.gz SuperGenius/ + - name: Compile + working-directory: ${{github.workspace}}/zkLLVM/build/Android/Release/arm64-v8a + run: make -j8 - # - name: Set Release Variables - # id: vars - # if: ${{ github.event_name == 'workflow_dispatch' }} - # run: | - # OS_NAME=Android-arm64-v8a - # BRANCH_NAME=${GITHUB_REF#refs/heads/} - # BUILD_TYPE=Release - # FILE_NAME="${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}.tar.gz" - # echo "RELEASE_TAG=${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}-${GITHUB_SHA::7}" >> $GITHUB_ENV - # echo "RELEASE_NAME=${OS_NAME} ${BRANCH_NAME} ${BUILD_TYPE} (${GITHUB_SHA::7})" >> $GITHUB_ENV - # echo "FILE_NAME=$FILE_NAME" >> $GITHUB_ENV - - # - name: Rename Artifact - # if: ${{ github.event_name == 'workflow_dispatch' }} - # run: mv SuperGenius.tar.gz ${{ env.FILE_NAME }} - - # - name: Create GitHub Release - # if: ${{ github.event_name == 'workflow_dispatch' }} - # id: create_release - # uses: actions/create-release@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} - # with: - # tag_name: ${{ env.RELEASE_TAG }} - # release_name: ${{ env.RELEASE_NAME }} - # draft: false - # prerelease: false - - # - name: Upload Release Asset - # if: ${{ github.event_name == 'workflow_dispatch' }} - # uses: actions/upload-release-asset@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} - # with: - # upload_url: ${{ steps.create_release.outputs.upload_url }} - # asset_path: ${{ env.FILE_NAME }} - # asset_name: ${{ env.FILE_NAME }} - # asset_content_type: application/gzip - - - # MacOS: - # runs-on: macos-latest - # steps: - # - name: Get branch name - # id: branch-name - # uses: tj-actions/branch-names@v6 + - name: Install + working-directory: ${{github.workspace}}/zkLLVM/build/Android/Release/arm64-v8a + run: cmake --install . - # # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - # - uses: actions/checkout@v3 - # with: - # path: 'SuperGenius' - # submodules: "recursive" - - # # Workaround for arm64 build - # - name: Ensure latest macOS SDK is used - # run: | - # sudo xcode-select --switch "$(find /Applications -mindepth 1 -maxdepth 1 ! -type l | grep "Xcode_[\.0-9]*app" | sort -V | tail -1)/Contents/Developer" - # sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/* + - name: Compressing Build Artifacts + working-directory: ${{github.workspace}}/zkLLVM + if: ${{ github.event_name == 'workflow_dispatch' }} + run: | + shopt -s extglob + rm -rf !(build) .[!.]* ..?* + cd build + rm -rf !(Android) .[!.]* ..?* + cd Android + rm -rf !(Release) .[!.]* ..?* + cd Release + rm -rf !(arm64-v8a) .[!.]* ..?* + cd arm64-v8a + rm -rf !(zkLLVM) .[!.]* ..?* + cd ${{github.workspace}} + tar --exclude='zkLLVM/build/Android/Release/zkLLVM/src' \ + --exclude='zkLLVM/build/Android/Release/zkLLVM/tmp' \ + -czvf zkLLVM.tar.gz zkLLVM/ - # - name: Install bindgen - # run: cargo install cbindgen + - name: Set Release Variables + id: vars + if: ${{ github.event_name == 'workflow_dispatch' }} + run: | + OS_NAME=Android-arm64-v8a + BRANCH_NAME=${GITHUB_REF#refs/heads/} + BUILD_TYPE=Release + FILE_NAME="${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}.tar.gz" + echo "RELEASE_TAG=${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}-${GITHUB_SHA::7}" >> $GITHUB_ENV + echo "RELEASE_NAME=${OS_NAME} ${BRANCH_NAME} ${BUILD_TYPE} (${GITHUB_SHA::7})" >> $GITHUB_ENV + echo "FILE_NAME=$FILE_NAME" >> $GITHUB_ENV + + - name: Rename Artifact + if: ${{ github.event_name == 'workflow_dispatch' }} + run: mv zkLLVM.tar.gz ${{ env.FILE_NAME }} - # - name: Add Rust wasm target - # run: rustup target add wasm32-unknown-emscripten + - name: Create GitHub Release + if: ${{ github.event_name == 'workflow_dispatch' }} + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} + with: + tag_name: ${{ env.RELEASE_TAG }} + release_name: ${{ env.RELEASE_NAME }} + draft: false + prerelease: false - # - name: Add Darwin rust toolchain - # run: rustup target add x86_64-apple-darwin - - # - name: Check if branch exists in thirdparty - # id: check_branch - # uses: tj-actions/branch-names@v6 - # with: - # repo: 'GeniusVentures/thirdparty' - # branch: ${{ steps.branch-name.outputs.current_branch }} - - # - name: Check out thirdparty repository - # uses: actions/checkout@v3 - # with: - # repository: 'GeniusVentures/thirdparty' - # path: 'thirdparty' - # submodules: 'recursive' - # ref: ${{ steps.check_branch.outputs.branch_exists == 'true' && steps.branch-name.outputs.current_branch || 'develop' }} - - # - name: Thirdparty Create Build Directory - # run: cmake -E make_directory ${{github.workspace}}/thirdparty/build/OSX/Release + - name: Upload Release Asset + if: ${{ github.event_name == 'workflow_dispatch' }} + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ${{ env.FILE_NAME }} + asset_name: ${{ env.FILE_NAME }} + asset_content_type: application/gzip - # - name: Thirdparty Configure CMake - # working-directory: ${{github.workspace}}/thirdparty/build/OSX/Release - # run: cmake -S .. -DCMAKE_BUILD_TYPE=Release - # - name: Thirdparty Compile - # working-directory: ${{github.workspace}}/thirdparty/build/OSX/Release - # run: make -j8 - - # - name: Create Build Directory - # run: cmake -E make_directory ${{github.workspace}}/SuperGenius/build/OSX/Release + MacOS: + runs-on: macos-latest + steps: + - name: Get branch name + id: branch-name + uses: tj-actions/branch-names@v6 - # - name: Configure CMake - # working-directory: ${{github.workspace}}/SuperGenius/build/OSX/Release - # run: cmake -S .. -DCMAKE_BUILD_TYPE=Release -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty/ + - name: Install GitHub CLI + run: | + brew install gh - # - name: Compile - # working-directory: ${{github.workspace}}/SuperGenius/build/OSX/Release - # run: make -j8 + - name: Authenticate GitHub CLI + run: | + echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token - # - name: Install - # working-directory: ${{github.workspace}}/SuperGenius/build/OSX/Release - # run: cmake --install . - - # - name: Compressing Build Artifacts - # working-directory: ${{github.workspace}}/SuperGenius - # if: ${{ github.event_name == 'workflow_dispatch' }} - # run: | - # shopt -s extglob - # rm -rf !(build) .[!.]* ..?* - # cd build - # rm -rf !(OSX) .[!.]* ..?* - # cd OSX - # rm -rf !(Release) .[!.]* ..?* - # cd Release - # rm -rf !(SuperGenius) .[!.]* ..?* - # cd ${{github.workspace}} - # tar -czvf SuperGenius.tar.gz SuperGenius/ + - name: Define Release Tag + id: release-tag + run: echo "RELEASE_TAG=OSX-develop-Release" >> $GITHUB_ENV + + - name: Download Prebuilt Boost from Thirdparty + shell: bash + run: | + gh release download \ + --repo GeniusVentures/thirdparty \ + OSX-develop-Release \ + --pattern Boost-lib.tar.gz + + - name: Ensure Directory Exists + run: | + mkdir -p ${{github.workspace}}/thirdparty/build/OSX/Release + + - name: Extract Prebuilt Boost + run: | + tar -xzvf Boost-lib.tar.gz -C ${{github.workspace}}/thirdparty/build/OSX/Release + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + path: 'zkLLVM' + submodules: "recursive" - # - name: Set Release Variables - # id: vars - # if: ${{ github.event_name == 'workflow_dispatch' }} - # run: | - # OS_NAME=OSX - # BRANCH_NAME=${GITHUB_REF#refs/heads/} - # BUILD_TYPE=Release - # FILE_NAME="${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}.tar.gz" - # echo "RELEASE_TAG=${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}-${GITHUB_SHA::7}" >> $GITHUB_ENV - # echo "RELEASE_NAME=${OS_NAME} ${BRANCH_NAME} ${BUILD_TYPE} (${GITHUB_SHA::7})" >> $GITHUB_ENV - # echo "FILE_NAME=$FILE_NAME" >> $GITHUB_ENV - - # - name: Rename Artifact - # if: ${{ github.event_name == 'workflow_dispatch' }} - # run: mv SuperGenius.tar.gz ${{ env.FILE_NAME }} - - # - name: Create GitHub Release - # if: ${{ github.event_name == 'workflow_dispatch' }} - # id: create_release - # uses: actions/create-release@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} - # with: - # tag_name: ${{ env.RELEASE_TAG }} - # release_name: ${{ env.RELEASE_NAME }} - # draft: false - # prerelease: false - - # - name: Upload Release Asset - # if: ${{ github.event_name == 'workflow_dispatch' }} - # uses: actions/upload-release-asset@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} - # with: - # upload_url: ${{ steps.create_release.outputs.upload_url }} - # asset_path: ${{ env.FILE_NAME }} - # asset_name: ${{ env.FILE_NAME }} - # asset_content_type: application/gzip - - # iOS: - # runs-on: macos-latest - # steps: - # - name: Get branch name - # id: branch-name - # uses: tj-actions/branch-names@v6 + # Workaround for arm64 build + - name: Ensure latest macOS SDK is used + run: | + sudo xcode-select --switch "$(find /Applications -mindepth 1 -maxdepth 1 ! -type l | grep "Xcode_[\.0-9]*app" | sort -V | tail -1)/Contents/Developer" + sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/* + + - name: Create Build Directory + run: cmake -E make_directory ${{github.workspace}}/zkLLVM/build/OSX/Release + + - name: Configure CMake + working-directory: ${{github.workspace}}/zkLLVM/build/OSX/Release + run: cmake -S .. -DCMAKE_BUILD_TYPE=Release -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty/ + + - name: Compile + working-directory: ${{github.workspace}}/zkLLVM/build/OSX/Release + run: make -j8 + + - name: Install + working-directory: ${{github.workspace}}/zkLLVM/build/OSX/Release + run: cmake --install . - # # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - # - uses: actions/checkout@v3 - # with: - # path: 'SuperGenius' - # submodules: "recursive" - - # - name: Install Ninja - # run: | - # brew install ccache ninja - # echo "CMAKE_GENERATOR=Ninja" >> $GITHUB_ENV - - # - name: Install bindgen - # run: cargo install cbindgen - - # - name: Add Rust wasm target - # run: rustup target add wasm32-unknown-emscripten + - name: Compressing Build Artifacts + working-directory: ${{github.workspace}}/zkLLVM + if: ${{ github.event_name == 'workflow_dispatch' }} + run: | + shopt -s extglob + rm -rf !(build) .[!.]* ..?* + cd build + rm -rf !(OSX) .[!.]* ..?* + cd OSX + rm -rf !(Release) .[!.]* ..?* + cd Release + rm -rf !(zkLLVM) .[!.]* ..?* + cd ${{github.workspace}} + tar --exclude='zkLLVM/build/OSX/Release/zkLLVM/src' \ + --exclude='zkLLVM/build/OSX/Release/zkLLVM/tmp' \ + -czvf zkLLVM.tar.gz zkLLVM/ - # - name: Add iOS toolchain - # run: | - # rustup toolchain install nightly-aarch64-apple-darwin - # rustup component add rust-src --toolchain nightly-aarch64-apple-darwin - # rustup target add aarch64-apple-ios - - # - name: Check if branch exists in thirdparty - # id: check_branch - # uses: tj-actions/branch-names@v6 - # with: - # repo: 'GeniusVentures/thirdparty' - # branch: ${{ steps.branch-name.outputs.current_branch }} - - # - name: Check out thirdparty repository - # uses: actions/checkout@v3 - # with: - # repository: 'GeniusVentures/thirdparty' - # path: 'thirdparty' - # submodules: 'recursive' - # ref: ${{ steps.check_branch.outputs.branch_exists == 'true' && steps.branch-name.outputs.current_branch || 'develop' }} - - # - name: Thirdparty Create Build Directory - # run: cmake -E make_directory ${{github.workspace}}/thirdparty/build/iOS/Release + - name: Set Release Variables + id: vars + if: ${{ github.event_name == 'workflow_dispatch' }} + run: | + OS_NAME=OSX + BRANCH_NAME=${GITHUB_REF#refs/heads/} + BUILD_TYPE=Release + FILE_NAME="${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}.tar.gz" + echo "RELEASE_TAG=${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}-${GITHUB_SHA::7}" >> $GITHUB_ENV + echo "RELEASE_NAME=${OS_NAME} ${BRANCH_NAME} ${BUILD_TYPE} (${GITHUB_SHA::7})" >> $GITHUB_ENV + echo "FILE_NAME=$FILE_NAME" >> $GITHUB_ENV + + - name: Rename Artifact + if: ${{ github.event_name == 'workflow_dispatch' }} + run: mv zkLLVM.tar.gz ${{ env.FILE_NAME }} + + - name: Create GitHub Release + if: ${{ github.event_name == 'workflow_dispatch' }} + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} + with: + tag_name: ${{ env.RELEASE_TAG }} + release_name: ${{ env.RELEASE_NAME }} + draft: false + prerelease: false + + - name: Upload Release Asset + if: ${{ github.event_name == 'workflow_dispatch' }} + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ${{ env.FILE_NAME }} + asset_name: ${{ env.FILE_NAME }} + asset_content_type: application/gzip + + iOS: + runs-on: macos-latest + steps: + - name: Get branch name + id: branch-name + uses: tj-actions/branch-names@v6 - # - name: Thirdparty Configure CMake - # working-directory: ${{github.workspace}}/thirdparty/build/iOS/Release - # run: cmake -S .. -DCMAKE_BUILD_TYPE=Release -DPLATFORM=OS64 + - name: Install GitHub CLI + run: | + brew install gh - # - name: Thirdparty Compile - # working-directory: ${{github.workspace}}/thirdparty/build/iOS/Release - # run: cmake --build . -j --config Release + - name: Authenticate GitHub CLI + run: | + echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token + + - name: Define Release Tag + id: release-tag + run: echo "RELEASE_TAG=iOS-develop-Release" >> $GITHUB_ENV + + - name: Download Prebuilt Boost from Thirdparty + shell: bash + run: | + gh release download \ + --repo GeniusVentures/thirdparty \ + iOS-develop-Release \ + --pattern Boost-lib.tar.gz + + - name: Ensure Directory Exists + run: | + mkdir -p ${{github.workspace}}/thirdparty/build/iOS/Release + + - name: Extract Prebuilt Boost + run: | + tar -xzvf Boost-lib.tar.gz -C ${{github.workspace}}/thirdparty/build/iOS/Release + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + path: 'zkLLVM' + submodules: "recursive" + + - name: Install Ninja + run: | + brew install ccache ninja + echo "CMAKE_GENERATOR=Ninja" >> $GITHUB_ENV + + - name: Add iOS toolchain + run: | + rustup toolchain install nightly-aarch64-apple-darwin + rustup component add rust-src --toolchain nightly-aarch64-apple-darwin + rustup target add aarch64-apple-ios - # - name: Create Build Directory - # run: cmake -E make_directory ${{github.workspace}}/SuperGenius/build/iOS/Release + - name: Create Build Directory + run: cmake -E make_directory ${{github.workspace}}/zkLLVM/build/iOS/Release - # - name: Configure CMake - # working-directory: ${{github.workspace}}/SuperGenius/build/iOS/Release - # run: cmake -S .. -DCMAKE_BUILD_TYPE=Release -DPLATFORM=OS64 -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty/ + - name: Configure CMake + working-directory: ${{github.workspace}}/zkLLVM/build/iOS/Release + run: cmake -S .. -DCMAKE_BUILD_TYPE=Release -DPLATFORM=OS64 -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty/ - # - name: Compile - # working-directory: ${{github.workspace}}/SuperGenius/build/iOS/Release - # run: cmake --build . -j --config Release + - name: Compile + working-directory: ${{github.workspace}}/zkLLVM/build/iOS/Release + run: cmake --build . -j --config Release - # - name: Install - # working-directory: ${{github.workspace}}/SuperGenius/build/iOS/Release - # run: cmake --install . + - name: Install + working-directory: ${{github.workspace}}/zkLLVM/build/iOS/Release + run: cmake --install . - # - name: Compressing Build Artifacts - # working-directory: ${{github.workspace}}/SuperGenius - # if: ${{ github.event_name == 'workflow_dispatch' }} - # run: | - # shopt -s extglob - # rm -rf !(build) .[!.]* ..?* - # cd build - # rm -rf !(iOS) .[!.]* ..?* - # cd iOS - # rm -rf !(Release) .[!.]* ..?* - # cd Release - # rm -rf !(SuperGenius) .[!.]* ..?* - # cd ${{github.workspace}} - # tar -czvf SuperGenius.tar.gz SuperGenius/ + - name: Compressing Build Artifacts + working-directory: ${{github.workspace}}/zkLLVM + if: ${{ github.event_name == 'workflow_dispatch' }} + run: | + shopt -s extglob + rm -rf !(build) .[!.]* ..?* + cd build + rm -rf !(iOS) .[!.]* ..?* + cd iOS + rm -rf !(Release) .[!.]* ..?* + cd Release + rm -rf !(zkLLVM) .[!.]* ..?* + cd ${{github.workspace}} + tar --exclude='zkLLVM/build/iOS/Release/zkLLVM/src' \ + --exclude='zkLLVM/build/iOS/Release/zkLLVM/tmp' \ + -czvf zkLLVM.tar.gz zkLLVM/ - # - name: Set Release Variables - # id: vars - # if: ${{ github.event_name == 'workflow_dispatch' }} - # run: | - # OS_NAME=iOS - # BRANCH_NAME=${GITHUB_REF#refs/heads/} - # BUILD_TYPE=Release - # FILE_NAME="${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}.tar.gz" - # echo "RELEASE_TAG=${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}-${GITHUB_SHA::7}" >> $GITHUB_ENV - # echo "RELEASE_NAME=${OS_NAME} ${BRANCH_NAME} ${BUILD_TYPE} (${GITHUB_SHA::7})" >> $GITHUB_ENV - # echo "FILE_NAME=$FILE_NAME" >> $GITHUB_ENV - - # - name: Rename Artifact - # if: ${{ github.event_name == 'workflow_dispatch' }} - # run: mv SuperGenius.tar.gz ${{ env.FILE_NAME }} - - # - name: Create GitHub Release - # if: ${{ github.event_name == 'workflow_dispatch' }} - # id: create_release - # uses: actions/create-release@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} - # with: - # tag_name: ${{ env.RELEASE_TAG }} - # release_name: ${{ env.RELEASE_NAME }} - # draft: false - # prerelease: false - - # - name: Upload Release Asset - # if: ${{ github.event_name == 'workflow_dispatch' }} - # uses: actions/upload-release-asset@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} - # with: - # upload_url: ${{ steps.create_release.outputs.upload_url }} - # asset_path: ${{ env.FILE_NAME }} - # asset_name: ${{ env.FILE_NAME }} - # asset_content_type: application/gzip + - name: Set Release Variables + id: vars + if: ${{ github.event_name == 'workflow_dispatch' }} + run: | + OS_NAME=iOS + BRANCH_NAME=${GITHUB_REF#refs/heads/} + BUILD_TYPE=Release + FILE_NAME="${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}.tar.gz" + echo "RELEASE_TAG=${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}-${GITHUB_SHA::7}" >> $GITHUB_ENV + echo "RELEASE_NAME=${OS_NAME} ${BRANCH_NAME} ${BUILD_TYPE} (${GITHUB_SHA::7})" >> $GITHUB_ENV + echo "FILE_NAME=$FILE_NAME" >> $GITHUB_ENV + + - name: Rename Artifact + if: ${{ github.event_name == 'workflow_dispatch' }} + run: mv zkLLVM.tar.gz ${{ env.FILE_NAME }} + + - name: Create GitHub Release + if: ${{ github.event_name == 'workflow_dispatch' }} + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} + with: + tag_name: ${{ env.RELEASE_TAG }} + release_name: ${{ env.RELEASE_NAME }} + draft: false + prerelease: false + + - name: Upload Release Asset + if: ${{ github.event_name == 'workflow_dispatch' }} + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ${{ env.FILE_NAME }} + asset_name: ${{ env.FILE_NAME }} + asset_content_type: application/gzip From 439255182e005870bbf10eba2710a859ed5c959b Mon Sep 17 00:00:00 2001 From: "sariru@gmail.com" <89619301+itsafuu@users.noreply.github.com> Date: Wed, 22 Jan 2025 10:31:27 -0500 Subject: [PATCH 053/114] Relative path for cmake template --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index f5e76f65..213b8fca 100644 --- a/.gitmodules +++ b/.gitmodules @@ -24,4 +24,4 @@ url = ../../GeniusVentures/crypto3.git [submodule "build"] path = build - url = git@github.com:GeniusVentures/cmaketemplate.git + url = ../../GeniusVentures/cmaketemplate.git From 608ef539b170b028207635411082eba2fee700f9 Mon Sep 17 00:00:00 2001 From: Henrique A Klein Date: Fri, 24 Jan 2025 08:13:22 -0300 Subject: [PATCH 054/114] Fix: Install of clang headers to zkLLVM/include instead of lib --- libs/circifier | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/circifier b/libs/circifier index 18a771d9..6e0865f8 160000 --- a/libs/circifier +++ b/libs/circifier @@ -1 +1 @@ -Subproject commit 18a771d9553d24808b3d9b1638ef1e2d8fe81d00 +Subproject commit 6e0865f86e275245667adc50edaeb315b75d384e From 0c077da6c88074484fa2161363931d26b36b3f45 Mon Sep 17 00:00:00 2001 From: "sariru@gmail.com" <89619301+itsafuu@users.noreply.github.com> Date: Fri, 24 Jan 2025 10:18:16 -0500 Subject: [PATCH 055/114] Indentation --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 8d6d00fb..b78d8ad2 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -273,7 +273,7 @@ jobs: id: branch-name uses: tj-actions/branch-names@v6 - - name: Install GitHub CLI + - name: Install GitHub CLI run: | sudo apt install -y gh From d69e2fb48091534d0ddc9dbadfb40eb1caedee86 Mon Sep 17 00:00:00 2001 From: "sariru@gmail.com" <89619301+itsafuu@users.noreply.github.com> Date: Fri, 24 Jan 2025 10:19:29 -0500 Subject: [PATCH 056/114] Can't be empty? --- .github/workflows/deploy.yml | 98 ++++++++++++++++++------------------ 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 6cb9ecd3..1a3b02f6 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,65 +1,65 @@ -# name: Deploy ZKLLVM +name: Deploy ZKLLVM -# on: -# workflow_run: -# workflows: ["Release Build CI"] -# types: -# - completed -# env: -# GH_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} +on: + workflow_run: + workflows: ["Release Build CI"] + types: + - completed +env: + GH_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} -# jobs: -# deploy: -# runs-on: ubuntu-latest +jobs: + deploy: + runs-on: ubuntu-latest -# steps: - # - name: Download Linux Build Artifacts - # uses: actions/download-artifact@v3 - # with: - # name: linux-build - # path: ${{github.workspace}}/linux-build + steps: + - name: Download Linux Build Artifacts + uses: actions/download-artifact@v3 + with: + name: linux-build + path: ${{github.workspace}}/linux-build - # - name: Download Windows Build Artifacts - # uses: actions/download-artifact@v3 - # with: - # name: windows-build - # path: ${{github.workspace}}/windows-build + - name: Download Windows Build Artifacts + uses: actions/download-artifact@v3 + with: + name: windows-build + path: ${{github.workspace}}/windows-build - # - name: Download Android Build Artifacts - # uses: actions/download-artifact@v3 - # with: - # name: android-build - # path: ${{github.workspace}}/android-build + - name: Download Android Build Artifacts + uses: actions/download-artifact@v3 + with: + name: android-build + path: ${{github.workspace}}/android-build - # - name: Download OSX Build Artifacts - # uses: actions/download-artifact@v3 - # with: - # name: osx-build - # path: ${{github.workspace}}/osx-build + - name: Download OSX Build Artifacts + uses: actions/download-artifact@v3 + with: + name: osx-build + path: ${{github.workspace}}/osx-build - # - name: Download iOS Build Artifacts - # uses: actions/download-artifact@v3 - # with: - # name: ios-build - # path: ${{github.workspace}}/ios-build + - name: Download iOS Build Artifacts + uses: actions/download-artifact@v3 + with: + name: ios-build + path: ${{github.workspace}}/ios-build - # - name: Compress Windows Build Artifacts - # run: tar -czvf windows-build.tar.gz -C ${{github.workspace}}/windows-build . + - name: Compress Windows Build Artifacts + run: tar -czvf windows-build.tar.gz -C ${{github.workspace}}/windows-build . - # - name: Compress Linux Build Artifacts - # run: tar -czvf linux-build.tar.gz -C ${{github.workspace}}/linux-build . + - name: Compress Linux Build Artifacts + run: tar -czvf linux-build.tar.gz -C ${{github.workspace}}/linux-build . - # - name: Compress Android Build Artifacts - # run: tar -czvf android-build.tar.gz -C ${{github.workspace}}/android-build . + - name: Compress Android Build Artifacts + run: tar -czvf android-build.tar.gz -C ${{github.workspace}}/android-build . - # - name: Compress MacOS Build Artifacts - # run: tar -czvf osx-build.tar.gz -C ${{github.workspace}}/osx-build . + - name: Compress MacOS Build Artifacts + run: tar -czvf osx-build.tar.gz -C ${{github.workspace}}/osx-build . - # - name: Compress iOS Build Artifacts - # run: tar -czvf ios-build.tar.gz -C ${{github.workspace}}/ios-build . + - name: Compress iOS Build Artifacts + run: tar -czvf ios-build.tar.gz -C ${{github.workspace}}/ios-build . - # - name: Deploy the compressed artifacts - # run: | + - name: Deploy the compressed artifacts + run: | \ No newline at end of file From 7cd32e63b0e6b30622edb85f8eaf29ffbb38592a Mon Sep 17 00:00:00 2001 From: "sariru@gmail.com" <89619301+itsafuu@users.noreply.github.com> Date: Fri, 24 Jan 2025 10:21:36 -0500 Subject: [PATCH 057/114] Revert --- .github/workflows/deploy.yml | 60 ++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1a3b02f6..0338a9c0 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -13,11 +13,11 @@ jobs: runs-on: ubuntu-latest steps: - - name: Download Linux Build Artifacts - uses: actions/download-artifact@v3 - with: - name: linux-build - path: ${{github.workspace}}/linux-build + # - name: Download Linux Build Artifacts + # uses: actions/download-artifact@v3 + # with: + # name: linux-build + # path: ${{github.workspace}}/linux-build - name: Download Windows Build Artifacts uses: actions/download-artifact@v3 @@ -25,41 +25,41 @@ jobs: name: windows-build path: ${{github.workspace}}/windows-build - - name: Download Android Build Artifacts - uses: actions/download-artifact@v3 - with: - name: android-build - path: ${{github.workspace}}/android-build + # - name: Download Android Build Artifacts + # uses: actions/download-artifact@v3 + # with: + # name: android-build + # path: ${{github.workspace}}/android-build - - name: Download OSX Build Artifacts - uses: actions/download-artifact@v3 - with: - name: osx-build - path: ${{github.workspace}}/osx-build + # - name: Download OSX Build Artifacts + # uses: actions/download-artifact@v3 + # with: + # name: osx-build + # path: ${{github.workspace}}/osx-build - - name: Download iOS Build Artifacts - uses: actions/download-artifact@v3 - with: - name: ios-build - path: ${{github.workspace}}/ios-build + # - name: Download iOS Build Artifacts + # uses: actions/download-artifact@v3 + # with: + # name: ios-build + # path: ${{github.workspace}}/ios-build - name: Compress Windows Build Artifacts run: tar -czvf windows-build.tar.gz -C ${{github.workspace}}/windows-build . - - name: Compress Linux Build Artifacts - run: tar -czvf linux-build.tar.gz -C ${{github.workspace}}/linux-build . + # - name: Compress Linux Build Artifacts + # run: tar -czvf linux-build.tar.gz -C ${{github.workspace}}/linux-build . - - name: Compress Android Build Artifacts - run: tar -czvf android-build.tar.gz -C ${{github.workspace}}/android-build . + # - name: Compress Android Build Artifacts + # run: tar -czvf android-build.tar.gz -C ${{github.workspace}}/android-build . - - name: Compress MacOS Build Artifacts - run: tar -czvf osx-build.tar.gz -C ${{github.workspace}}/osx-build . + # - name: Compress MacOS Build Artifacts + # run: tar -czvf osx-build.tar.gz -C ${{github.workspace}}/osx-build . - - name: Compress iOS Build Artifacts - run: tar -czvf ios-build.tar.gz -C ${{github.workspace}}/ios-build . + # - name: Compress iOS Build Artifacts + # run: tar -czvf ios-build.tar.gz -C ${{github.workspace}}/ios-build . - - name: Deploy the compressed artifacts - run: | + # - name: Deploy the compressed artifacts + # run: | \ No newline at end of file From 74f585fa930c25cf33666b297c2e861e75843f33 Mon Sep 17 00:00:00 2001 From: "sariru@gmail.com" <89619301+itsafuu@users.noreply.github.com> Date: Fri, 24 Jan 2025 17:12:25 -0500 Subject: [PATCH 058/114] CI build adjustments --- .github/workflows/cmake.yml | 4 ++-- build | 2 +- cmake/CommonBuildParameters.cmake | 12 ++++++++++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index b78d8ad2..1d4e0bf0 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -152,7 +152,7 @@ jobs: - name: Install Linux host dependencies run: | sudo apt install ccache ninja-build -y - sudo apt install vulkan-tools vulkan-validationlayers-dev libvulkan-dev -y + sudo apt install vulkan-tools libvulkan-dev -y echo "CMAKE_GENERATOR=Ninja" >> $GITHUB_ENV - name: Install GitHub CLI @@ -299,7 +299,7 @@ jobs: - name: Extract Prebuilt Boost run: | - tar -xzvf Boost-lib.tar.gz -C ${{github.workspace}}/thirdparty/build/Android/Release + tar -xzvf Boost-lib.tar.gz -C ${{github.workspace}}/thirdparty/build/Android/Release/arm64-v8a # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v3 diff --git a/build b/build index 2a41ef82..e208e45c 160000 --- a/build +++ b/build @@ -1 +1 @@ -Subproject commit 2a41ef82bf1e1cd386981e7b84e9058feb95e84f +Subproject commit e208e45c0a1d514df2773246980b5be755e2beaf diff --git a/cmake/CommonBuildParameters.cmake b/cmake/CommonBuildParameters.cmake index 461ebbba..1e0f2cff 100644 --- a/cmake/CommonBuildParameters.cmake +++ b/cmake/CommonBuildParameters.cmake @@ -77,6 +77,18 @@ set(_CMAKE_COMMON_CACHE_ARGS -DCMAKE_MSVC_RUNTIME_LIBRARY:STRING=${MSVC_RUNTIME_LIBRARY_OPTION} ) +if(APPLE) +set(_CMAKE_COMMON_CACHE_ARGS ${_CMAKE_COMMON_CACHE_ARGS} + -DNAMED_LANGUAGE_SUPPORT:BOOL=${NAMED_LANGUAGE_SUPPORT} + -DENABLE_BITCODE:BOOL=${ENABLE_BITCODE} + -DENABLE_ARC:BOOL=${ENABLE_ARC} + -DENABLE_VISIBILITY:BOOL=${ENABLE_VISIBILITY} + -DENABLE_STRICT_TRY_COMPILE:BOOL=${ENABLE_STRICT_TRY_COMPILE} + -DPLATFORM:STRING=${PLATFORM} + -DDEPLOYMENT_TARGET:STRING=${DEPLOYMENT_TARGET} +) +endif() + include(ExternalProject) ExternalProject_Add(zkLLVM PREFIX zkLLVM From bae970f9c025afec5861fda3d65a51ef3aa0ac98 Mon Sep 17 00:00:00 2001 From: "sariru@gmail.com" <89619301+itsafuu@users.noreply.github.com> Date: Fri, 24 Jan 2025 17:15:01 -0500 Subject: [PATCH 059/114] Create directory arm64 --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 1d4e0bf0..32e07a8e 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -295,7 +295,7 @@ jobs: - name: Ensure Directory Exists run: | - mkdir -p ${{github.workspace}}/thirdparty/build/Android/Release + mkdir -p ${{github.workspace}}/thirdparty/build/Android/Release/arm64-v8a - name: Extract Prebuilt Boost run: | From 926a4c09d9577d9025fff95968b57f8259d42528 Mon Sep 17 00:00:00 2001 From: itsafuu Date: Mon, 27 Jan 2025 18:45:32 -0500 Subject: [PATCH 060/114] ios fixes --- cmake/CommonBuildParameters.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/CommonBuildParameters.cmake b/cmake/CommonBuildParameters.cmake index 1e0f2cff..380d18ea 100644 --- a/cmake/CommonBuildParameters.cmake +++ b/cmake/CommonBuildParameters.cmake @@ -86,6 +86,7 @@ set(_CMAKE_COMMON_CACHE_ARGS ${_CMAKE_COMMON_CACHE_ARGS} -DENABLE_STRICT_TRY_COMPILE:BOOL=${ENABLE_STRICT_TRY_COMPILE} -DPLATFORM:STRING=${PLATFORM} -DDEPLOYMENT_TARGET:STRING=${DEPLOYMENT_TARGET} + -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE} ) endif() From 26b4607e9a3c58c0ac2d2a81df6c0a17e15d4937 Mon Sep 17 00:00:00 2001 From: "sariru@gmail.com" <89619301+itsafuu@users.noreply.github.com> Date: Mon, 27 Jan 2025 18:52:46 -0500 Subject: [PATCH 061/114] Android cmake params --- cmake/CommonBuildParameters.cmake | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/cmake/CommonBuildParameters.cmake b/cmake/CommonBuildParameters.cmake index 380d18ea..12fd6f20 100644 --- a/cmake/CommonBuildParameters.cmake +++ b/cmake/CommonBuildParameters.cmake @@ -89,6 +89,22 @@ set(_CMAKE_COMMON_CACHE_ARGS ${_CMAKE_COMMON_CACHE_ARGS} -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE} ) endif() +if(ANDROID) +set(_CMAKE_COMMON_CACHE_ARGS ${_CMAKE_COMMON_CACHE_ARGS} + -DCMAKE_ANDROID_NDK:PATH=${CMAKE_ANDROID_NDK} + -DANDROID_ABI:STRING=${ANDROID_ABI} + -DANDROID_NATIVE_API_LEVEL:STRING=${ANDROID_NATIVE_API_LEVEL} + -DANDROID_PLATFORM_LEVEL:STRING=${ANDROID_PLATFORM_LEVEL} + -DANDROID_PLATFORM:STRING=${ANDROID_PLATFORM} + -DANDROID_STL:STRING=c++_static + -DANDROID_TOOLCHAIN:STRING=${ANDROID_TOOLCHAIN} + -DANDROID_USE_LEGACY_TOOLCHAIN_FILE:BOOL=${ANDROID_USE_LEGACY_TOOLCHAIN_FILE} + -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE:STRING=BOTH + -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE:STRING=BOTH + -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY:STRING=BOTH + -DOPENSSL_USE_STATIC_LIBS:BOOL=TRUE +) +endif() include(ExternalProject) ExternalProject_Add(zkLLVM From d3a13218f5e10be8a4b1d5cbccb84e9abc479c32 Mon Sep 17 00:00:00 2001 From: itsafuu Date: Mon, 27 Jan 2025 19:43:44 -0500 Subject: [PATCH 062/114] Set boost cache args for android specific Boost_COMPILER override --- cmake/CommonBuildParameters.cmake | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cmake/CommonBuildParameters.cmake b/cmake/CommonBuildParameters.cmake index 12fd6f20..10c4b12c 100644 --- a/cmake/CommonBuildParameters.cmake +++ b/cmake/CommonBuildParameters.cmake @@ -104,6 +104,16 @@ set(_CMAKE_COMMON_CACHE_ARGS ${_CMAKE_COMMON_CACHE_ARGS} -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY:STRING=BOTH -DOPENSSL_USE_STATIC_LIBS:BOOL=TRUE ) +set(_BOOST_CACHE_ARGS ${_BOOST_CACHE_ARGS} + -Dboost_atomic_DIR:PATH=${boost_atomic_DIR} + -Dboost_chrono_DIR:PATH=${boost_chrono_DIR} + -Dboost_container_DIR:PATH=${boost_container_DIR} + -Dboost_log_DIR:PATH=${boost_log_DIR} + -Dboost_log_setup_DIR:PATH=${boost_log_setup_DIR} + -Dboost_thread_DIR:PATH=${boost_thread_DIR} + -Dboost_unit_test_framework_DIR:PATH=${boost_unit_test_framework_DIR} + -DBoost_COMPILER:STRING=clang +) endif() include(ExternalProject) From fa6ceff246b95b1c50cc29f0534e2a45eb923e5e Mon Sep 17 00:00:00 2001 From: itsafuu Date: Tue, 28 Jan 2025 13:57:33 -0500 Subject: [PATCH 063/114] STD Lib Param for mobile --- cmake/CommonBuildParameters.cmake | 40 +++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/cmake/CommonBuildParameters.cmake b/cmake/CommonBuildParameters.cmake index 380d18ea..6d7a1527 100644 --- a/cmake/CommonBuildParameters.cmake +++ b/cmake/CommonBuildParameters.cmake @@ -48,14 +48,27 @@ set(_BOOST_CACHE_ARGS -DBoost_USE_STATIC_RUNTIME:BOOL=ON ) -set(_ZKLLVM_EXTRA_PARAM - -DZKLLVM_BUILD_TRANSPILER_LIB:BOOL=OFF - -DZKLLVM_BUILD_EXAMPLES:BOOL=OFF - -DZKLLVM_BUILD_STD_LIB:BOOL=ON - -DZKLLVM_BUILD_EXECUTABLES:BOOL=OFF - -DLLVM_INCLUDE_UTILS:BOOL=OFF - -DLLVM_INCLUDE_TESTS:BOOL=OFF -) +if(APPLE OR WIN32 OR UNIX) + # For desktop platforms (macOS, Windows, Linux) + set(_ZKLLVM_EXTRA_PARAM + -DZKLLVM_BUILD_TRANSPILER_LIB:BOOL=OFF + -DZKLLVM_BUILD_EXAMPLES:BOOL=OFF + -DZKLLVM_BUILD_STD_LIB:BOOL=ON + -DZKLLVM_BUILD_EXECUTABLES:BOOL=OFF + -DLLVM_INCLUDE_UTILS:BOOL=OFF + -DLLVM_INCLUDE_TESTS:BOOL=OFF + ) +elseif(ANDROID OR IOS) + # For mobile platforms (Android, iOS) + set(_ZKLLVM_EXTRA_PARAM + -DZKLLVM_BUILD_TRANSPILER_LIB:BOOL=OFF + -DZKLLVM_BUILD_EXAMPLES:BOOL=OFF + -DZKLLVM_BUILD_STD_LIB:BOOL=OFF + -DZKLLVM_BUILD_EXECUTABLES:BOOL=OFF + -DLLVM_INCLUDE_UTILS:BOOL=OFF + -DLLVM_INCLUDE_TESTS:BOOL=OFF + ) +endif() set(_CMAKE_COMMON_CACHE_ARGS -DBUILD_SHARED_LIBS:BOOL=OFF @@ -93,17 +106,18 @@ endif() include(ExternalProject) ExternalProject_Add(zkLLVM PREFIX zkLLVM - SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../zkLLVM/" + SOURCE_DIR "${THIRDPARTY_DIR}/zkLLVM/" CMAKE_GENERATOR ${CMAKE_GENERATOR} CONFIGURE_COMMAND ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX:PATH= + -DLLVM_ENABLE_ZSTD:BOOL=OFF + -DLLVM_INCLUDE_EXAMPLES:BOOL=OFF + -DZKLLVM_BUILD_EXECUTABLES:BOOL=OFF + -DZKLLVM_BUILD_RSLANG:BOOL=OFF + -DZKLLVM_DEV_ENVIRONMENT:BOOL=ON -DZKLLVM_STDLIB_DIR:PATH=lib - -DZKLLVM_DEV_ENVIRONMENT:BOOL=true -DZKLLVM_VERSION:STRING=v0.1.18-22-gf095fb0 - -DLLVM_ENABLE_ZSTD:BOOL=FALSE - -DLLVM_INCLUDE_EXAMPLES:BOOL=OFF - -DZKLLVM_BUILD_RSLANG:BOOL=FALSE ${_CMAKE_COMMON_CACHE_ARGS} ${_BOOST_CACHE_ARGS} ${_ZKLLVM_EXTRA_PARAM} From c3dacbe5ffa0d5fab2fcc99a5f8c12272028da5e Mon Sep 17 00:00:00 2001 From: itsafuu Date: Tue, 28 Jan 2025 14:06:28 -0500 Subject: [PATCH 064/114] oops --- cmake/CommonBuildParameters.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/CommonBuildParameters.cmake b/cmake/CommonBuildParameters.cmake index b690856a..c4465a8d 100644 --- a/cmake/CommonBuildParameters.cmake +++ b/cmake/CommonBuildParameters.cmake @@ -132,7 +132,7 @@ endif() include(ExternalProject) ExternalProject_Add(zkLLVM PREFIX zkLLVM - SOURCE_DIR "${THIRDPARTY_DIR}/zkLLVM/" + SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../zkLLVM/" CMAKE_GENERATOR ${CMAKE_GENERATOR} CONFIGURE_COMMAND ${CMAKE_COMMAND} From 9b660150d22c23d6ea0cd498cf58b3317867ad11 Mon Sep 17 00:00:00 2001 From: "sariru@gmail.com" <89619301+itsafuu@users.noreply.github.com> Date: Tue, 28 Jan 2025 14:33:18 -0500 Subject: [PATCH 065/114] NDK version --- .github/workflows/cmake.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 32e07a8e..235eedc8 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -263,9 +263,9 @@ jobs: Android: runs-on: ubuntu-latest env: - ANDROID_NDK_HOME: ${{github.workspace}}/android-ndk/android-ndk-r25b - ANDROID_TOOLCHAIN: ${{github.workspace}}/android-ndk/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin - NDK_URL: "https://dl.google.com/android/repository/android-ndk-r25b-linux.zip" + ANDROID_NDK_HOME: ${{github.workspace}}/android-ndk/android-ndk-r27b + ANDROID_TOOLCHAIN: ${{github.workspace}}/android-ndk/android-ndk-r27b/toolchains/llvm/prebuilt/linux-x86_64/bin + NDK_URL: "https://dl.google.com/android/repository/android-ndk-r27b-linux.zip" CC: clang steps: From 354816072ca7cdce4d5a4706ed302e2fff871689 Mon Sep 17 00:00:00 2001 From: "sariru@gmail.com" <89619301+itsafuu@users.noreply.github.com> Date: Tue, 28 Jan 2025 14:46:06 -0500 Subject: [PATCH 066/114] Up NDK check in android cmake --- build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build b/build index e208e45c..b11dea5b 160000 --- a/build +++ b/build @@ -1 +1 @@ -Subproject commit e208e45c0a1d514df2773246980b5be755e2beaf +Subproject commit b11dea5bf1ab2d0acd78c36acfaa09167926be83 From 29878b2d55e1919da13fb69fdb54e917f658d945 Mon Sep 17 00:00:00 2001 From: "sariru@gmail.com" <89619301+itsafuu@users.noreply.github.com> Date: Tue, 28 Jan 2025 15:19:41 -0500 Subject: [PATCH 067/114] Clang defaults on android build --- .github/workflows/cmake.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 235eedc8..1a768dc9 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -273,6 +273,13 @@ jobs: id: branch-name uses: tj-actions/branch-names@v6 + - name: Set clang as the default compiler + run: | + sudo update-alternatives --install /usr/bin/cc cc $(which clang) 100 + sudo update-alternatives --install /usr/bin/c++ c++ $(which clang++) 100 + sudo update-alternatives --set cc $(which clang) + sudo update-alternatives --set c++ $(which clang++) + - name: Install GitHub CLI run: | sudo apt install -y gh From 393fdea5b14e5de44c58f923ca2bcf5a90d682b4 Mon Sep 17 00:00:00 2001 From: "sariru@gmail.com" <89619301+itsafuu@users.noreply.github.com> Date: Tue, 28 Jan 2025 15:36:26 -0500 Subject: [PATCH 068/114] Thanks chatgpt, that elseif wouldn't work --- cmake/CommonBuildParameters.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/CommonBuildParameters.cmake b/cmake/CommonBuildParameters.cmake index c4465a8d..d890debb 100644 --- a/cmake/CommonBuildParameters.cmake +++ b/cmake/CommonBuildParameters.cmake @@ -58,7 +58,8 @@ if(APPLE OR WIN32 OR UNIX) -DLLVM_INCLUDE_UTILS:BOOL=OFF -DLLVM_INCLUDE_TESTS:BOOL=OFF ) -elseif(ANDROID OR IOS) +endif() +if(ANDROID OR IOS) # For mobile platforms (Android, iOS) set(_ZKLLVM_EXTRA_PARAM -DZKLLVM_BUILD_TRANSPILER_LIB:BOOL=OFF From f79b463fad00f8b13736c565a9f0635cea00379e Mon Sep 17 00:00:00 2001 From: "sariru@gmail.com" <89619301+itsafuu@users.noreply.github.com> Date: Tue, 28 Jan 2025 19:27:10 -0500 Subject: [PATCH 069/114] ios specific cmake --- .github/workflows/cmake-ios.yml | 136 ++++++++++++++++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 .github/workflows/cmake-ios.yml diff --git a/.github/workflows/cmake-ios.yml b/.github/workflows/cmake-ios.yml new file mode 100644 index 00000000..ffaf6c25 --- /dev/null +++ b/.github/workflows/cmake-ios.yml @@ -0,0 +1,136 @@ +name: Release Build CI - iOS Only +on: + workflow_dispatch: + +jobs: + iOS: + runs-on: macos-latest + steps: + - name: Get branch name + id: branch-name + uses: tj-actions/branch-names@v6 + + - name: Install GitHub CLI + run: | + brew install gh + + - name: Authenticate GitHub CLI + run: | + echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token + + - name: Define Release Tag + id: release-tag + run: echo "RELEASE_TAG=iOS-develop-Release" >> $GITHUB_ENV + + - name: Download Prebuilt Boost from Thirdparty + shell: bash + run: | + gh release download \ + --repo GeniusVentures/thirdparty \ + iOS-develop-Release \ + --pattern Boost-lib.tar.gz + + - name: Ensure Directory Exists + run: | + mkdir -p ${{github.workspace}}/thirdparty/build/iOS/Release + + - name: Extract Prebuilt Boost + run: | + tar -xzvf Boost-lib.tar.gz -C ${{github.workspace}}/thirdparty/build/iOS/Release + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + path: 'zkLLVM' + submodules: "recursive" + + - name: Install Ninja + run: | + brew install ccache ninja + echo "CMAKE_GENERATOR=Ninja" >> $GITHUB_ENV + + - name: Add iOS toolchain + run: | + rustup toolchain install nightly-aarch64-apple-darwin + rustup component add rust-src --toolchain nightly-aarch64-apple-darwin + rustup target add aarch64-apple-ios + + - name: Create Build Directory + run: cmake -E make_directory ${{github.workspace}}/zkLLVM/build/iOS/Release + + - name: Configure CMake + working-directory: ${{github.workspace}}/zkLLVM/build/iOS/Release + run: cmake -S .. -DCMAKE_BUILD_TYPE=Release -DPLATFORM=OS64 -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty/ + + - name: Compile + working-directory: ${{github.workspace}}/zkLLVM/build/iOS/Release + run: cmake --build . -j --config Release + + - name: Install + working-directory: ${{github.workspace}}/zkLLVM/build/iOS/Release + run: cmake --install . + + - name: Compressing Build Artifacts + working-directory: ${{github.workspace}}/zkLLVM + if: ${{ github.event_name == 'workflow_dispatch' }} + run: | + shopt -s extglob + rm -rf !(build) .[!.]* ..?* + cd build + rm -rf !(iOS) .[!.]* ..?* + cd iOS + rm -rf !(Release) .[!.]* ..?* + cd Release + rm -rf !(zkLLVM) .[!.]* ..?* + cd ${{github.workspace}} + tar --exclude='zkLLVM/build/iOS/Release/zkLLVM/src' \ + --exclude='zkLLVM/build/iOS/Release/zkLLVM/tmp' \ + --exclude='zkLLVM/build/iOS/Release/zkLLVM/Applications' \ + -czvf zkLLVM.tar.gz zkLLVM/ + + - name: Validate Artifact Size + run: | + if [ $(stat -c%s "zkLLVM.tar.gz") -ge $((2 * 1024 * 1024 * 1024)) ]; then + echo "Artifact exceeds 2GB limit! Exiting." + exit 1 + fi + + - name: Set Release Variables + id: vars + if: ${{ github.event_name == 'workflow_dispatch' }} + run: | + OS_NAME=iOS + BRANCH_NAME=${GITHUB_REF#refs/heads/} + BUILD_TYPE=Release + FILE_NAME="${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}.tar.gz" + echo "RELEASE_TAG=${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}-${GITHUB_SHA::7}" >> $GITHUB_ENV + echo "RELEASE_NAME=${OS_NAME} ${BRANCH_NAME} ${BUILD_TYPE} (${GITHUB_SHA::7})" >> $GITHUB_ENV + echo "FILE_NAME=$FILE_NAME" >> $GITHUB_ENV + + - name: Rename Artifact + if: ${{ github.event_name == 'workflow_dispatch' }} + run: mv zkLLVM.tar.gz ${{ env.FILE_NAME }} + + - name: Create GitHub Release + if: ${{ github.event_name == 'workflow_dispatch' }} + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} + with: + tag_name: ${{ env.RELEASE_TAG }} + release_name: ${{ env.RELEASE_NAME }} + draft: false + prerelease: false + + - name: Upload Release Asset + if: ${{ github.event_name == 'workflow_dispatch' }} + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ${{ env.FILE_NAME }} + asset_name: ${{ env.FILE_NAME }} + asset_content_type: application/gzip + From 136b1f5186012060707dd42537a0e1310146b3c2 Mon Sep 17 00:00:00 2001 From: itsafuu Date: Tue, 28 Jan 2025 23:20:49 -0500 Subject: [PATCH 070/114] Set toolchain file in common cache args --- cmake/CommonBuildParameters.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/CommonBuildParameters.cmake b/cmake/CommonBuildParameters.cmake index d890debb..e7b947af 100644 --- a/cmake/CommonBuildParameters.cmake +++ b/cmake/CommonBuildParameters.cmake @@ -68,6 +68,8 @@ if(ANDROID OR IOS) -DZKLLVM_BUILD_EXECUTABLES:BOOL=OFF -DLLVM_INCLUDE_UTILS:BOOL=OFF -DLLVM_INCLUDE_TESTS:BOOL=OFF + -DCLANG_BUILD_TOOLS:BOOL=OFF + -DCLANG_INCLUDE_DOCS:BOOL=OFF ) endif() @@ -89,6 +91,7 @@ set(_CMAKE_COMMON_CACHE_ARGS -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON -DCMAKE_VS_GLOBALS:STRING=${CMAKE_VS_GLOBALS} -DCMAKE_MSVC_RUNTIME_LIBRARY:STRING=${MSVC_RUNTIME_LIBRARY_OPTION} + -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE} ) if(APPLE) @@ -100,7 +103,6 @@ set(_CMAKE_COMMON_CACHE_ARGS ${_CMAKE_COMMON_CACHE_ARGS} -DENABLE_STRICT_TRY_COMPILE:BOOL=${ENABLE_STRICT_TRY_COMPILE} -DPLATFORM:STRING=${PLATFORM} -DDEPLOYMENT_TARGET:STRING=${DEPLOYMENT_TARGET} - -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE} ) endif() if(ANDROID) From e8dac8d2cca0c0051e2e60f8600d4bad5fe0d0fc Mon Sep 17 00:00:00 2001 From: itsafuu Date: Tue, 28 Jan 2025 23:21:02 -0500 Subject: [PATCH 071/114] Update build dir --- build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build b/build index b11dea5b..981c1128 160000 --- a/build +++ b/build @@ -1 +1 @@ -Subproject commit b11dea5bf1ab2d0acd78c36acfaa09167926be83 +Subproject commit 981c1128b7a82600132dee23b71e5d9a4a082405 From f321fb045afec46afd2161a64a9fd22c97371bb8 Mon Sep 17 00:00:00 2001 From: "sariru@gmail.com" <89619301+itsafuu@users.noreply.github.com> Date: Wed, 29 Jan 2025 08:10:18 -0500 Subject: [PATCH 072/114] Android cmake specific --- .github/workflows/cmake-android.yml | 150 ++++++++++++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 .github/workflows/cmake-android.yml diff --git a/.github/workflows/cmake-android.yml b/.github/workflows/cmake-android.yml new file mode 100644 index 00000000..40d186dc --- /dev/null +++ b/.github/workflows/cmake-android.yml @@ -0,0 +1,150 @@ +name: Release Build CI - Android Only +on: + workflow_dispatch: + +jobs: + Android: + runs-on: ubuntu-latest + env: + ANDROID_NDK_HOME: ${{github.workspace}}/android-ndk/android-ndk-r27b + ANDROID_TOOLCHAIN: ${{github.workspace}}/android-ndk/android-ndk-r27b/toolchains/llvm/prebuilt/linux-x86_64/bin + NDK_URL: "https://dl.google.com/android/repository/android-ndk-r27b-linux.zip" + CC: clang + + steps: + - name: Get branch name + id: branch-name + uses: tj-actions/branch-names@v6 + + - name: Set clang as the default compiler + run: | + sudo update-alternatives --install /usr/bin/cc cc $(which clang) 100 + sudo update-alternatives --install /usr/bin/c++ c++ $(which clang++) 100 + sudo update-alternatives --set cc $(which clang) + sudo update-alternatives --set c++ $(which clang++) + + - name: Install GitHub CLI + run: | + sudo apt install -y gh + + - name: Authenticate GitHub CLI + run: | + echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token + + - name: Define Release Tag + id: release-tag + run: echo "RELEASE_TAG=Android-develop-Release" >> $GITHUB_ENV + + - name: Download Prebuilt Boost from Thirdparty + shell: bash + run: | + gh release download \ + --repo GeniusVentures/thirdparty \ + Android-develop-Release \ + --pattern Boost-lib.tar.gz + + - name: Ensure Directory Exists + run: | + mkdir -p ${{github.workspace}}/thirdparty/build/Android/Release/arm64-v8a + + - name: Extract Prebuilt Boost + run: | + tar -xzvf Boost-lib.tar.gz -C ${{github.workspace}}/thirdparty/build/Android/Release/arm64-v8a + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + path: 'zkLLVM' + submodules: "recursive" + + - name: Download Android NDK + run: | + mkdir "${{github.workspace}}/android-ndk" + cd "${{github.workspace}}/android-ndk" + curl -o ndk.zip ${{ env.NDK_URL }} + unzip ndk.zip + rm ndk.zip + + - name: Create Build Directory + run: cmake -E make_directory ${{github.workspace}}/zkLLVM/build/Android/Release/arm64-v8a + + - name: Configure CMake + working-directory: ${{github.workspace}}/zkLLVM/build/Android/Release/arm64-v8a + run: | + export ANDROID_NDK=${{env.ANDROID_NDK_HOME}} + export ANDROID_NDK_HOME=${{env.ANDROID_NDK_HOME}} + export ANDROID_TOOLCHAIN=${{env.ANDROID_TOOLCHAIN}} + export PATH=${{env.ANDROID_TOOLCHAIN}}:$PATH + echo $PATH + echo $CC + ls -la $ANDROID_TOOLCHAIN + echo "Check clang path:" + which clang + env + cmake -S ../../ -DANDROID_ABI="arm64-v8a" -DCMAKE_BUILD_TYPE=Release -DCMAKE_ANDROID_NDK=$ANDROID_NDK -DANDROID_TOOLCHAIN=clang -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty/ + + - name: Compile + working-directory: ${{github.workspace}}/zkLLVM/build/Android/Release/arm64-v8a + run: make -j8 + + - name: Install + working-directory: ${{github.workspace}}/zkLLVM/build/Android/Release/arm64-v8a + run: cmake --install . + + - name: Compressing Build Artifacts + working-directory: ${{github.workspace}}/zkLLVM + if: ${{ github.event_name == 'workflow_dispatch' }} + run: | + shopt -s extglob + rm -rf !(build) .[!.]* ..?* + cd build + rm -rf !(Android) .[!.]* ..?* + cd Android + rm -rf !(Release) .[!.]* ..?* + cd Release + rm -rf !(arm64-v8a) .[!.]* ..?* + cd arm64-v8a + rm -rf !(zkLLVM) .[!.]* ..?* + cd ${{github.workspace}} + tar --exclude='zkLLVM/build/Android/Release/zkLLVM/src' \ + --exclude='zkLLVM/build/Android/Release/zkLLVM/tmp' \ + -czvf zkLLVM.tar.gz zkLLVM/ + + - name: Set Release Variables + id: vars + if: ${{ github.event_name == 'workflow_dispatch' }} + run: | + OS_NAME=Android-arm64-v8a + BRANCH_NAME=${GITHUB_REF#refs/heads/} + BUILD_TYPE=Release + FILE_NAME="${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}.tar.gz" + echo "RELEASE_TAG=${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}-${GITHUB_SHA::7}" >> $GITHUB_ENV + echo "RELEASE_NAME=${OS_NAME} ${BRANCH_NAME} ${BUILD_TYPE} (${GITHUB_SHA::7})" >> $GITHUB_ENV + echo "FILE_NAME=$FILE_NAME" >> $GITHUB_ENV + + - name: Rename Artifact + if: ${{ github.event_name == 'workflow_dispatch' }} + run: mv zkLLVM.tar.gz ${{ env.FILE_NAME }} + + - name: Create GitHub Release + if: ${{ github.event_name == 'workflow_dispatch' }} + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} + with: + tag_name: ${{ env.RELEASE_TAG }} + release_name: ${{ env.RELEASE_NAME }} + draft: false + prerelease: false + + - name: Upload Release Asset + if: ${{ github.event_name == 'workflow_dispatch' }} + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ${{ env.FILE_NAME }} + asset_name: ${{ env.FILE_NAME }} + asset_content_type: application/gzip \ No newline at end of file From 5702198e0f071f30d1d1eea725a65939e84f8d43 Mon Sep 17 00:00:00 2001 From: Eduardo Menges Mattje Date: Wed, 29 Jan 2025 11:48:19 -0300 Subject: [PATCH 073/114] Fixed string size in MSVC --- libs/blueprint | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/blueprint b/libs/blueprint index 1a5c21f1..6ce6ec8a 160000 --- a/libs/blueprint +++ b/libs/blueprint @@ -1 +1 @@ -Subproject commit 1a5c21f110729f0ae0cbac472c8a941c8f856bd5 +Subproject commit 6ce6ec8acac17747f2c2fe160c2c7780328efda7 From 1f06b109eef22c7e3c3778f916c520eb2ea756d0 Mon Sep 17 00:00:00 2001 From: "sariru@gmail.com" <89619301+itsafuu@users.noreply.github.com> Date: Wed, 29 Jan 2025 11:35:07 -0500 Subject: [PATCH 074/114] Filter Applications folder ios --- .github/workflows/cmake.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 1a768dc9..d1dd315d 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -607,6 +607,7 @@ jobs: cd ${{github.workspace}} tar --exclude='zkLLVM/build/iOS/Release/zkLLVM/src' \ --exclude='zkLLVM/build/iOS/Release/zkLLVM/tmp' \ + --exclude='zkLLVM/build/iOS/Release/zkLLVM/Applications' \ -czvf zkLLVM.tar.gz zkLLVM/ - name: Set Release Variables From dbb944850b56d8e2325e8570546ed782019f375f Mon Sep 17 00:00:00 2001 From: "sariru@gmail.com" <89619301+itsafuu@users.noreply.github.com> Date: Wed, 29 Jan 2025 23:09:39 -0500 Subject: [PATCH 075/114] prep for arm7 release --- .github/workflows/cmake-android-arm7.yml | 150 +++++++++++++++++++++++ .github/workflows/cmake-android.yml | 4 +- .github/workflows/cmake.yml | 149 +++++++++++++++++++++- 3 files changed, 299 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/cmake-android-arm7.yml diff --git a/.github/workflows/cmake-android-arm7.yml b/.github/workflows/cmake-android-arm7.yml new file mode 100644 index 00000000..bb9c80e7 --- /dev/null +++ b/.github/workflows/cmake-android-arm7.yml @@ -0,0 +1,150 @@ +name: Release Build CI - Android Arm7 Only +on: + workflow_dispatch: + +jobs: + Android-arm7: + runs-on: ubuntu-latest + env: + ANDROID_NDK_HOME: ${{github.workspace}}/android-ndk/android-ndk-r27b + ANDROID_TOOLCHAIN: ${{github.workspace}}/android-ndk/android-ndk-r27b/toolchains/llvm/prebuilt/linux-x86_64/bin + NDK_URL: "https://dl.google.com/android/repository/android-ndk-r27b-linux.zip" + CC: clang + + steps: + - name: Get branch name + id: branch-name + uses: tj-actions/branch-names@v6 + + - name: Set clang as the default compiler + run: | + sudo update-alternatives --install /usr/bin/cc cc $(which clang) 100 + sudo update-alternatives --install /usr/bin/c++ c++ $(which clang++) 100 + sudo update-alternatives --set cc $(which clang) + sudo update-alternatives --set c++ $(which clang++) + + - name: Install GitHub CLI + run: | + sudo apt install -y gh + + - name: Authenticate GitHub CLI + run: | + echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token + + - name: Define Release Tag + id: release-tag + run: echo "RELEASE_TAG=Android-armeabi-v7a-develop-Release" >> $GITHUB_ENV + + - name: Download Prebuilt Boost from Thirdparty + shell: bash + run: | + gh release download \ + --repo GeniusVentures/thirdparty \ + Android-develop-Release \ + --pattern Boost-lib.tar.gz + + - name: Ensure Directory Exists + run: | + mkdir -p ${{github.workspace}}/thirdparty/build/Android/Release/armeabi-v7a + + - name: Extract Prebuilt Boost + run: | + tar -xzvf Boost-lib.tar.gz -C ${{github.workspace}}/thirdparty/build/Android/Release/armeabi-v7a + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + path: 'zkLLVM' + submodules: "recursive" + + - name: Download Android NDK + run: | + mkdir "${{github.workspace}}/android-ndk" + cd "${{github.workspace}}/android-ndk" + curl -o ndk.zip ${{ env.NDK_URL }} + unzip ndk.zip + rm ndk.zip + + - name: Create Build Directory + run: cmake -E make_directory ${{github.workspace}}/zkLLVM/build/Android/Release/armeabi-v7a + + - name: Configure CMake + working-directory: ${{github.workspace}}/zkLLVM/build/Android/Release/armeabi-v7a + run: | + export ANDROID_NDK=${{env.ANDROID_NDK_HOME}} + export ANDROID_NDK_HOME=${{env.ANDROID_NDK_HOME}} + export ANDROID_TOOLCHAIN=${{env.ANDROID_TOOLCHAIN}} + export PATH=${{env.ANDROID_TOOLCHAIN}}:$PATH + echo $PATH + echo $CC + ls -la $ANDROID_TOOLCHAIN + echo "Check clang path:" + which clang + env + cmake -S ../../ -DANDROID_ABI="armeabi-v7a" -DCMAKE_BUILD_TYPE=Release -DCMAKE_ANDROID_NDK=$ANDROID_NDK -DANDROID_TOOLCHAIN=clang -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty/ + + - name: Compile + working-directory: ${{github.workspace}}/zkLLVM/build/Android/Release/armeabi-v7a + run: make -j8 + + - name: Install + working-directory: ${{github.workspace}}/zkLLVM/build/Android/Release/armeabi-v7a + run: cmake --install . + + - name: Compressing Build Artifacts + working-directory: ${{github.workspace}}/zkLLVM + if: ${{ github.event_name == 'workflow_dispatch' }} + run: | + shopt -s extglob + rm -rf !(build) .[!.]* ..?* + cd build + rm -rf !(Android) .[!.]* ..?* + cd Android + rm -rf !(Release) .[!.]* ..?* + cd Release + rm -rf !(armeabi-v7a) .[!.]* ..?* + cd armeabi-v7a + rm -rf !(zkLLVM) .[!.]* ..?* + cd ${{github.workspace}} + tar --exclude='zkLLVM/build/Android/Release/zkLLVM/src' \ + --exclude='zkLLVM/build/Android/Release/zkLLVM/tmp' \ + -czvf zkLLVM.tar.gz zkLLVM/ + + - name: Set Release Variables + id: vars + if: ${{ github.event_name == 'workflow_dispatch' }} + run: | + OS_NAME=Android-armeabi-v7a + BRANCH_NAME=${GITHUB_REF#refs/heads/} + BUILD_TYPE=Release + FILE_NAME="${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}.tar.gz" + echo "RELEASE_TAG=${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}-${GITHUB_SHA::7}" >> $GITHUB_ENV + echo "RELEASE_NAME=${OS_NAME} ${BRANCH_NAME} ${BUILD_TYPE} (${GITHUB_SHA::7})" >> $GITHUB_ENV + echo "FILE_NAME=$FILE_NAME" >> $GITHUB_ENV + + - name: Rename Artifact + if: ${{ github.event_name == 'workflow_dispatch' }} + run: mv zkLLVM.tar.gz ${{ env.FILE_NAME }} + + - name: Create GitHub Release + if: ${{ github.event_name == 'workflow_dispatch' }} + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} + with: + tag_name: ${{ env.RELEASE_TAG }} + release_name: ${{ env.RELEASE_NAME }} + draft: false + prerelease: false + + - name: Upload Release Asset + if: ${{ github.event_name == 'workflow_dispatch' }} + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ${{ env.FILE_NAME }} + asset_name: ${{ env.FILE_NAME }} + asset_content_type: application/gzip \ No newline at end of file diff --git a/.github/workflows/cmake-android.yml b/.github/workflows/cmake-android.yml index 40d186dc..c700a6c8 100644 --- a/.github/workflows/cmake-android.yml +++ b/.github/workflows/cmake-android.yml @@ -3,7 +3,7 @@ on: workflow_dispatch: jobs: - Android: + Android-arm64: runs-on: ubuntu-latest env: ANDROID_NDK_HOME: ${{github.workspace}}/android-ndk/android-ndk-r27b @@ -33,7 +33,7 @@ jobs: - name: Define Release Tag id: release-tag - run: echo "RELEASE_TAG=Android-develop-Release" >> $GITHUB_ENV + run: echo "RELEASE_TAG=Android-arm64-v8a-develop-Release" >> $GITHUB_ENV - name: Download Prebuilt Boost from Thirdparty shell: bash diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index d1dd315d..66134d39 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -260,7 +260,7 @@ jobs: asset_name: ${{ env.FILE_NAME }} asset_content_type: application/gzip - Android: + Android-arm64: runs-on: ubuntu-latest env: ANDROID_NDK_HOME: ${{github.workspace}}/android-ndk/android-ndk-r27b @@ -290,7 +290,7 @@ jobs: - name: Define Release Tag id: release-tag - run: echo "RELEASE_TAG=Android-develop-Release" >> $GITHUB_ENV + run: echo "RELEASE_TAG=Android-arm64-v8a-develop-Release" >> $GITHUB_ENV - name: Download Prebuilt Boost from Thirdparty shell: bash @@ -406,7 +406,152 @@ jobs: asset_name: ${{ env.FILE_NAME }} asset_content_type: application/gzip + Android-arm7: + runs-on: ubuntu-latest + env: + ANDROID_NDK_HOME: ${{github.workspace}}/android-ndk/android-ndk-r27b + ANDROID_TOOLCHAIN: ${{github.workspace}}/android-ndk/android-ndk-r27b/toolchains/llvm/prebuilt/linux-x86_64/bin + NDK_URL: "https://dl.google.com/android/repository/android-ndk-r27b-linux.zip" + CC: clang + + steps: + - name: Get branch name + id: branch-name + uses: tj-actions/branch-names@v6 + + - name: Set clang as the default compiler + run: | + sudo update-alternatives --install /usr/bin/cc cc $(which clang) 100 + sudo update-alternatives --install /usr/bin/c++ c++ $(which clang++) 100 + sudo update-alternatives --set cc $(which clang) + sudo update-alternatives --set c++ $(which clang++) + + - name: Install GitHub CLI + run: | + sudo apt install -y gh + + - name: Authenticate GitHub CLI + run: | + echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token + - name: Define Release Tag + id: release-tag + run: echo "RELEASE_TAG=Android-armeabi-v7a-develop-Release" >> $GITHUB_ENV + + - name: Download Prebuilt Boost from Thirdparty + shell: bash + run: | + gh release download \ + --repo GeniusVentures/thirdparty \ + Android-develop-Release \ + --pattern Boost-lib.tar.gz + + - name: Ensure Directory Exists + run: | + mkdir -p ${{github.workspace}}/thirdparty/build/Android/Release/armeabi-v7a + + - name: Extract Prebuilt Boost + run: | + tar -xzvf Boost-lib.tar.gz -C ${{github.workspace}}/thirdparty/build/Android/Release/armeabi-v7a + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + path: 'zkLLVM' + submodules: "recursive" + + - name: Download Android NDK + run: | + mkdir "${{github.workspace}}/android-ndk" + cd "${{github.workspace}}/android-ndk" + curl -o ndk.zip ${{ env.NDK_URL }} + unzip ndk.zip + rm ndk.zip + + - name: Create Build Directory + run: cmake -E make_directory ${{github.workspace}}/zkLLVM/build/Android/Release/armeabi-v7a + + - name: Configure CMake + working-directory: ${{github.workspace}}/zkLLVM/build/Android/Release/armeabi-v7a + run: | + export ANDROID_NDK=${{env.ANDROID_NDK_HOME}} + export ANDROID_NDK_HOME=${{env.ANDROID_NDK_HOME}} + export ANDROID_TOOLCHAIN=${{env.ANDROID_TOOLCHAIN}} + export PATH=${{env.ANDROID_TOOLCHAIN}}:$PATH + echo $PATH + echo $CC + ls -la $ANDROID_TOOLCHAIN + echo "Check clang path:" + which clang + env + cmake -S ../../ -DANDROID_ABI="armeabi-v7a" -DCMAKE_BUILD_TYPE=Release -DCMAKE_ANDROID_NDK=$ANDROID_NDK -DANDROID_TOOLCHAIN=clang -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty/ + + - name: Compile + working-directory: ${{github.workspace}}/zkLLVM/build/Android/Release/armeabi-v7a + run: make -j8 + + - name: Install + working-directory: ${{github.workspace}}/zkLLVM/build/Android/Release/armeabi-v7a + run: cmake --install . + + - name: Compressing Build Artifacts + working-directory: ${{github.workspace}}/zkLLVM + if: ${{ github.event_name == 'workflow_dispatch' }} + run: | + shopt -s extglob + rm -rf !(build) .[!.]* ..?* + cd build + rm -rf !(Android) .[!.]* ..?* + cd Android + rm -rf !(Release) .[!.]* ..?* + cd Release + rm -rf !(armeabi-v7a) .[!.]* ..?* + cd armeabi-v7a + rm -rf !(zkLLVM) .[!.]* ..?* + cd ${{github.workspace}} + tar --exclude='zkLLVM/build/Android/Release/zkLLVM/src' \ + --exclude='zkLLVM/build/Android/Release/zkLLVM/tmp' \ + -czvf zkLLVM.tar.gz zkLLVM/ + + - name: Set Release Variables + id: vars + if: ${{ github.event_name == 'workflow_dispatch' }} + run: | + OS_NAME=Android-armeabi-v7a + BRANCH_NAME=${GITHUB_REF#refs/heads/} + BUILD_TYPE=Release + FILE_NAME="${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}.tar.gz" + echo "RELEASE_TAG=${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}-${GITHUB_SHA::7}" >> $GITHUB_ENV + echo "RELEASE_NAME=${OS_NAME} ${BRANCH_NAME} ${BUILD_TYPE} (${GITHUB_SHA::7})" >> $GITHUB_ENV + echo "FILE_NAME=$FILE_NAME" >> $GITHUB_ENV + + - name: Rename Artifact + if: ${{ github.event_name == 'workflow_dispatch' }} + run: mv zkLLVM.tar.gz ${{ env.FILE_NAME }} + + - name: Create GitHub Release + if: ${{ github.event_name == 'workflow_dispatch' }} + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} + with: + tag_name: ${{ env.RELEASE_TAG }} + release_name: ${{ env.RELEASE_NAME }} + draft: false + prerelease: false + + - name: Upload Release Asset + if: ${{ github.event_name == 'workflow_dispatch' }} + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ${{ env.FILE_NAME }} + asset_name: ${{ env.FILE_NAME }} + asset_content_type: application/gzip + MacOS: runs-on: macos-latest steps: From 09f6aa4ac7a66cfd9d145b5dacac50360b44efea Mon Sep 17 00:00:00 2001 From: Eduardo Menges Mattje Date: Thu, 30 Jan 2025 11:51:50 -0300 Subject: [PATCH 076/114] Fixed MSVC built-in usage --- libs/blueprint | 2 +- libs/circifier | 2 +- libs/crypto3 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/blueprint b/libs/blueprint index 6ce6ec8a..69b86bab 160000 --- a/libs/blueprint +++ b/libs/blueprint @@ -1 +1 @@ -Subproject commit 6ce6ec8acac17747f2c2fe160c2c7780328efda7 +Subproject commit 69b86bab364fb2bdfe02c69b50ad6d7d700eee84 diff --git a/libs/circifier b/libs/circifier index 6e0865f8..dd2fb602 160000 --- a/libs/circifier +++ b/libs/circifier @@ -1 +1 @@ -Subproject commit 6e0865f86e275245667adc50edaeb315b75d384e +Subproject commit dd2fb60213bf5b67880788ddc1ab7c86feec3692 diff --git a/libs/crypto3 b/libs/crypto3 index e1d75d29..4665b5a3 160000 --- a/libs/crypto3 +++ b/libs/crypto3 @@ -1 +1 @@ -Subproject commit e1d75d2948004c6e8e3be81a23a40aa25ab0a4c6 +Subproject commit 4665b5a3a48e4151fb5fb16ab760df2d31898935 From 60a8c9f3afd120c829fd4ac2059aafbe253258a6 Mon Sep 17 00:00:00 2001 From: Henrique A Klein Date: Tue, 4 Feb 2025 09:46:02 -0300 Subject: [PATCH 077/114] Fix: Windows/Linux CI hopefully fixed --- build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build b/build index 981c1128..fead08b5 160000 --- a/build +++ b/build @@ -1 +1 @@ -Subproject commit 981c1128b7a82600132dee23b71e5d9a4a082405 +Subproject commit fead08b595aeca15399f1fa8917280dd2ed92e70 From 5281a0b71f676f4e32fe7fbab4d5907352d1255e Mon Sep 17 00:00:00 2001 From: Henrique A Klein Date: Wed, 5 Feb 2025 10:09:14 -0300 Subject: [PATCH 078/114] Fix: CI build of Linux using strtol instead of __isoc23_strtol --- cmake/CommonBuildParameters.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmake/CommonBuildParameters.cmake b/cmake/CommonBuildParameters.cmake index e7b947af..2d120c2a 100644 --- a/cmake/CommonBuildParameters.cmake +++ b/cmake/CommonBuildParameters.cmake @@ -73,6 +73,11 @@ if(ANDROID OR IOS) ) endif() +if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GNU_SOURCE") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_GNU_SOURCE") +endif() + set(_CMAKE_COMMON_CACHE_ARGS -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_TESTING:BOOL=OFF From c27afd5711822745540e81291ef84b3f78139b0c Mon Sep 17 00:00:00 2001 From: Eduardo Menges Mattje Date: Mon, 3 Feb 2025 10:50:01 -0300 Subject: [PATCH 079/114] MSVC fix attempt --- libs/crypto3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/crypto3 b/libs/crypto3 index 4665b5a3..4f5e1e7a 160000 --- a/libs/crypto3 +++ b/libs/crypto3 @@ -1 +1 @@ -Subproject commit 4665b5a3a48e4151fb5fb16ab760df2d31898935 +Subproject commit 4f5e1e7a7d2e10ac213c1f9b29354d3ee5e6adae From 87ec3b4177b7c66e52973bc6d165bf500f5afa2b Mon Sep 17 00:00:00 2001 From: Henrique A Klein Date: Thu, 6 Feb 2025 08:51:33 -0300 Subject: [PATCH 080/114] Fix: Compiling MSVC circifier without custom boost throw that was causing linking issues --- libs/circifier | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/circifier b/libs/circifier index dd2fb602..adfe888d 160000 --- a/libs/circifier +++ b/libs/circifier @@ -1 +1 @@ -Subproject commit dd2fb60213bf5b67880788ddc1ab7c86feec3692 +Subproject commit adfe888d078ad9bbc8c87ea3828e97ffd2641c08 From eae53b6fd025939fbb2b9fb25f34ca30a323072a Mon Sep 17 00:00:00 2001 From: Henrique A Klein Date: Thu, 6 Feb 2025 13:14:26 -0300 Subject: [PATCH 081/114] WIP: Adding Applications folder back on the release, because we need it --- .github/workflows/cmake.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 66134d39..0651146f 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -752,7 +752,6 @@ jobs: cd ${{github.workspace}} tar --exclude='zkLLVM/build/iOS/Release/zkLLVM/src' \ --exclude='zkLLVM/build/iOS/Release/zkLLVM/tmp' \ - --exclude='zkLLVM/build/iOS/Release/zkLLVM/Applications' \ -czvf zkLLVM.tar.gz zkLLVM/ - name: Set Release Variables From ed770e1e9b07cda7f23b20088f8499cc60559dfe Mon Sep 17 00:00:00 2001 From: Eduardo Menges Mattje Date: Thu, 6 Feb 2025 10:13:11 -0300 Subject: [PATCH 082/114] Refactored CI script --- .github/workflows/cmake-android-arm7.yml | 150 ---- .github/workflows/cmake-android.yml | 150 ---- .github/workflows/cmake-ios.yml | 136 ---- .github/workflows/cmake.yml | 827 ++++------------------- build | 2 +- 5 files changed, 129 insertions(+), 1136 deletions(-) delete mode 100644 .github/workflows/cmake-android-arm7.yml delete mode 100644 .github/workflows/cmake-android.yml delete mode 100644 .github/workflows/cmake-ios.yml diff --git a/.github/workflows/cmake-android-arm7.yml b/.github/workflows/cmake-android-arm7.yml deleted file mode 100644 index bb9c80e7..00000000 --- a/.github/workflows/cmake-android-arm7.yml +++ /dev/null @@ -1,150 +0,0 @@ -name: Release Build CI - Android Arm7 Only -on: - workflow_dispatch: - -jobs: - Android-arm7: - runs-on: ubuntu-latest - env: - ANDROID_NDK_HOME: ${{github.workspace}}/android-ndk/android-ndk-r27b - ANDROID_TOOLCHAIN: ${{github.workspace}}/android-ndk/android-ndk-r27b/toolchains/llvm/prebuilt/linux-x86_64/bin - NDK_URL: "https://dl.google.com/android/repository/android-ndk-r27b-linux.zip" - CC: clang - - steps: - - name: Get branch name - id: branch-name - uses: tj-actions/branch-names@v6 - - - name: Set clang as the default compiler - run: | - sudo update-alternatives --install /usr/bin/cc cc $(which clang) 100 - sudo update-alternatives --install /usr/bin/c++ c++ $(which clang++) 100 - sudo update-alternatives --set cc $(which clang) - sudo update-alternatives --set c++ $(which clang++) - - - name: Install GitHub CLI - run: | - sudo apt install -y gh - - - name: Authenticate GitHub CLI - run: | - echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token - - - name: Define Release Tag - id: release-tag - run: echo "RELEASE_TAG=Android-armeabi-v7a-develop-Release" >> $GITHUB_ENV - - - name: Download Prebuilt Boost from Thirdparty - shell: bash - run: | - gh release download \ - --repo GeniusVentures/thirdparty \ - Android-develop-Release \ - --pattern Boost-lib.tar.gz - - - name: Ensure Directory Exists - run: | - mkdir -p ${{github.workspace}}/thirdparty/build/Android/Release/armeabi-v7a - - - name: Extract Prebuilt Boost - run: | - tar -xzvf Boost-lib.tar.gz -C ${{github.workspace}}/thirdparty/build/Android/Release/armeabi-v7a - - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 - with: - path: 'zkLLVM' - submodules: "recursive" - - - name: Download Android NDK - run: | - mkdir "${{github.workspace}}/android-ndk" - cd "${{github.workspace}}/android-ndk" - curl -o ndk.zip ${{ env.NDK_URL }} - unzip ndk.zip - rm ndk.zip - - - name: Create Build Directory - run: cmake -E make_directory ${{github.workspace}}/zkLLVM/build/Android/Release/armeabi-v7a - - - name: Configure CMake - working-directory: ${{github.workspace}}/zkLLVM/build/Android/Release/armeabi-v7a - run: | - export ANDROID_NDK=${{env.ANDROID_NDK_HOME}} - export ANDROID_NDK_HOME=${{env.ANDROID_NDK_HOME}} - export ANDROID_TOOLCHAIN=${{env.ANDROID_TOOLCHAIN}} - export PATH=${{env.ANDROID_TOOLCHAIN}}:$PATH - echo $PATH - echo $CC - ls -la $ANDROID_TOOLCHAIN - echo "Check clang path:" - which clang - env - cmake -S ../../ -DANDROID_ABI="armeabi-v7a" -DCMAKE_BUILD_TYPE=Release -DCMAKE_ANDROID_NDK=$ANDROID_NDK -DANDROID_TOOLCHAIN=clang -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty/ - - - name: Compile - working-directory: ${{github.workspace}}/zkLLVM/build/Android/Release/armeabi-v7a - run: make -j8 - - - name: Install - working-directory: ${{github.workspace}}/zkLLVM/build/Android/Release/armeabi-v7a - run: cmake --install . - - - name: Compressing Build Artifacts - working-directory: ${{github.workspace}}/zkLLVM - if: ${{ github.event_name == 'workflow_dispatch' }} - run: | - shopt -s extglob - rm -rf !(build) .[!.]* ..?* - cd build - rm -rf !(Android) .[!.]* ..?* - cd Android - rm -rf !(Release) .[!.]* ..?* - cd Release - rm -rf !(armeabi-v7a) .[!.]* ..?* - cd armeabi-v7a - rm -rf !(zkLLVM) .[!.]* ..?* - cd ${{github.workspace}} - tar --exclude='zkLLVM/build/Android/Release/zkLLVM/src' \ - --exclude='zkLLVM/build/Android/Release/zkLLVM/tmp' \ - -czvf zkLLVM.tar.gz zkLLVM/ - - - name: Set Release Variables - id: vars - if: ${{ github.event_name == 'workflow_dispatch' }} - run: | - OS_NAME=Android-armeabi-v7a - BRANCH_NAME=${GITHUB_REF#refs/heads/} - BUILD_TYPE=Release - FILE_NAME="${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}.tar.gz" - echo "RELEASE_TAG=${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}-${GITHUB_SHA::7}" >> $GITHUB_ENV - echo "RELEASE_NAME=${OS_NAME} ${BRANCH_NAME} ${BUILD_TYPE} (${GITHUB_SHA::7})" >> $GITHUB_ENV - echo "FILE_NAME=$FILE_NAME" >> $GITHUB_ENV - - - name: Rename Artifact - if: ${{ github.event_name == 'workflow_dispatch' }} - run: mv zkLLVM.tar.gz ${{ env.FILE_NAME }} - - - name: Create GitHub Release - if: ${{ github.event_name == 'workflow_dispatch' }} - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} - with: - tag_name: ${{ env.RELEASE_TAG }} - release_name: ${{ env.RELEASE_NAME }} - draft: false - prerelease: false - - - name: Upload Release Asset - if: ${{ github.event_name == 'workflow_dispatch' }} - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ${{ env.FILE_NAME }} - asset_name: ${{ env.FILE_NAME }} - asset_content_type: application/gzip \ No newline at end of file diff --git a/.github/workflows/cmake-android.yml b/.github/workflows/cmake-android.yml deleted file mode 100644 index c700a6c8..00000000 --- a/.github/workflows/cmake-android.yml +++ /dev/null @@ -1,150 +0,0 @@ -name: Release Build CI - Android Only -on: - workflow_dispatch: - -jobs: - Android-arm64: - runs-on: ubuntu-latest - env: - ANDROID_NDK_HOME: ${{github.workspace}}/android-ndk/android-ndk-r27b - ANDROID_TOOLCHAIN: ${{github.workspace}}/android-ndk/android-ndk-r27b/toolchains/llvm/prebuilt/linux-x86_64/bin - NDK_URL: "https://dl.google.com/android/repository/android-ndk-r27b-linux.zip" - CC: clang - - steps: - - name: Get branch name - id: branch-name - uses: tj-actions/branch-names@v6 - - - name: Set clang as the default compiler - run: | - sudo update-alternatives --install /usr/bin/cc cc $(which clang) 100 - sudo update-alternatives --install /usr/bin/c++ c++ $(which clang++) 100 - sudo update-alternatives --set cc $(which clang) - sudo update-alternatives --set c++ $(which clang++) - - - name: Install GitHub CLI - run: | - sudo apt install -y gh - - - name: Authenticate GitHub CLI - run: | - echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token - - - name: Define Release Tag - id: release-tag - run: echo "RELEASE_TAG=Android-arm64-v8a-develop-Release" >> $GITHUB_ENV - - - name: Download Prebuilt Boost from Thirdparty - shell: bash - run: | - gh release download \ - --repo GeniusVentures/thirdparty \ - Android-develop-Release \ - --pattern Boost-lib.tar.gz - - - name: Ensure Directory Exists - run: | - mkdir -p ${{github.workspace}}/thirdparty/build/Android/Release/arm64-v8a - - - name: Extract Prebuilt Boost - run: | - tar -xzvf Boost-lib.tar.gz -C ${{github.workspace}}/thirdparty/build/Android/Release/arm64-v8a - - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 - with: - path: 'zkLLVM' - submodules: "recursive" - - - name: Download Android NDK - run: | - mkdir "${{github.workspace}}/android-ndk" - cd "${{github.workspace}}/android-ndk" - curl -o ndk.zip ${{ env.NDK_URL }} - unzip ndk.zip - rm ndk.zip - - - name: Create Build Directory - run: cmake -E make_directory ${{github.workspace}}/zkLLVM/build/Android/Release/arm64-v8a - - - name: Configure CMake - working-directory: ${{github.workspace}}/zkLLVM/build/Android/Release/arm64-v8a - run: | - export ANDROID_NDK=${{env.ANDROID_NDK_HOME}} - export ANDROID_NDK_HOME=${{env.ANDROID_NDK_HOME}} - export ANDROID_TOOLCHAIN=${{env.ANDROID_TOOLCHAIN}} - export PATH=${{env.ANDROID_TOOLCHAIN}}:$PATH - echo $PATH - echo $CC - ls -la $ANDROID_TOOLCHAIN - echo "Check clang path:" - which clang - env - cmake -S ../../ -DANDROID_ABI="arm64-v8a" -DCMAKE_BUILD_TYPE=Release -DCMAKE_ANDROID_NDK=$ANDROID_NDK -DANDROID_TOOLCHAIN=clang -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty/ - - - name: Compile - working-directory: ${{github.workspace}}/zkLLVM/build/Android/Release/arm64-v8a - run: make -j8 - - - name: Install - working-directory: ${{github.workspace}}/zkLLVM/build/Android/Release/arm64-v8a - run: cmake --install . - - - name: Compressing Build Artifacts - working-directory: ${{github.workspace}}/zkLLVM - if: ${{ github.event_name == 'workflow_dispatch' }} - run: | - shopt -s extglob - rm -rf !(build) .[!.]* ..?* - cd build - rm -rf !(Android) .[!.]* ..?* - cd Android - rm -rf !(Release) .[!.]* ..?* - cd Release - rm -rf !(arm64-v8a) .[!.]* ..?* - cd arm64-v8a - rm -rf !(zkLLVM) .[!.]* ..?* - cd ${{github.workspace}} - tar --exclude='zkLLVM/build/Android/Release/zkLLVM/src' \ - --exclude='zkLLVM/build/Android/Release/zkLLVM/tmp' \ - -czvf zkLLVM.tar.gz zkLLVM/ - - - name: Set Release Variables - id: vars - if: ${{ github.event_name == 'workflow_dispatch' }} - run: | - OS_NAME=Android-arm64-v8a - BRANCH_NAME=${GITHUB_REF#refs/heads/} - BUILD_TYPE=Release - FILE_NAME="${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}.tar.gz" - echo "RELEASE_TAG=${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}-${GITHUB_SHA::7}" >> $GITHUB_ENV - echo "RELEASE_NAME=${OS_NAME} ${BRANCH_NAME} ${BUILD_TYPE} (${GITHUB_SHA::7})" >> $GITHUB_ENV - echo "FILE_NAME=$FILE_NAME" >> $GITHUB_ENV - - - name: Rename Artifact - if: ${{ github.event_name == 'workflow_dispatch' }} - run: mv zkLLVM.tar.gz ${{ env.FILE_NAME }} - - - name: Create GitHub Release - if: ${{ github.event_name == 'workflow_dispatch' }} - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} - with: - tag_name: ${{ env.RELEASE_TAG }} - release_name: ${{ env.RELEASE_NAME }} - draft: false - prerelease: false - - - name: Upload Release Asset - if: ${{ github.event_name == 'workflow_dispatch' }} - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ${{ env.FILE_NAME }} - asset_name: ${{ env.FILE_NAME }} - asset_content_type: application/gzip \ No newline at end of file diff --git a/.github/workflows/cmake-ios.yml b/.github/workflows/cmake-ios.yml deleted file mode 100644 index ffaf6c25..00000000 --- a/.github/workflows/cmake-ios.yml +++ /dev/null @@ -1,136 +0,0 @@ -name: Release Build CI - iOS Only -on: - workflow_dispatch: - -jobs: - iOS: - runs-on: macos-latest - steps: - - name: Get branch name - id: branch-name - uses: tj-actions/branch-names@v6 - - - name: Install GitHub CLI - run: | - brew install gh - - - name: Authenticate GitHub CLI - run: | - echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token - - - name: Define Release Tag - id: release-tag - run: echo "RELEASE_TAG=iOS-develop-Release" >> $GITHUB_ENV - - - name: Download Prebuilt Boost from Thirdparty - shell: bash - run: | - gh release download \ - --repo GeniusVentures/thirdparty \ - iOS-develop-Release \ - --pattern Boost-lib.tar.gz - - - name: Ensure Directory Exists - run: | - mkdir -p ${{github.workspace}}/thirdparty/build/iOS/Release - - - name: Extract Prebuilt Boost - run: | - tar -xzvf Boost-lib.tar.gz -C ${{github.workspace}}/thirdparty/build/iOS/Release - - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 - with: - path: 'zkLLVM' - submodules: "recursive" - - - name: Install Ninja - run: | - brew install ccache ninja - echo "CMAKE_GENERATOR=Ninja" >> $GITHUB_ENV - - - name: Add iOS toolchain - run: | - rustup toolchain install nightly-aarch64-apple-darwin - rustup component add rust-src --toolchain nightly-aarch64-apple-darwin - rustup target add aarch64-apple-ios - - - name: Create Build Directory - run: cmake -E make_directory ${{github.workspace}}/zkLLVM/build/iOS/Release - - - name: Configure CMake - working-directory: ${{github.workspace}}/zkLLVM/build/iOS/Release - run: cmake -S .. -DCMAKE_BUILD_TYPE=Release -DPLATFORM=OS64 -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty/ - - - name: Compile - working-directory: ${{github.workspace}}/zkLLVM/build/iOS/Release - run: cmake --build . -j --config Release - - - name: Install - working-directory: ${{github.workspace}}/zkLLVM/build/iOS/Release - run: cmake --install . - - - name: Compressing Build Artifacts - working-directory: ${{github.workspace}}/zkLLVM - if: ${{ github.event_name == 'workflow_dispatch' }} - run: | - shopt -s extglob - rm -rf !(build) .[!.]* ..?* - cd build - rm -rf !(iOS) .[!.]* ..?* - cd iOS - rm -rf !(Release) .[!.]* ..?* - cd Release - rm -rf !(zkLLVM) .[!.]* ..?* - cd ${{github.workspace}} - tar --exclude='zkLLVM/build/iOS/Release/zkLLVM/src' \ - --exclude='zkLLVM/build/iOS/Release/zkLLVM/tmp' \ - --exclude='zkLLVM/build/iOS/Release/zkLLVM/Applications' \ - -czvf zkLLVM.tar.gz zkLLVM/ - - - name: Validate Artifact Size - run: | - if [ $(stat -c%s "zkLLVM.tar.gz") -ge $((2 * 1024 * 1024 * 1024)) ]; then - echo "Artifact exceeds 2GB limit! Exiting." - exit 1 - fi - - - name: Set Release Variables - id: vars - if: ${{ github.event_name == 'workflow_dispatch' }} - run: | - OS_NAME=iOS - BRANCH_NAME=${GITHUB_REF#refs/heads/} - BUILD_TYPE=Release - FILE_NAME="${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}.tar.gz" - echo "RELEASE_TAG=${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}-${GITHUB_SHA::7}" >> $GITHUB_ENV - echo "RELEASE_NAME=${OS_NAME} ${BRANCH_NAME} ${BUILD_TYPE} (${GITHUB_SHA::7})" >> $GITHUB_ENV - echo "FILE_NAME=$FILE_NAME" >> $GITHUB_ENV - - - name: Rename Artifact - if: ${{ github.event_name == 'workflow_dispatch' }} - run: mv zkLLVM.tar.gz ${{ env.FILE_NAME }} - - - name: Create GitHub Release - if: ${{ github.event_name == 'workflow_dispatch' }} - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} - with: - tag_name: ${{ env.RELEASE_TAG }} - release_name: ${{ env.RELEASE_NAME }} - draft: false - prerelease: false - - - name: Upload Release Asset - if: ${{ github.event_name == 'workflow_dispatch' }} - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ${{ env.FILE_NAME }} - asset_name: ${{ env.FILE_NAME }} - asset_content_type: application/gzip - diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 0651146f..d4788a4f 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -2,773 +2,203 @@ name: Release Build CI # Controls when the workflow will run # Triggers the workflow on push or pull request events and manually from the Actions tab -on: +on: push: - branches: + branches: - develop - main pull_request: - branches: + branches: - develop - main workflow_dispatch: -jobs: - Windows: - runs-on: windows-latest - steps: - - name: Get branch name - id: branch-name - uses: tj-actions/branch-names@v6 - - - name: Install Windows host dependencies - run: | - choco install ccache -A - - - name: Install GitHub CLI - run: | - choco install gh - - - name: Authenticate GitHub CLI - run: | - echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token - - - name: Define Release Tag - id: release-tag - run: echo "RELEASE_TAG=Windows-develop-Release" >> $GITHUB_ENV - - - name: Download Prebuilt Boost from Thirdparty - shell: bash - run: | - gh release download \ - --repo GeniusVentures/thirdparty \ - Windows-develop-Release \ - --pattern Boost-lib.tar.gz - - - name: Ensure Directory Exists - run: | - mkdir -p ${{github.workspace}}/thirdparty/build/Windows/Release - - - name: Extract Prebuilt Boost - run: | - tar -xzvf Boost-lib.tar.gz -C ${{github.workspace}}/thirdparty/build/Windows/Release - - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - name: Checkout zkLLVM repository - uses: actions/checkout@v3 - with: - path: 'zkLLVM' - submodules: "recursive" - - - name: Create Build Directory - run: cmake -E make_directory ${{github.workspace}}/zkLLVM/build/Windows/Release - - - name: Configure CMake - working-directory: ${{github.workspace}}/zkLLVM/build/Windows/Release - run: cmake -S .. -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty/ - - - name: Compile - working-directory: ${{github.workspace}}/zkLLVM/build/Windows/Release - run: cmake --build . --config Release -j - - - name: Create install directory - working-directory: ${{github.workspace}}/zkLLVM/build/Windows/Release - run: cmake --install . - - - name: Compressing Build Artifacts - working-directory: ${{github.workspace}}/zkLLVM - if: ${{ github.event_name == 'workflow_dispatch' }} - run: | - shopt -s extglob - rm -rf !(build) .[!.]* ..?* - cd build - rm -rf !(Windows) .[!.]* ..?* - cd Windows - rm -rf !(Release) .[!.]* ..?* - cd Release - rm -rf !(zkLLVM) .[!.]* ..?* - cd $GITHUB_WORKSPACE - tar --exclude='zkLLVM/build/Windows/Release/zkLLVM/src' \ - --exclude='zkLLVM/build/Windows/Release/zkLLVM/tmp' \ - -czvf zkLLVM.tar.gz zkLLVM/ - shell: bash - - - - name: Set Release Variables - id: vars - if: ${{ github.event_name == 'workflow_dispatch' }} - run: | - OS_NAME=Windows - BRANCH_NAME=${GITHUB_REF#refs/heads/} - BUILD_TYPE=Release - FILE_NAME="${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}.tar.gz" - echo "RELEASE_TAG=${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}-${GITHUB_SHA::7}" >> $GITHUB_ENV - echo "RELEASE_NAME=${OS_NAME} ${BRANCH_NAME} ${BUILD_TYPE} (${GITHUB_SHA::7})" >> $GITHUB_ENV - echo "FILE_NAME=$FILE_NAME" >> $GITHUB_ENV - shell: bash - - - name: Rename Artifact - if: ${{ github.event_name == 'workflow_dispatch' }} - run: mv zkLLVM.tar.gz ${{ env.FILE_NAME }} - shell: bash - - - name: Create GitHub Release - if: ${{ github.event_name == 'workflow_dispatch' }} - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} - with: - tag_name: ${{ env.RELEASE_TAG }} - release_name: ${{ env.RELEASE_NAME }} - draft: false - prerelease: false - - - name: Upload Release Asset - if: ${{ github.event_name == 'workflow_dispatch' }} - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ${{ env.FILE_NAME }} - asset_name: ${{ env.FILE_NAME }} - asset_content_type: application/gzip - - Linux: - runs-on: ubuntu-latest +jobs: + build: + env: + GH_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} + runs-on: ${{matrix.host}} + strategy: + fail-fast: false + matrix: + target: [Android, iOS, OSX, Linux, Windows] + build-type: [Release] + abi: [""] + include: + - target: Android + host: ubuntu-latest + abi: arm64-v8a + build-type: Release + - target: Android + host: ubuntu-latest + abi: armeabi-v7a + build-type: Release + - target: iOS + host: macos-latest + - target: OSX + host: macos-latest + - target: Linux + host: ubuntu-latest + - target: Windows + host: windows-latest + exclude: + - target: Android + abi: "" steps: - - name: Get branch name - id: branch-name - uses: tj-actions/branch-names@v6 - - - name: Set clang as the default compiler + - name: Configure Linux host + if: ${{ runner.os == 'Linux'}} run: | sudo update-alternatives --install /usr/bin/cc cc $(which clang) 100 sudo update-alternatives --install /usr/bin/c++ c++ $(which clang++) 100 sudo update-alternatives --set cc $(which clang) sudo update-alternatives --set c++ $(which clang++) - - name: Install Linux host dependencies - run: | sudo apt install ccache ninja-build -y - sudo apt install vulkan-tools libvulkan-dev -y echo "CMAKE_GENERATOR=Ninja" >> $GITHUB_ENV - - name: Install GitHub CLI - run: | - sudo apt install -y gh - - - name: Authenticate GitHub CLI - run: | - echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token - - - name: Define Release Tag - id: release-tag - run: echo "RELEASE_TAG=Linux-develop-Release" >> $GITHUB_ENV - - - name: Download Prebuilt Boost from Thirdparty - shell: bash - run: | - gh release download \ - --repo GeniusVentures/thirdparty \ - Linux-develop-Release \ - --pattern Boost-lib.tar.gz - - - name: Ensure Directory Exists + - name: Configure Windows host + if: ${{ runner.os == 'Windows'}} run: | - mkdir -p ${{github.workspace}}/thirdparty/build/Linux/Release + choco install ccache -y - - name: Extract Prebuilt Boost + - name: Configure macOS host + if: ${{ runner.os == 'macOS'}} run: | - tar -xzvf Boost-lib.tar.gz -C ${{github.workspace}}/thirdparty/build/Linux/Release - - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 - with: - path: 'zkLLVM' - submodules: "recursive" - - - name: Create Build Directory - run: cmake -E make_directory ${{github.workspace}}/zkLLVM/build/Linux/Release - - - name: Configure CMake - working-directory: ${{github.workspace}}/zkLLVM/build/Linux/Release - run: cmake -S .. -DCMAKE_BUILD_TYPE=Release -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty/ - - - name: Compile - working-directory: ${{github.workspace}}/zkLLVM/build/Linux/Release - run: cmake --build . --config Release -j + brew install ccache ninja bash + echo "CMAKE_GENERATOR=Ninja" >> $GITHUB_ENV - - name: Install - working-directory: ${{github.workspace}}/zkLLVM/build/Linux/Release - run: cmake --install . - - - name: Compressing Build Artifacts - working-directory: ${{github.workspace}}/zkLLVM - if: ${{ github.event_name == 'workflow_dispatch' }} + - name: Add Android toolchain + if: ${{ matrix.target == 'Android' }} run: | - shopt -s extglob - rm -rf !(build) .[!.]* ..?* - cd build - rm -rf !(Linux) .[!.]* ..?* - cd Linux - rm -rf !(Release) .[!.]* ..?* - cd Release - rm -rf !(zkLLVM) .[!.]* ..?* - cd ${{github.workspace}} - tar --exclude='zkLLVM/build/Linux/Release/zkLLVM/src' \ - --exclude='zkLLVM/build/Linux/Release/zkLLVM/tmp' \ - -czvf zkLLVM.tar.gz zkLLVM/ - - - name: Set Release Variables - id: vars - if: ${{ github.event_name == 'workflow_dispatch' }} - run: | - OS_NAME=Linux - BRANCH_NAME=${GITHUB_REF#refs/heads/} - BUILD_TYPE=Release - FILE_NAME="${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}.tar.gz" - echo "RELEASE_TAG=${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}-${GITHUB_SHA::7}" >> $GITHUB_ENV - echo "RELEASE_NAME=${OS_NAME} ${BRANCH_NAME} ${BUILD_TYPE} (${GITHUB_SHA::7})" >> $GITHUB_ENV - echo "FILE_NAME=$FILE_NAME" >> $GITHUB_ENV - - - name: Rename Artifact - if: ${{ github.event_name == 'workflow_dispatch' }} - run: mv zkLLVM.tar.gz ${{ env.FILE_NAME }} - - - name: Create GitHub Release - if: ${{ github.event_name == 'workflow_dispatch' }} - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} - with: - tag_name: ${{ env.RELEASE_TAG }} - release_name: ${{ env.RELEASE_NAME }} - draft: false - prerelease: false - - - name: Upload Release Asset - if: ${{ github.event_name == 'workflow_dispatch' }} - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ${{ env.FILE_NAME }} - asset_name: ${{ env.FILE_NAME }} - asset_content_type: application/gzip - - Android-arm64: - runs-on: ubuntu-latest - env: - ANDROID_NDK_HOME: ${{github.workspace}}/android-ndk/android-ndk-r27b - ANDROID_TOOLCHAIN: ${{github.workspace}}/android-ndk/android-ndk-r27b/toolchains/llvm/prebuilt/linux-x86_64/bin - NDK_URL: "https://dl.google.com/android/repository/android-ndk-r27b-linux.zip" - CC: clang - - steps: - - name: Get branch name - id: branch-name - uses: tj-actions/branch-names@v6 + NDK_VERSION="r27b" + wget https://dl.google.com/android/repository/android-ndk-$NDK_VERSION-linux.zip -O ndk.zip + unzip ndk.zip -d $HOME - - name: Set clang as the default compiler - run: | - sudo update-alternatives --install /usr/bin/cc cc $(which clang) 100 - sudo update-alternatives --install /usr/bin/c++ c++ $(which clang++) 100 - sudo update-alternatives --set cc $(which clang) - sudo update-alternatives --set c++ $(which clang++) - - - name: Install GitHub CLI - run: | - sudo apt install -y gh + echo "ANDROID_NDK_HOME=$HOME/android-ndk-$NDK_VERSION" >> $GITHUB_ENV - - name: Authenticate GitHub CLI + - name: Set build directory run: | - echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token + if [ '${{matrix.abi}}' ]; then + BUILD_DIRECTORY=build/${{matrix.target}}/${{matrix.build-type}}/${{matrix.abi}} + else + BUILD_DIRECTORY=build/${{matrix.target}}/${{matrix.build-type}} + fi + echo "BUILD_DIRECTORY=$BUILD_DIRECTORY" >> $GITHUB_ENV + shell: bash - name: Define Release Tag - id: release-tag - run: echo "RELEASE_TAG=Android-arm64-v8a-develop-Release" >> $GITHUB_ENV - - - name: Download Prebuilt Boost from Thirdparty shell: bash run: | - gh release download \ - --repo GeniusVentures/thirdparty \ - Android-develop-Release \ - --pattern Boost-lib.tar.gz - - - name: Ensure Directory Exists - run: | - mkdir -p ${{github.workspace}}/thirdparty/build/Android/Release/arm64-v8a - - - name: Extract Prebuilt Boost - run: | - tar -xzvf Boost-lib.tar.gz -C ${{github.workspace}}/thirdparty/build/Android/Release/arm64-v8a - - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 - with: - path: 'zkLLVM' - submodules: "recursive" - - - name: Download Android NDK - run: | - mkdir "${{github.workspace}}/android-ndk" - cd "${{github.workspace}}/android-ndk" - curl -o ndk.zip ${{ env.NDK_URL }} - unzip ndk.zip - rm ndk.zip - - - name: Create Build Directory - run: cmake -E make_directory ${{github.workspace}}/zkLLVM/build/Android/Release/arm64-v8a - - - name: Configure CMake - working-directory: ${{github.workspace}}/zkLLVM/build/Android/Release/arm64-v8a - run: | - export ANDROID_NDK=${{env.ANDROID_NDK_HOME}} - export ANDROID_NDK_HOME=${{env.ANDROID_NDK_HOME}} - export ANDROID_TOOLCHAIN=${{env.ANDROID_TOOLCHAIN}} - export PATH=${{env.ANDROID_TOOLCHAIN}}:$PATH - echo $PATH - echo $CC - ls -la $ANDROID_TOOLCHAIN - echo "Check clang path:" - which clang - env - cmake -S ../../ -DANDROID_ABI="arm64-v8a" -DCMAKE_BUILD_TYPE=Release -DCMAKE_ANDROID_NDK=$ANDROID_NDK -DANDROID_TOOLCHAIN=clang -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty/ - - - name: Compile - working-directory: ${{github.workspace}}/zkLLVM/build/Android/Release/arm64-v8a - run: make -j8 - - - name: Install - working-directory: ${{github.workspace}}/zkLLVM/build/Android/Release/arm64-v8a - run: cmake --install . - - - name: Compressing Build Artifacts - working-directory: ${{github.workspace}}/zkLLVM - if: ${{ github.event_name == 'workflow_dispatch' }} - run: | - shopt -s extglob - rm -rf !(build) .[!.]* ..?* - cd build - rm -rf !(Android) .[!.]* ..?* - cd Android - rm -rf !(Release) .[!.]* ..?* - cd Release - rm -rf !(arm64-v8a) .[!.]* ..?* - cd arm64-v8a - rm -rf !(zkLLVM) .[!.]* ..?* - cd ${{github.workspace}} - tar --exclude='zkLLVM/build/Android/Release/zkLLVM/src' \ - --exclude='zkLLVM/build/Android/Release/zkLLVM/tmp' \ - -czvf zkLLVM.tar.gz zkLLVM/ - - - name: Set Release Variables - id: vars - if: ${{ github.event_name == 'workflow_dispatch' }} - run: | - OS_NAME=Android-arm64-v8a - BRANCH_NAME=${GITHUB_REF#refs/heads/} - BUILD_TYPE=Release - FILE_NAME="${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}.tar.gz" - echo "RELEASE_TAG=${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}-${GITHUB_SHA::7}" >> $GITHUB_ENV - echo "RELEASE_NAME=${OS_NAME} ${BRANCH_NAME} ${BUILD_TYPE} (${GITHUB_SHA::7})" >> $GITHUB_ENV - echo "FILE_NAME=$FILE_NAME" >> $GITHUB_ENV - - - name: Rename Artifact - if: ${{ github.event_name == 'workflow_dispatch' }} - run: mv zkLLVM.tar.gz ${{ env.FILE_NAME }} - - - name: Create GitHub Release - if: ${{ github.event_name == 'workflow_dispatch' }} - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} - with: - tag_name: ${{ env.RELEASE_TAG }} - release_name: ${{ env.RELEASE_NAME }} - draft: false - prerelease: false - - - name: Upload Release Asset - if: ${{ github.event_name == 'workflow_dispatch' }} - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ${{ env.FILE_NAME }} - asset_name: ${{ env.FILE_NAME }} - asset_content_type: application/gzip - - Android-arm7: - runs-on: ubuntu-latest - env: - ANDROID_NDK_HOME: ${{github.workspace}}/android-ndk/android-ndk-r27b - ANDROID_TOOLCHAIN: ${{github.workspace}}/android-ndk/android-ndk-r27b/toolchains/llvm/prebuilt/linux-x86_64/bin - NDK_URL: "https://dl.google.com/android/repository/android-ndk-r27b-linux.zip" - CC: clang - - steps: - - name: Get branch name - id: branch-name - uses: tj-actions/branch-names@v6 - - - name: Set clang as the default compiler - run: | - sudo update-alternatives --install /usr/bin/cc cc $(which clang) 100 - sudo update-alternatives --install /usr/bin/c++ c++ $(which clang++) 100 - sudo update-alternatives --set cc $(which clang) - sudo update-alternatives --set c++ $(which clang++) - - - name: Install GitHub CLI - run: | - sudo apt install -y gh + if [ '${{matrix.abi}}' ]; then + RELEASE_TAG='${{matrix.target}}-${{matrix.abi}}-${{ github.ref_name }}-${{matrix.build-type}}' + else + RELEASE_TAG='${{matrix.target}}-${{ github.ref_name }}-${{matrix.build-type}}' + fi - - name: Authenticate GitHub CLI - run: | - echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token - - - name: Define Release Tag - id: release-tag - run: echo "RELEASE_TAG=Android-armeabi-v7a-develop-Release" >> $GITHUB_ENV + echo "RELEASE_TAG=${RELEASE_TAG}" >> $GITHUB_ENV - name: Download Prebuilt Boost from Thirdparty shell: bash run: | + if [ '${{matrix.abi}}' ]; then + thirdparty_tag='${{matrix.target}}-${{matrix.abi}}-develop-${{matrix.build-type}}' + else + thirdparty_tag='${{matrix.target}}-develop-${{matrix.build-type}}' + fi + gh release download \ --repo GeniusVentures/thirdparty \ - Android-develop-Release \ + ${thirdparty_tag} \ --pattern Boost-lib.tar.gz - - name: Ensure Directory Exists - run: | - mkdir -p ${{github.workspace}}/thirdparty/build/Android/Release/armeabi-v7a + mkdir -p ${{github.workspace}}/thirdparty/${{env.BUILD_DIRECTORY}} - - name: Extract Prebuilt Boost + - name: Extract Boost run: | - tar -xzvf Boost-lib.tar.gz -C ${{github.workspace}}/thirdparty/build/Android/Release/armeabi-v7a + mkdir -p thirdparty/${{env.BUILD_DIRECTORY}} + tar -xzf Boost-lib.tar.gz -C thirdparty/${{env.BUILD_DIRECTORY}} - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v4 with: - path: 'zkLLVM' + path: "zkLLVM" submodules: "recursive" - - - name: Download Android NDK - run: | - mkdir "${{github.workspace}}/android-ndk" - cd "${{github.workspace}}/android-ndk" - curl -o ndk.zip ${{ env.NDK_URL }} - unzip ndk.zip - rm ndk.zip - - - name: Create Build Directory - run: cmake -E make_directory ${{github.workspace}}/zkLLVM/build/Android/Release/armeabi-v7a - - - name: Configure CMake - working-directory: ${{github.workspace}}/zkLLVM/build/Android/Release/armeabi-v7a - run: | - export ANDROID_NDK=${{env.ANDROID_NDK_HOME}} - export ANDROID_NDK_HOME=${{env.ANDROID_NDK_HOME}} - export ANDROID_TOOLCHAIN=${{env.ANDROID_TOOLCHAIN}} - export PATH=${{env.ANDROID_TOOLCHAIN}}:$PATH - echo $PATH - echo $CC - ls -la $ANDROID_TOOLCHAIN - echo "Check clang path:" - which clang - env - cmake -S ../../ -DANDROID_ABI="armeabi-v7a" -DCMAKE_BUILD_TYPE=Release -DCMAKE_ANDROID_NDK=$ANDROID_NDK -DANDROID_TOOLCHAIN=clang -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty/ - - - name: Compile - working-directory: ${{github.workspace}}/zkLLVM/build/Android/Release/armeabi-v7a - run: make -j8 - - - name: Install - working-directory: ${{github.workspace}}/zkLLVM/build/Android/Release/armeabi-v7a - run: cmake --install . - - - name: Compressing Build Artifacts - working-directory: ${{github.workspace}}/zkLLVM - if: ${{ github.event_name == 'workflow_dispatch' }} - run: | - shopt -s extglob - rm -rf !(build) .[!.]* ..?* - cd build - rm -rf !(Android) .[!.]* ..?* - cd Android - rm -rf !(Release) .[!.]* ..?* - cd Release - rm -rf !(armeabi-v7a) .[!.]* ..?* - cd armeabi-v7a - rm -rf !(zkLLVM) .[!.]* ..?* - cd ${{github.workspace}} - tar --exclude='zkLLVM/build/Android/Release/zkLLVM/src' \ - --exclude='zkLLVM/build/Android/Release/zkLLVM/tmp' \ - -czvf zkLLVM.tar.gz zkLLVM/ - - - name: Set Release Variables - id: vars - if: ${{ github.event_name == 'workflow_dispatch' }} - run: | - OS_NAME=Android-armeabi-v7a - BRANCH_NAME=${GITHUB_REF#refs/heads/} - BUILD_TYPE=Release - FILE_NAME="${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}.tar.gz" - echo "RELEASE_TAG=${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}-${GITHUB_SHA::7}" >> $GITHUB_ENV - echo "RELEASE_NAME=${OS_NAME} ${BRANCH_NAME} ${BUILD_TYPE} (${GITHUB_SHA::7})" >> $GITHUB_ENV - echo "FILE_NAME=$FILE_NAME" >> $GITHUB_ENV - - - name: Rename Artifact - if: ${{ github.event_name == 'workflow_dispatch' }} - run: mv zkLLVM.tar.gz ${{ env.FILE_NAME }} - - - name: Create GitHub Release - if: ${{ github.event_name == 'workflow_dispatch' }} - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} - with: - tag_name: ${{ env.RELEASE_TAG }} - release_name: ${{ env.RELEASE_NAME }} - draft: false - prerelease: false - - - name: Upload Release Asset - if: ${{ github.event_name == 'workflow_dispatch' }} - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ${{ env.FILE_NAME }} - asset_name: ${{ env.FILE_NAME }} - asset_content_type: application/gzip - - MacOS: - runs-on: macos-latest - steps: - - name: Get branch name - id: branch-name - uses: tj-actions/branch-names@v6 - - - name: Install GitHub CLI - run: | - brew install gh - - - name: Authenticate GitHub CLI - run: | - echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token - - - name: Define Release Tag - id: release-tag - run: echo "RELEASE_TAG=OSX-develop-Release" >> $GITHUB_ENV - - - name: Download Prebuilt Boost from Thirdparty - shell: bash - run: | - gh release download \ - --repo GeniusVentures/thirdparty \ - OSX-develop-Release \ - --pattern Boost-lib.tar.gz - - name: Ensure Directory Exists - run: | - mkdir -p ${{github.workspace}}/thirdparty/build/OSX/Release + - name: Configure CMake for Android + if: ${{ matrix.target == 'Android'}} + working-directory: ${{github.workspace}}/zkLLVM + run: cmake -S build/${{matrix.target}} -B $BUILD_DIRECTORY -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty -DANDROID_ABI=${{matrix.abi}} -DCMAKE_ANDROID_NDK=${ANDROID_NDK_HOME} - - name: Extract Prebuilt Boost - run: | - tar -xzvf Boost-lib.tar.gz -C ${{github.workspace}}/thirdparty/build/OSX/Release + - name: Configure CMake for iOS + if: ${{ matrix.target == 'iOS'}} + working-directory: ${{github.workspace}}/zkLLVM + run: cmake -S build/${{matrix.target}} -B $BUILD_DIRECTORY -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty -DPLATFORM=OS64 - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 - with: - path: 'zkLLVM' - submodules: "recursive" - - # Workaround for arm64 build - - name: Ensure latest macOS SDK is used - run: | - sudo xcode-select --switch "$(find /Applications -mindepth 1 -maxdepth 1 ! -type l | grep "Xcode_[\.0-9]*app" | sort -V | tail -1)/Contents/Developer" - sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/* + - name: Configure CMake for Mac + if: ${{ matrix.target == 'OSX'}} + working-directory: ${{github.workspace}}/zkLLVM + run: cmake -S build/${{matrix.target}} -B $BUILD_DIRECTORY -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty -DPLATFORM=MAC_UNIVERSAL - - name: Create Build Directory - run: cmake -E make_directory ${{github.workspace}}/zkLLVM/build/OSX/Release + - name: Configure CMake for Linux + if: ${{ matrix.target == 'Linux' }} + working-directory: ${{github.workspace}}/zkLLVM + run: cmake -S build/${{matrix.target}} -B $BUILD_DIRECTORY -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty - - name: Configure CMake - working-directory: ${{github.workspace}}/zkLLVM/build/OSX/Release - run: cmake -S .. -DCMAKE_BUILD_TYPE=Release -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty/ + - name: Configure CMake for Windows + if: ${{ matrix.target == 'Windows' }} + working-directory: ${{github.workspace}}/zkLLVM + run: cmake -S build/${{matrix.target}} -B $env:BUILD_DIRECTORY -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty -G "Visual Studio 17 2022" -A x64 - - name: Compile - working-directory: ${{github.workspace}}/zkLLVM/build/OSX/Release - run: make -j8 + - name: Build + working-directory: ${{github.workspace}}/zkLLVM + run: cmake --build ${{env.BUILD_DIRECTORY}} --config ${{matrix.build-type}} -j - name: Install - working-directory: ${{github.workspace}}/zkLLVM/build/OSX/Release + working-directory: ${{github.workspace}}/zkLLVM/${{env.BUILD_DIRECTORY}} run: cmake --install . - + - name: Compressing Build Artifacts working-directory: ${{github.workspace}}/zkLLVM - if: ${{ github.event_name == 'workflow_dispatch' }} - run: | - shopt -s extglob - rm -rf !(build) .[!.]* ..?* - cd build - rm -rf !(OSX) .[!.]* ..?* - cd OSX - rm -rf !(Release) .[!.]* ..?* - cd Release - rm -rf !(zkLLVM) .[!.]* ..?* - cd ${{github.workspace}} - tar --exclude='zkLLVM/build/OSX/Release/zkLLVM/src' \ - --exclude='zkLLVM/build/OSX/Release/zkLLVM/tmp' \ - -czvf zkLLVM.tar.gz zkLLVM/ - - - name: Set Release Variables - id: vars - if: ${{ github.event_name == 'workflow_dispatch' }} - run: | - OS_NAME=OSX - BRANCH_NAME=${GITHUB_REF#refs/heads/} - BUILD_TYPE=Release - FILE_NAME="${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}.tar.gz" - echo "RELEASE_TAG=${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}-${GITHUB_SHA::7}" >> $GITHUB_ENV - echo "RELEASE_NAME=${OS_NAME} ${BRANCH_NAME} ${BUILD_TYPE} (${GITHUB_SHA::7})" >> $GITHUB_ENV - echo "FILE_NAME=$FILE_NAME" >> $GITHUB_ENV - - - name: Rename Artifact - if: ${{ github.event_name == 'workflow_dispatch' }} - run: mv zkLLVM.tar.gz ${{ env.FILE_NAME }} - - - name: Create GitHub Release - if: ${{ github.event_name == 'workflow_dispatch' }} - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} - with: - tag_name: ${{ env.RELEASE_TAG }} - release_name: ${{ env.RELEASE_NAME }} - draft: false - prerelease: false - - - name: Upload Release Asset - if: ${{ github.event_name == 'workflow_dispatch' }} - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ${{ env.FILE_NAME }} - asset_name: ${{ env.FILE_NAME }} - asset_content_type: application/gzip - - iOS: - runs-on: macos-latest - steps: - - name: Get branch name - id: branch-name - uses: tj-actions/branch-names@v6 - - - name: Install GitHub CLI - run: | - brew install gh - - - name: Authenticate GitHub CLI - run: | - echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token - - - name: Define Release Tag - id: release-tag - run: echo "RELEASE_TAG=iOS-develop-Release" >> $GITHUB_ENV - - - name: Download Prebuilt Boost from Thirdparty + if: ${{github.event_name == 'workflow_dispatch'}} shell: bash run: | - gh release download \ - --repo GeniusVentures/thirdparty \ - iOS-develop-Release \ - --pattern Boost-lib.tar.gz - - - name: Ensure Directory Exists - run: | - mkdir -p ${{github.workspace}}/thirdparty/build/iOS/Release + shopt -s extglob - - name: Extract Prebuilt Boost - run: | - tar -xzvf Boost-lib.tar.gz -C ${{github.workspace}}/thirdparty/build/iOS/Release + IFS='/' read -ra dirs <<< "$BUILD_DIRECTORY" - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 - with: - path: 'zkLLVM' - submodules: "recursive" + for dir in "${dirs[@]}"; do + rm -rf !($dir) .[!.]* ..?* + cd $dir + done - - name: Install Ninja - run: | - brew install ccache ninja - echo "CMAKE_GENERATOR=Ninja" >> $GITHUB_ENV - - - name: Add iOS toolchain - run: | - rustup toolchain install nightly-aarch64-apple-darwin - rustup component add rust-src --toolchain nightly-aarch64-apple-darwin - rustup target add aarch64-apple-ios - - - name: Create Build Directory - run: cmake -E make_directory ${{github.workspace}}/zkLLVM/build/iOS/Release - - - name: Configure CMake - working-directory: ${{github.workspace}}/zkLLVM/build/iOS/Release - run: cmake -S .. -DCMAKE_BUILD_TYPE=Release -DPLATFORM=OS64 -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty/ - - - name: Compile - working-directory: ${{github.workspace}}/zkLLVM/build/iOS/Release - run: cmake --build . -j --config Release - - - name: Install - working-directory: ${{github.workspace}}/zkLLVM/build/iOS/Release - run: cmake --install . - - - name: Compressing Build Artifacts - working-directory: ${{github.workspace}}/zkLLVM - if: ${{ github.event_name == 'workflow_dispatch' }} - run: | - shopt -s extglob - rm -rf !(build) .[!.]* ..?* - cd build - rm -rf !(iOS) .[!.]* ..?* - cd iOS - rm -rf !(Release) .[!.]* ..?* - cd Release - rm -rf !(zkLLVM) .[!.]* ..?* - cd ${{github.workspace}} - tar --exclude='zkLLVM/build/iOS/Release/zkLLVM/src' \ - --exclude='zkLLVM/build/iOS/Release/zkLLVM/tmp' \ + cd $GITHUB_WORKSPACE + tar --exclude='zkLLVM/build/Windows/Release/zkLLVM/src' \ + --exclude='zkLLVM/build/Windows/Release/zkLLVM/tmp' \ -czvf zkLLVM.tar.gz zkLLVM/ - + - name: Set Release Variables id: vars + shell: bash if: ${{ github.event_name == 'workflow_dispatch' }} run: | - OS_NAME=iOS - BRANCH_NAME=${GITHUB_REF#refs/heads/} - BUILD_TYPE=Release - FILE_NAME="${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}.tar.gz" - echo "RELEASE_TAG=${OS_NAME}-${BRANCH_NAME}-${BUILD_TYPE}-${GITHUB_SHA::7}" >> $GITHUB_ENV - echo "RELEASE_NAME=${OS_NAME} ${BRANCH_NAME} ${BUILD_TYPE} (${GITHUB_SHA::7})" >> $GITHUB_ENV - echo "FILE_NAME=$FILE_NAME" >> $GITHUB_ENV + if [ '${{matrix.abi}}' ]; then + OS_NAME=${{matrix.target}}-${{matrix.abi}} + else + OS_NAME=${{matrix.target}} + fi + + branch_name=${GITHUB_REF#refs/heads/} + build_type=Release + file_name="${OS_NAME}-${branch_name}-${build_type}.tar.gz" + + echo "RELEASE_TAG=${OS_NAME}-${branch_name}-${build_type}-${GITHUB_SHA::7}" >> $GITHUB_ENV + echo "RELEASE_NAME=${OS_NAME} ${branch_name} ${build_type} (${GITHUB_SHA::7})" >> $GITHUB_ENV + echo "FILE_NAME=$file_name" >> $GITHUB_ENV - name: Rename Artifact if: ${{ github.event_name == 'workflow_dispatch' }} run: mv zkLLVM.tar.gz ${{ env.FILE_NAME }} + shell: bash - name: Create GitHub Release if: ${{ github.event_name == 'workflow_dispatch' }} @@ -792,4 +222,3 @@ jobs: asset_path: ${{ env.FILE_NAME }} asset_name: ${{ env.FILE_NAME }} asset_content_type: application/gzip - diff --git a/build b/build index fead08b5..b084a664 160000 --- a/build +++ b/build @@ -1 +1 @@ -Subproject commit fead08b595aeca15399f1fa8917280dd2ed92e70 +Subproject commit b084a66418b37d1ce81e1b1fb38eae75e291732a From e2e95943f94846237d15c8ec2170a19a838a63a0 Mon Sep 17 00:00:00 2001 From: Eduardo Menges Mattje Date: Fri, 7 Feb 2025 15:33:36 -0300 Subject: [PATCH 083/114] Removed hard-coded Windows path in compression --- .github/workflows/cmake.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index d4788a4f..bd186a8a 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -172,8 +172,8 @@ jobs: done cd $GITHUB_WORKSPACE - tar --exclude='zkLLVM/build/Windows/Release/zkLLVM/src' \ - --exclude='zkLLVM/build/Windows/Release/zkLLVM/tmp' \ + tar --exclude="zkLLVM/${BUILD_DIRECTORY}/zkLLVM/src" \ + --exclude="zkLLVM/${BUILD_DIRECTORY}/zkLLVM/tmp" \ -czvf zkLLVM.tar.gz zkLLVM/ - name: Set Release Variables From f8db8de77436d47ee679de90318bfaf1d28cd340 Mon Sep 17 00:00:00 2001 From: Eduardo Menges Mattje Date: Mon, 10 Feb 2025 15:05:13 -0300 Subject: [PATCH 084/114] More fixes for MSVC --- libs/crypto3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/crypto3 b/libs/crypto3 index 4f5e1e7a..6ae53177 160000 --- a/libs/crypto3 +++ b/libs/crypto3 @@ -1 +1 @@ -Subproject commit 4f5e1e7a7d2e10ac213c1f9b29354d3ee5e6adae +Subproject commit 6ae531772556980dad0f1bf78012f6b6dc7dcb91 From 5b4dcb100587eb7a2174e9fd58fddb5205b426b8 Mon Sep 17 00:00:00 2001 From: Eduardo Menges Mattje Date: Tue, 11 Feb 2025 07:19:09 -0300 Subject: [PATCH 085/114] Android arm7 fixes --- libs/blueprint | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/blueprint b/libs/blueprint index 69b86bab..ccbee814 160000 --- a/libs/blueprint +++ b/libs/blueprint @@ -1 +1 @@ -Subproject commit 69b86bab364fb2bdfe02c69b50ad6d7d700eee84 +Subproject commit ccbee81442a0b95ec2c44706c3a50435ad12c0b3 From 060b172859084c0f5298bc2d4c6dcd6cbad312cb Mon Sep 17 00:00:00 2001 From: Eduardo Menges Mattje Date: Wed, 12 Feb 2025 09:51:11 -0300 Subject: [PATCH 086/114] Removed SHA information from releases --- .github/workflows/cmake.yml | 100 ++++++++++++++--------------------- .github/workflows/deploy.yml | 65 ----------------------- 2 files changed, 41 insertions(+), 124 deletions(-) delete mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index bd186a8a..1e5909d7 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -64,7 +64,9 @@ jobs: - name: Configure macOS host if: ${{ runner.os == 'macOS'}} run: | - brew install ccache ninja bash + brew install ccache ninja bash gnu-tar + PATH="$HOMEBREW_PREFIX/opt/gnu-tar/libexec/gnubin:$PATH" + echo "PATH=$PATH" >> $GITHUB_ENV echo "CMAKE_GENERATOR=Ninja" >> $GITHUB_ENV - name: Add Android toolchain @@ -86,24 +88,21 @@ jobs: echo "BUILD_DIRECTORY=$BUILD_DIRECTORY" >> $GITHUB_ENV shell: bash - - name: Define Release Tag + - name: Download Prebuilt Boost from Thirdparty shell: bash run: | - if [ '${{matrix.abi}}' ]; then - RELEASE_TAG='${{matrix.target}}-${{matrix.abi}}-${{ github.ref_name }}-${{matrix.build-type}}' + if git ls-remote --heads https://github.com/GeniusVentures/thirdparty.git $current_branch | grep -q $current_branch; then + thirdparty_branch=${current_branch} else - RELEASE_TAG='${{matrix.target}}-${{ github.ref_name }}-${{matrix.build-type}}' + thirdparty_branch=develop fi - echo "RELEASE_TAG=${RELEASE_TAG}" >> $GITHUB_ENV + echo "Using ${thirdparty_branch} for thirdparty" - - name: Download Prebuilt Boost from Thirdparty - shell: bash - run: | if [ '${{matrix.abi}}' ]; then - thirdparty_tag='${{matrix.target}}-${{matrix.abi}}-develop-${{matrix.build-type}}' + thirdparty_tag="${{matrix.target}}-${{matrix.abi}}-${thirdparty_branch}-${{matrix.build-type}}" else - thirdparty_tag='${{matrix.target}}-develop-${{matrix.build-type}}' + thirdparty_tag="${{matrix.target}}-${thirdparty_branch}-${{matrix.build-type}}" fi gh release download \ @@ -157,27 +156,15 @@ jobs: working-directory: ${{github.workspace}}/zkLLVM/${{env.BUILD_DIRECTORY}} run: cmake --install . - - name: Compressing Build Artifacts - working-directory: ${{github.workspace}}/zkLLVM + - name: Compressing build artifacts + working-directory: ${{github.workspace}}/zkLLVM/${{env.BUILD_DIRECTORY}} if: ${{github.event_name == 'workflow_dispatch'}} shell: bash run: | - shopt -s extglob - - IFS='/' read -ra dirs <<< "$BUILD_DIRECTORY" - - for dir in "${dirs[@]}"; do - rm -rf !($dir) .[!.]* ..?* - cd $dir - done - - cd $GITHUB_WORKSPACE - tar --exclude="zkLLVM/${BUILD_DIRECTORY}/zkLLVM/src" \ - --exclude="zkLLVM/${BUILD_DIRECTORY}/zkLLVM/tmp" \ - -czvf zkLLVM.tar.gz zkLLVM/ + tar -czvf zkLLVM.tar.gz --transform 's|^|${{env.BUILD_DIRECTORY}}/|' zkLLVM + mv zkLLVM.tar.gz ${{github.workspace}}/zkLLVM.tar.gz - - name: Set Release Variables - id: vars + - name: Release file shell: bash if: ${{ github.event_name == 'workflow_dispatch' }} run: | @@ -187,38 +174,33 @@ jobs: OS_NAME=${{matrix.target}} fi - branch_name=${GITHUB_REF#refs/heads/} - build_type=Release - file_name="${OS_NAME}-${branch_name}-${build_type}.tar.gz" + if ${{github.event_name == 'pull_request'}}; then + branch_name=${{ github.event.pull_request.head.ref }} + else + branch_name=$GITHUB_REF_NAME + fi - echo "RELEASE_TAG=${OS_NAME}-${branch_name}-${build_type}-${GITHUB_SHA::7}" >> $GITHUB_ENV - echo "RELEASE_NAME=${OS_NAME} ${branch_name} ${build_type} (${GITHUB_SHA::7})" >> $GITHUB_ENV - echo "FILE_NAME=$file_name" >> $GITHUB_ENV + file_name="${OS_NAME}-${branch_name}-${{matrix.build-type}}.tar.gz" + RELEASE_TAG=${OS_NAME}-${branch_name}-${{matrix.build-type}} - - name: Rename Artifact - if: ${{ github.event_name == 'workflow_dispatch' }} - run: mv zkLLVM.tar.gz ${{ env.FILE_NAME }} - shell: bash + mv zkLLVM.tar.gz ${file_name} - - name: Create GitHub Release - if: ${{ github.event_name == 'workflow_dispatch' }} - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} - with: - tag_name: ${{ env.RELEASE_TAG }} - release_name: ${{ env.RELEASE_NAME }} - draft: false - prerelease: false + if ! gh release view $RELEASE_TAG --repo GeniusVentures/zkLLVM; then + echo "Release not found, creating tag ${RELEASE_TAG}" - - name: Upload Release Asset - if: ${{ github.event_name == 'workflow_dispatch' }} - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ${{ env.FILE_NAME }} - asset_name: ${{ env.FILE_NAME }} - asset_content_type: application/gzip + if [ '${{matrix.build-type}}' != 'Release' ]; then + RELEASE_TYPE="--prerelease" + else + RELEASE_TYPE="--latest" + fi + + gh release create ${RELEASE_TAG} \ + -n "${CURRENT_BRANCH} branch" \ + --target "${CURRENT_BRANCH}" \ + ${RELEASE_TYPE} \ + --repo GeniusVentures/zkLLVM \ + -t "${{matrix.target}} ${{matrix.abi && format('({0}) ', matrix.abi) || ''}}${CURRENT_BRANCH} branch ${{matrix.build-type}} build" + fi + + echo "Uploading ${file_name}" + gh release upload ${RELEASE_TAG} ${file_name} --repo GeniusVentures/zkLLVM --clobber diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index 0338a9c0..00000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,65 +0,0 @@ -name: Deploy ZKLLVM - -on: - workflow_run: - workflows: ["Release Build CI"] - types: - - completed -env: - GH_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} - -jobs: - deploy: - runs-on: ubuntu-latest - - steps: - # - name: Download Linux Build Artifacts - # uses: actions/download-artifact@v3 - # with: - # name: linux-build - # path: ${{github.workspace}}/linux-build - - - name: Download Windows Build Artifacts - uses: actions/download-artifact@v3 - with: - name: windows-build - path: ${{github.workspace}}/windows-build - - # - name: Download Android Build Artifacts - # uses: actions/download-artifact@v3 - # with: - # name: android-build - # path: ${{github.workspace}}/android-build - - # - name: Download OSX Build Artifacts - # uses: actions/download-artifact@v3 - # with: - # name: osx-build - # path: ${{github.workspace}}/osx-build - - # - name: Download iOS Build Artifacts - # uses: actions/download-artifact@v3 - # with: - # name: ios-build - # path: ${{github.workspace}}/ios-build - - - - name: Compress Windows Build Artifacts - run: tar -czvf windows-build.tar.gz -C ${{github.workspace}}/windows-build . - - # - name: Compress Linux Build Artifacts - # run: tar -czvf linux-build.tar.gz -C ${{github.workspace}}/linux-build . - - # - name: Compress Android Build Artifacts - # run: tar -czvf android-build.tar.gz -C ${{github.workspace}}/android-build . - - # - name: Compress MacOS Build Artifacts - # run: tar -czvf osx-build.tar.gz -C ${{github.workspace}}/osx-build . - - # - name: Compress iOS Build Artifacts - # run: tar -czvf ios-build.tar.gz -C ${{github.workspace}}/ios-build . - - - # - name: Deploy the compressed artifacts - # run: | - \ No newline at end of file From 676115939401cfbbb2983aacc7e935f6120bc919 Mon Sep 17 00:00:00 2001 From: "sariru@gmail.com" <89619301+itsafuu@users.noreply.github.com> Date: Fri, 14 Feb 2025 19:13:49 -0500 Subject: [PATCH 087/114] Now ubuntu 22 here --- .github/workflows/cmake.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 1e5909d7..be6148f4 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -26,11 +26,11 @@ jobs: abi: [""] include: - target: Android - host: ubuntu-latest + host: ubuntu-22.04 abi: arm64-v8a build-type: Release - target: Android - host: ubuntu-latest + host: ubuntu-22.04 abi: armeabi-v7a build-type: Release - target: iOS @@ -38,7 +38,7 @@ jobs: - target: OSX host: macos-latest - target: Linux - host: ubuntu-latest + host: ubuntu-22.04 - target: Windows host: windows-latest exclude: From dfd8e272d1aa2418bb482f8673d0d287f1b74ac4 Mon Sep 17 00:00:00 2001 From: "sariru@gmail.com" <89619301+itsafuu@users.noreply.github.com> Date: Fri, 14 Feb 2025 21:23:55 -0500 Subject: [PATCH 088/114] Added filters again for src and tmp because macos release was too large. Adjusted how the release tar.gz is moved on windows as the resolved path was wrong --- .github/workflows/cmake.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index be6148f4..ef05485e 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -161,8 +161,20 @@ jobs: if: ${{github.event_name == 'workflow_dispatch'}} shell: bash run: | - tar -czvf zkLLVM.tar.gz --transform 's|^|${{env.BUILD_DIRECTORY}}/|' zkLLVM - mv zkLLVM.tar.gz ${{github.workspace}}/zkLLVM.tar.gz + tar --exclude="build/${{matrix.target}}/${{matrix.build-type}}/armeabi-v7a/zkLLVM/src" \ + --exclude="build/${{matrix.target}}/${{matrix.build-type}}/armeabi-v7a/zkLLVM/tmp" \ + --exclude="build/${{matrix.target}}/${{matrix.build-type}}/arm64-v8a/zkLLVM/src" \ + --exclude="build/${{matrix.target}}/${{matrix.build-type}}/arm64-v8a/zkLLVM/tmp" \ + --exclude="build/${{matrix.target}}/${{matrix.build-type}}/zkLLVM/src" \ + --exclude="build/${{matrix.target}}/${{matrix.build-type}}/zkLLVM/tmp" \ + -czvf zkLLVM.tar.gz \ + --transform "s|^|${{env.BUILD_DIRECTORY}}/|" \ + -C ${{github.workspace}}/zkLLVM ${{env.BUILD_DIRECTORY}} + if ($env:RUNNER_OS -eq "Windows") { + Move-Item -Path "zkLLVM.tar.gz" -Destination "$env:GITHUB_WORKSPACE\zkLLVM.tar.gz" + } else { + mv zkLLVM.tar.gz "${{ github.workspace }}/zkLLVM.tar.gz" + } - name: Release file shell: bash From 4346804beadb1345f0025a05627013091fc4ce98 Mon Sep 17 00:00:00 2001 From: "sariru@gmail.com" <89619301+itsafuu@users.noreply.github.com> Date: Fri, 14 Feb 2025 21:26:27 -0500 Subject: [PATCH 089/114] Maybe yaml fix --- .github/workflows/cmake.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index ef05485e..d8053c65 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -170,11 +170,16 @@ jobs: -czvf zkLLVM.tar.gz \ --transform "s|^|${{env.BUILD_DIRECTORY}}/|" \ -C ${{github.workspace}}/zkLLVM ${{env.BUILD_DIRECTORY}} - if ($env:RUNNER_OS -eq "Windows") { - Move-Item -Path "zkLLVM.tar.gz" -Destination "$env:GITHUB_WORKSPACE\zkLLVM.tar.gz" - } else { - mv zkLLVM.tar.gz "${{ github.workspace }}/zkLLVM.tar.gz" - } + + - name: Move Archive (Windows) + if: runner.os == 'Windows' + shell: pwsh + run: Move-Item -Path "zkLLVM.tar.gz" -Destination "$env:GITHUB_WORKSPACE\zkLLVM.tar.gz" + + - name: Move Archive (Linux/macOS) + if: runner.os != 'Windows' + shell: bash + run: mv zkLLVM.tar.gz "${{ github.workspace }}/zkLLVM.tar.gz" - name: Release file shell: bash From aca82fefe0bedf05688a5f3af79ff731ed63c4c6 Mon Sep 17 00:00:00 2001 From: "sariru@gmail.com" <89619301+itsafuu@users.noreply.github.com> Date: Fri, 14 Feb 2025 21:29:05 -0500 Subject: [PATCH 090/114] Identation --- .github/workflows/cmake.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index d8053c65..07dfa866 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -161,16 +161,16 @@ jobs: if: ${{github.event_name == 'workflow_dispatch'}} shell: bash run: | - tar --exclude="build/${{matrix.target}}/${{matrix.build-type}}/armeabi-v7a/zkLLVM/src" \ - --exclude="build/${{matrix.target}}/${{matrix.build-type}}/armeabi-v7a/zkLLVM/tmp" \ - --exclude="build/${{matrix.target}}/${{matrix.build-type}}/arm64-v8a/zkLLVM/src" \ - --exclude="build/${{matrix.target}}/${{matrix.build-type}}/arm64-v8a/zkLLVM/tmp" \ - --exclude="build/${{matrix.target}}/${{matrix.build-type}}/zkLLVM/src" \ - --exclude="build/${{matrix.target}}/${{matrix.build-type}}/zkLLVM/tmp" \ - -czvf zkLLVM.tar.gz \ - --transform "s|^|${{env.BUILD_DIRECTORY}}/|" \ - -C ${{github.workspace}}/zkLLVM ${{env.BUILD_DIRECTORY}} - + tar --exclude="build/${{matrix.target}}/${{matrix.build-type}}/armeabi-v7a/zkLLVM/src" \ + --exclude="build/${{matrix.target}}/${{matrix.build-type}}/armeabi-v7a/zkLLVM/tmp" \ + --exclude="build/${{matrix.target}}/${{matrix.build-type}}/arm64-v8a/zkLLVM/src" \ + --exclude="build/${{matrix.target}}/${{matrix.build-type}}/arm64-v8a/zkLLVM/tmp" \ + --exclude="build/${{matrix.target}}/${{matrix.build-type}}/zkLLVM/src" \ + --exclude="build/${{matrix.target}}/${{matrix.build-type}}/zkLLVM/tmp" \ + -czvf zkLLVM.tar.gz \ + --transform "s|^|${{env.BUILD_DIRECTORY}}/|" \ + -C ${{github.workspace}}/zkLLVM ${{env.BUILD_DIRECTORY}} + - name: Move Archive (Windows) if: runner.os == 'Windows' shell: pwsh From 7967d1b824e69bf91c04280e6d06b1a2ed534c57 Mon Sep 17 00:00:00 2001 From: "sariru@gmail.com" <89619301+itsafuu@users.noreply.github.com> Date: Fri, 14 Feb 2025 22:45:24 -0500 Subject: [PATCH 091/114] Adjust tar command because it was detecting modifications and failing --- .github/workflows/cmake.yml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 07dfa866..cb7bd389 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -161,23 +161,19 @@ jobs: if: ${{github.event_name == 'workflow_dispatch'}} shell: bash run: | - tar --exclude="build/${{matrix.target}}/${{matrix.build-type}}/armeabi-v7a/zkLLVM/src" \ - --exclude="build/${{matrix.target}}/${{matrix.build-type}}/armeabi-v7a/zkLLVM/tmp" \ - --exclude="build/${{matrix.target}}/${{matrix.build-type}}/arm64-v8a/zkLLVM/src" \ - --exclude="build/${{matrix.target}}/${{matrix.build-type}}/arm64-v8a/zkLLVM/tmp" \ - --exclude="build/${{matrix.target}}/${{matrix.build-type}}/zkLLVM/src" \ - --exclude="build/${{matrix.target}}/${{matrix.build-type}}/zkLLVM/tmp" \ - -czvf zkLLVM.tar.gz \ + tar -czvf zkLLVM.tar.gz \ + --exclude='zkLLVM/src' \ + --exclude='zkLLVM/tmp' \ --transform "s|^|${{env.BUILD_DIRECTORY}}/|" \ - -C ${{github.workspace}}/zkLLVM ${{env.BUILD_DIRECTORY}} + zkLLVM - name: Move Archive (Windows) - if: runner.os == 'Windows' + if: ${{ github.event_name == 'workflow_dispatch' && runner.os == 'Windows' }} shell: pwsh run: Move-Item -Path "zkLLVM.tar.gz" -Destination "$env:GITHUB_WORKSPACE\zkLLVM.tar.gz" - name: Move Archive (Linux/macOS) - if: runner.os != 'Windows' + if: ${{ github.event_name == 'workflow_dispatch' && runner.os != 'Windows' }} shell: bash run: mv zkLLVM.tar.gz "${{ github.workspace }}/zkLLVM.tar.gz" From 0bbdd9059857ac1a530ec3fdac64888ea21cba8b Mon Sep 17 00:00:00 2001 From: "sariru@gmail.com" <89619301+itsafuu@users.noreply.github.com> Date: Fri, 14 Feb 2025 23:40:00 -0500 Subject: [PATCH 092/114] Set working dir for move --- .github/workflows/cmake.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index cb7bd389..7c21291f 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -168,11 +168,13 @@ jobs: zkLLVM - name: Move Archive (Windows) + working-directory: ${{github.workspace}}/zkLLVM/${{env.BUILD_DIRECTORY}} if: ${{ github.event_name == 'workflow_dispatch' && runner.os == 'Windows' }} shell: pwsh run: Move-Item -Path "zkLLVM.tar.gz" -Destination "$env:GITHUB_WORKSPACE\zkLLVM.tar.gz" - name: Move Archive (Linux/macOS) + working-directory: ${{github.workspace}}/zkLLVM/${{env.BUILD_DIRECTORY}} if: ${{ github.event_name == 'workflow_dispatch' && runner.os != 'Windows' }} shell: bash run: mv zkLLVM.tar.gz "${{ github.workspace }}/zkLLVM.tar.gz" From 3c33b606c1523e1e5f85716de314d777144c6f80 Mon Sep 17 00:00:00 2001 From: Eduardo Menges Mattje Date: Tue, 18 Feb 2025 11:40:03 -0300 Subject: [PATCH 093/114] Fixated C standard version when compiling --- .github/workflows/cmake.yml | 10 +++++----- cmake/CommonBuildParameters.cmake | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 7c21291f..2ffda46d 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -126,27 +126,27 @@ jobs: - name: Configure CMake for Android if: ${{ matrix.target == 'Android'}} working-directory: ${{github.workspace}}/zkLLVM - run: cmake -S build/${{matrix.target}} -B $BUILD_DIRECTORY -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty -DANDROID_ABI=${{matrix.abi}} -DCMAKE_ANDROID_NDK=${ANDROID_NDK_HOME} + run: cmake -S build/${{matrix.target}} -B $BUILD_DIRECTORY -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_C_STANDARD=17 -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty -DANDROID_ABI=${{matrix.abi}} -DCMAKE_ANDROID_NDK=${ANDROID_NDK_HOME} - name: Configure CMake for iOS if: ${{ matrix.target == 'iOS'}} working-directory: ${{github.workspace}}/zkLLVM - run: cmake -S build/${{matrix.target}} -B $BUILD_DIRECTORY -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty -DPLATFORM=OS64 + run: cmake -S build/${{matrix.target}} -B $BUILD_DIRECTORY -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_C_STANDARD=17 -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty -DPLATFORM=OS64 - name: Configure CMake for Mac if: ${{ matrix.target == 'OSX'}} working-directory: ${{github.workspace}}/zkLLVM - run: cmake -S build/${{matrix.target}} -B $BUILD_DIRECTORY -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty -DPLATFORM=MAC_UNIVERSAL + run: cmake -S build/${{matrix.target}} -B $BUILD_DIRECTORY -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_C_STANDARD=17 -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty -DPLATFORM=MAC_UNIVERSAL - name: Configure CMake for Linux if: ${{ matrix.target == 'Linux' }} working-directory: ${{github.workspace}}/zkLLVM - run: cmake -S build/${{matrix.target}} -B $BUILD_DIRECTORY -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty + run: cmake -S build/${{matrix.target}} -B $BUILD_DIRECTORY -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_C_STANDARD=17 -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty - name: Configure CMake for Windows if: ${{ matrix.target == 'Windows' }} working-directory: ${{github.workspace}}/zkLLVM - run: cmake -S build/${{matrix.target}} -B $env:BUILD_DIRECTORY -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty -G "Visual Studio 17 2022" -A x64 + run: cmake -S build/${{matrix.target}} -B $env:BUILD_DIRECTORY -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_C_STANDARD=17 -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty -G "Visual Studio 17 2022" -A x64 - name: Build working-directory: ${{github.workspace}}/zkLLVM diff --git a/cmake/CommonBuildParameters.cmake b/cmake/CommonBuildParameters.cmake index 2d120c2a..fb178286 100644 --- a/cmake/CommonBuildParameters.cmake +++ b/cmake/CommonBuildParameters.cmake @@ -85,6 +85,7 @@ set(_CMAKE_COMMON_CACHE_ARGS -DCMAKE_C_FLAGS_DEBUG:STRING=${CMAKE_C_FLAGS_DEBUG} -DCMAKE_C_FLAGS_RELEASE:STRING=${CMAKE_C_FLAGS_RELEASE} -DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS} + -DCMAKE_C_STANDARD:STRING=${CMAKE_C_STANDARD} -DCMAKE_CXX_FLAGS_DEBUG:STRING=${CMAKE_CXX_FLAGS_DEBUG} -DCMAKE_CXX_FLAGS_RELEASE:STRING=${CMAKE_CXX_FLAGS_RELEASE} -DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS} From c37fac66c3f3fe3ec092917ce1bf928f9152f4e2 Mon Sep 17 00:00:00 2001 From: "sariru@gmail.com" <89619301+itsafuu@users.noreply.github.com> Date: Tue, 18 Feb 2025 21:13:22 -0500 Subject: [PATCH 094/114] Set to build type instead of forced release --- cmake/CommonBuildParameters.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/CommonBuildParameters.cmake b/cmake/CommonBuildParameters.cmake index fb178286..06d369ec 100644 --- a/cmake/CommonBuildParameters.cmake +++ b/cmake/CommonBuildParameters.cmake @@ -156,8 +156,8 @@ ExternalProject_Add(zkLLVM ${_CMAKE_COMMON_CACHE_ARGS} ${_BOOST_CACHE_ARGS} ${_ZKLLVM_EXTRA_PARAM} - -DCMAKE_BUILD_TYPE=Release - BUILD_COMMAND ${CMAKE_COMMAND} --build --config Release + -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} + BUILD_COMMAND ${CMAKE_COMMAND} --build --config ${CMAKE_BUILD_TYPE} INSTALL_COMMAND ${CMAKE_COMMAND} --install . ) From 414284a36e981a4b06e820bf12ad4f044370930b Mon Sep 17 00:00:00 2001 From: Henrique A Klein Date: Wed, 19 Feb 2025 16:16:51 -0300 Subject: [PATCH 095/114] Fix: In case CMAKE_C_STANDARD is not defined, set it to 17 --- cmake/CommonBuildParameters.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmake/CommonBuildParameters.cmake b/cmake/CommonBuildParameters.cmake index 06d369ec..a46b4354 100644 --- a/cmake/CommonBuildParameters.cmake +++ b/cmake/CommonBuildParameters.cmake @@ -48,6 +48,8 @@ set(_BOOST_CACHE_ARGS -DBoost_USE_STATIC_RUNTIME:BOOL=ON ) +set(CMAKE_C_STANDARD "17" CACHE STRING "CMAKE C standard") + if(APPLE OR WIN32 OR UNIX) # For desktop platforms (macOS, Windows, Linux) set(_ZKLLVM_EXTRA_PARAM From 47ab9878cfdc347d76937951edc731f3fd225c43 Mon Sep 17 00:00:00 2001 From: Eduardo Menges Mattje Date: Tue, 25 Feb 2025 11:29:35 -0300 Subject: [PATCH 096/114] Fixed sym links --- .github/workflows/cmake.yml | 84 ++++++++++++++++--------------- cmake/CommonBuildParameters.cmake | 2 +- 2 files changed, 44 insertions(+), 42 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 2ffda46d..1a22565d 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -64,7 +64,7 @@ jobs: - name: Configure macOS host if: ${{ runner.os == 'macOS'}} run: | - brew install ccache ninja bash gnu-tar + brew install ccache ninja bash PATH="$HOMEBREW_PREFIX/opt/gnu-tar/libexec/gnubin:$PATH" echo "PATH=$PATH" >> $GITHUB_ENV echo "CMAKE_GENERATOR=Ninja" >> $GITHUB_ENV @@ -78,19 +78,35 @@ jobs: echo "ANDROID_NDK_HOME=$HOME/android-ndk-$NDK_VERSION" >> $GITHUB_ENV + - name: Checkout + uses: actions/checkout@v4 + with: + path: zkLLVM + submodules: "recursive" + - name: Set build directory run: | if [ '${{matrix.abi}}' ]; then - BUILD_DIRECTORY=build/${{matrix.target}}/${{matrix.build-type}}/${{matrix.abi}} + BUILD_DIRECTORY=${{matrix.build-type}}/${{matrix.abi}} else - BUILD_DIRECTORY=build/${{matrix.target}}/${{matrix.build-type}} + BUILD_DIRECTORY=${{matrix.build-type}} fi + + echo "SOURCE_DIRECTORY=build/${{matrix.target}}" >> $GITHUB_ENV echo "BUILD_DIRECTORY=$BUILD_DIRECTORY" >> $GITHUB_ENV shell: bash - name: Download Prebuilt Boost from Thirdparty shell: bash run: | + if ${{github.event_name == 'pull_request'}}; then + current_branch=${{github.event.pull_request.head.ref}} + else + current_branch=$GITHUB_REF_NAME + fi + + echo "CURRENT_BRANCH=${current_branch}" >>$GITHUB_ENV + if git ls-remote --heads https://github.com/GeniusVentures/thirdparty.git $current_branch | grep -q $current_branch; then thirdparty_branch=${current_branch} else @@ -110,74 +126,60 @@ jobs: ${thirdparty_tag} \ --pattern Boost-lib.tar.gz - mkdir -p ${{github.workspace}}/thirdparty/${{env.BUILD_DIRECTORY}} - - name: Extract Boost + shell: bash run: | - mkdir -p thirdparty/${{env.BUILD_DIRECTORY}} - tar -xzf Boost-lib.tar.gz -C thirdparty/${{env.BUILD_DIRECTORY}} - - - name: Checkout - uses: actions/checkout@v4 - with: - path: "zkLLVM" - submodules: "recursive" + thirdparty_path=thirdparty/${{env.SOURCE_DIRECTORY}}/${{env.BUILD_DIRECTORY}} + mkdir -p ${thirdparty_path} + tar -xzf Boost-lib.tar.gz -C ${thirdparty_path} - name: Configure CMake for Android if: ${{ matrix.target == 'Android'}} - working-directory: ${{github.workspace}}/zkLLVM - run: cmake -S build/${{matrix.target}} -B $BUILD_DIRECTORY -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_C_STANDARD=17 -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty -DANDROID_ABI=${{matrix.abi}} -DCMAKE_ANDROID_NDK=${ANDROID_NDK_HOME} + working-directory: ${{github.workspace}}/zkLLVM/${{env.SOURCE_DIRECTORY}} + run: cmake -B ${{env.BUILD_DIRECTORY}} -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_C_STANDARD=17 -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty -DANDROID_ABI=${{matrix.abi}} -DCMAKE_ANDROID_NDK=${ANDROID_NDK_HOME} - name: Configure CMake for iOS if: ${{ matrix.target == 'iOS'}} - working-directory: ${{github.workspace}}/zkLLVM - run: cmake -S build/${{matrix.target}} -B $BUILD_DIRECTORY -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_C_STANDARD=17 -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty -DPLATFORM=OS64 + working-directory: ${{github.workspace}}/zkLLVM/${{env.SOURCE_DIRECTORY}} + run: cmake -B ${{env.BUILD_DIRECTORY}} -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_C_STANDARD=17 -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty -DPLATFORM=OS64 - name: Configure CMake for Mac if: ${{ matrix.target == 'OSX'}} - working-directory: ${{github.workspace}}/zkLLVM - run: cmake -S build/${{matrix.target}} -B $BUILD_DIRECTORY -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_C_STANDARD=17 -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty -DPLATFORM=MAC_UNIVERSAL + working-directory: ${{github.workspace}}/zkLLVM/${{env.SOURCE_DIRECTORY}} + run: cmake -B ${{env.BUILD_DIRECTORY}} -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_C_STANDARD=17 -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty -DPLATFORM=MAC_UNIVERSAL - name: Configure CMake for Linux if: ${{ matrix.target == 'Linux' }} - working-directory: ${{github.workspace}}/zkLLVM - run: cmake -S build/${{matrix.target}} -B $BUILD_DIRECTORY -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_C_STANDARD=17 -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty + working-directory: ${{github.workspace}}/zkLLVM/${{env.SOURCE_DIRECTORY}} + run: cmake -B ${{env.BUILD_DIRECTORY}} -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_C_STANDARD=17 -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty - name: Configure CMake for Windows if: ${{ matrix.target == 'Windows' }} - working-directory: ${{github.workspace}}/zkLLVM - run: cmake -S build/${{matrix.target}} -B $env:BUILD_DIRECTORY -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_C_STANDARD=17 -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty -G "Visual Studio 17 2022" -A x64 + working-directory: ${{github.workspace}}\zkLLVM + run: | + cd ${{env.SOURCE_DIRECTORY}} + cmake -B ${{env.BUILD_DIRECTORY}} -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_C_STANDARD=17 -DTHIRDPARTY_DIR=${{github.workspace}}\thirdparty -G "Visual Studio 17 2022" -A x64 - name: Build - working-directory: ${{github.workspace}}/zkLLVM + working-directory: ${{github.workspace}}/zkLLVM/${{env.SOURCE_DIRECTORY}} run: cmake --build ${{env.BUILD_DIRECTORY}} --config ${{matrix.build-type}} -j - name: Install - working-directory: ${{github.workspace}}/zkLLVM/${{env.BUILD_DIRECTORY}} - run: cmake --install . + working-directory: ${{github.workspace}}/zkLLVM/${{env.SOURCE_DIRECTORY}} + run: cmake --install ${{env.BUILD_DIRECTORY}} - - name: Compressing build artifacts - working-directory: ${{github.workspace}}/zkLLVM/${{env.BUILD_DIRECTORY}} + - name: Compress build artifacts + working-directory: ${{github.workspace}}/zkLLVM/${{env.SOURCE_DIRECTORY}}/${{env.BUILD_DIRECTORY}} if: ${{github.event_name == 'workflow_dispatch'}} shell: bash run: | tar -czvf zkLLVM.tar.gz \ --exclude='zkLLVM/src' \ --exclude='zkLLVM/tmp' \ - --transform "s|^|${{env.BUILD_DIRECTORY}}/|" \ + --transform 's|^|${{env.SOURCE_DIRECTORY}}/${{env.BUILD_DIRECTORY}}/|S' \ zkLLVM - - name: Move Archive (Windows) - working-directory: ${{github.workspace}}/zkLLVM/${{env.BUILD_DIRECTORY}} - if: ${{ github.event_name == 'workflow_dispatch' && runner.os == 'Windows' }} - shell: pwsh - run: Move-Item -Path "zkLLVM.tar.gz" -Destination "$env:GITHUB_WORKSPACE\zkLLVM.tar.gz" - - - name: Move Archive (Linux/macOS) - working-directory: ${{github.workspace}}/zkLLVM/${{env.BUILD_DIRECTORY}} - if: ${{ github.event_name == 'workflow_dispatch' && runner.os != 'Windows' }} - shell: bash - run: mv zkLLVM.tar.gz "${{ github.workspace }}/zkLLVM.tar.gz" + mv zkLLVM.tar.gz "${{github.workspace}}/zkLLVM.tar.gz" - name: Release file shell: bash @@ -216,6 +218,6 @@ jobs: --repo GeniusVentures/zkLLVM \ -t "${{matrix.target}} ${{matrix.abi && format('({0}) ', matrix.abi) || ''}}${CURRENT_BRANCH} branch ${{matrix.build-type}} build" fi - + echo "Uploading ${file_name}" gh release upload ${RELEASE_TAG} ${file_name} --repo GeniusVentures/zkLLVM --clobber diff --git a/cmake/CommonBuildParameters.cmake b/cmake/CommonBuildParameters.cmake index a46b4354..456df671 100644 --- a/cmake/CommonBuildParameters.cmake +++ b/cmake/CommonBuildParameters.cmake @@ -159,7 +159,7 @@ ExternalProject_Add(zkLLVM ${_BOOST_CACHE_ARGS} ${_ZKLLVM_EXTRA_PARAM} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} - BUILD_COMMAND ${CMAKE_COMMAND} --build --config ${CMAKE_BUILD_TYPE} + BUILD_COMMAND ${CMAKE_COMMAND} --build --config $ INSTALL_COMMAND ${CMAKE_COMMAND} --install . ) From 76357d4e9a79a117e724c9153c9c430452d2e690 Mon Sep 17 00:00:00 2001 From: Eduardo Menges Mattje Date: Fri, 7 Mar 2025 11:25:09 -0300 Subject: [PATCH 097/114] Fixed head for blueprint --- libs/blueprint | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/blueprint b/libs/blueprint index ccbee814..ba551c80 160000 --- a/libs/blueprint +++ b/libs/blueprint @@ -1 +1 @@ -Subproject commit ccbee81442a0b95ec2c44706c3a50435ad12c0b3 +Subproject commit ba551c80403550404af251d5f08bb37554ccb4ab From c4a26eabe262c6af9f530f58e5d5d0f4bbec3969 Mon Sep 17 00:00:00 2001 From: Eduardo Menges Mattje Date: Fri, 7 Mar 2025 11:06:31 -0300 Subject: [PATCH 098/114] Speed up compile times --- .gitmodules | 3 --- libs/crypto3 | 2 +- libs/rslang | 1 - 3 files changed, 1 insertion(+), 5 deletions(-) delete mode 160000 libs/rslang diff --git a/.gitmodules b/.gitmodules index 213b8fca..6d7d06cc 100644 --- a/.gitmodules +++ b/.gitmodules @@ -16,9 +16,6 @@ [submodule "libs/transpiler"] path = libs/transpiler url = ../../NilFoundation/zkllvm-transpiler.git -[submodule "libs/rslang"] - path = libs/rslang - url = ../../NilFoundation/zkllvm-rslang.git [submodule "libs/crypto3"] path = libs/crypto3 url = ../../GeniusVentures/crypto3.git diff --git a/libs/crypto3 b/libs/crypto3 index 6ae53177..4aada10f 160000 --- a/libs/crypto3 +++ b/libs/crypto3 @@ -1 +1 @@ -Subproject commit 6ae531772556980dad0f1bf78012f6b6dc7dcb91 +Subproject commit 4aada10f213f1ea85dc3135c4475da6e50cdd1fa diff --git a/libs/rslang b/libs/rslang deleted file mode 160000 index a516bc53..00000000 --- a/libs/rslang +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a516bc53931245040a6e42e9c2c02793c8eb86bd From c3c8e764e7ca0712de86f6a5090457260700aaf9 Mon Sep 17 00:00:00 2001 From: Eduardo Menges Mattje Date: Fri, 14 Mar 2025 11:33:11 -0300 Subject: [PATCH 099/114] `build` project update --- build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build b/build index b084a664..011868ac 160000 --- a/build +++ b/build @@ -1 +1 @@ -Subproject commit b084a66418b37d1ce81e1b1fb38eae75e291732a +Subproject commit 011868ac29b01d2bccb6af42a13cb708dff23930 From 8bab9d5dbbc806e7964d6dc115239d9b892ac136 Mon Sep 17 00:00:00 2001 From: Henrique A Klein Date: Mon, 31 Mar 2025 15:42:57 -0300 Subject: [PATCH 100/114] Fix: iOS and Linux issues on running the wallet --- cmake/CommonBuildParameters.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmake/CommonBuildParameters.cmake b/cmake/CommonBuildParameters.cmake index 456df671..2663e377 100644 --- a/cmake/CommonBuildParameters.cmake +++ b/cmake/CommonBuildParameters.cmake @@ -78,6 +78,8 @@ endif() if(CMAKE_SYSTEM_NAME STREQUAL "Linux") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GNU_SOURCE") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_GNU_SOURCE") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden") endif() set(_CMAKE_COMMON_CACHE_ARGS @@ -150,6 +152,10 @@ ExternalProject_Add(zkLLVM -DCMAKE_INSTALL_PREFIX:PATH= -DLLVM_ENABLE_ZSTD:BOOL=OFF -DLLVM_INCLUDE_EXAMPLES:BOOL=OFF + -DLLVM_ENABLE_TERMINFO:BOOL=OFF + -DLLVM_ENABLE_LIBEDIT=OFF + -DLLVM_ENABLE_CURSES=OFF + -DLLVM_EXPORT_SYMBOLS_FOR_PLUGINS=OFF -DZKLLVM_BUILD_EXECUTABLES:BOOL=OFF -DZKLLVM_BUILD_RSLANG:BOOL=OFF -DZKLLVM_DEV_ENVIRONMENT:BOOL=ON From a8e0c9c9a06c963193d813622f0741ac89edbfc2 Mon Sep 17 00:00:00 2001 From: Eduardo Menges Mattje Date: Mon, 21 Apr 2025 13:09:38 -0300 Subject: [PATCH 101/114] Added Linux arm64 to CI --- .github/workflows/cmake.yml | 10 +++++++++- build | 2 +- cmake/CommonBuildParameters.cmake | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 1a22565d..21387c02 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -39,11 +39,19 @@ jobs: host: macos-latest - target: Linux host: ubuntu-22.04 + abi: x86_64 + build-type: Release + - target: Linux + host: ubuntu-24.04-arm + abi: aarch64 + build-type: Release - target: Windows host: windows-latest exclude: - target: Android abi: "" + - target: Linux + abi: "" steps: - name: Configure Linux host if: ${{ runner.os == 'Linux'}} @@ -151,7 +159,7 @@ jobs: - name: Configure CMake for Linux if: ${{ matrix.target == 'Linux' }} working-directory: ${{github.workspace}}/zkLLVM/${{env.SOURCE_DIRECTORY}} - run: cmake -B ${{env.BUILD_DIRECTORY}} -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_C_STANDARD=17 -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty + run: cmake -B ${{env.BUILD_DIRECTORY}} -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_C_STANDARD=17 -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty -DABI_SUBFOLDER_NAME='/${{matrix.abi}}' - name: Configure CMake for Windows if: ${{ matrix.target == 'Windows' }} diff --git a/build b/build index 011868ac..11437de0 160000 --- a/build +++ b/build @@ -1 +1 @@ -Subproject commit 011868ac29b01d2bccb6af42a13cb708dff23930 +Subproject commit 11437de0c770038abe64124c0334fea9e6695e6c diff --git a/cmake/CommonBuildParameters.cmake b/cmake/CommonBuildParameters.cmake index 2663e377..e5357e38 100644 --- a/cmake/CommonBuildParameters.cmake +++ b/cmake/CommonBuildParameters.cmake @@ -10,7 +10,7 @@ set(BOOST_VERSION_2U "${BOOST_MAJOR_VERSION}_${BOOST_MINOR_VERSION}") # Boost should be loaded before libp2p v0.1.2 # Set config of Boost project -set(_BOOST_ROOT "${THIRDPARTY_BUILD_DIR}/boost/build/${CMAKE_SYSTEM_NAME}${ABI_SUBFOLDER_NAME}") +set(_BOOST_ROOT "${THIRDPARTY_BUILD_DIR}/boost/build/${CMAKE_SYSTEM_NAME}") set(Boost_LIB_DIR "${_BOOST_ROOT}/lib") set(Boost_INCLUDE_DIR "${_BOOST_ROOT}/include/boost-${BOOST_VERSION_2U}") set(Boost_DIR "${Boost_LIB_DIR}/cmake/Boost-${BOOST_VERSION}") From 1d3e9761afc34c42eb428a3b90a37a2ac8b9403a Mon Sep 17 00:00:00 2001 From: Eduardo Menges Mattje Date: Wed, 4 Jun 2025 17:37:33 -0300 Subject: [PATCH 102/114] Changed release files --- .github/workflows/cmake.yml | 91 +++++++++++++------------------ build | 2 +- cmake/CommonBuildParameters.cmake | 2 +- 3 files changed, 41 insertions(+), 54 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 21387c02..3e689b12 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -104,69 +104,69 @@ jobs: echo "BUILD_DIRECTORY=$BUILD_DIRECTORY" >> $GITHUB_ENV shell: bash - - name: Download Prebuilt Boost from Thirdparty - shell: bash + - name: Download thirdparty release + working-directory: ${{github.workspace}} run: | if ${{github.event_name == 'pull_request'}}; then - current_branch=${{github.event.pull_request.head.ref}} + CURRENT_BRANCH=${{ github.event.pull_request.head.ref }} else - current_branch=$GITHUB_REF_NAME + CURRENT_BRANCH=$GITHUB_REF_NAME fi - echo "CURRENT_BRANCH=${current_branch}" >>$GITHUB_ENV + echo "Identified current branch as ${CURRENT_BRANCH}" + + echo "CURRENT_BRANCH=${CURRENT_BRANCH}" >>$GITHUB_ENV - if git ls-remote --heads https://github.com/GeniusVentures/thirdparty.git $current_branch | grep -q $current_branch; then - thirdparty_branch=${current_branch} + if [ "$CURRENT_BRANCH" == "main" ]; then + thirdparty_branch="main" else - thirdparty_branch=develop + thirdparty_branch="develop" fi echo "Using ${thirdparty_branch} for thirdparty" if [ '${{matrix.abi}}' ]; then - thirdparty_tag="${{matrix.target}}-${{matrix.abi}}-${thirdparty_branch}-${{matrix.build-type}}" + FILE_NAME=${{matrix.target}}-${{matrix.abi}}-${{matrix.build-type}}.tar.gz else - thirdparty_tag="${{matrix.target}}-${thirdparty_branch}-${{matrix.build-type}}" + FILE_NAME=${{matrix.target}}-${{matrix.build-type}}.tar.gz fi + echo "FILE_NAME=${FILE_NAME}" >> $GITHUB_ENV + + mkdir thirdparty + cd thirdparty - gh release download \ - --repo GeniusVentures/thirdparty \ - ${thirdparty_tag} \ - --pattern Boost-lib.tar.gz + tag_name="${{matrix.target}}-${thirdparty_branch}-${{matrix.build-type}}" - - name: Extract Boost + gh release download ${tag_name} --repo GeniusVentures/thirdparty -p "${FILE_NAME}" + tar -zxf "${FILE_NAME}" ${{env.SOURCE_DIRECTORY}}/${{env.BUILD_DIRECTORY}}/boost shell: bash - run: | - thirdparty_path=thirdparty/${{env.SOURCE_DIRECTORY}}/${{env.BUILD_DIRECTORY}} - mkdir -p ${thirdparty_path} - tar -xzf Boost-lib.tar.gz -C ${thirdparty_path} - name: Configure CMake for Android if: ${{ matrix.target == 'Android'}} working-directory: ${{github.workspace}}/zkLLVM/${{env.SOURCE_DIRECTORY}} - run: cmake -B ${{env.BUILD_DIRECTORY}} -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_C_STANDARD=17 -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty -DANDROID_ABI=${{matrix.abi}} -DCMAKE_ANDROID_NDK=${ANDROID_NDK_HOME} + run: cmake -B ${{env.BUILD_DIRECTORY}} -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_C_STANDARD=17 -DTHIRDPARTY_BUILD_DIR=${{github.workspace}}/thirdparty/${{env.SOURCE_DIRECTORY}}/${{env.BUILD_DIRECTORY}} -DANDROID_ABI=${{matrix.abi}} -DCMAKE_ANDROID_NDK=${ANDROID_NDK_HOME} - name: Configure CMake for iOS if: ${{ matrix.target == 'iOS'}} working-directory: ${{github.workspace}}/zkLLVM/${{env.SOURCE_DIRECTORY}} - run: cmake -B ${{env.BUILD_DIRECTORY}} -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_C_STANDARD=17 -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty -DPLATFORM=OS64 + run: cmake -B ${{env.BUILD_DIRECTORY}} -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_C_STANDARD=17 -DTHIRDPARTY_BUILD_DIR=${{github.workspace}}/thirdparty/${{env.SOURCE_DIRECTORY}}/${{env.BUILD_DIRECTORY}} -DPLATFORM=OS64 - name: Configure CMake for Mac if: ${{ matrix.target == 'OSX'}} working-directory: ${{github.workspace}}/zkLLVM/${{env.SOURCE_DIRECTORY}} - run: cmake -B ${{env.BUILD_DIRECTORY}} -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_C_STANDARD=17 -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty -DPLATFORM=MAC_UNIVERSAL + run: cmake -B ${{env.BUILD_DIRECTORY}} -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_C_STANDARD=17 -DTHIRDPARTY_BUILD_DIR=${{github.workspace}}/thirdparty/${{env.SOURCE_DIRECTORY}}/${{env.BUILD_DIRECTORY}} -DPLATFORM=MAC_UNIVERSAL - name: Configure CMake for Linux if: ${{ matrix.target == 'Linux' }} working-directory: ${{github.workspace}}/zkLLVM/${{env.SOURCE_DIRECTORY}} - run: cmake -B ${{env.BUILD_DIRECTORY}} -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_C_STANDARD=17 -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty -DABI_SUBFOLDER_NAME='/${{matrix.abi}}' + run: cmake -B ${{env.BUILD_DIRECTORY}} -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_C_STANDARD=17 -DTHIRDPARTY_BUILD_DIR=${{github.workspace}}/thirdparty/${{env.SOURCE_DIRECTORY}}/${{env.BUILD_DIRECTORY}} -DABI_SUBFOLDER_NAME='/${{matrix.abi}}' - name: Configure CMake for Windows if: ${{ matrix.target == 'Windows' }} working-directory: ${{github.workspace}}\zkLLVM run: | cd ${{env.SOURCE_DIRECTORY}} - cmake -B ${{env.BUILD_DIRECTORY}} -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_C_STANDARD=17 -DTHIRDPARTY_DIR=${{github.workspace}}\thirdparty -G "Visual Studio 17 2022" -A x64 + cmake -B ${{env.BUILD_DIRECTORY}} -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_C_STANDARD=17 -DTHIRDPARTY_BUILD_DIR=${{github.workspace}}\thirdparty/${{env.SOURCE_DIRECTORY}}/${{env.BUILD_DIRECTORY}} -G "Visual Studio 17 2022" -A x64 - name: Build working-directory: ${{github.workspace}}/zkLLVM/${{env.SOURCE_DIRECTORY}} @@ -178,54 +178,41 @@ jobs: - name: Compress build artifacts working-directory: ${{github.workspace}}/zkLLVM/${{env.SOURCE_DIRECTORY}}/${{env.BUILD_DIRECTORY}} - if: ${{github.event_name == 'workflow_dispatch'}} + if: github.ref_name == 'main' || github.ref_name == 'develop' shell: bash run: | - tar -czvf zkLLVM.tar.gz \ + tar -czvf ${FILE_NAME} \ --exclude='zkLLVM/src' \ --exclude='zkLLVM/tmp' \ --transform 's|^|${{env.SOURCE_DIRECTORY}}/${{env.BUILD_DIRECTORY}}/|S' \ zkLLVM - mv zkLLVM.tar.gz "${{github.workspace}}/zkLLVM.tar.gz" + mv ${FILE_NAME} "${{github.workspace}}/zkLLVM/${FILE_NAME}" - name: Release file + if: github.ref_name == 'main' || github.ref_name == 'develop' + working-directory: ${{github.workspace}}/zkLLVM shell: bash - if: ${{ github.event_name == 'workflow_dispatch' }} run: | - if [ '${{matrix.abi}}' ]; then - OS_NAME=${{matrix.target}}-${{matrix.abi}} - else - OS_NAME=${{matrix.target}} - fi - - if ${{github.event_name == 'pull_request'}}; then - branch_name=${{ github.event.pull_request.head.ref }} - else - branch_name=$GITHUB_REF_NAME - fi - - file_name="${OS_NAME}-${branch_name}-${{matrix.build-type}}.tar.gz" - RELEASE_TAG=${OS_NAME}-${branch_name}-${{matrix.build-type}} + RELEASE_TAG='${{matrix.target}}-${{github.ref_name}}-${{matrix.build-type}}' - mv zkLLVM.tar.gz ${file_name} + echo "RELEASE_TAG=${RELEASE_TAG}" >> $GITHUB_ENV - if ! gh release view $RELEASE_TAG --repo GeniusVentures/zkLLVM; then - echo "Release not found, creating tag ${RELEASE_TAG}" + if ! gh release view $RELEASE_TAG; then + echo "Release not found, creating with tag: $RELEASE_TAG" - if [ '${{matrix.build-type}}' != 'Release' ]; then + if [ '${{ matrix.build-type }}' != 'Release' ]; then RELEASE_TYPE="--prerelease" else RELEASE_TYPE="--latest" fi - gh release create ${RELEASE_TAG} \ - -n "${CURRENT_BRANCH} branch" \ + gh release create $RELEASE_TAG \ + -n "${CURRENT_BRANCH} branch" \ --target "${CURRENT_BRANCH}" \ ${RELEASE_TYPE} \ - --repo GeniusVentures/zkLLVM \ - -t "${{matrix.target}} ${{matrix.abi && format('({0}) ', matrix.abi) || ''}}${CURRENT_BRANCH} branch ${{matrix.build-type}} build" + -t "${{ matrix.target }} ${CURRENT_BRANCH} branch ${{ matrix.build-type }} build" fi - echo "Uploading ${file_name}" - gh release upload ${RELEASE_TAG} ${file_name} --repo GeniusVentures/zkLLVM --clobber + echo -e "Uploading ${FILE_NAME}" + gh release upload --clobber ${RELEASE_TAG} ${FILE_NAME} diff --git a/build b/build index 11437de0..80a91a83 160000 --- a/build +++ b/build @@ -1 +1 @@ -Subproject commit 11437de0c770038abe64124c0334fea9e6695e6c +Subproject commit 80a91a834d9322978d6b9910ac53312964b4d2ea diff --git a/cmake/CommonBuildParameters.cmake b/cmake/CommonBuildParameters.cmake index e5357e38..07764155 100644 --- a/cmake/CommonBuildParameters.cmake +++ b/cmake/CommonBuildParameters.cmake @@ -10,7 +10,7 @@ set(BOOST_VERSION_2U "${BOOST_MAJOR_VERSION}_${BOOST_MINOR_VERSION}") # Boost should be loaded before libp2p v0.1.2 # Set config of Boost project -set(_BOOST_ROOT "${THIRDPARTY_BUILD_DIR}/boost/build/${CMAKE_SYSTEM_NAME}") +set(_BOOST_ROOT "${THIRDPARTY_BUILD_DIR}/boost/build") set(Boost_LIB_DIR "${_BOOST_ROOT}/lib") set(Boost_INCLUDE_DIR "${_BOOST_ROOT}/include/boost-${BOOST_VERSION_2U}") set(Boost_DIR "${Boost_LIB_DIR}/cmake/Boost-${BOOST_VERSION}") From 168c85c87052a3bef49fb96528c9a2d74a486748 Mon Sep 17 00:00:00 2001 From: Henrique A Klein Date: Thu, 5 Jun 2025 13:50:12 -0300 Subject: [PATCH 103/114] WIP: Debug release of zkLLVM --- .github/workflows/cmake.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 3e689b12..be801b8c 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -22,7 +22,7 @@ jobs: fail-fast: false matrix: target: [Android, iOS, OSX, Linux, Windows] - build-type: [Release] + build-type: [Debug, Release] abi: [""] include: - target: Android @@ -41,6 +41,10 @@ jobs: host: ubuntu-22.04 abi: x86_64 build-type: Release + - target: Linux + host: ubuntu-22.04 + abi: x86_64 + build-type: Debug - target: Linux host: ubuntu-24.04-arm abi: aarch64 @@ -176,6 +180,20 @@ jobs: working-directory: ${{github.workspace}}/zkLLVM/${{env.SOURCE_DIRECTORY}} run: cmake --install ${{env.BUILD_DIRECTORY}} + - name: Print install directory size + working-directory: ${{github.workspace}}/zkLLVM/${{env.SOURCE_DIRECTORY}}/${{env.BUILD_DIRECTORY}}/zkLLVM + if: runner.os != 'Windows' + run: du -sh . + shell: bash + + - name: Print install directory size (Windows) + if: runner.os == 'Windows' + run: | + $path = "${{github.workspace}}\zkLLVM\${{env.SOURCE_DIRECTORY}}\${{env.BUILD_DIRECTORY}}\zkLLVM" + $size = (Get-ChildItem -Recurse -Force $path | Measure-Object -Property Length -Sum).Sum + "{0:N2} MB" -f ($size / 1MB) + shell: pwsh + - name: Compress build artifacts working-directory: ${{github.workspace}}/zkLLVM/${{env.SOURCE_DIRECTORY}}/${{env.BUILD_DIRECTORY}} if: github.ref_name == 'main' || github.ref_name == 'develop' From b8877fd30c153733e57d19660492c31ede181d0b Mon Sep 17 00:00:00 2001 From: Eduardo Menges Mattje Date: Fri, 6 Jun 2025 09:10:46 -0300 Subject: [PATCH 104/114] Revert "WIP: Debug release of zkLLVM" This reverts commit 168c85c87052a3bef49fb96528c9a2d74a486748. --- .github/workflows/cmake.yml | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index be801b8c..3e689b12 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -22,7 +22,7 @@ jobs: fail-fast: false matrix: target: [Android, iOS, OSX, Linux, Windows] - build-type: [Debug, Release] + build-type: [Release] abi: [""] include: - target: Android @@ -41,10 +41,6 @@ jobs: host: ubuntu-22.04 abi: x86_64 build-type: Release - - target: Linux - host: ubuntu-22.04 - abi: x86_64 - build-type: Debug - target: Linux host: ubuntu-24.04-arm abi: aarch64 @@ -180,20 +176,6 @@ jobs: working-directory: ${{github.workspace}}/zkLLVM/${{env.SOURCE_DIRECTORY}} run: cmake --install ${{env.BUILD_DIRECTORY}} - - name: Print install directory size - working-directory: ${{github.workspace}}/zkLLVM/${{env.SOURCE_DIRECTORY}}/${{env.BUILD_DIRECTORY}}/zkLLVM - if: runner.os != 'Windows' - run: du -sh . - shell: bash - - - name: Print install directory size (Windows) - if: runner.os == 'Windows' - run: | - $path = "${{github.workspace}}\zkLLVM\${{env.SOURCE_DIRECTORY}}\${{env.BUILD_DIRECTORY}}\zkLLVM" - $size = (Get-ChildItem -Recurse -Force $path | Measure-Object -Property Length -Sum).Sum - "{0:N2} MB" -f ($size / 1MB) - shell: pwsh - - name: Compress build artifacts working-directory: ${{github.workspace}}/zkLLVM/${{env.SOURCE_DIRECTORY}}/${{env.BUILD_DIRECTORY}} if: github.ref_name == 'main' || github.ref_name == 'develop' From d13f5132b859735903e577a8d2b480fe3b4fa042 Mon Sep 17 00:00:00 2001 From: itsafuu Date: Sat, 7 Jun 2025 21:19:44 -0400 Subject: [PATCH 105/114] I think this is likely the solution to making windows build --- cmake/CommonBuildParameters.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/CommonBuildParameters.cmake b/cmake/CommonBuildParameters.cmake index 07764155..6adbde6d 100644 --- a/cmake/CommonBuildParameters.cmake +++ b/cmake/CommonBuildParameters.cmake @@ -166,7 +166,7 @@ ExternalProject_Add(zkLLVM ${_ZKLLVM_EXTRA_PARAM} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} BUILD_COMMAND ${CMAKE_COMMAND} --build --config $ - INSTALL_COMMAND ${CMAKE_COMMAND} --install . + INSTALL_COMMAND ${CMAKE_COMMAND} --install . --config $ ) if(EXT_ZKSTDLIB) From 4021181dc9046e52463350779356433e574a4193 Mon Sep 17 00:00:00 2001 From: itsafuu Date: Sat, 7 Jun 2025 22:44:46 -0400 Subject: [PATCH 106/114] CMAKE_MSVC_RUNTIME_LIBRARY Does not seem to work properly in the external project, which could be for several reasons. I'm not inclined to go find that out, just set C/CXX flags. Honestly we should have kept this in cmaketemplate, I don't think it harms anything --- cmake/CommonBuildParameters.cmake | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/cmake/CommonBuildParameters.cmake b/cmake/CommonBuildParameters.cmake index 6adbde6d..20865fe5 100644 --- a/cmake/CommonBuildParameters.cmake +++ b/cmake/CommonBuildParameters.cmake @@ -81,6 +81,21 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden") endif() +if(WIN32) + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd") + set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT") + set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd") + if (CMAKE_BUILD_TYPE EQUAL Debug) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MTd") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MTd") + endif (CMAKE_BUILD_TYPE EQUAL Debug) + + if (CMAKE_BUILD_TYPE EQUAL Release) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MT") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MT") + endif (CMAKE_BUILD_TYPE EQUAL Release) +endif() set(_CMAKE_COMMON_CACHE_ARGS -DBUILD_SHARED_LIBS:BOOL=OFF From ac8985d1d7547a919bed6bef5acf3918d37a1520 Mon Sep 17 00:00:00 2001 From: Henrique A Klein Date: Mon, 9 Jun 2025 12:29:18 -0300 Subject: [PATCH 107/114] Feat: Adding tag release build yaml --- .github/workflows/build-release-tag.yml | 202 ++++++++++++++++++++++++ 1 file changed, 202 insertions(+) create mode 100644 .github/workflows/build-release-tag.yml diff --git a/.github/workflows/build-release-tag.yml b/.github/workflows/build-release-tag.yml new file mode 100644 index 00000000..cb37432f --- /dev/null +++ b/.github/workflows/build-release-tag.yml @@ -0,0 +1,202 @@ +name: zkLLVM Tag Build + +on: + workflow_dispatch: + inputs: + tag: + description: 'Tag to create releases for' + required: true + type: string + +jobs: + build: + env: + GH_TOKEN: ${{ secrets.GNUS_TOKEN_1 }} + runs-on: ${{matrix.host}} + strategy: + fail-fast: false + matrix: + target: [Android, iOS, OSX, Linux, Windows] + build-type: [Release] + abi: [""] + include: + - target: Android + host: ubuntu-22.04 + abi: arm64-v8a + build-type: Release + - target: Android + host: ubuntu-22.04 + abi: armeabi-v7a + build-type: Release + - target: iOS + host: macos-latest + - target: OSX + host: macos-latest + - target: Linux + host: ubuntu-22.04 + abi: x86_64 + build-type: Release + - target: Linux + host: ubuntu-24.04-arm + abi: aarch64 + build-type: Release + - target: Windows + host: windows-latest + exclude: + - target: Android + abi: "" + - target: Linux + abi: "" + steps: + - name: Configure Linux host + if: ${{ runner.os == 'Linux'}} + run: | + sudo update-alternatives --install /usr/bin/cc cc $(which clang) 100 + sudo update-alternatives --install /usr/bin/c++ c++ $(which clang++) 100 + sudo update-alternatives --set cc $(which clang) + sudo update-alternatives --set c++ $(which clang++) + + sudo apt install ccache ninja-build -y + echo "CMAKE_GENERATOR=Ninja" >> $GITHUB_ENV + + - name: Configure Windows host + if: ${{ runner.os == 'Windows'}} + run: | + choco install ccache -y + + - name: Configure macOS host + if: ${{ runner.os == 'macOS'}} + run: | + brew install ccache ninja bash + PATH="$HOMEBREW_PREFIX/opt/gnu-tar/libexec/gnubin:$PATH" + echo "PATH=$PATH" >> $GITHUB_ENV + echo "CMAKE_GENERATOR=Ninja" >> $GITHUB_ENV + + - name: Add Android toolchain + if: ${{ matrix.target == 'Android' }} + run: | + NDK_VERSION="r27b" + wget https://dl.google.com/android/repository/android-ndk-$NDK_VERSION-linux.zip -O ndk.zip + unzip ndk.zip -d $HOME + + echo "ANDROID_NDK_HOME=$HOME/android-ndk-$NDK_VERSION" >> $GITHUB_ENV + + - name: Checkout + uses: actions/checkout@v4 + with: + path: zkLLVM + submodules: "recursive" + ref: ${{ github.event.inputs.tag }} + + - name: Set build directory + run: | + if [ '${{matrix.abi}}' ]; then + BUILD_DIRECTORY=${{matrix.build-type}}/${{matrix.abi}} + else + BUILD_DIRECTORY=${{matrix.build-type}} + fi + + echo "SOURCE_DIRECTORY=build/${{matrix.target}}" >> $GITHUB_ENV + echo "BUILD_DIRECTORY=$BUILD_DIRECTORY" >> $GITHUB_ENV + shell: bash + + - name: Download thirdparty release + working-directory: ${{github.workspace}} + run: | + TAG_NAME="${{ github.event.inputs.tag }}" + echo "Building for tag: ${TAG_NAME}" + + if [ '${{matrix.abi}}' ]; then + FILE_NAME=${{matrix.target}}-${{matrix.abi}}-${{matrix.build-type}}.tar.gz + else + FILE_NAME=${{matrix.target}}-${{matrix.build-type}}.tar.gz + fi + echo "FILE_NAME=${FILE_NAME}" >> $GITHUB_ENV + + mkdir thirdparty + cd thirdparty + + # Download from the tag's release + echo "Downloading thirdparty from tag: ${TAG_NAME}" + + gh release download ${TAG_NAME} --repo GeniusVentures/thirdparty -p "${FILE_NAME}" + tar -zxf "${FILE_NAME}" ${{env.SOURCE_DIRECTORY}}/${{env.BUILD_DIRECTORY}}/boost + shell: bash + + - name: Configure CMake for Android + if: ${{ matrix.target == 'Android'}} + working-directory: ${{github.workspace}}/zkLLVM/${{env.SOURCE_DIRECTORY}} + run: cmake -B ${{env.BUILD_DIRECTORY}} -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_C_STANDARD=17 -DTHIRDPARTY_BUILD_DIR=${{github.workspace}}/thirdparty/${{env.SOURCE_DIRECTORY}}/${{env.BUILD_DIRECTORY}} -DANDROID_ABI=${{matrix.abi}} -DCMAKE_ANDROID_NDK=${ANDROID_NDK_HOME} + + - name: Configure CMake for iOS + if: ${{ matrix.target == 'iOS'}} + working-directory: ${{github.workspace}}/zkLLVM/${{env.SOURCE_DIRECTORY}} + run: cmake -B ${{env.BUILD_DIRECTORY}} -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_C_STANDARD=17 -DTHIRDPARTY_BUILD_DIR=${{github.workspace}}/thirdparty/${{env.SOURCE_DIRECTORY}}/${{env.BUILD_DIRECTORY}} -DPLATFORM=OS64 + + - name: Configure CMake for Mac + if: ${{ matrix.target == 'OSX'}} + working-directory: ${{github.workspace}}/zkLLVM/${{env.SOURCE_DIRECTORY}} + run: cmake -B ${{env.BUILD_DIRECTORY}} -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_C_STANDARD=17 -DTHIRDPARTY_BUILD_DIR=${{github.workspace}}/thirdparty/${{env.SOURCE_DIRECTORY}}/${{env.BUILD_DIRECTORY}} -DPLATFORM=MAC_UNIVERSAL + + - name: Configure CMake for Linux + if: ${{ matrix.target == 'Linux' }} + working-directory: ${{github.workspace}}/zkLLVM/${{env.SOURCE_DIRECTORY}} + run: cmake -B ${{env.BUILD_DIRECTORY}} -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_C_STANDARD=17 -DTHIRDPARTY_BUILD_DIR=${{github.workspace}}/thirdparty/${{env.SOURCE_DIRECTORY}}/${{env.BUILD_DIRECTORY}} -DABI_SUBFOLDER_NAME='/${{matrix.abi}}' + + - name: Configure CMake for Windows + if: ${{ matrix.target == 'Windows' }} + working-directory: ${{github.workspace}}\zkLLVM + run: | + cd ${{env.SOURCE_DIRECTORY}} + cmake -B ${{env.BUILD_DIRECTORY}} -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_C_STANDARD=17 -DTHIRDPARTY_BUILD_DIR=${{github.workspace}}\thirdparty/${{env.SOURCE_DIRECTORY}}/${{env.BUILD_DIRECTORY}} -G "Visual Studio 17 2022" -A x64 + + - name: Build + working-directory: ${{github.workspace}}/zkLLVM/${{env.SOURCE_DIRECTORY}} + run: cmake --build ${{env.BUILD_DIRECTORY}} --config ${{matrix.build-type}} -j + + - name: Install + working-directory: ${{github.workspace}}/zkLLVM/${{env.SOURCE_DIRECTORY}} + run: cmake --install ${{env.BUILD_DIRECTORY}} + + - name: Create or check release + shell: bash + run: | + TAG_NAME='${{ github.event.inputs.tag }}' + echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV + + echo "Checking if GitHub release exists for tag: $TAG_NAME" + + set +e + gh release view $TAG_NAME + releaseFound=$? + set -e + + if [[ $releaseFound -ne 0 ]]; then + echo "Release not found, creating for tag: $TAG_NAME" + + # Create a single release for the tag + gh release create $TAG_NAME \ + -n "Build artifacts for tag ${TAG_NAME}" \ + -t "${TAG_NAME} build artifacts" + else + echo "Release already exists for tag: $TAG_NAME" + fi + + - name: Compress build artifacts + working-directory: ${{github.workspace}}/zkLLVM/${{env.SOURCE_DIRECTORY}}/${{env.BUILD_DIRECTORY}} + shell: bash + run: | + tar -czvf ${FILE_NAME} \ + --exclude='zkLLVM/src' \ + --exclude='zkLLVM/tmp' \ + --transform 's|^|${{env.SOURCE_DIRECTORY}}/${{env.BUILD_DIRECTORY}}/|S' \ + zkLLVM + + mv ${FILE_NAME} "${{github.workspace}}/zkLLVM/${FILE_NAME}" + + - name: Release file + working-directory: ${{github.workspace}}/zkLLVM + shell: bash + run: | + echo -e "Uploading ${FILE_NAME} to release ${TAG_NAME}" + gh release upload --clobber ${TAG_NAME} ${FILE_NAME} \ No newline at end of file From 14053202a5f6fd86722a4e4fec56b9e6baca4a5f Mon Sep 17 00:00:00 2001 From: Henrique A Klein Date: Mon, 9 Jun 2025 12:42:11 -0300 Subject: [PATCH 108/114] Fix: Download of thirdparty artifacts --- .github/workflows/build-release-tag.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-release-tag.yml b/.github/workflows/build-release-tag.yml index cb37432f..e04479e6 100644 --- a/.github/workflows/build-release-tag.yml +++ b/.github/workflows/build-release-tag.yml @@ -115,40 +115,41 @@ jobs: mkdir thirdparty cd thirdparty + pwd # Download from the tag's release echo "Downloading thirdparty from tag: ${TAG_NAME}" gh release download ${TAG_NAME} --repo GeniusVentures/thirdparty -p "${FILE_NAME}" - tar -zxf "${FILE_NAME}" ${{env.SOURCE_DIRECTORY}}/${{env.BUILD_DIRECTORY}}/boost + tar -zxvf "${FILE_NAME}" shell: bash - name: Configure CMake for Android if: ${{ matrix.target == 'Android'}} working-directory: ${{github.workspace}}/zkLLVM/${{env.SOURCE_DIRECTORY}} - run: cmake -B ${{env.BUILD_DIRECTORY}} -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_C_STANDARD=17 -DTHIRDPARTY_BUILD_DIR=${{github.workspace}}/thirdparty/${{env.SOURCE_DIRECTORY}}/${{env.BUILD_DIRECTORY}} -DANDROID_ABI=${{matrix.abi}} -DCMAKE_ANDROID_NDK=${ANDROID_NDK_HOME} + run: cmake -B ${{env.BUILD_DIRECTORY}} -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_C_STANDARD=17 -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty/${{env.SOURCE_DIRECTORY}} -DTHIRDPARTY_BUILD_DIR=${{github.workspace}}/thirdparty/${{env.SOURCE_DIRECTORY}}/${{env.BUILD_DIRECTORY}} -DANDROID_ABI=${{matrix.abi}} -DCMAKE_ANDROID_NDK=${ANDROID_NDK_HOME} - name: Configure CMake for iOS if: ${{ matrix.target == 'iOS'}} working-directory: ${{github.workspace}}/zkLLVM/${{env.SOURCE_DIRECTORY}} - run: cmake -B ${{env.BUILD_DIRECTORY}} -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_C_STANDARD=17 -DTHIRDPARTY_BUILD_DIR=${{github.workspace}}/thirdparty/${{env.SOURCE_DIRECTORY}}/${{env.BUILD_DIRECTORY}} -DPLATFORM=OS64 + run: cmake -B ${{env.BUILD_DIRECTORY}} -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_C_STANDARD=17 -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty/${{env.SOURCE_DIRECTORY}} -DTHIRDPARTY_BUILD_DIR=${{github.workspace}}/thirdparty/${{env.SOURCE_DIRECTORY}}/${{env.BUILD_DIRECTORY}} -DPLATFORM=OS64 - name: Configure CMake for Mac if: ${{ matrix.target == 'OSX'}} working-directory: ${{github.workspace}}/zkLLVM/${{env.SOURCE_DIRECTORY}} - run: cmake -B ${{env.BUILD_DIRECTORY}} -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_C_STANDARD=17 -DTHIRDPARTY_BUILD_DIR=${{github.workspace}}/thirdparty/${{env.SOURCE_DIRECTORY}}/${{env.BUILD_DIRECTORY}} -DPLATFORM=MAC_UNIVERSAL + run: cmake -B ${{env.BUILD_DIRECTORY}} -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_C_STANDARD=17 -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty/${{env.SOURCE_DIRECTORY}} -DTHIRDPARTY_BUILD_DIR=${{github.workspace}}/thirdparty/${{env.SOURCE_DIRECTORY}}/${{env.BUILD_DIRECTORY}} -DPLATFORM=MAC_UNIVERSAL - name: Configure CMake for Linux if: ${{ matrix.target == 'Linux' }} working-directory: ${{github.workspace}}/zkLLVM/${{env.SOURCE_DIRECTORY}} - run: cmake -B ${{env.BUILD_DIRECTORY}} -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_C_STANDARD=17 -DTHIRDPARTY_BUILD_DIR=${{github.workspace}}/thirdparty/${{env.SOURCE_DIRECTORY}}/${{env.BUILD_DIRECTORY}} -DABI_SUBFOLDER_NAME='/${{matrix.abi}}' + run: cmake -B ${{env.BUILD_DIRECTORY}} -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_C_STANDARD=17 -DTHIRDPARTY_DIR=${{github.workspace}}/thirdparty/${{env.SOURCE_DIRECTORY}} -DTHIRDPARTY_BUILD_DIR=${{github.workspace}}/thirdparty/${{env.SOURCE_DIRECTORY}}/${{env.BUILD_DIRECTORY}} -DABI_SUBFOLDER_NAME='/${{matrix.abi}}' - name: Configure CMake for Windows if: ${{ matrix.target == 'Windows' }} working-directory: ${{github.workspace}}\zkLLVM run: | cd ${{env.SOURCE_DIRECTORY}} - cmake -B ${{env.BUILD_DIRECTORY}} -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_C_STANDARD=17 -DTHIRDPARTY_BUILD_DIR=${{github.workspace}}\thirdparty/${{env.SOURCE_DIRECTORY}}/${{env.BUILD_DIRECTORY}} -G "Visual Studio 17 2022" -A x64 + cmake -B ${{env.BUILD_DIRECTORY}} -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_C_STANDARD=17 -DTHIRDPARTY_DIR=${{github.workspace}}\thirdparty/${{env.SOURCE_DIRECTORY}} -DTHIRDPARTY_BUILD_DIR=${{github.workspace}}\thirdparty/${{env.SOURCE_DIRECTORY}}/${{env.BUILD_DIRECTORY}} -G "Visual Studio 17 2022" -A x64 - name: Build working-directory: ${{github.workspace}}/zkLLVM/${{env.SOURCE_DIRECTORY}} @@ -159,6 +160,7 @@ jobs: run: cmake --install ${{env.BUILD_DIRECTORY}} - name: Create or check release + working-directory: ${{github.workspace}}/zkLLVM shell: bash run: | TAG_NAME='${{ github.event.inputs.tag }}' From c9b581013394705f03733bdc9e3856c34b5f7383 Mon Sep 17 00:00:00 2001 From: Eduardo Menges Mattje Date: Mon, 9 Jun 2025 15:46:35 -0300 Subject: [PATCH 109/114] Removed `circifier` from debug builds --- CMakeLists.txt | 5 ++++- cmake/CommonBuildParameters.cmake | 12 +++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 390f32f9..0c3d3481 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -96,7 +96,10 @@ if (ZKLLVM_BUILD_TRANSPILER_LIB) endif() set(LLVM_ENABLE_PROJECTS "clang" CACHE STRING "Additional llvm projects") -add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/libs/circifier/llvm") + +if(NOT CMAKE_BUILD_TYPE MATCHES "[Dd]ebug") + add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/libs/circifier/llvm") +endif() if (ZKLLVM_BUILD_EXAMPLES) add_subdirectory(examples) diff --git a/cmake/CommonBuildParameters.cmake b/cmake/CommonBuildParameters.cmake index 20865fe5..7386b7af 100644 --- a/cmake/CommonBuildParameters.cmake +++ b/cmake/CommonBuildParameters.cmake @@ -70,7 +70,6 @@ if(ANDROID OR IOS) -DZKLLVM_BUILD_EXECUTABLES:BOOL=OFF -DLLVM_INCLUDE_UTILS:BOOL=OFF -DLLVM_INCLUDE_TESTS:BOOL=OFF - -DCLANG_BUILD_TOOLS:BOOL=OFF -DCLANG_INCLUDE_DOCS:BOOL=OFF ) endif() @@ -165,12 +164,15 @@ ExternalProject_Add(zkLLVM CONFIGURE_COMMAND ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX:PATH= - -DLLVM_ENABLE_ZSTD:BOOL=OFF - -DLLVM_INCLUDE_EXAMPLES:BOOL=OFF + -DCLANG_BUILD_TOOLS:BOOL=OFF + -DLLVM_BUILD_TOOLS:BOOL=OFF + -DLLVM_ENABLE_CURSES:BOOL=OFF + -DLLVM_ENABLE_LIBEDIT:BOOL=OFF + -DLLVM_ENABLE_PLUGINS:BOOL=OFF -DLLVM_ENABLE_TERMINFO:BOOL=OFF - -DLLVM_ENABLE_LIBEDIT=OFF - -DLLVM_ENABLE_CURSES=OFF + -DLLVM_ENABLE_ZSTD:BOOL=OFF -DLLVM_EXPORT_SYMBOLS_FOR_PLUGINS=OFF + -DLLVM_INCLUDE_EXAMPLES:BOOL=OFF -DZKLLVM_BUILD_EXECUTABLES:BOOL=OFF -DZKLLVM_BUILD_RSLANG:BOOL=OFF -DZKLLVM_DEV_ENVIRONMENT:BOOL=ON From 3f244ec5e99a42fd380e2543a68decfd42647240 Mon Sep 17 00:00:00 2001 From: Eduardo Menges Mattje Date: Mon, 9 Jun 2025 17:02:34 -0300 Subject: [PATCH 110/114] Also disabled `stdlib` for debug --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0c3d3481..73a2db0d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -108,7 +108,7 @@ if(BUILD_TESTS) add_subdirectory(tests) endif() -if (ZKLLVM_BUILD_STD_LIB) +if (ZKLLVM_BUILD_STD_LIB AND NOT CMAKE_BUILD_TYPE MATCHES "[Dd]ebug") add_subdirectory(libs/stdlib) endif() From 3ae27832cf60e4c3c2b318d7830b905c25f80a52 Mon Sep 17 00:00:00 2001 From: Eduardo Menges Mattje Date: Tue, 10 Jun 2025 10:46:18 -0300 Subject: [PATCH 111/114] Revert "Also disabled `stdlib` for debug" This reverts commit 3f244ec5e99a42fd380e2543a68decfd42647240. --- CMakeLists.txt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 73a2db0d..390f32f9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -96,10 +96,7 @@ if (ZKLLVM_BUILD_TRANSPILER_LIB) endif() set(LLVM_ENABLE_PROJECTS "clang" CACHE STRING "Additional llvm projects") - -if(NOT CMAKE_BUILD_TYPE MATCHES "[Dd]ebug") - add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/libs/circifier/llvm") -endif() +add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/libs/circifier/llvm") if (ZKLLVM_BUILD_EXAMPLES) add_subdirectory(examples) @@ -108,7 +105,7 @@ if(BUILD_TESTS) add_subdirectory(tests) endif() -if (ZKLLVM_BUILD_STD_LIB AND NOT CMAKE_BUILD_TYPE MATCHES "[Dd]ebug") +if (ZKLLVM_BUILD_STD_LIB) add_subdirectory(libs/stdlib) endif() From 10e3d447892761c0db7a186944de382bd212a434 Mon Sep 17 00:00:00 2001 From: Eduardo Menges Mattje Date: Tue, 10 Jun 2025 10:49:12 -0300 Subject: [PATCH 112/114] Reapply "WIP: Debug release of zkLLVM" This reverts commit b8877fd30c153733e57d19660492c31ede181d0b. --- .github/workflows/cmake.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 3e689b12..be801b8c 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -22,7 +22,7 @@ jobs: fail-fast: false matrix: target: [Android, iOS, OSX, Linux, Windows] - build-type: [Release] + build-type: [Debug, Release] abi: [""] include: - target: Android @@ -41,6 +41,10 @@ jobs: host: ubuntu-22.04 abi: x86_64 build-type: Release + - target: Linux + host: ubuntu-22.04 + abi: x86_64 + build-type: Debug - target: Linux host: ubuntu-24.04-arm abi: aarch64 @@ -176,6 +180,20 @@ jobs: working-directory: ${{github.workspace}}/zkLLVM/${{env.SOURCE_DIRECTORY}} run: cmake --install ${{env.BUILD_DIRECTORY}} + - name: Print install directory size + working-directory: ${{github.workspace}}/zkLLVM/${{env.SOURCE_DIRECTORY}}/${{env.BUILD_DIRECTORY}}/zkLLVM + if: runner.os != 'Windows' + run: du -sh . + shell: bash + + - name: Print install directory size (Windows) + if: runner.os == 'Windows' + run: | + $path = "${{github.workspace}}\zkLLVM\${{env.SOURCE_DIRECTORY}}\${{env.BUILD_DIRECTORY}}\zkLLVM" + $size = (Get-ChildItem -Recurse -Force $path | Measure-Object -Property Length -Sum).Sum + "{0:N2} MB" -f ($size / 1MB) + shell: pwsh + - name: Compress build artifacts working-directory: ${{github.workspace}}/zkLLVM/${{env.SOURCE_DIRECTORY}}/${{env.BUILD_DIRECTORY}} if: github.ref_name == 'main' || github.ref_name == 'develop' From 24de013316bdbf75f874d13900dfcf316cead392 Mon Sep 17 00:00:00 2001 From: Eduardo Menges Mattje Date: Tue, 10 Jun 2025 17:30:28 -0300 Subject: [PATCH 113/114] Disabled debug builds for OSX and Linux --- .github/workflows/cmake.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index be801b8c..5a60d13f 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -41,10 +41,6 @@ jobs: host: ubuntu-22.04 abi: x86_64 build-type: Release - - target: Linux - host: ubuntu-22.04 - abi: x86_64 - build-type: Debug - target: Linux host: ubuntu-24.04-arm abi: aarch64 @@ -56,6 +52,8 @@ jobs: abi: "" - target: Linux abi: "" + - target: OSX + build-type: Debug steps: - name: Configure Linux host if: ${{ runner.os == 'Linux'}} From dadd92fcde947229dc808cbfdfdbaae3e23ff85e Mon Sep 17 00:00:00 2001 From: Henrique A Klein Date: Tue, 10 Jun 2025 17:48:38 -0300 Subject: [PATCH 114/114] Fix: Removed iOS debug builds --- .github/workflows/build-release-tag.yml | 4 ++++ .github/workflows/cmake.yml | 2 ++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/build-release-tag.yml b/.github/workflows/build-release-tag.yml index e04479e6..affea2b5 100644 --- a/.github/workflows/build-release-tag.yml +++ b/.github/workflows/build-release-tag.yml @@ -47,6 +47,10 @@ jobs: abi: "" - target: Linux abi: "" + - target: OSX + build-type: Debug + - target: iOS + build-type: Debug steps: - name: Configure Linux host if: ${{ runner.os == 'Linux'}} diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 5a60d13f..045cb3bd 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -54,6 +54,8 @@ jobs: abi: "" - target: OSX build-type: Debug + - target: iOS + build-type: Debug steps: - name: Configure Linux host if: ${{ runner.os == 'Linux'}}