Page MenuHomePhabricator

span: Add std::byte helpers
ClosedPublic

Authored by PiRK on Apr 2 2024, 16:28.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCd97242ade07e: span: Add std::byte helpers
Summary

Also, add Span<std::byte> interface to strencondings.

This concludes backport of core#23451
https://github.com/bitcoin/bitcoin/pull/23451/commits/faa3ec2304051be7cfbe301cfbfbda3faf7514fc

Depends on D15858

Test Plan

ninja all check-all

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Tail of the build log:

wallet_listreceivedby.py                   | ○ Skipped | 0 s
wallet_listsinceblock.py                   | ○ Skipped | 0 s
wallet_listsinceblock.py --descriptors     | ○ Skipped | 0 s
wallet_listtransactions.py                 | ○ Skipped | 0 s
wallet_listtransactions.py --descriptors   | ○ Skipped | 0 s
wallet_multiwallet.py                      | ○ Skipped | 0 s
wallet_multiwallet.py --descriptors        | ○ Skipped | 0 s
wallet_multiwallet.py --usecli             | ○ Skipped | 0 s
wallet_reorgsrestore.py                    | ○ Skipped | 0 s
wallet_resendwallettransactions.py         | ○ Skipped | 0 s
wallet_send.py                             | ○ Skipped | 0 s
wallet_startup.py                          | ○ Skipped | 0 s
wallet_timelock.py                         | ○ Skipped | 0 s
wallet_txn_clone.py                        | ○ Skipped | 0 s
wallet_txn_clone.py --mineblock            | ○ Skipped | 0 s
wallet_txn_doublespend.py                  | ○ Skipped | 0 s
wallet_txn_doublespend.py --mineblock      | ○ Skipped | 0 s
wallet_watchonly.py                        | ○ Skipped | 0 s
wallet_watchonly.py --usecli               | ○ Skipped | 0 s

ALL                                        | ✓ Passed  | 809 s (accumulated) 
Runtime: 162 s

[178/460] Test Bitcoin RPC authentication...
...
----------------------------------------------------------------------
Ran 3 tests in 0.005s

OK
[179/460] cd /work/contrib/devtools/chainparams && /usr/bin/python3.9 ./test_make_chainparams.py
.....
----------------------------------------------------------------------
Ran 5 tests in 0.001s

OK
[186/460] Running avalanche test suite
PASSED: avalanche test suite
[201/460] Running seeder test suite
PASSED: seeder test suite
[211/460] Running pow test suite
PASSED: pow test suite
[215/460] Running bitcoin-qt test suite
PASSED: bitcoin-qt test suite
[216/460] Building CXX object src/test/CMakeFiles/test_bitcoin.dir/util_tests.cpp.o
FAILED: src/test/CMakeFiles/test_bitcoin.dir/util_tests.cpp.o 
/usr/bin/ccache /usr/bin/c++ -DBOOST_ALL_NO_LIB -DBUILD_BITCOIN_INTERNAL -DENABLE_AVX2 -DENABLE_SHANI -DENABLE_SSE41 -DHAVE_BUILD_INFO -DHAVE_CONFIG_H -DHAVE_CONSENSUS_LIB -DLEVELDB_ATOMIC_PRESENT -DLEVELDB_PLATFORM_POSIX -DOS_LINUX -I../../src/univalue/include -I../../src/. -Isrc -Isrc/crypto/.. -I../../src/secp256k1/include -I../../src/leveldb/include -isystem /usr/include/jemalloc -isystem /usr/include/miniupnpc -Werror -g -O2 -fPIE -fvisibility=hidden -fstack-reuse=none -fstack-protector-all -Wstack-protector -fcf-protection=full -fstack-clash-protection -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wformat -Wvla -Wcast-align -Wunused-parameter -Wmissing-braces -Wredundant-decls -Wsign-compare -Wduplicated-branches -Wduplicated-cond -Wlogical-op -Wformat-security -Wredundant-move -Woverloaded-virtual -Wno-unused-parameter -Wno-implicit-fallthrough -Wno-psabi -pthread -std=gnu++17 -MD -MT src/test/CMakeFiles/test_bitcoin.dir/util_tests.cpp.o -MF src/test/CMakeFiles/test_bitcoin.dir/util_tests.cpp.o.d -o src/test/CMakeFiles/test_bitcoin.dir/util_tests.cpp.o -c ../../src/test/util_tests.cpp
../../src/test/util_tests.cpp: In member function ‘void util_tests::span_write_bytes::test_method()’:
../../src/test/util_tests.cpp:210:52: error: missing braces around initializer for ‘std::__array_traits<unsigned char, 2>::_Type’ {aka ‘unsigned char [2]’} [-Werror=missing-braces]
  210 |     std::array mut_arr{uint8_t{0xaa}, uint8_t{0xbb}};
      |                                                    ^
cc1plus: all warnings being treated as errors
[217/460] Building CXX object src/test/CMakeFiles/test_bitcoin.dir/script_tests.cpp.o
In file included from /usr/include/boost/test/unit_test.hpp:19,
                 from ../../src/test/script_tests.cpp:30:
../../src/test/script_tests.cpp: In member function ‘void script_tests::script_build::test_method()’:
../../src/test/script_tests.cpp:540:22: note: variable tracking size limit exceeded with ‘-fvar-tracking-assignments’, retrying without
  540 | BOOST_AUTO_TEST_CASE(script_build) {
      |                      ^~~~~~~~~~~~
ninja: build stopped: cannot make progress due to previous errors.
Build build-without-wallet failed with exit code 1

Tail of the build log:

chronik_disallow_prune.py                  | ○ Skipped | 0 s
chronik_mempool_conflicts.py               | ○ Skipped | 0 s
chronik_pause.py                           | ○ Skipped | 0 s
chronik_plugins_setup.py                   | ○ Skipped | 0 s
chronik_raw_tx.py                          | ○ Skipped | 0 s
chronik_resync.py                          | ○ Skipped | 0 s
chronik_script_confirmed_txs.py            | ○ Skipped | 0 s
chronik_script_history.py                  | ○ Skipped | 0 s
chronik_script_unconfirmed_txs.py          | ○ Skipped | 0 s
chronik_script_utxos.py                    | ○ Skipped | 0 s
chronik_serve.py                           | ○ Skipped | 0 s
chronik_spent_by.py                        | ○ Skipped | 0 s
chronik_token_alp.py                       | ○ Skipped | 0 s
chronik_token_broadcast_txs.py             | ○ Skipped | 0 s
chronik_token_burn.py                      | ○ Skipped | 0 s
chronik_token_id_group.py                  | ○ Skipped | 0 s
chronik_token_parse_failure.py             | ○ Skipped | 0 s
chronik_token_script_group.py              | ○ Skipped | 0 s
chronik_token_slp_fungible.py              | ○ Skipped | 0 s
chronik_token_slp_mint_vault.py            | ○ Skipped | 0 s
chronik_token_slp_nft1.py                  | ○ Skipped | 0 s
chronik_tx.py                              | ○ Skipped | 0 s
chronik_tx_removal_order.py                | ○ Skipped | 0 s
chronik_ws.py                              | ○ Skipped | 0 s
chronik_ws_ordering.py                     | ○ Skipped | 0 s
chronik_ws_ping.py                         | ○ Skipped | 0 s
chronik_ws_script.py                       | ○ Skipped | 0 s
feature_bind_port_discover.py              | ○ Skipped | 0 s
feature_bind_port_externalip.py            | ○ Skipped | 0 s
interface_usdt_net.py                      | ○ Skipped | 0 s
interface_usdt_utxocache.py                | ○ Skipped | 0 s
interface_usdt_validation.py               | ○ Skipped | 0 s

ALL                                        | ✓ Passed  | 2523 s (accumulated) 
Runtime: 505 s

[165/500] Test Bitcoin RPC authentication...
...
----------------------------------------------------------------------
Ran 3 tests in 0.005s

OK
[166/500] cd /work/contrib/devtools/chainparams && /usr/bin/python3.9 ./test_make_chainparams.py
.....
----------------------------------------------------------------------
Ran 5 tests in 0.001s

OK
[215/500] Running seeder test suite
PASSED: seeder test suite
[230/500] Running secp256k1 test suite
PASSED: secp256k1 test suite
[233/500] Running pow test suite
PASSED: pow test suite
[236/500] Running bitcoin-qt test suite
PASSED: bitcoin-qt test suite
[239/500] Running avalanche test suite
PASSED: avalanche test suite
ninja: build stopped: cannot make progress due to previous errors.
Build build-debug failed with exit code 1

Tail of the build log:

wallet_multiwallet.py                      | ✓ Passed  | 41 s
wallet_multiwallet.py --descriptors        | ✓ Passed  | 41 s
wallet_multiwallet.py --usecli             | ✓ Passed  | 15 s
wallet_reorgsrestore.py                    | ✓ Passed  | 5 s
wallet_resendwallettransactions.py         | ✓ Passed  | 4 s
wallet_send.py                             | ✓ Passed  | 10 s
wallet_startup.py                          | ✓ Passed  | 4 s
wallet_timelock.py                         | ✓ Passed  | 1 s
wallet_txn_clone.py                        | ✓ Passed  | 3 s
wallet_txn_clone.py --mineblock            | ✓ Passed  | 3 s
wallet_txn_doublespend.py                  | ✓ Passed  | 2 s
wallet_txn_doublespend.py --mineblock      | ✓ Passed  | 3 s
wallet_watchonly.py                        | ✓ Passed  | 2 s
wallet_watchonly.py --usecli               | ✓ Passed  | 2 s
chronik_avalanche.py                       | ○ Skipped | 0 s
chronik_block.py                           | ○ Skipped | 0 s
chronik_block_info.py                      | ○ Skipped | 0 s
chronik_block_txs.py                       | ○ Skipped | 0 s
chronik_blockchain_info.py                 | ○ Skipped | 0 s
chronik_blocks.py                          | ○ Skipped | 0 s
chronik_chronik_info.py                    | ○ Skipped | 0 s
chronik_disable_token_index.py             | ○ Skipped | 0 s
chronik_disallow_prune.py                  | ○ Skipped | 0 s
chronik_mempool_conflicts.py               | ○ Skipped | 0 s
chronik_pause.py                           | ○ Skipped | 0 s
chronik_plugins_setup.py                   | ○ Skipped | 0 s
chronik_raw_tx.py                          | ○ Skipped | 0 s
chronik_resync.py                          | ○ Skipped | 0 s
chronik_script_confirmed_txs.py            | ○ Skipped | 0 s
chronik_script_history.py                  | ○ Skipped | 0 s
chronik_script_unconfirmed_txs.py          | ○ Skipped | 0 s
chronik_script_utxos.py                    | ○ Skipped | 0 s
chronik_serve.py                           | ○ Skipped | 0 s
chronik_spent_by.py                        | ○ Skipped | 0 s
chronik_token_alp.py                       | ○ Skipped | 0 s
chronik_token_broadcast_txs.py             | ○ Skipped | 0 s
chronik_token_burn.py                      | ○ Skipped | 0 s
chronik_token_id_group.py                  | ○ Skipped | 0 s
chronik_token_parse_failure.py             | ○ Skipped | 0 s
chronik_token_script_group.py              | ○ Skipped | 0 s
chronik_token_slp_fungible.py              | ○ Skipped | 0 s
chronik_token_slp_mint_vault.py            | ○ Skipped | 0 s
chronik_token_slp_nft1.py                  | ○ Skipped | 0 s
chronik_tx.py                              | ○ Skipped | 0 s
chronik_tx_removal_order.py                | ○ Skipped | 0 s
chronik_ws.py                              | ○ Skipped | 0 s
chronik_ws_ordering.py                     | ○ Skipped | 0 s
chronik_ws_ping.py                         | ○ Skipped | 0 s
chronik_ws_script.py                       | ○ Skipped | 0 s
feature_bind_port_discover.py              | ○ Skipped | 0 s
feature_bind_port_externalip.py            | ○ Skipped | 0 s
interface_usdt_net.py                      | ○ Skipped | 0 s
interface_usdt_utxocache.py                | ○ Skipped | 0 s
interface_usdt_validation.py               | ○ Skipped | 0 s

ALL                                        | ✓ Passed  | 1744 s (accumulated) 
Runtime: 349 s

ninja: build stopped: cannot make progress due to previous errors.
Build build-diff failed with exit code 1

workaround for compiler warning

PiRK published this revision for review.Apr 3 2024, 07:43
PiRK added inline comments.
src/span.h
293 ↗(On Diff #46758)

See D14768 for Span vs MakeSpan

This revision is now accepted and ready to land.Apr 4 2024, 07:50
This revision was automatically updated to reflect the committed changes.