Avoid the use of P0083R3 std::set::merge #22342

pull sipa wants to merge 1 commits into bitcoin:master from sipa:202106_no_cxx17_merge changing 1 files +7 −1
  1. sipa commented at 5:32 pm on June 25, 2021: member

    This use was introduced in #21365, but as pointed out in #22339, this causes compatibility problems.

    Just avoid its use for now.

  2. in src/script/standard.cpp:410 in 3052341dfd outdated
    406@@ -407,7 +407,13 @@ void TaprootSpendData::Merge(TaprootSpendData other)
    407         merkle_root = other.merkle_root;
    408     }
    409     for (auto& [key, control_blocks] : other.scripts) {
    410-        scripts[key].merge(std::move(control_blocks));
    411+        // Once P0083R3 is supported by all our targetted platforms,
    


    jonatack commented at 5:37 pm on June 25, 2021:
    0test/lint/lint-spelling.sh 
    1src/script/standard.cpp:410: targetted ==> targeted
    

    sipa commented at 5:42 pm on June 25, 2021:
    Fixed.
  3. jonatack commented at 5:38 pm on June 25, 2021: member
    ACK 3052341dfda688e0c9f4fea228024cdd5099d565
  4. Avoid the use of P0083R3 std::set::merge 6cf4ea7187
  5. sipa force-pushed on Jun 25, 2021
  6. jonatack commented at 5:45 pm on June 25, 2021: member
    re-ACK 6cf4ea71878c0a83f2e49831e4dfa119c53761b7
  7. benthecarman commented at 11:35 pm on June 25, 2021: contributor
    ACK 6cf4ea71878c0a83f2e49831e4dfa119c53761b7
  8. hebasto approved
  9. hebasto commented at 2:23 am on June 26, 2021: member

    ACK 6cf4ea71878c0a83f2e49831e4dfa119c53761b7, successfully compiled on the following systems:

    • macOS Mojave 10.14.6 (18G9216)
    0$ clang --version
    1Apple LLVM version 10.0.1 (clang-1001.0.46.4)
    2Target: x86_64-apple-darwin18.7.0
    3Thread model: posix
    4InstalledDir: /Library/Developer/CommandLineTools/usr/bin
    
    • Debian 9.13 (stretch)
    0$ make -C depends NO_QT=1 CC=clang-7 CXX='clang++-7 -stdlib=libc++'
    1$ ./autogen.sh && CONFIG_SITE=$PWD/depends/x86_64-pc-linux-gnu/share/config.site ./configure -q --disable-tests --disable-bench CC=clang-7 CXX='clang++-7 -stdlib=libc++' && make clean > /dev/null
    2$ make
    
  10. hebasto commented at 2:28 am on June 26, 2021: member
    Should this be tagged for 22.0?
  11. sipa added this to the milestone 22.0 on Jun 26, 2021
  12. MarcoFalke commented at 7:59 am on June 26, 2021: member

    Before:

     0$ make V=1
     1Making all in src
     2make[1]: Entering directory '/bitcoin-core/src'
     3make[2]: Entering directory '/bitcoin-core/src'
     4make[3]: Entering directory '/bitcoin-core'
     5make[3]: Leaving directory '/bitcoin-core'
     6/usr/bin/ccache clang++-7 -stdlib=libc++ -std=c++17 -DHAVE_CONFIG_H -I. -I../src/config   -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -I. -I./secp256k1/include  -I/bitcoin-core/depends/x86_64-pc-linux-gnu/include -I./leveldb/include -I./leveldb/helpers/memenv -I./univalue/include -I/bitcoin-core/depends/x86_64-pc-linux-gnu/include/  -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS -DPROVIDE_FUZZ_MAIN_FUNCTION -fdebug-prefix-map=/bitcoin-core/src=. -Wstack-protector -fstack-protector-all      -fPIE -pipe -O2  -MT script/libbitcoin_common_a-standard.o -MD -MP -MF script/.deps/libbitcoin_common_a-standard.Tpo -c -o script/libbitcoin_common_a-standard.o `test -f 'script/standard.cpp' || echo './'`script/standard.cpp
     7script/standard.cpp:410:22: error: no member named 'merge' in 'std::__1::set<std::__1::vector<unsigned char, std::__1::allocator<unsigned char> >, ShortestVectorFirstComparator, std::__1::allocator<std::__1::vector<unsigned char, std::__1::allocator<unsigned char> > > >'
     8        scripts[key].merge(std::move(control_blocks));
     9        ~~~~~~~~~~~~ ^
    101 error generated.
    11make[2]: *** [Makefile:8408: script/libbitcoin_common_a-standard.o] Error 1
    12make[2]: Leaving directory '/bitcoin-core/src'
    13make[1]: *** [Makefile:16141: all-recursive] Error 1
    14make[1]: Leaving directory '/bitcoin-core/src'
    15make: *** [Makefile:820: all-recursive] Error 1
    

    After: (passes)

  13. MarcoFalke merged this on Jun 26, 2021
  14. MarcoFalke closed this on Jun 26, 2021

  15. sidhujag referenced this in commit 654f89678e on Jun 27, 2021
  16. fanquake commented at 2:04 am on June 28, 2021: member
    We probably could have almost left this as is for 22.0, #22339 also didn’t cover the actual hard compatibility issue, which would have been needing to bump the minimum required macOS to 10.15. In any case, I think we can revert this for 0.23, as we are going to bump our macOS and lib(std)c++ requirements to use std::filesystem.
  17. gwillen referenced this in commit a523f13fc5 on Jun 1, 2022
  18. DrahtBot locked this on Aug 16, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-18 15:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me