From a6b2739c4d136ca2f86bb1958313e9241171a56f Mon Sep 17 00:00:00 2001 From: gogoex <110195520+gogoex@users.noreply.github.com> Date: Wed, 3 Jan 2024 11:02:10 +0900 Subject: [PATCH 01/12] move bech32_mod under blsct directory --- src/Makefile.am | 4 ++-- src/Makefile.test.include | 2 +- src/bench/bech32_mod.cpp | 2 +- src/{ => blsct}/bech32_mod.cpp | 2 +- src/{ => blsct}/bech32_mod.h | 0 src/key_io.cpp | 2 +- src/key_io.h | 2 +- src/test/{ => blsct}/bech32_mod_tests.cpp | 2 +- src/test/fuzz/bech32_mod.cpp | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) rename src/{ => blsct}/bech32_mod.cpp (99%) rename src/{ => blsct}/bech32_mod.h (100%) rename src/test/{ => blsct}/bech32_mod_tests.cpp (99%) diff --git a/src/Makefile.am b/src/Makefile.am index db99ee47c2fe5..1538b71b8be4d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -154,7 +154,6 @@ BITCOIN_CORE_H = \ banman.h \ base58.h \ bech32.h \ - bech32_mod.h \ blockencodings.h \ blockfilter.h \ blsct/arith/mcl/mcl.h \ @@ -164,6 +163,7 @@ BITCOIN_CORE_H = \ blsct/arith/mcl/mcl_util.h \ blsct/arith/elements.h \ blsct/arith/endianness.h \ + blsct/bech32_mod.h \ blsct/building_block/fiat_shamir.h \ blsct/building_block/generator_deriver.h \ blsct/building_block/g_h_gi_hi_zero_verifier.h \ @@ -822,8 +822,8 @@ libbitcoin_common_a_SOURCES = \ bech32.cpp \ blsct/arith/mcl/mcl_g1point.cpp \ blsct/arith/mcl/mcl_scalar.cpp \ - bech32_mod.cpp \ blsct/arith/elements.cpp \ + blsct/bech32_mod.cpp \ blsct/building_block/generator_deriver.cpp \ blsct/building_block/g_h_gi_hi_zero_verifier.cpp \ blsct/building_block/imp_inner_prod_arg.cpp \ diff --git a/src/Makefile.test.include b/src/Makefile.test.include index 46d151020dd7d..8070635cec192 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -77,7 +77,6 @@ BITCOIN_TESTS =\ test/base58_tests.cpp \ test/base64_tests.cpp \ test/bech32_tests.cpp \ - test/bech32_mod_tests.cpp \ test/bip32_tests.cpp \ test/blockchain_tests.cpp \ test/blockencodings_tests.cpp \ @@ -89,6 +88,7 @@ BITCOIN_TESTS =\ test/blsct/arith/mcl/mcl_g1point_tests.cpp \ test/blsct/arith/mcl/mcl_integration_tests.cpp \ test/blsct/arith/mcl/mcl_scalar_tests.cpp \ + test/blsct/bech32_mod_tests.cpp \ test/blsct/building_block/generator_deriver_tests.cpp \ test/blsct/building_block/imp_inner_prod_arg_tests.cpp \ test/blsct/building_block/lazy_points_tests.cpp \ diff --git a/src/bench/bech32_mod.cpp b/src/bench/bech32_mod.cpp index a4c8d7e7b731c..90f4efae46587 100644 --- a/src/bench/bech32_mod.cpp +++ b/src/bench/bech32_mod.cpp @@ -4,7 +4,7 @@ #include -#include +#include #include #include diff --git a/src/bech32_mod.cpp b/src/blsct/bech32_mod.cpp similarity index 99% rename from src/bech32_mod.cpp rename to src/blsct/bech32_mod.cpp index 8ba07d9422564..2d0a5d0680c5d 100644 --- a/src/bech32_mod.cpp +++ b/src/blsct/bech32_mod.cpp @@ -4,7 +4,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include -#include +#include #include #include diff --git a/src/bech32_mod.h b/src/blsct/bech32_mod.h similarity index 100% rename from src/bech32_mod.h rename to src/blsct/bech32_mod.h diff --git a/src/key_io.cpp b/src/key_io.cpp index 7e89e78e82a20..5a98d2652564c 100644 --- a/src/key_io.cpp +++ b/src/key_io.cpp @@ -4,8 +4,8 @@ #include #include -#include #include +#include #include #include #include diff --git a/src/key_io.h b/src/key_io.h index 1ca2ea0cea804..34f23f9bb0d65 100644 --- a/src/key_io.h +++ b/src/key_io.h @@ -6,7 +6,7 @@ #ifndef BITCOIN_KEY_IO_H #define BITCOIN_KEY_IO_H -#include +#include #include #include #include diff --git a/src/test/bech32_mod_tests.cpp b/src/test/blsct/bech32_mod_tests.cpp similarity index 99% rename from src/test/bech32_mod_tests.cpp rename to src/test/blsct/bech32_mod_tests.cpp index c9850abaff3c7..7e1ef62107b57 100644 --- a/src/test/bech32_mod_tests.cpp +++ b/src/test/blsct/bech32_mod_tests.cpp @@ -3,8 +3,8 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. +#include #include -#include #include #include diff --git a/src/test/fuzz/bech32_mod.cpp b/src/test/fuzz/bech32_mod.cpp index 60ca715bb1ac1..01f96dfdc2133 100644 --- a/src/test/fuzz/bech32_mod.cpp +++ b/src/test/fuzz/bech32_mod.cpp @@ -2,7 +2,7 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include +#include #include #include #include From afc8579c6989bfd8e485a7263a54df7c6ac647f9 Mon Sep 17 00:00:00 2001 From: gogoex <110195520+gogoex@users.noreply.github.com> Date: Wed, 3 Jan 2024 12:10:06 +0900 Subject: [PATCH 02/12] add enable-build-libblsct-only build option --- configure.ac | 28 ++++++ src/Makefile.am | 153 ++++++++++++++++++++----------- src/blsct/external_api/blsct.cpp | 24 +++++ src/blsct/external_api/blsct.h | 6 ++ 4 files changed, 160 insertions(+), 51 deletions(-) create mode 100644 src/blsct/external_api/blsct.cpp create mode 100644 src/blsct/external_api/blsct.h diff --git a/configure.ac b/configure.ac index 432eccc389f32..34291ebf2b971 100644 --- a/configure.ac +++ b/configure.ac @@ -323,6 +323,12 @@ AC_ARG_ENABLE([lto], [enable_lto=$enableval], [enable_lto=no]) +AC_ARG_ENABLE([build-libblsct-only], + [AS_HELP_STRING([--enable-build-libblsct-only], + [build libblsct.a only and do not build others (default is to build everything)])], + [enable_build_libblsct_only=$enableval], + [enable_build_libblsct_only=no]) + AC_LANG_PUSH([C++]) dnl Check for a flag to turn compiler warnings into errors. This is helpful for checks which may @@ -1310,6 +1316,26 @@ if test "$enable_fuzz" = "yes"; then AX_CHECK_PREPROC_FLAG([-DABORT_ON_FAILED_ASSUME], [DEBUG_CPPFLAGS="$DEBUG_CPPFLAGS -DABORT_ON_FAILED_ASSUME"], [], [$CXXFLAG_WERROR]) fi +if test "$enable_build_libblsct_only" = "yes"; then + AC_MSG_WARN([enable-build-libblsct-only will disable all other targets overriding enable-fuzz]) + build_bitcoin_utils=no + build_bitcoin_cli=no + build_bitcoin_tx=no + build_bitcoin_util=no + build_bitcoin_chainstate=no + build_bitcoin_wallet=no + build_bitcoind=no + build_bitcoin_libs=no + use_bench=no + use_tests=no + use_external_signer=no + use_upnp=no + use_natpmp=no + use_zmq=no + enable_fuzz=no + enable_fuzz_binary=no +fi + if test "$enable_fuzz_binary" = "yes"; then AC_MSG_CHECKING([whether main function is needed for fuzz binary]) AX_CHECK_LINK_FLAG( @@ -1809,6 +1835,7 @@ AM_CONDITIONAL([USE_ASM], [test "$use_asm" = "yes"]) AM_CONDITIONAL([WORDS_BIGENDIAN], [test "$ac_cv_c_bigendian" = "yes"]) AM_CONDITIONAL([USE_NATPMP], [test "$use_natpmp" = "yes"]) AM_CONDITIONAL([USE_UPNP], [test "$use_upnp" = "yes"]) +AM_CONDITIONAL([BUILD_LIBBLSCT_ONLY], [test "$enable_build_libblsct_only" = "yes"]) dnl for minisketch AM_CONDITIONAL([ENABLE_CLMUL], [test "$enable_clmul" = "yes"]) @@ -1947,6 +1974,7 @@ echo " debug enabled = $enable_debug" echo " gprof enabled = $enable_gprof" echo " werror = $enable_werror" echo " LTO = $enable_lto" +echo " libblsct only = $enable_build_libblsct_only" echo echo " target os = $host_os" echo " build os = $build_os" diff --git a/src/Makefile.am b/src/Makefile.am index 1538b71b8be4d..5c2a77d453890 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -74,6 +74,7 @@ noinst_LTLIBRARIES += $(LIBBITCOIN_CRYPTO) $(LIBSECP256K1): $(wildcard secp256k1/src/*.h) $(wildcard secp256k1/src/*.c) $(wildcard secp256k1/include/*) $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F) +LIBBLS_A = bls/lib/libbls384_256.a $(LIBBLS): $(AM_V_at) \ ARCH='$(firstword $(subst -, ,$(HOST)))' \ @@ -85,8 +86,9 @@ $(LIBBLS): AR='$(AR)' \ RANLIB='$(RANLIB)' \ $(MAKE) $(AM_MAKEFLAGS) BLS_ETH=1 -C bls lib/libbls384_256.a - $(RANLIB) bls/lib/libbls384_256.a + $(RANLIB) $(LIBBLS_A) +LIBMCL_A = bls/mcl/lib/libmcl.a $(LIBMCL): $(AM_V_at) \ MCL_USE_LLVM=0 \ @@ -99,7 +101,7 @@ $(LIBMCL): AR='$(AR)' \ RANLIB='$(RANLIB)' \ $(MAKE) $(AM_MAKEFLAGS) -C bls/mcl lib/libmcl.a - $(RANLIB) bls/mcl/lib/libmcl.a + $(RANLIB) $(LIBMCL_A) # Make is not made aware of per-object dependencies to avoid limiting building parallelization # But to build the less dependent modules first, we manually select their order here: @@ -144,18 +146,7 @@ if BUILD_BITCOIN_CHAINSTATE bin_PROGRAMS += navcoin-chainstate endif -.PHONY: FORCE check-symbols check-security -# navcoin core # -BITCOIN_CORE_H = \ - addrdb.h \ - addrman.h \ - addrman_impl.h \ - attributes.h \ - banman.h \ - base58.h \ - bech32.h \ - blockencodings.h \ - blockfilter.h \ +BLSCT_H = \ blsct/arith/mcl/mcl.h \ blsct/arith/mcl/mcl_g1point.h \ blsct/arith/mcl/mcl_init.h \ @@ -205,7 +196,57 @@ BITCOIN_CORE_H = \ blsct/wallet/keyring.h \ blsct/wallet/txfactory.h \ blsct/wallet/txfactory_global.h \ - blsct/wallet/verification.h \ + blsct/wallet/verification.h + +BLSCT_CPP = \ + blsct/arith/mcl/mcl_g1point.cpp \ + blsct/arith/mcl/mcl_scalar.cpp \ + blsct/arith/elements.cpp \ + blsct/building_block/generator_deriver.cpp \ + blsct/building_block/g_h_gi_hi_zero_verifier.cpp \ + blsct/building_block/imp_inner_prod_arg.cpp \ + blsct/building_block/lazy_point.cpp \ + blsct/building_block/lazy_points.cpp \ + blsct/building_block/weighted_inner_prod_arg.cpp \ + blsct/common.cpp \ + blsct/double_public_key.cpp \ + blsct/eip_2333/bls12_381_keygen.cpp \ + blsct/private_key.cpp \ + blsct/public_key.cpp \ + blsct/public_keys.cpp \ + blsct/range_proof/bulletproofs/amount_recovery_request.cpp \ + blsct/range_proof/bulletproofs/amount_recovery_result.cpp \ + blsct/range_proof/bulletproofs/range_proof_logic.cpp \ + blsct/range_proof/bulletproofs/range_proof.cpp \ + blsct/range_proof/bulletproofs/range_proof_with_transcript.cpp \ + blsct/range_proof/bulletproofs_plus/amount_recovery_request.cpp \ + blsct/range_proof/bulletproofs_plus/amount_recovery_result.cpp \ + blsct/range_proof/bulletproofs_plus/range_proof_logic.cpp \ + blsct/range_proof/bulletproofs_plus/range_proof.cpp \ + blsct/range_proof/bulletproofs_plus/range_proof_with_transcript.cpp \ + blsct/range_proof/bulletproofs_plus/util.cpp \ + blsct/range_proof/common.cpp \ + blsct/range_proof/generators.cpp \ + blsct/range_proof/msg_amt_cipher.cpp \ + blsct/range_proof/proof_base.cpp \ + blsct/set_mem_proof/set_mem_proof.cpp \ + blsct/set_mem_proof/set_mem_proof_setup.cpp \ + blsct/set_mem_proof/set_mem_proof_prover.cpp \ + blsct/wallet/verification.cpp \ + blsct/signature.cpp + +.PHONY: FORCE check-symbols check-security +# navcoin core # +BITCOIN_CORE_H = \ + addrdb.h \ + addrman.h \ + addrman_impl.h \ + attributes.h \ + banman.h \ + base58.h \ + bech32.h \ + blockencodings.h \ + blockfilter.h \ dandelion.h \ chain.h \ chainparams.h \ @@ -434,7 +475,8 @@ BITCOIN_CORE_H = \ zmq/zmqnotificationinterface.h \ zmq/zmqpublishnotifier.h \ zmq/zmqrpc.h \ - zmq/zmqutil.h + zmq/zmqutil.h \ + $(BLSCT_H) obj/build.h: FORCE @@ -452,41 +494,6 @@ libbitcoin_node_a_SOURCES = \ banman.cpp \ blockencodings.cpp \ blockfilter.cpp \ - blsct/arith/mcl/mcl_g1point.cpp \ - blsct/arith/mcl/mcl_scalar.cpp \ - blsct/arith/elements.cpp \ - blsct/building_block/generator_deriver.cpp \ - blsct/building_block/g_h_gi_hi_zero_verifier.cpp \ - blsct/building_block/imp_inner_prod_arg.cpp \ - blsct/building_block/lazy_point.cpp \ - blsct/building_block/lazy_points.cpp \ - blsct/building_block/weighted_inner_prod_arg.cpp \ - blsct/common.cpp \ - blsct/double_public_key.cpp \ - blsct/eip_2333/bls12_381_keygen.cpp \ - blsct/private_key.cpp \ - blsct/public_key.cpp \ - blsct/public_keys.cpp \ - blsct/range_proof/bulletproofs/amount_recovery_request.cpp \ - blsct/range_proof/bulletproofs/amount_recovery_result.cpp \ - blsct/range_proof/bulletproofs/range_proof_logic.cpp \ - blsct/range_proof/bulletproofs/range_proof.cpp \ - blsct/range_proof/bulletproofs/range_proof_with_transcript.cpp \ - blsct/range_proof/bulletproofs_plus/amount_recovery_request.cpp \ - blsct/range_proof/bulletproofs_plus/amount_recovery_result.cpp \ - blsct/range_proof/bulletproofs_plus/range_proof_logic.cpp \ - blsct/range_proof/bulletproofs_plus/range_proof.cpp \ - blsct/range_proof/bulletproofs_plus/range_proof_with_transcript.cpp \ - blsct/range_proof/bulletproofs_plus/util.cpp \ - blsct/range_proof/common.cpp \ - blsct/range_proof/generators.cpp \ - blsct/range_proof/msg_amt_cipher.cpp \ - blsct/range_proof/proof_base.cpp \ - blsct/set_mem_proof/set_mem_proof.cpp \ - blsct/set_mem_proof/set_mem_proof_setup.cpp \ - blsct/set_mem_proof/set_mem_proof_prover.cpp \ - blsct/wallet/verification.cpp \ - blsct/signature.cpp \ chain.cpp \ chainparams.cpp \ consensus/tx_verify.cpp \ @@ -566,6 +573,7 @@ libbitcoin_node_a_SOURCES = \ validation.cpp \ validationinterface.cpp \ versionbits.cpp \ + $(BLSCT_CPP) \ $(BITCOIN_CORE_H) if ENABLE_WALLET @@ -1296,9 +1304,52 @@ CLEANFILES += wallet/*.gcda wallet/*.gcno CLEANFILES += wallet/test/*.gcda wallet/test/*.gcno CLEANFILES += zmq/*.gcda zmq/*.gcno CLEANFILES += obj/build.h +CLEANFILES += $(LIBBLS_A) +CLEANFILES += $(LIBMCL_A) EXTRA_DIST = $(CTAES_DIST) +# blsct library # +if BUILD_LIBBLSCT_ONLY +LIBBLSCT_A = libblsct.a +noinst_LIBRARIES = $(LIBBLSCT_A) +libblsct_a_SOURCES = \ + crypto/sha256_arm_shani.cpp \ + crypto/sha256_avx2.cpp \ + crypto/sha256_sse4.cpp \ + crypto/sha256_sse41.cpp \ + crypto/sha256_x86_shani.cpp \ + crypto/sha256.cpp \ + blsct/external_api/blsct.cpp \ + $(BLSCT_CPP) +libblsct_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) +libblsct_a_CPPFLAGS = $(AM_CPPFLAGS) $(BLS_INCLUDES) $(BOOST_CPPFLAGS) + +if ENABLE_SSE41 +libblsct_a_CXXFLAGS += $(SSE41_CXXFLAGS) +libblsct_a_CPPFLAGS += -DENABLE_SSE41 +endif + +if ENABLE_AVX2 +libblsct_a_CXXFLAGS += $(AVX2_CXXFLAGS) +libblsct_a_CPPFLAGS += -DENABLE_AVX2 +endif + +if ENABLE_X86_SHANI +libblsct_a_CXXFLAGS += $(X86_SHANI_CXXFLAGS) +libblsct_a_CPPFLAGS += -DENABLE_X86_SHANI +endif + +if ENABLE_ARM_SHANI +libblsct_a_CXXFLAGS += $(ARM_SHANI_CXXFLAGS) +libblsct_a_CPPFLAGS += -DENABLE_ARM_SHANI +endif + +$(LIBBLSCT_A): $(LIBBLS) $(LIBMCL) + +CLEANFILES += $(LIBBLSCT_A) blsct/include/libblsct_a-blsct.o +endif +# config/bitcoin-config.h: config/stamp-h1 @$(MAKE) -C $(top_builddir) $(subdir)/$(@) diff --git a/src/blsct/external_api/blsct.cpp b/src/blsct/external_api/blsct.cpp new file mode 100644 index 0000000000000..d2db31d46f6f6 --- /dev/null +++ b/src/blsct/external_api/blsct.cpp @@ -0,0 +1,24 @@ +#include +#include +#include +#include + +extern "C" { + +void BlsctInit() { + MclInit for_side_effect_only; +} + +void BlsctTest() { + + Mcl::Scalar a(1); + Mcl::Scalar b(2); + + auto c = a + b; + + auto s = c.GetString(); + + printf("The answer is %s\n", s.c_str()); +} + +} // extern "C" diff --git a/src/blsct/external_api/blsct.h b/src/blsct/external_api/blsct.h new file mode 100644 index 0000000000000..578d22db26cc1 --- /dev/null +++ b/src/blsct/external_api/blsct.h @@ -0,0 +1,6 @@ +extern "C" { + +void BlsctInit(); +void BlsctTest(); + +} // extern "C" From a819b5a4d2a649edc634974b614cf417e3429625 Mon Sep 17 00:00:00 2001 From: gogoex <110195520+gogoex@users.noreply.github.com> Date: Thu, 4 Jan 2024 07:42:14 +0900 Subject: [PATCH 03/12] fix typo. replace printf with cout --- src/blsct/external_api/blsct.cpp | 4 ++-- src/test/coins_tests.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/blsct/external_api/blsct.cpp b/src/blsct/external_api/blsct.cpp index d2db31d46f6f6..f0bef0eb7c8e7 100644 --- a/src/blsct/external_api/blsct.cpp +++ b/src/blsct/external_api/blsct.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include extern "C" { @@ -18,7 +18,7 @@ void BlsctTest() { auto s = c.GetString(); - printf("The answer is %s\n", s.c_str()); + std::cout << "The answer is " << s << std::endl; } } // extern "C" diff --git a/src/test/coins_tests.cpp b/src/test/coins_tests.cpp index 6170415f7a757..556d0dcda2322 100644 --- a/src/test/coins_tests.cpp +++ b/src/test/coins_tests.cpp @@ -500,7 +500,7 @@ BOOST_AUTO_TEST_CASE(updatecoins_simulation_test) g_mock_deterministic_tests = false; } -/** TODO: Reenable when the blsct data fields are implemented in the class +/** TODO: Re-enable when the blsct data fields are implemented in the class * TxOutCompressor. * BOOST_AUTO_TEST_CASE(ccoins_serialization) From 51aa46ca7e8d9dcf5bc527f9899df39ba66d2464 Mon Sep 17 00:00:00 2001 From: gogoex <110195520+gogoex@users.noreply.github.com> Date: Thu, 4 Jan 2024 08:33:42 +0900 Subject: [PATCH 04/12] add fingerprint_script to releases cache --- .cirrus.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.cirrus.yml b/.cirrus.yml index b49c99291eead..0576db7884636 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -197,6 +197,7 @@ task: name: '[previous releases, dev package and depends packages, DEBUG] [focal]' previous_releases_cache: folder: "releases" + fingerprint_script: echo $CIRRUS_TASK_NAME $(git rev-parse HEAD:depends) << : *GLOBAL_TASK_TEMPLATE << : *PERSISTENT_WORKER_TEMPLATE env: From 883d57dd18627c7c7c37608bcc19e2ddf1c4cf58 Mon Sep 17 00:00:00 2001 From: gogoex <110195520+gogoex@users.noreply.github.com> Date: Thu, 4 Jan 2024 08:36:00 +0900 Subject: [PATCH 05/12] remove releases cache --- .cirrus.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 0576db7884636..fe619bb8b7764 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -195,9 +195,6 @@ task: task: name: '[previous releases, dev package and depends packages, DEBUG] [focal]' - previous_releases_cache: - folder: "releases" - fingerprint_script: echo $CIRRUS_TASK_NAME $(git rev-parse HEAD:depends) << : *GLOBAL_TASK_TEMPLATE << : *PERSISTENT_WORKER_TEMPLATE env: From f7dde63044ac8a3539d144f5fa10b620f013c89f Mon Sep 17 00:00:00 2001 From: gogoex <110195520+gogoex@users.noreply.github.com> Date: Thu, 4 Jan 2024 10:11:55 +0900 Subject: [PATCH 06/12] drop tasks except previous releases one --- .cirrus.yml | 268 +--------------------------------------------------- 1 file changed, 2 insertions(+), 266 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index fe619bb8b7764..5e191e14cc886 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -55,276 +55,12 @@ compute_credits_template: &CREDITS_TEMPLATE # Only use credits for pull requests to the main repo use_compute_credits: $CIRRUS_REPO_FULL_NAME == 'navcoin/navcoin' && $CIRRUS_PR != "" -task: - name: 'lint [bookworm]' - << : *BASE_TEMPLATE - container: - image: debian:bookworm - cpu: 1 - memory: 1G - # For faster CI feedback, immediately schedule the linters - << : *CREDITS_TEMPLATE - python_cache: - folder: "/tmp/python" - fingerprint_script: cat .python-version /etc/os-release - unshallow_script: - - git fetch --unshallow --no-tags - lint_script: - - ./ci/lint_run_all.sh - env: - << : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV - -task: - name: 'tidy [lunar]' - << : *GLOBAL_TASK_TEMPLATE - container: - cpu: 2 - memory: 5G - docker_arguments: - CI_IMAGE_NAME_TAG: ubuntu:23.04 - FILE_ENV: "./ci/test/00_setup_env_native_tidy.sh" - # For faster CI feedback, immediately schedule the linters - << : *CREDITS_TEMPLATE - env: - << : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV - -task: - name: "Win64 native [vs2022]" - windows_container: - cpu: 8 - memory: 16G - image: cirrusci/windowsservercore:visualstudio2022 - timeout_in: 120m - env: - PATH: 'C:\jom;C:\Python39;C:\Python39\Scripts;C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin;%PATH%' - PYTHONUTF8: 1 - CI_VCPKG_TAG: '2023.01.09' - VCPKG_DOWNLOADS: 'C:\Users\ContainerAdministrator\AppData\Local\vcpkg\downloads' - VCPKG_DEFAULT_BINARY_CACHE: 'C:\Users\ContainerAdministrator\AppData\Local\vcpkg\archives' - CCACHE_DIR: 'C:\Users\ContainerAdministrator\AppData\Local\ccache' - WRAPPED_CL: 'C:\Users\ContainerAdministrator\AppData\Local\Temp\cirrus-ci-build\ci\test\wrapped-cl.bat' - x64_NATIVE_TOOLS: '"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat"' - IgnoreWarnIntDirInTempDetected: 'true' - merge_script: - - PowerShell -NoLogo -Command if ($env:CIRRUS_PR -ne $null) { git fetch $env:CIRRUS_REPO_CLONE_URL pull/$env:CIRRUS_PR/merge; git reset --hard FETCH_HEAD; } - vcpkg_tools_cache: - folder: '%VCPKG_DOWNLOADS%\tools' - reupload_on_changes: false - fingerprint_script: - - echo %CI_VCPKG_TAG% - - msbuild -version - vcpkg_binary_cache: - folder: '%VCPKG_DEFAULT_BINARY_CACHE%' - reupload_on_changes: true - fingerprint_script: - - echo %CI_VCPKG_TAG% - - type build_msvc\vcpkg.json - - msbuild -version - populate_script: - - mkdir %VCPKG_DEFAULT_BINARY_CACHE% - ccache_cache: - folder: '%CCACHE_DIR%' - install_tools_script: - - choco install --yes --no-progress ccache --version=4.7.4 - - choco install --yes --no-progress python3 --version=3.9.6 - - pip install zmq - - ccache --version - - python -VV - install_vcpkg_script: - - cd .. - - git clone --quiet https://github.com/microsoft/vcpkg.git - - cd vcpkg - - git -c advice.detachedHead=false checkout %CI_VCPKG_TAG% - - .\bootstrap-vcpkg -disableMetrics - - echo set(VCPKG_BUILD_TYPE release) >> triplets\x64-windows-static.cmake - - .\vcpkg integrate install - - .\vcpkg version - build_script: - - '%x64_NATIVE_TOOLS%' - - cd %CIRRUS_WORKING_DIR% - - ccache --zero-stats --max-size=%CCACHE_SIZE% - - python build_msvc\msvc-autogen.py - - msbuild build_msvc\bitcoin.sln -property:CLToolExe=%WRAPPED_CL%;UseMultiToolTask=true;Configuration=Release -verbosity:minimal -noLogo - - ccache --show-stats - check_script: - - build_msvc\x64\Release\test_navcoin.exe -l test_suite - - build_msvc\x64\Release\bench_bench_navcoin.exe --sanity-check - - python test\util\test_runner.py - - python test\util\rpcauth-test.py - functional_tests_script: - # Increase the dynamic port range to the maximum allowed value to mitigate "OSError: [WinError 10048] Only one usage of each socket address (protocol/network address/port) is normally permitted". - # See: https://learn.microsoft.com/en-us/biztalk/technical-guides/settings-that-can-be-modified-to-improve-network-performance - - netsh int ipv4 set dynamicport tcp start=1025 num=64511 - - netsh int ipv6 set dynamicport tcp start=1025 num=64511 - # Exclude feature_dbcrash for now due to timeout - - python test\functional\test_runner.py --nocleanup --ci --quiet --combinedlogslen=99999999 --jobs=6 --timeout-factor=8 --extended --exclude feature_dbcrash - -task: - name: 'ARM [unit tests, no functional tests] [bookworm]' - << : *GLOBAL_TASK_TEMPLATE - container: - docker_arguments: - CI_IMAGE_NAME_TAG: debian:bookworm - FILE_ENV: "./ci/test/00_setup_env_arm.sh" - env: - << : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV - -task: - name: 'Win64 [unit tests, no boost::process, no functional tests] [jammy]' - << : *GLOBAL_TASK_TEMPLATE - container: - docker_arguments: - CI_IMAGE_NAME_TAG: ubuntu:jammy - FILE_ENV: "./ci/test/00_setup_env_win64.sh" - << : *CREDITS_TEMPLATE - env: - << : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV - -task: - name: '32-bit + dash [CentOS 8]' - << : *GLOBAL_TASK_TEMPLATE - container: - docker_arguments: - CI_IMAGE_NAME_TAG: quay.io/centos/centos:stream8 - FILE_ENV: "./ci/test/00_setup_env_i686_centos.sh" - # For faster CI feedback, immediately schedule one task that runs all tests - << : *CREDITS_TEMPLATE - env: - << : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV - PACKAGE_MANAGER_INSTALL: "yum install -y" - task: name: '[previous releases, dev package and depends packages, DEBUG] [focal]' + previous_releases_cache: + folder: "releases" << : *GLOBAL_TASK_TEMPLATE << : *PERSISTENT_WORKER_TEMPLATE env: << : *PERSISTENT_WORKER_TEMPLATE_ENV FILE_ENV: "./ci/test/00_setup_env_native.sh" - -task: - name: '[TSan, depends] [lunar]' - << : *GLOBAL_TASK_TEMPLATE - container: - cpu: 6 # Increase CPU and Memory to avoid timeout - memory: 24G - docker_arguments: - CI_IMAGE_NAME_TAG: ubuntu:23.04 - FILE_ENV: "./ci/test/00_setup_env_native_tsan.sh" - env: - << : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV - -task: - name: '[MSan, depends] [lunar]' - << : *GLOBAL_TASK_TEMPLATE - container: - docker_arguments: - CI_IMAGE_NAME_TAG: ubuntu:lunar - FILE_ENV: "./ci/test/00_setup_env_native_msan.sh" - env: - << : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV - MAKEJOBS: "-j4" # Avoid excessive memory use due to MSan - -task: - name: '[ASan + LSan + UBSan + integer, no depends, USDT] [lunar]' - << : *GLOBAL_TASK_TEMPLATE - # We can't use a 'container' for the USDT interface tests as the CirrusCI - # containers don't have privileges to hook into bitcoind. CirrusCI uses - # Google Compute Engine instances: https://cirrus-ci.org/guide/custom-vms/ - # Images can be found here: https://cloud.google.com/compute/docs/images/os-details - compute_engine_instance: - image_project: ubuntu-os-cloud - image: family/ubuntu-2304-amd64 # https://cirrus-ci.org/guide/custom-vms/#custom-compute-engine-vms - cpu: 4 - disk: 100 - memory: 12G - env: - << : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV - HOME: /root/ # Only needed for compute_engine_instance - FILE_ENV: "./ci/test/00_setup_env_native_asan.sh" - MAKEJOBS: "-j4" # Avoid excessive memory use - -task: - name: '[fuzzer,address,undefined,integer, no depends] [lunar]' - << : *GLOBAL_TASK_TEMPLATE - container: - cpu: 4 # Increase CPU and memory to avoid timeout - memory: 16G - docker_arguments: - CI_IMAGE_NAME_TAG: ubuntu:lunar - FILE_ENV: "./ci/test/00_setup_env_native_fuzz.sh" - env: - << : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV - -task: - name: '[multiprocess, i686, DEBUG] [focal]' - << : *GLOBAL_TASK_TEMPLATE - container: - cpu: 4 - memory: 16G # The default memory is sometimes just a bit too small, so double everything - docker_arguments: - CI_IMAGE_NAME_TAG: ubuntu:focal - FILE_ENV: "./ci/test/00_setup_env_i686_multiprocess.sh" - env: - << : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV - -task: - name: '[no wallet, libbitcoinkernel] [focal]' - << : *GLOBAL_TASK_TEMPLATE - container: - docker_arguments: - CI_IMAGE_NAME_TAG: ubuntu:focal - FILE_ENV: "./ci/test/00_setup_env_native_nowallet_libbitcoinkernel.sh" - << : *CREDITS_TEMPLATE - env: - << : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV - -task: - name: 'macOS 10.15 [no tests] [focal]' - << : *CONTAINER_DEPENDS_TEMPLATE - container: - docker_arguments: - CI_IMAGE_NAME_TAG: ubuntu:focal - FILE_ENV: "./ci/test/00_setup_env_mac.sh" - << : *CREDITS_TEMPLATE - macos_sdk_cache: - folder: "depends/SDKs/$MACOS_SDK" - fingerprint_key: "$MACOS_SDK" - << : *MAIN_TEMPLATE - env: - MACOS_SDK: "Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers" - << : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV - -task: - name: 'macOS 13 native arm64 [sqlite only] [no depends]' - macos_instance: - # Use latest image, but hardcode version to avoid silent upgrades (and breaks) - image: ghcr.io/cirruslabs/macos-ventura-xcode:14.1 # https://cirrus-ci.org/guide/macOS - << : *BASE_TEMPLATE - check_clang_script: - - clang --version - brew_install_script: - - brew install boost libevent qt@5 miniupnpc libnatpmp ccache zeromq qrencode libtool automake gnu-getopt - << : *MAIN_TEMPLATE - env: - << : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV - CI_USE_APT_INSTALL: "no" - PACKAGE_MANAGER_INSTALL: "echo" # Nothing to do - FILE_ENV: "./ci/test/00_setup_env_mac_native_arm64.sh" - -task: - name: 'ARM64 Android APK [jammy]' - << : *CONTAINER_DEPENDS_TEMPLATE - container: - docker_arguments: - CI_IMAGE_NAME_TAG: ubuntu:jammy - FILE_ENV: "./ci/test/00_setup_env_android.sh" - << : *CREDITS_TEMPLATE - android_sdk_cache: - folder: "depends/SDKs/android" - fingerprint_key: "ANDROID_API_LEVEL=28 ANDROID_BUILD_TOOLS_VERSION=28.0.3 ANDROID_NDK_VERSION=23.2.8568313" - depends_sources_cache: - folder: "depends/sources" - fingerprint_script: git rev-parse HEAD:depends/packages - << : *MAIN_TEMPLATE - env: - << : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV From 5da3a22c0f4208fb469132488b77f3520e042129 Mon Sep 17 00:00:00 2001 From: gogoex <110195520+gogoex@users.noreply.github.com> Date: Thu, 4 Jan 2024 10:16:37 +0900 Subject: [PATCH 07/12] wip --- ci/test/04_install.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ci/test/04_install.sh b/ci/test/04_install.sh index 907981524b459..14c9c600e99e9 100755 --- a/ci/test/04_install.sh +++ b/ci/test/04_install.sh @@ -30,6 +30,10 @@ if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then # Though, exclude those with newlines to avoid parsing problems. python3 -c 'import os; [print(f"{key}={value}") for key, value in os.environ.items() if "\n" not in value]' | tee /tmp/env echo "Creating $CI_IMAGE_NAME_TAG container to run in" + echo "ci_retry: $CI_RETRY_EXE" + echo "root_dir: $BASE_ROOT_DIR" + echo "env: $FILE_ENV" + echo "container: $CONTAINER_NAME" DOCKER_BUILDKIT=1 ${CI_RETRY_EXE} docker build \ --file "${BASE_ROOT_DIR}/ci/test_imagefile" \ --build-arg "CI_IMAGE_NAME_TAG=${CI_IMAGE_NAME_TAG}" \ From fdd621c15eeecd3d8c3da93c1fb85d57ecaa4d32 Mon Sep 17 00:00:00 2001 From: gogoex <110195520+gogoex@users.noreply.github.com> Date: Thu, 4 Jan 2024 10:41:06 +0900 Subject: [PATCH 08/12] wip --- ci/test/04_install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ci/test/04_install.sh b/ci/test/04_install.sh index 14c9c600e99e9..cb3cdf5ee906c 100755 --- a/ci/test/04_install.sh +++ b/ci/test/04_install.sh @@ -40,9 +40,9 @@ if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then --build-arg "FILE_ENV=${FILE_ENV}" \ --tag="${CONTAINER_NAME}" \ "${BASE_ROOT_DIR}" - docker volume create "${CONTAINER_NAME}_ccache" || true - docker volume create "${CONTAINER_NAME}_depends" || true - docker volume create "${CONTAINER_NAME}_previous_releases" || true + #docker volume create "${CONTAINER_NAME}_ccache" || true + #docker volume create "${CONTAINER_NAME}_depends" || true + #docker volume create "${CONTAINER_NAME}_previous_releases" || true if [ -n "${RESTART_CI_DOCKER_BEFORE_RUN}" ] ; then echo "Restart docker before run to stop and clear all containers started with --rm" From 9dddf5af7c403f68532c5fb8e971907bf762e95e Mon Sep 17 00:00:00 2001 From: gogoex <110195520+gogoex@users.noreply.github.com> Date: Thu, 4 Jan 2024 10:45:35 +0900 Subject: [PATCH 09/12] wip --- ci/test/04_install.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ci/test/04_install.sh b/ci/test/04_install.sh index cb3cdf5ee906c..19ca002f532f5 100755 --- a/ci/test/04_install.sh +++ b/ci/test/04_install.sh @@ -40,13 +40,13 @@ if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then --build-arg "FILE_ENV=${FILE_ENV}" \ --tag="${CONTAINER_NAME}" \ "${BASE_ROOT_DIR}" - #docker volume create "${CONTAINER_NAME}_ccache" || true - #docker volume create "${CONTAINER_NAME}_depends" || true - #docker volume create "${CONTAINER_NAME}_previous_releases" || true + docker volume create "${CONTAINER_NAME}_ccache" || true + docker volume create "${CONTAINER_NAME}_depends" || true + docker volume create "${CONTAINER_NAME}_previous_releases" || true if [ -n "${RESTART_CI_DOCKER_BEFORE_RUN}" ] ; then echo "Restart docker before run to stop and clear all containers started with --rm" - systemctl restart docker + #systemctl restart docker echo "Prune all dangling images" docker image prune --force fi From 4b5632f73762c74c50fcbacfbfd80e2b21e17b98 Mon Sep 17 00:00:00 2001 From: gogoex <110195520+gogoex@users.noreply.github.com> Date: Thu, 4 Jan 2024 10:59:17 +0900 Subject: [PATCH 10/12] wip --- ci/test/04_install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/test/04_install.sh b/ci/test/04_install.sh index 19ca002f532f5..2e618a37823b8 100755 --- a/ci/test/04_install.sh +++ b/ci/test/04_install.sh @@ -46,7 +46,7 @@ if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then if [ -n "${RESTART_CI_DOCKER_BEFORE_RUN}" ] ; then echo "Restart docker before run to stop and clear all containers started with --rm" - #systemctl restart docker + podman container prune -f echo "Prune all dangling images" docker image prune --force fi From 36cdb7652c6d4022e292d54d933fc1044d756fe9 Mon Sep 17 00:00:00 2001 From: gogoex <110195520+gogoex@users.noreply.github.com> Date: Thu, 4 Jan 2024 11:18:15 +0900 Subject: [PATCH 11/12] revert .cirrus.yml --- .cirrus.yml | 266 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 266 insertions(+) diff --git a/.cirrus.yml b/.cirrus.yml index 5e191e14cc886..b49c99291eead 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -55,6 +55,144 @@ compute_credits_template: &CREDITS_TEMPLATE # Only use credits for pull requests to the main repo use_compute_credits: $CIRRUS_REPO_FULL_NAME == 'navcoin/navcoin' && $CIRRUS_PR != "" +task: + name: 'lint [bookworm]' + << : *BASE_TEMPLATE + container: + image: debian:bookworm + cpu: 1 + memory: 1G + # For faster CI feedback, immediately schedule the linters + << : *CREDITS_TEMPLATE + python_cache: + folder: "/tmp/python" + fingerprint_script: cat .python-version /etc/os-release + unshallow_script: + - git fetch --unshallow --no-tags + lint_script: + - ./ci/lint_run_all.sh + env: + << : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV + +task: + name: 'tidy [lunar]' + << : *GLOBAL_TASK_TEMPLATE + container: + cpu: 2 + memory: 5G + docker_arguments: + CI_IMAGE_NAME_TAG: ubuntu:23.04 + FILE_ENV: "./ci/test/00_setup_env_native_tidy.sh" + # For faster CI feedback, immediately schedule the linters + << : *CREDITS_TEMPLATE + env: + << : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV + +task: + name: "Win64 native [vs2022]" + windows_container: + cpu: 8 + memory: 16G + image: cirrusci/windowsservercore:visualstudio2022 + timeout_in: 120m + env: + PATH: 'C:\jom;C:\Python39;C:\Python39\Scripts;C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin;%PATH%' + PYTHONUTF8: 1 + CI_VCPKG_TAG: '2023.01.09' + VCPKG_DOWNLOADS: 'C:\Users\ContainerAdministrator\AppData\Local\vcpkg\downloads' + VCPKG_DEFAULT_BINARY_CACHE: 'C:\Users\ContainerAdministrator\AppData\Local\vcpkg\archives' + CCACHE_DIR: 'C:\Users\ContainerAdministrator\AppData\Local\ccache' + WRAPPED_CL: 'C:\Users\ContainerAdministrator\AppData\Local\Temp\cirrus-ci-build\ci\test\wrapped-cl.bat' + x64_NATIVE_TOOLS: '"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat"' + IgnoreWarnIntDirInTempDetected: 'true' + merge_script: + - PowerShell -NoLogo -Command if ($env:CIRRUS_PR -ne $null) { git fetch $env:CIRRUS_REPO_CLONE_URL pull/$env:CIRRUS_PR/merge; git reset --hard FETCH_HEAD; } + vcpkg_tools_cache: + folder: '%VCPKG_DOWNLOADS%\tools' + reupload_on_changes: false + fingerprint_script: + - echo %CI_VCPKG_TAG% + - msbuild -version + vcpkg_binary_cache: + folder: '%VCPKG_DEFAULT_BINARY_CACHE%' + reupload_on_changes: true + fingerprint_script: + - echo %CI_VCPKG_TAG% + - type build_msvc\vcpkg.json + - msbuild -version + populate_script: + - mkdir %VCPKG_DEFAULT_BINARY_CACHE% + ccache_cache: + folder: '%CCACHE_DIR%' + install_tools_script: + - choco install --yes --no-progress ccache --version=4.7.4 + - choco install --yes --no-progress python3 --version=3.9.6 + - pip install zmq + - ccache --version + - python -VV + install_vcpkg_script: + - cd .. + - git clone --quiet https://github.com/microsoft/vcpkg.git + - cd vcpkg + - git -c advice.detachedHead=false checkout %CI_VCPKG_TAG% + - .\bootstrap-vcpkg -disableMetrics + - echo set(VCPKG_BUILD_TYPE release) >> triplets\x64-windows-static.cmake + - .\vcpkg integrate install + - .\vcpkg version + build_script: + - '%x64_NATIVE_TOOLS%' + - cd %CIRRUS_WORKING_DIR% + - ccache --zero-stats --max-size=%CCACHE_SIZE% + - python build_msvc\msvc-autogen.py + - msbuild build_msvc\bitcoin.sln -property:CLToolExe=%WRAPPED_CL%;UseMultiToolTask=true;Configuration=Release -verbosity:minimal -noLogo + - ccache --show-stats + check_script: + - build_msvc\x64\Release\test_navcoin.exe -l test_suite + - build_msvc\x64\Release\bench_bench_navcoin.exe --sanity-check + - python test\util\test_runner.py + - python test\util\rpcauth-test.py + functional_tests_script: + # Increase the dynamic port range to the maximum allowed value to mitigate "OSError: [WinError 10048] Only one usage of each socket address (protocol/network address/port) is normally permitted". + # See: https://learn.microsoft.com/en-us/biztalk/technical-guides/settings-that-can-be-modified-to-improve-network-performance + - netsh int ipv4 set dynamicport tcp start=1025 num=64511 + - netsh int ipv6 set dynamicport tcp start=1025 num=64511 + # Exclude feature_dbcrash for now due to timeout + - python test\functional\test_runner.py --nocleanup --ci --quiet --combinedlogslen=99999999 --jobs=6 --timeout-factor=8 --extended --exclude feature_dbcrash + +task: + name: 'ARM [unit tests, no functional tests] [bookworm]' + << : *GLOBAL_TASK_TEMPLATE + container: + docker_arguments: + CI_IMAGE_NAME_TAG: debian:bookworm + FILE_ENV: "./ci/test/00_setup_env_arm.sh" + env: + << : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV + +task: + name: 'Win64 [unit tests, no boost::process, no functional tests] [jammy]' + << : *GLOBAL_TASK_TEMPLATE + container: + docker_arguments: + CI_IMAGE_NAME_TAG: ubuntu:jammy + FILE_ENV: "./ci/test/00_setup_env_win64.sh" + << : *CREDITS_TEMPLATE + env: + << : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV + +task: + name: '32-bit + dash [CentOS 8]' + << : *GLOBAL_TASK_TEMPLATE + container: + docker_arguments: + CI_IMAGE_NAME_TAG: quay.io/centos/centos:stream8 + FILE_ENV: "./ci/test/00_setup_env_i686_centos.sh" + # For faster CI feedback, immediately schedule one task that runs all tests + << : *CREDITS_TEMPLATE + env: + << : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV + PACKAGE_MANAGER_INSTALL: "yum install -y" + task: name: '[previous releases, dev package and depends packages, DEBUG] [focal]' previous_releases_cache: @@ -64,3 +202,131 @@ task: env: << : *PERSISTENT_WORKER_TEMPLATE_ENV FILE_ENV: "./ci/test/00_setup_env_native.sh" + +task: + name: '[TSan, depends] [lunar]' + << : *GLOBAL_TASK_TEMPLATE + container: + cpu: 6 # Increase CPU and Memory to avoid timeout + memory: 24G + docker_arguments: + CI_IMAGE_NAME_TAG: ubuntu:23.04 + FILE_ENV: "./ci/test/00_setup_env_native_tsan.sh" + env: + << : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV + +task: + name: '[MSan, depends] [lunar]' + << : *GLOBAL_TASK_TEMPLATE + container: + docker_arguments: + CI_IMAGE_NAME_TAG: ubuntu:lunar + FILE_ENV: "./ci/test/00_setup_env_native_msan.sh" + env: + << : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV + MAKEJOBS: "-j4" # Avoid excessive memory use due to MSan + +task: + name: '[ASan + LSan + UBSan + integer, no depends, USDT] [lunar]' + << : *GLOBAL_TASK_TEMPLATE + # We can't use a 'container' for the USDT interface tests as the CirrusCI + # containers don't have privileges to hook into bitcoind. CirrusCI uses + # Google Compute Engine instances: https://cirrus-ci.org/guide/custom-vms/ + # Images can be found here: https://cloud.google.com/compute/docs/images/os-details + compute_engine_instance: + image_project: ubuntu-os-cloud + image: family/ubuntu-2304-amd64 # https://cirrus-ci.org/guide/custom-vms/#custom-compute-engine-vms + cpu: 4 + disk: 100 + memory: 12G + env: + << : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV + HOME: /root/ # Only needed for compute_engine_instance + FILE_ENV: "./ci/test/00_setup_env_native_asan.sh" + MAKEJOBS: "-j4" # Avoid excessive memory use + +task: + name: '[fuzzer,address,undefined,integer, no depends] [lunar]' + << : *GLOBAL_TASK_TEMPLATE + container: + cpu: 4 # Increase CPU and memory to avoid timeout + memory: 16G + docker_arguments: + CI_IMAGE_NAME_TAG: ubuntu:lunar + FILE_ENV: "./ci/test/00_setup_env_native_fuzz.sh" + env: + << : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV + +task: + name: '[multiprocess, i686, DEBUG] [focal]' + << : *GLOBAL_TASK_TEMPLATE + container: + cpu: 4 + memory: 16G # The default memory is sometimes just a bit too small, so double everything + docker_arguments: + CI_IMAGE_NAME_TAG: ubuntu:focal + FILE_ENV: "./ci/test/00_setup_env_i686_multiprocess.sh" + env: + << : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV + +task: + name: '[no wallet, libbitcoinkernel] [focal]' + << : *GLOBAL_TASK_TEMPLATE + container: + docker_arguments: + CI_IMAGE_NAME_TAG: ubuntu:focal + FILE_ENV: "./ci/test/00_setup_env_native_nowallet_libbitcoinkernel.sh" + << : *CREDITS_TEMPLATE + env: + << : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV + +task: + name: 'macOS 10.15 [no tests] [focal]' + << : *CONTAINER_DEPENDS_TEMPLATE + container: + docker_arguments: + CI_IMAGE_NAME_TAG: ubuntu:focal + FILE_ENV: "./ci/test/00_setup_env_mac.sh" + << : *CREDITS_TEMPLATE + macos_sdk_cache: + folder: "depends/SDKs/$MACOS_SDK" + fingerprint_key: "$MACOS_SDK" + << : *MAIN_TEMPLATE + env: + MACOS_SDK: "Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers" + << : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV + +task: + name: 'macOS 13 native arm64 [sqlite only] [no depends]' + macos_instance: + # Use latest image, but hardcode version to avoid silent upgrades (and breaks) + image: ghcr.io/cirruslabs/macos-ventura-xcode:14.1 # https://cirrus-ci.org/guide/macOS + << : *BASE_TEMPLATE + check_clang_script: + - clang --version + brew_install_script: + - brew install boost libevent qt@5 miniupnpc libnatpmp ccache zeromq qrencode libtool automake gnu-getopt + << : *MAIN_TEMPLATE + env: + << : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV + CI_USE_APT_INSTALL: "no" + PACKAGE_MANAGER_INSTALL: "echo" # Nothing to do + FILE_ENV: "./ci/test/00_setup_env_mac_native_arm64.sh" + +task: + name: 'ARM64 Android APK [jammy]' + << : *CONTAINER_DEPENDS_TEMPLATE + container: + docker_arguments: + CI_IMAGE_NAME_TAG: ubuntu:jammy + FILE_ENV: "./ci/test/00_setup_env_android.sh" + << : *CREDITS_TEMPLATE + android_sdk_cache: + folder: "depends/SDKs/android" + fingerprint_key: "ANDROID_API_LEVEL=28 ANDROID_BUILD_TOOLS_VERSION=28.0.3 ANDROID_NDK_VERSION=23.2.8568313" + depends_sources_cache: + folder: "depends/sources" + fingerprint_script: git rev-parse HEAD:depends/packages + << : *MAIN_TEMPLATE + env: + << : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV From 195e412f56bc9babe4cbb1976f4067a7a3ada3b2 Mon Sep 17 00:00:00 2001 From: gogoex <110195520+gogoex@users.noreply.github.com> Date: Thu, 4 Jan 2024 11:33:46 +0900 Subject: [PATCH 12/12] remove debug output --- ci/test/04_install.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ci/test/04_install.sh b/ci/test/04_install.sh index 2e618a37823b8..5ab6a7f9820e6 100755 --- a/ci/test/04_install.sh +++ b/ci/test/04_install.sh @@ -30,10 +30,6 @@ if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then # Though, exclude those with newlines to avoid parsing problems. python3 -c 'import os; [print(f"{key}={value}") for key, value in os.environ.items() if "\n" not in value]' | tee /tmp/env echo "Creating $CI_IMAGE_NAME_TAG container to run in" - echo "ci_retry: $CI_RETRY_EXE" - echo "root_dir: $BASE_ROOT_DIR" - echo "env: $FILE_ENV" - echo "container: $CONTAINER_NAME" DOCKER_BUILDKIT=1 ${CI_RETRY_EXE} docker build \ --file "${BASE_ROOT_DIR}/ci/test_imagefile" \ --build-arg "CI_IMAGE_NAME_TAG=${CI_IMAGE_NAME_TAG}" \ @@ -45,7 +41,7 @@ if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then docker volume create "${CONTAINER_NAME}_previous_releases" || true if [ -n "${RESTART_CI_DOCKER_BEFORE_RUN}" ] ; then - echo "Restart docker before run to stop and clear all containers started with --rm" + echo "Prune stopped containers" podman container prune -f echo "Prune all dangling images" docker image prune --force