From dd54b224c548ff0d810e78a5e183c2900efb2a01 Mon Sep 17 00:00:00 2001 From: Konstantin Akimov Date: Fri, 8 Dec 2023 18:59:48 +0700 Subject: [PATCH 01/12] fix: merge mistake to follow-up bitcoin#17261 The member `m_spk_man` survived in CWallet after backport of refactoring --- src/wallet/wallet.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 31590aa736..6ab17e3219 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -1362,11 +1362,6 @@ public: const CKeyingMaterial& GetEncryptionKey() const override; bool HasEncryptionKeys() const override; - // Temporary LegacyScriptPubKeyMan accessors and aliases. - friend class LegacyScriptPubKeyMan; - - std::unique_ptr m_spk_man; - /** Get last block processed height */ int GetLastBlockHeight() const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) { From 23a5df7d54ec6c3d1e957b76bf43855f9a9d5850 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Thu, 12 Nov 2020 09:32:53 +0100 Subject: [PATCH 02/12] Merge #20285: Remove references to CreateWalletFromFile c82336c493b112160d781974d4066fcb956b85f6 Remove references to CreateWalletFromFile (fanquake) Pull request description: `CWallet::CreateWalletFromFile()` was removed in 8b5e7297c02f3100a9cb27bfe206e3fc617ec173 but these references remain. ACKs for top commit: hebasto: ACK c82336c493b112160d781974d4066fcb956b85f6 Tree-SHA512: 3dd50fe0cd5a60bbc96d265107d4739f3e08f943435f3772038963ac4be9e4a87a863412ac0d571226ea66d71550b17b52f01b9d46a6282d49feae1508fd682e --- src/wallet/test/wallet_tests.cpp | 4 ++-- test/sanitizer_suppressions/tsan | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wallet/test/wallet_tests.cpp b/src/wallet/test/wallet_tests.cpp index 8b926e25d9..382235ef80 100644 --- a/src/wallet/test/wallet_tests.cpp +++ b/src/wallet/test/wallet_tests.cpp @@ -1201,7 +1201,7 @@ BOOST_FIXTURE_TEST_CASE(wallet_disableprivkeys, TestChain100Setup) BOOST_CHECK(!wallet->GetNewDestination("", dest, error)); } -//! Test CreateWalletFromFile function and its behavior handling potential race +//! Test CWallet::Create() and its behavior handling potential race //! conditions if it's called the same time an incoming transaction shows up in //! the mempool or a new block. //! @@ -1219,7 +1219,7 @@ BOOST_FIXTURE_TEST_CASE(wallet_disableprivkeys, TestChain100Setup) //! wallet rescan and notifications are immediately synced, to verify the wallet //! must already have a handler in place for them, and there's no gap after //! rescanning where new transactions in new blocks could be lost. -BOOST_FIXTURE_TEST_CASE(CreateWalletFromFile, TestChain100Setup) +BOOST_FIXTURE_TEST_CASE(CreateWallet, TestChain100Setup) { gArgs.ForceSetArg("-unsafesqlitesync", "1"); // Create new wallet with known key and unload it. diff --git a/test/sanitizer_suppressions/tsan b/test/sanitizer_suppressions/tsan index 5595cbb7bb..80c0a089b7 100644 --- a/test/sanitizer_suppressions/tsan +++ b/test/sanitizer_suppressions/tsan @@ -38,7 +38,7 @@ deadlock:CConnman::ForNode deadlock:CConnman::GetNodeStats deadlock:CChainState::ConnectTip deadlock:UpdateTip -deadlock:wallet_tests::CreateWalletFromFile +deadlock:wallet_tests::CreateWallet # WalletBatch (unidentified deadlock) deadlock:WalletBatch From 46e527a550f4e1a2e5b1daaeb6874bf1cf5a29db Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Thu, 22 Oct 2020 14:11:47 +0200 Subject: [PATCH 03/12] Merge #20112: test: Speed up wallet_resendwallettransactions with mockscheduler RPC fa299ac27364bd7a59e6fb7e0c4ce476f2deec40 test: Speed up wallet_resendwallettransactions test with mockscheduler RPC (MarcoFalke) Pull request description: Also fixes #20143 ACKs for top commit: guggero: ACK fa299ac2 Tree-SHA512: 024ced4aa5f5c266e24fd0583d47b45b19c2a6ae25a06fabeacaa0ac996eec0c45f11cc34b2df17d01759b78ed31a991aa86978aafcc76cb0017382f601bf85a --- .../wallet_resendwallettransactions.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test/functional/wallet_resendwallettransactions.py b/test/functional/wallet_resendwallettransactions.py index 764c8a6edf..592d0a6ea3 100755 --- a/test/functional/wallet_resendwallettransactions.py +++ b/test/functional/wallet_resendwallettransactions.py @@ -3,7 +3,6 @@ # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test that the wallet resends transactions periodically.""" -import time from test_framework.blocktools import create_block, create_coinbase from test_framework.messages import ToHex @@ -11,6 +10,7 @@ from test_framework.p2p import P2PTxInvStore from test_framework.test_framework import BitcoinTestFramework from test_framework.util import assert_equal + class ResendWalletTransactionsTest(BitcoinTestFramework): def set_test_params(self): self.num_nodes = 1 @@ -27,10 +27,10 @@ class ResendWalletTransactionsTest(BitcoinTestFramework): txid = node.sendtoaddress(node.getnewaddress(), 1) # Wallet rebroadcast is first scheduled 1 sec after startup (see - # nNextResend in ResendWalletTransactions()). Sleep for just over a - # second to be certain that it has been called before the first + # nNextResend in ResendWalletTransactions()). Tell scheduler to call + # MaybeResendWalletTxn now to initialize nNextResend before the first # setmocktime call below. - time.sleep(1.1) + node.mockscheduler(1) # Can take a few seconds due to transaction trickling def wait_p2p(): @@ -60,16 +60,16 @@ class ResendWalletTransactionsTest(BitcoinTestFramework): twelve_hrs = 12 * 60 * 60 two_min = 2 * 60 node.setmocktime(self.mocktime + twelve_hrs - two_min) - self.mocktime = self.mocktime + twelve_hrs - two_min - time.sleep(2) # ensure enough time has passed for rebroadcast attempt to occur + node.mockscheduler(1) # Tell scheduler to call MaybeResendWalletTxn now assert_equal(int(txid, 16) in peer_second.get_invs(), False) self.log.info("Bump time & check that transaction is rebroadcast") # Transaction should be rebroadcast approximately 24 hours in the future, # but can range from 12-36. So bump 36 hours to be sure. - node.setmocktime(self.mocktime + 36 * 60 * 60) - # Tell scheduler to call MaybeResendWalletTxn now. - node.mockscheduler(1) + with node.assert_debug_log(['ResendWalletTransactions: resubmit 1 unconfirmed transactions']): + node.setmocktime(self.mocktime + 36 * 60 * 60) + # Tell scheduler to call MaybeResendWalletTxn now. + node.mockscheduler(1) # Give some time for trickle to occur node.setmocktime(self.mocktime + 36 * 60 * 60 + 600) peer_second.wait_for_broadcast([txid]) From 3184b432675de7b0ca048dfd9ebde2a698f51e9d Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 29 Oct 2020 12:04:08 +0100 Subject: [PATCH 04/12] Merge #20115: cli: -netinfo quick updates/fixups for 0.21 398045ba8b3694931069f88ec95553b3207dd1a6 cli -netinfo: print oversized/extreme ping times as "-" (Jon Atack) 773f4c99c00c0b1d8c1b53cb99ba571337100953 cli -netinfo: handle longer tor v3 local addresses (Jon Atack) 33e987452f869c279f2491499939e51e0af8364c cli -netinfo: make age column variable-width (Jon Atack) f8a1c4d9469cb496fdafaf6f4d94977687df9190 cli -netinfo: various quick updates and fixes (Jon Atack) Pull request description: Quick fixups and updates for v0.21.0: - [x] handle larger BIP155 `addrv2` addresses - [x] add Signet chain - [x] add an additional space between the `net` and `mping` columns; add missing `tinyformat` and `algorithm` headers - [x] s/uptime/age/ per 0xB10C suggestion, and make the column auto-adjusting variable width - [x] display `-` for oversized mping/ping times like `1.17348e+06`, as reported by practicalswift Edit: removed the release note commit, as this PR was not merged before the notes were moved to the wiki. It's here: ``` - A new `bitcoin-cli -netinfo` command returns a network peer connections dashboard that displays data from the `getpeerinfo` and `getnetworkinfo` RPCs in a human-readable format. An optional integer argument from `0` to `4` may be passed to see various levels of detail. (#19643) ``` ACKs for top commit: michaelfolkson: ACK 398045ba8b3694931069f88ec95553b3207dd1a6 Emzy: Tested ACK 398045ba8b3694931069f88ec95553b3207dd1a6 Tree-SHA512: 0625ee840141bafbfcaf8f1fce53f8f850ae91721b2bdad4279372da87c18a1fe3a214d90bfdbbabdf6da38d58290d7dd0f1109b4e2ca5d20cacf417d6ced0f9 --- src/bitcoin-cli.cpp | 63 ++++++++++++++++++++++++++++----------------- 1 file changed, 40 insertions(+), 23 deletions(-) diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index f4a6cf6ae8..1ad8f189c8 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -16,11 +16,13 @@ #include #include #include +#include #include #include #include #include +#include #include #include #include @@ -306,12 +308,12 @@ class NetinfoRequestHandler : public BaseRequestHandler { private: static constexpr int8_t UNKNOWN_NETWORK{-1}; - static constexpr size_t m_networks_size{3}; + static constexpr uint8_t m_networks_size{3}; const std::array m_networks{{"ipv4", "ipv6", "onion"}}; std::array, 3> m_counts{{{}}}; //!< Peer counts by (in/out/total, networks/total/block-relay) int8_t NetworkStringToId(const std::string& str) const { - for (size_t i = 0; i < m_networks_size; ++i) { + for (uint8_t i = 0; i < m_networks_size; ++i) { if (str == m_networks.at(i)) return i; } return UNKNOWN_NETWORK; @@ -323,21 +325,22 @@ private: bool IsVersionSelected() const { return m_details_level == 3 || m_details_level == 4; } bool m_is_asmap_on{false}; size_t m_max_addr_length{0}; + size_t m_max_age_length{4}; size_t m_max_id_length{2}; struct Peer { - int id; - int mapped_as; - int version; - int64_t conn_time; + std::string addr; + std::string sub_version; + std::string network; + std::string age; + double min_ping; + double ping; int64_t last_blck; int64_t last_recv; int64_t last_send; int64_t last_trxn; - double min_ping; - double ping; - std::string addr; - std::string network; - std::string sub_version; + int id; + int mapped_as; + int version; bool is_block_relay; bool is_outbound; bool operator<(const Peer& rhs) const { return std::tie(is_outbound, min_ping) < std::tie(rhs.is_outbound, rhs.min_ping); } @@ -346,9 +349,16 @@ private: std::string ChainToString() const { if (gArgs.GetChainName() == CBaseChainParams::TESTNET) return " testnet"; + if (gArgs.GetChainName() == CBaseChainParams::DEVNET) return " devnet"; if (gArgs.GetChainName() == CBaseChainParams::REGTEST) return " regtest"; return ""; } + std::string PingTimeToString(double seconds) const + { + if (seconds < 0) return ""; + const double milliseconds{round(1000 * seconds)}; + return milliseconds > 999999 ? "-" : ToString(milliseconds); + } const UniValue NetinfoHelp() { return std::string{ @@ -471,10 +481,12 @@ public: const double min_ping{peer["minping"].isNull() ? -1 : peer["minping"].get_real()}; const double ping{peer["pingtime"].isNull() ? -1 : peer["pingtime"].get_real()}; const std::string addr{peer["addr"].get_str()}; + const std::string age{conn_time == 0 ? "" : ToString((m_time_now - conn_time) / 60)}; const std::string sub_version{peer["subver"].get_str()}; - m_peers.push_back({peer_id, mapped_as, version, conn_time, last_blck, last_recv, last_send, last_trxn, min_ping, ping, addr, network, sub_version, is_block_relay, is_outbound}); - m_max_id_length = std::max(ToString(peer_id).length(), m_max_id_length); + m_peers.push_back({addr, sub_version, network, age, min_ping, ping, last_blck, last_recv, last_send, last_trxn, peer_id, mapped_as, version, is_block_relay, is_outbound}); m_max_addr_length = std::max(addr.length() + 1, m_max_addr_length); + m_max_age_length = std::max(age.length(), m_max_age_length); + m_max_id_length = std::max(ToString(peer_id).length(), m_max_id_length); m_is_asmap_on |= (mapped_as != 0); } } @@ -485,23 +497,24 @@ public: // Report detailed peer connections list sorted by direction and minimum ping time. if (DetailsRequested() && !m_peers.empty()) { std::sort(m_peers.begin(), m_peers.end()); - result += "<-> relay net mping ping send recv txn blk uptime "; + result += strprintf("<-> relay net mping ping send recv txn blk %*s ", m_max_age_length, "age"); if (m_is_asmap_on) result += " asmap "; result += strprintf("%*s %-*s%s\n", m_max_id_length, "id", IsAddressSelected() ? m_max_addr_length : 0, IsAddressSelected() ? "address" : "", IsVersionSelected() ? "version" : ""); for (const Peer& peer : m_peers) { std::string version{ToString(peer.version) + peer.sub_version}; result += strprintf( - "%3s %5s %5s%6s%7s%5s%5s%5s%5s%7s%*i %*s %-*s%s\n", + "%3s %5s %5s%7s%7s%5s%5s%5s%5s %*s%*i %*s %-*s%s\n", peer.is_outbound ? "out" : "in", peer.is_block_relay ? "block" : "full", peer.network, - peer.min_ping == -1 ? "" : ToString(round(1000 * peer.min_ping)), - peer.ping == -1 ? "" : ToString(round(1000 * peer.ping)), + PingTimeToString(peer.min_ping), + PingTimeToString(peer.ping), peer.last_send == 0 ? "" : ToString(m_time_now - peer.last_send), peer.last_recv == 0 ? "" : ToString(m_time_now - peer.last_recv), peer.last_trxn == 0 ? "" : ToString((m_time_now - peer.last_trxn) / 60), peer.last_blck == 0 ? "" : ToString((m_time_now - peer.last_blck) / 60), - peer.conn_time == 0 ? "" : ToString((m_time_now - peer.conn_time) / 60), + m_max_age_length, // variable spacing + peer.age, m_is_asmap_on ? 7 : 0, // variable spacing m_is_asmap_on && peer.mapped_as != 0 ? ToString(peer.mapped_as) : "", m_max_id_length, // variable spacing @@ -510,24 +523,28 @@ public: IsAddressSelected() ? peer.addr : "", IsVersionSelected() && version != "0" ? version : ""); } - result += " ms ms sec sec min min min\n\n"; + result += strprintf(" ms ms sec sec min min %*s\n\n", m_max_age_length, "min"); } // Report peer connection totals by type. result += " ipv4 ipv6 onion total block-relay\n"; const std::array rows{{"in", "out", "total"}}; - for (size_t i = 0; i < m_networks_size; ++i) { + for (uint8_t i = 0; i < m_networks_size; ++i) { result += strprintf("%-5s %5i %5i %5i %5i %5i\n", rows.at(i), m_counts.at(i).at(0), m_counts.at(i).at(1), m_counts.at(i).at(2), m_counts.at(i).at(m_networks_size), m_counts.at(i).at(m_networks_size + 1)); } // Report local addresses, ports, and scores. result += "\nLocal addresses"; - const UniValue& local_addrs{networkinfo["localaddresses"]}; + const std::vector& local_addrs{networkinfo["localaddresses"].getValues()}; if (local_addrs.empty()) { result += ": n/a\n"; } else { - for (const UniValue& addr : local_addrs.getValues()) { - result += strprintf("\n%-40i port %5i score %6i", addr["address"].get_str(), addr["port"].get_int(), addr["score"].get_int()); + size_t max_addr_size{0}; + for (const UniValue& addr : local_addrs) { + max_addr_size = std::max(addr["address"].get_str().length() + 1, max_addr_size); + } + for (const UniValue& addr : local_addrs) { + result += strprintf("\n%-*s port %6i score %6i", max_addr_size, addr["address"].get_str(), addr["port"].get_int(), addr["score"].get_int()); } } From 90419a453565c3e7e756afe7010e41fa7710cf49 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Wed, 28 Oct 2020 16:27:26 +0100 Subject: [PATCH 05/12] Merge #20258: tests: Remove getnettotals/getpeerinfo consistency test 778cd0d88d8d6dd22d7f0fb740f3ca3dbb2280a1 [tests] Remove getnettotals/getpeerinfo consistency test (John Newbery) Pull request description: We make no guarantees about consistency between RPC calls. Alternative to 18784 ACKs for top commit: MarcoFalke: review ACK 778cd0d88d8d6dd22d7f0fb740f3ca3dbb2280a1 troygiorshev: ACK 778cd0d88d8d6dd22d7f0fb740f3ca3dbb2280a1 after reading discussion on 18784, code review, ran test Tree-SHA512: 438333a111cc93a09680cec47f13fbe03557d4803e5d826aec6f72e5afea62a088622645f0756e8fd2c9182c2a69ccca867d4d6fed2250364bee2b6c834adb1a --- test/functional/rpc_net.py | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/test/functional/rpc_net.py b/test/functional/rpc_net.py index c4986186f7..b23edaeade 100755 --- a/test/functional/rpc_net.py +++ b/test/functional/rpc_net.py @@ -73,32 +73,18 @@ class NetTest(DashTestFramework): def test_getnettotals(self): self.log.info("Test getnettotals") - # getnettotals totalbytesrecv and totalbytessent should be - # consistent with getpeerinfo. Since the RPC calls are not atomic, - # and messages might have been recvd or sent between RPC calls, call - # getnettotals before and after and verify that the returned values - # from getpeerinfo are bounded by those values. + # Test getnettotals and getpeerinfo by doing a ping. The bytes + # sent/received should increase by at least the size of one ping (32 + # bytes) and one pong (32 bytes). net_totals_before = self.nodes[0].getnettotals() - peer_info = self.nodes[0].getpeerinfo() - net_totals_after = self.nodes[0].getnettotals() - assert_equal(len(peer_info), 3) - peers_recv = sum([peer['bytesrecv'] for peer in peer_info]) - peers_sent = sum([peer['bytessent'] for peer in peer_info]) + peer_info_before = self.nodes[0].getpeerinfo() - assert_greater_than_or_equal(peers_recv, net_totals_before['totalbytesrecv']) - assert_greater_than_or_equal(net_totals_after['totalbytesrecv'], peers_recv) - assert_greater_than_or_equal(peers_sent, net_totals_before['totalbytessent']) - assert_greater_than_or_equal(net_totals_after['totalbytessent'], peers_sent) - - # test getnettotals and getpeerinfo by doing a ping - # the bytes sent/received should change - # note ping and pong are 32 bytes each self.nodes[0].ping() - self.wait_until(lambda: (self.nodes[0].getnettotals()['totalbytessent'] >= net_totals_after['totalbytessent'] + 32 * 2), timeout=1) - self.wait_until(lambda: (self.nodes[0].getnettotals()['totalbytesrecv'] >= net_totals_after['totalbytesrecv'] + 32 * 2), timeout=1) + self.wait_until(lambda: (self.nodes[0].getnettotals()['totalbytessent'] >= net_totals_before['totalbytessent'] + 32 * 2), timeout=1) + self.wait_until(lambda: (self.nodes[0].getnettotals()['totalbytesrecv'] >= net_totals_before['totalbytesrecv'] + 32 * 2), timeout=1) - peer_info_after_ping = self.nodes[0].getpeerinfo() - for before, after in zip(peer_info, peer_info_after_ping): + peer_info_after = self.nodes[0].getpeerinfo() + for before, after in zip(peer_info_before, peer_info_after): assert_greater_than_or_equal(after['bytesrecv_per_msg'].get('pong', 0), before['bytesrecv_per_msg'].get('pong', 0) + 32) assert_greater_than_or_equal(after['bytessent_per_msg'].get('ping', 0), before['bytessent_per_msg'].get('ping', 0) + 32) From b747585486e8f70cc9a99daf2a39366cdfbf91e9 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Wed, 4 Nov 2020 17:16:38 +0100 Subject: [PATCH 06/12] Merge #20299: test: Fix intermittent rpc_net issue fa2ecadd0d3283a89d27772dc0275e76277ae17e test: Fix intermittent rpc_net issue (MarcoFalke) Pull request description: The test fails because getpeerinfo and getnettotals are not synchronised, so a `wait_until` is needed for each RPC (separately). Fixes https://cirrus-ci.com/task/4663366629195776?command=ci#L5034 ACKs for top commit: jnewbery: utACK fa2ecadd0d3283a89d27772dc0275e76277ae17e Tree-SHA512: 5ea7128801aab8dbe3d9e6737545ff4ee770e4a9c5a2096ba2339a688424f1879ccba6bf8bcb219983acf86eb28af06fc629586613e7fe28aeffadd2c98633e8 --- test/functional/rpc_net.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/test/functional/rpc_net.py b/test/functional/rpc_net.py index b23edaeade..aaa7c3c6c5 100755 --- a/test/functional/rpc_net.py +++ b/test/functional/rpc_net.py @@ -19,7 +19,6 @@ from test_framework.test_framework import DashTestFramework from test_framework.util import ( assert_approx, assert_equal, - assert_greater_than_or_equal, assert_greater_than, assert_raises_rpc_error, p2p_port, @@ -83,10 +82,10 @@ class NetTest(DashTestFramework): self.wait_until(lambda: (self.nodes[0].getnettotals()['totalbytessent'] >= net_totals_before['totalbytessent'] + 32 * 2), timeout=1) self.wait_until(lambda: (self.nodes[0].getnettotals()['totalbytesrecv'] >= net_totals_before['totalbytesrecv'] + 32 * 2), timeout=1) - peer_info_after = self.nodes[0].getpeerinfo() - for before, after in zip(peer_info_before, peer_info_after): - assert_greater_than_or_equal(after['bytesrecv_per_msg'].get('pong', 0), before['bytesrecv_per_msg'].get('pong', 0) + 32) - assert_greater_than_or_equal(after['bytessent_per_msg'].get('ping', 0), before['bytessent_per_msg'].get('ping', 0) + 32) + for peer_before in peer_info_before: + peer_after = lambda: next(p for p in self.nodes[0].getpeerinfo() if p['id'] == peer_before['id']) + self.wait_until(lambda: peer_after()['bytesrecv_per_msg'].get('pong', 0) >= peer_before['bytesrecv_per_msg'].get('pong', 0) + 32, timeout=1) + self.wait_until(lambda: peer_after()['bytessent_per_msg'].get('ping', 0) >= peer_before['bytessent_per_msg'].get('ping', 0) + 32, timeout=1) def test_getnetworkinfo(self): self.log.info("Test getnetworkinfo") From b23e0f5e07f467ec3f6da1b0c7a625f2d04cc664 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Wed, 4 Nov 2020 20:12:56 +0100 Subject: [PATCH 07/12] Merge #20294: ci: Run more ci configs on cirrus fa8e494554d0f5f8f48bb33ce96a8d7de9b95e31 ci: Run ci configs on cirrus (MarcoFalke) Pull request description: Now that cirrus ci runs more stable than travis ci, we can try to move more configs over there to see if any issues arise. ACKs for top commit: practicalswift: ACK fa8e494554d0f5f8f48bb33ce96a8d7de9b95e31: patch looks correct decryp2kanon: reACK fa8e494554d0f5f8f48bb33ce96a8d7de9b95e31 Tree-SHA512: e2d1838050b6199d11fa06d1cc9d804883ec5df7d65386c950e8124c0067dc1aaa62ec84c9842c8263e2cf5b17fc819ce85689338113f8d69edb1954f06e76e2 --- .cirrus.yml | 40 ++++++++++++++++++++++++++++++++++++++++ .travis.yml | 21 --------------------- 2 files changed, 40 insertions(+), 21 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index b835db4dc7..5eb41f1444 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -37,6 +37,14 @@ global_task_template: &GLOBAL_TASK_TEMPLATE - ./ci/test_run_all.sh +task: + name: 'x86_64 Linux [GOAL: install] [focal] [previous releases, uses qt5 dev package and some depends packages] [unsigned char]' + << : *GLOBAL_TASK_TEMPLATE + container: + image: ubuntu:focal + env: + FILE_ENV: "./ci/test/00_setup_env_native_qt5.sh" + task: name: 'x86_64 Linux [GOAL: install] [focal] [depends, sanitizers: thread (TSan), no gui]' << : *GLOBAL_TASK_TEMPLATE @@ -48,6 +56,14 @@ task: MAKEJOBS: "-j8" FILE_ENV: "./ci/test/00_setup_env_native_tsan.sh" +task: + name: 'x86_64 Linux [GOAL: install] [focal] [depends, sanitizers: memory (MSan)]' + << : *GLOBAL_TASK_TEMPLATE + container: + image: ubuntu:focal + env: + FILE_ENV: "./ci/test/00_setup_env_native_msan.sh" + task: name: 'x86_64 Linux [GOAL: install] [focal] [no depends, only system libs, sanitizers: address/leak (ASan + LSan) + undefined (UBSan) + integer]' << : *GLOBAL_TASK_TEMPLATE @@ -56,6 +72,14 @@ task: env: FILE_ENV: "./ci/test/00_setup_env_native_asan.sh" +task: + name: 'x86_64 Linux [GOAL: install] [focal] [no depends, only system libs, sanitizers: fuzzer,address,undefined]' + << : *GLOBAL_TASK_TEMPLATE + container: + image: ubuntu:focal + env: + FILE_ENV: "./ci/test/00_setup_env_native_fuzz.sh" + task: name: 'x86_64 Linux [GOAL: install] [focal] [no depends, only system libs, fuzzers under valgrind]' << : *GLOBAL_TASK_TEMPLATE @@ -63,3 +87,19 @@ task: image: ubuntu:focal env: FILE_ENV: "./ci/test/00_setup_env_native_fuzz_with_valgrind.sh" + +task: + name: 'x86_64 Linux [GOAL: install] [focal] [multiprocess]' + << : *GLOBAL_TASK_TEMPLATE + container: + image: ubuntu:focal + env: + FILE_ENV: "./ci/test/00_setup_env_native_multiprocess.sh" + +task: + name: 'macOS 10.12 [GOAL: deploy] [no functional tests]' + << : *GLOBAL_TASK_TEMPLATE + container: + image: ubuntu:focal + env: + FILE_ENV: "./ci/test/00_setup_env_mac.sh" diff --git a/.travis.yml b/.travis.yml index 4b24c663e0..8374844cec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -204,32 +204,11 @@ after_success: env: >- FILE_ENV="./ci/test/00_setup_env_win64.sh" - - stage: test - name: 'x86_64 Linux [GOAL: install] [focal] [previous releases, uses qt5 dev package and some depends packages] [unsigned char]' - env: >- - FILE_ENV="./ci/test/00_setup_env_native_qt5.sh" -# x86_64 Linux (xenial, no depends, only system libs, sanitizers: thread (TSan)) - - - stage: test - name: 'x86_64 Linux [GOAL: install] [focal] [no depends, only system libs, sanitizers: fuzzer,address,undefined]' - env: >- - FILE_ENV="./ci/test/00_setup_env_native_fuzz.sh" - - - stage: test - name: 'x86_64 Linux [GOAL: install] [focal] [multiprocess]' - env: >- - FILE_ENV="./ci/test/00_setup_env_native_multiprocess.sh" - - stage: test name: 'x86_64 Linux [GOAL: install] [focal] [no wallet]' env: >- FILE_ENV="./ci/test/00_setup_env_native_nowallet.sh" - - stage: test - name: 'macOS 10.12 [GOAL: deploy] [no functional tests]' - env: >- - FILE_ENV="./ci/test/00_setup_env_mac.sh" - - stage: test name: 'macOS 10.14 native [GOAL: install] [GUI] [no depends]' os: osx From 5abe35afa728ce7bd6756b0ee4eacaabea3f25d0 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Fri, 6 Nov 2020 18:03:44 +0100 Subject: [PATCH 08/12] Merge #20328: cirrus: Skip tasks on the gui repo main branch 66667acc53cdfe224b36a74be4ba046b28282d15 cirrus: Skip tasks on the gui repo main branch (MarcoFalke) Pull request description: No need to run every build twice, once in the main repo and then in the read-only gui mirror repo ACKs for top commit: decryp2kanon: ACK 66667ac hebasto: ACK 66667acc53cdfe224b36a74be4ba046b28282d15, though still preferring `only_if` as showing skipped tasks as successful ones seems a bit confused. Tree-SHA512: 0d35bd115152e06ba4dc5f364130ba5496167d960c44eac2c76192ff9bf7c51f46ab72e2d054dcc6a91818a18dffbbc262f8a4c4483857158c0af4f55dfe9b28 --- .cirrus.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.cirrus.yml b/.cirrus.yml index 5eb41f1444..0b891d10ee 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -19,6 +19,7 @@ env: # https://cirrus-ci.org/guide/tips-and-tricks/#sharing-configuration-between-tasks global_task_template: &GLOBAL_TASK_TEMPLATE + skip: $CIRRUS_REPO_FULL_NAME == "bitcoin-core/gui" && $CIRRUS_PR == "" # No need to run on the read-only mirror, unless it is a PR. https://cirrus-ci.org/guide/writing-tasks/#conditional-task-execution ccache_cache: folder: "/tmp/ccache_dir" depends_built_cache: From c295a13ac6c72c999b577a14020ac34a45f7344d Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Fri, 6 Nov 2020 18:08:28 +0100 Subject: [PATCH 09/12] Merge #20315: travis: Remove s390x build fa2c3c0d96b48bc1685d84186552f72e3609a331 ci: Set LC_ALL=C to allow running the s390x tests in qemu (MarcoFalke) fac05178366a1c9100b1d19d66fb669d7266f306 travis: Remove s390x build (MarcoFalke) Pull request description: This has been discussed in the last meeting. Refer to the commit body for more details. Top commit has no ACKs. Tree-SHA512: 8e0455286ce41c95ed2e5eb624ac534251bb4a321f13d26d14356497e0c39f841372e166373ffd4a0a9fa379636c2cfb535bd92534fff427cdcb827354e66b6c --- .travis.yml | 7 ------- ci/dash/test_unittests.sh | 4 ++-- ci/test/00_setup_env_s390x.sh | 1 + 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8374844cec..50adfc2ef4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -192,13 +192,6 @@ after_success: FILE_ENV="./ci/test/00_setup_env_arm.sh" QEMU_USER_CMD="" - - stage: test - name: 'S390x [GOAL: install] [focal] [unit tests, functional tests]' - arch: s390x # Can disable QEMU_USER_CMD and run the tests natively without qemu - env: >- - FILE_ENV="./ci/test/00_setup_env_s390x.sh" - QEMU_USER_CMD="" - - stage: test name: 'Win64 [GOAL: deploy] [unit tests, no gui, no boost::process, no functional tests]' env: >- diff --git a/ci/dash/test_unittests.sh b/ci/dash/test_unittests.sh index 1b0796b340..02e3af883d 100755 --- a/ci/dash/test_unittests.sh +++ b/ci/dash/test_unittests.sh @@ -29,8 +29,8 @@ if [ "$DIRECT_WINE_EXEC_TESTS" = "true" ]; then wine ./src/test/test_dash.exe else if [ "$RUN_UNIT_TESTS_SEQUENTIAL" = "true" ]; then - ./src/test/test_dash --catch_system_errors=no -l test_suite + ${TEST_RUNNER_ENV} ./src/test/test_dash --catch_system_errors=no -l test_suite else - make $MAKEJOBS check VERBOSE=1 + ${TEST_RUNNER_ENV} make $MAKEJOBS check VERBOSE=1 fi fi diff --git a/ci/test/00_setup_env_s390x.sh b/ci/test/00_setup_env_s390x.sh index a46bde95b5..c71a4891b9 100644 --- a/ci/test/00_setup_env_s390x.sh +++ b/ci/test/00_setup_env_s390x.sh @@ -19,6 +19,7 @@ fi # Use debian to avoid 404 apt errors export CONTAINER_NAME=ci_s390x export RUN_UNIT_TESTS=true +export TEST_RUNNER_ENV="LC_ALL=C" export RUN_FUNCTIONAL_TESTS=true export GOAL="install" export BITCOIN_CONFIG="--enable-reduce-exports --disable-gui-tests --with-boost-process" # GUI tests disabled for now, see https://github.com/bitcoin/bitcoin/issues/23730 From b18a58b4f73f005f10fe1d0281494fb04fca6777 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Mon, 9 Nov 2020 15:30:46 +0100 Subject: [PATCH 10/12] Merge #20339: ci: Run more ci configs on cirrus 77777c8b5e3d0edbe1178d982a778b7cc9964b70 ci: Run windows ci config on cirrus (MarcoFalke) 3333d6942e8c5d823b97ea51ef88c8a0791742c6 ci: Run macos ci config on cirrus (MarcoFalke) fa8b1114e60100f503673ccc7ef5618851c0c9e3 ci: Run arm ci config on cirrus (MarcoFalke) fa0795f54dc5268bacc6acdfdbe23f9952a0e7d8 ci: Replace TRAVIS_OS_NAME with CI_OS_NAME (MarcoFalke) fafce1a13a65cc3ae0cd5351648bb0290f9bfe8c ci: Move documentation to correct config file (MarcoFalke) Pull request description: ACKs for top commit: hebasto: ACK 77777c8b5e3d0edbe1178d982a778b7cc9964b70 Tree-SHA512: 581d3bdb2c3e3da20bd8492c6b23d90f3b4f7f9300ade384667e41de9fbbe42bbcef26dd99328839dc0b49be6e303c4c6d1b66ceb5d8009800c52c97685f9080 --- .cirrus.yml | 32 +++++++++++++++++++++++++++++++- .travis.yml | 32 -------------------------------- ci/test/00_setup_env_mac_host.sh | 5 +---- ci/test/00_setup_env_win64.sh | 2 +- ci/test/04_install.sh | 14 ++++++-------- ci/test/05_before_script.sh | 2 +- ci/test/wrap-wine.sh | 20 ++++++++++++++++++++ 7 files changed, 60 insertions(+), 47 deletions(-) create mode 100755 ci/test/wrap-wine.sh diff --git a/.cirrus.yml b/.cirrus.yml index 0b891d10ee..d9bfaf4c73 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -8,7 +8,7 @@ container: memory: 8G # Set to 8GB to avoid OOM. https://cirrus-ci.org/guide/linux/#linux-containers kvm: true # Use kvm to avoid spurious CI failures in the default virtualization cluster, see https://github.com/bitcoin/bitcoin/issues/20093 env: - PACKAGE_MANAGER_INSTALL : "apt-get update && apt-get install -y" + PACKAGE_MANAGER_INSTALL: "apt-get update && apt-get install -y" MAKEJOBS: "-j4" DANGER_RUN_CI_ON_HOST: "1" # Containers will be discarded after the run, so there is no risk that the ci scripts modify the system TEST_RUNNER_PORT_MIN: "14000" # Must be larger than 12321, which is used for the http cache. See https://cirrus-ci.org/guide/writing-tasks/#http-cache @@ -38,6 +38,22 @@ global_task_template: &GLOBAL_TASK_TEMPLATE - ./ci/test_run_all.sh +task: + name: 'ARM [GOAL: install] [buster] [unit tests, no functional tests]' + << : *GLOBAL_TASK_TEMPLATE + container: + image: debian:buster + env: + FILE_ENV: "./ci/test/00_setup_env_arm.sh" + +task: + name: 'Win64 [GOAL: deploy] [unit tests, no gui, no boost::process, no functional tests]' + << : *GLOBAL_TASK_TEMPLATE + container: + image: ubuntu:bionic + env: + FILE_ENV: "./ci/test/00_setup_env_win64.sh" + task: name: 'x86_64 Linux [GOAL: install] [focal] [previous releases, uses qt5 dev package and some depends packages] [unsigned char]' << : *GLOBAL_TASK_TEMPLATE @@ -104,3 +120,17 @@ task: image: ubuntu:focal env: FILE_ENV: "./ci/test/00_setup_env_mac.sh" + +task: + name: 'macOS 10.14 native [GOAL: install] [GUI] [no depends]' + macos_brew_addon_script: + - brew install boost libevent berkeley-db4 qt miniupnpc ccache zeromq qrencode sqlite libtool automake pkg-config gnu-getopt + << : *GLOBAL_TASK_TEMPLATE + osx_instance: + # Use latest image, but hardcode version to avoid silent upgrades (and breaks) + image: catalina-xcode-12.1 # https://cirrus-ci.org/guide/macOS + env: + DANGER_RUN_CI_ON_HOST: "true" + CI_USE_APT_INSTALL: "no" + PACKAGE_MANAGER_INSTALL: "echo" # Nothing to do + FILE_ENV: "./ci/test/00_setup_env_mac_host.sh" diff --git a/.travis.yml b/.travis.yml index 50adfc2ef4..26311af385 100644 --- a/.travis.yml +++ b/.travis.yml @@ -185,39 +185,7 @@ after_success: script: - set -o errexit; source ./ci/lint/06_script.sh - - stage: test - name: 'ARM [GOAL: install] [focal] [unit tests, no functional tests]' - arch: arm64 # Can disable QEMU_USER_CMD and run the tests natively without qemu - env: >- - FILE_ENV="./ci/test/00_setup_env_arm.sh" - QEMU_USER_CMD="" - - - stage: test - name: 'Win64 [GOAL: deploy] [unit tests, no gui, no boost::process, no functional tests]' - env: >- - FILE_ENV="./ci/test/00_setup_env_win64.sh" - - stage: test name: 'x86_64 Linux [GOAL: install] [focal] [no wallet]' env: >- FILE_ENV="./ci/test/00_setup_env_native_nowallet.sh" - - - stage: test - name: 'macOS 10.14 native [GOAL: install] [GUI] [no depends]' - os: osx - # Use the most recent version: - # Xcode 11.3.1, macOS 10.14, SDK 10.15 - # https://docs.travis-ci.com/user/reference/osx/#macos-version - osx_image: xcode11.3 - addons: - homebrew: - packages: - - berkeley-db4 - - miniupnpc - - qrencode - - ccache - - zeromq - env: >- - DANGER_RUN_CI_ON_HOST=true - CI_USE_APT_INSTALL=no - FILE_ENV="./ci/test/00_setup_env_mac_host.sh" diff --git a/ci/test/00_setup_env_mac_host.sh b/ci/test/00_setup_env_mac_host.sh index 4bdc5dc409..7ad8d1b024 100755 --- a/ci/test/00_setup_env_mac_host.sh +++ b/ci/test/00_setup_env_mac_host.sh @@ -11,12 +11,9 @@ export HOST=x86_64-apple-darwin export PIP_PACKAGES="zmq lief" export GOAL="install" export BITCOIN_CONFIG="--with-gui --enable-reduce-exports --disable-miner --enable-werror --with-boost-process" +export CI_OS_NAME="macos" export NO_DEPENDS=1 export OSX_SDK="" export CCACHE_SIZE=300M export RUN_SECURITY_TESTS="true" -if [ "$TRAVIS_REPO_SLUG" != "dashpay/dash" ]; then - export RUN_FUNCTIONAL_TESTS="false" - export EXPECTED_TESTS_DURATION_IN_SECONDS=200 -fi diff --git a/ci/test/00_setup_env_win64.sh b/ci/test/00_setup_env_win64.sh index b1477d9b99..eecd9e7de8 100755 --- a/ci/test/00_setup_env_win64.sh +++ b/ci/test/00_setup_env_win64.sh @@ -8,7 +8,7 @@ export LC_ALL=C.UTF-8 export CONTAINER_NAME=ci_win64 export HOST=x86_64-w64-mingw32 -export PACKAGES="python3 nsis g++-mingw-w64-x86-64 wine-binfmt wine64" +export PACKAGES="python3 nsis g++-mingw-w64-x86-64 wine-binfmt wine64 file" export DPKG_ADD_ARCH="i386" export RUN_FUNCTIONAL_TESTS=false export RUN_SECURITY_TESTS="false" diff --git a/ci/test/04_install.sh b/ci/test/04_install.sh index b89fa16f22..5b9cf5f064 100755 --- a/ci/test/04_install.sh +++ b/ci/test/04_install.sh @@ -13,8 +13,8 @@ if [[ $QEMU_USER_CMD == qemu-s390* ]]; then export LC_ALL=C fi -if [ "$TRAVIS_OS_NAME" == "osx" ]; then - ${CI_RETRY_EXE} pip3 install $PIP_PACKAGES +if [ "$CI_OS_NAME" == "macos" ]; then + IN_GETOPT_BIN="/usr/local/opt/gnu-getopt/bin/getopt" ${CI_RETRY_EXE} pip3 install --user $PIP_PACKAGES fi # Create folders that are mounted into the docker @@ -26,9 +26,7 @@ export LSAN_OPTIONS="suppressions=${BASE_BUILD_DIR}/test/sanitizer_suppressions/ export TSAN_OPTIONS="suppressions=${BASE_BUILD_DIR}/test/sanitizer_suppressions/tsan:halt_on_error=1" export UBSAN_OPTIONS="suppressions=${BASE_BUILD_DIR}/test/sanitizer_suppressions/ubsan:print_stacktrace=1:halt_on_error=1:report_error_type=1" env | grep -E '^(BASE_|QEMU_|CCACHE_|LC_ALL|BOOST_TEST_RANDOM|DEBIAN_FRONTEND|CONFIG_SHELL|(ASAN|LSAN|TSAN|UBSAN)_OPTIONS|PREVIOUS_RELEASES_DIR))' | tee /tmp/env -if [[ $HOST = *-mingw32 ]]; then - DOCKER_ADMIN="--cap-add SYS_ADMIN" -elif [[ $BITCOIN_CONFIG = *--with-sanitizers=*address* ]]; then # If ran with (ASan + LSan), Docker needs access to ptrace (https://github.com/google/sanitizers/issues/764) +if [[ $BITCOIN_CONFIG = *--with-sanitizers=*address* ]]; then # If ran with (ASan + LSan), Docker needs access to ptrace (https://github.com/google/sanitizers/issues/764) DOCKER_ADMIN="--cap-add SYS_PTRACE" fi @@ -72,16 +70,16 @@ elif [ "$CI_USE_APT_INSTALL" != "no" ]; then fi fi -if [ "$TRAVIS_OS_NAME" == "osx" ]; then +if [ "$CI_OS_NAME" == "macos" ]; then top -l 1 -s 0 | awk ' /PhysMem/ {print}' echo "Number of CPUs: $(sysctl -n hw.logicalcpu)" else DOCKER_EXEC free -m -h DOCKER_EXEC echo "Number of CPUs \(nproc\):" \$\(nproc\) DOCKER_EXEC echo $(lscpu | grep Endian) - DOCKER_EXEC echo "Free disk space:" - DOCKER_EXEC df -h fi +DOCKER_EXEC echo "Free disk space:" +DOCKER_EXEC df -h if [ ! -d ${DIR_QA_ASSETS} ]; then if [ "$RUN_FUZZ_TESTS" = "true" ]; then diff --git a/ci/test/05_before_script.sh b/ci/test/05_before_script.sh index 2e56c926b7..1c595a7573 100755 --- a/ci/test/05_before_script.sh +++ b/ci/test/05_before_script.sh @@ -7,7 +7,7 @@ export LC_ALL=C.UTF-8 # Make sure default datadir does not exist and is never read by creating a dummy file -if [ "$TRAVIS_OS_NAME" == "osx" ]; then +if [ "$CI_OS_NAME" == "macos" ]; then echo > $HOME/Library/Application\ Support/DashCore else DOCKER_EXEC echo \> \$HOME/.dashcore diff --git a/ci/test/wrap-wine.sh b/ci/test/wrap-wine.sh new file mode 100755 index 0000000000..58a8983e6e --- /dev/null +++ b/ci/test/wrap-wine.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +# +# Copyright (c) 2020 The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +export LC_ALL=C.UTF-8 + +for b_name in {"${BASE_OUTDIR}/bin"/*,src/secp256k1/*tests,src/univalue/{no_nul,test_json,unitester,object}}.exe; do + # shellcheck disable=SC2044 + for b in $(find "${BASE_ROOT_DIR}" -executable -type f -name "$(basename $b_name)"); do + if (file "$b" | grep "Windows"); then + echo "Wrap $b ..." + mv "$b" "${b}_orig" + echo '#!/usr/bin/env bash' > "$b" + echo "wine64 \"${b}_orig\" \"\$@\"" >> "$b" + chmod +x "$b" + fi + done +done From 3a0e88cf6fdd21490ae1128d4e1e103500b9cd48 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Wed, 11 Nov 2020 14:21:33 +0100 Subject: [PATCH 11/12] Merge #20368: ci: Remove redundant valgrind fuzz task fa92cf29d971811ff8dd844ee1a1e2e12b79e389 ci: Remove redundant valgrind fuzz task (MarcoFalke) Pull request description: This task has several issues: * It slows down other tasks and times out: It needs a lot of resources (CPU, RAM, time), because it builds more than 100 fuzzers, clones a 2 GB repo with 100k seeds and pipes them all through valgrind * It doesn't add a lot of value: Except for one issue in the boost time library, it hasn't found any issues that the existing fuzz,asan,ubsan fuzzer has already found * It is redundant: It is already run in the bitcoin-core/qa-assets repo on every push of new seeds and once daily Fix all issues by removing it here. Top commit has no ACKs. Tree-SHA512: 76d16a3e5afc79ba9d89cfeb915d7e66fd1ad4e2035ae4ccd30a21cc060bfba3fb6a904346b7c41606e69d972e86bf660df962673028689227cc26072bba24bd --- .cirrus.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index d9bfaf4c73..7c5f94092e 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -97,14 +97,6 @@ task: env: FILE_ENV: "./ci/test/00_setup_env_native_fuzz.sh" -task: - name: 'x86_64 Linux [GOAL: install] [focal] [no depends, only system libs, fuzzers under valgrind]' - << : *GLOBAL_TASK_TEMPLATE - container: - image: ubuntu:focal - env: - FILE_ENV: "./ci/test/00_setup_env_native_fuzz_with_valgrind.sh" - task: name: 'x86_64 Linux [GOAL: install] [focal] [multiprocess]' << : *GLOBAL_TASK_TEMPLATE From cc55e4e5a933176dbbc6bc9d5dd4dec6bda6fc49 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Mon, 16 Nov 2020 07:59:39 +0100 Subject: [PATCH 12/12] Merge #20390: CI/Cirrus: Skip merge_base step for non-PRs 20e491ddcb2617472c15294067768e8ce122499a CI/Cirrus: Skip merge_base step for non-PRs (Luke Dashjr) Pull request description: CIRRUS_BASE_BRANCH is a PR-specific variable and undocumented on non-PR builds. In practice (at the moment), it seems to be HEAD, which in private repositories can be pretty much anything, causing CI to fail if it can't be cleanly merged. By checking CIRRUS_PR first, we can reliably do CI builds of branches outside PRs. ACKs for top commit: MarcoFalke: review ACK 20e491ddcb2617472c15294067768e8ce122499a Tree-SHA512: 9fd8db2e19a3145f7dccfca107631b20df8c94d385f624e2bcef2fa18e38bf3e23c6c68fc8241decedbf1413bf69ca572cff75e1ccf82c09ac50443001ec5ae5 --- .cirrus.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.cirrus.yml b/.cirrus.yml index 7c5f94092e..23b298ef6c 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -29,6 +29,7 @@ global_task_template: &GLOBAL_TASK_TEMPLATE depends_releases_cache: folder: "/tmp/cirrus-ci-build/releases" merge_base_script: + - if [ "$CIRRUS_PR" = "" ]; then exit 0; fi - bash -c "$PACKAGE_MANAGER_INSTALL git" - git fetch $CIRRUS_REPO_CLONE_URL $CIRRUS_BASE_BRANCH - git config --global user.email "ci@ci.ci"