Skip to content

Conversation

fanquake
Copy link
Member

@fanquake fanquake commented Sep 22, 2021

This increases the minimum required compiler versions to Clang 7 and GCC 8.1. This has been split out of #20744 (migration to std::filesystem), as it's also a requirement for some other changes, such as #20452 or #20457 which want to make use of std::from_chars. As well as #20435, which is also std::filesystem related. Given that the std::filesystem changes are moving ahead, splitting out this change to let other PRs take advantage of the new requirements seems worthwhile.

Clang 7 has been available in Debian since Stretch (oldoldstable) and in Ubuntu since Bionic (18.04). GCC 8 has been available in Debian since Buster (oldstable) and in Ubuntu since Bionic (18.04). CentOS 8 also packages GCC 8.

The CI changes here give us one build with GCC 8, and another using Clang 7 on top of libc++.

Note that the minimum required libc++ in dependencies.md is unchanged as, at least for <filesystem>, and the *_chars use cases, libc++ 7 should be sufficient.

I've tested that building <filesystem> code using Clang 7 & libc++ works. i.e clang++-7 -std=c++17 fs.cpp -stdlib=libc++ -lc++fs. Also that building <filesystem> code with Clang 7 and libstdc++ 8 works. i.e clang++-7 -std=c++17 fs.cpp -lstdc++fs.

@jonatack
Copy link
Member

Concept ACK.

Copy link
Member

@maflcko maflcko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason in ci to check libstdc++-8 twice, when one could use libc++-7?

@fanquake fanquake force-pushed the 23_0_min_compiler_libcpp_requires branch from cf1c9fb to 50a0eb7 Compare September 22, 2021 09:53
@fanquake fanquake force-pushed the 23_0_min_compiler_libcpp_requires branch from 50a0eb7 to 182de7b Compare September 22, 2021 10:18
@maflcko
Copy link
Member

maflcko commented Sep 22, 2021

review ACK 182de7b

Also tested on debian:stretch with the following diff:

diff --git a/ci/test/00_setup_env_native_nowallet.sh b/ci/test/00_setup_env_native_nowallet.sh
index e9a20fca7..6d0b36295 100755
--- a/ci/test/00_setup_env_native_nowallet.sh
+++ b/ci/test/00_setup_env_native_nowallet.sh
@@ -9,6 +9,6 @@ export LC_ALL=C.UTF-8
 export CONTAINER_NAME=ci_native_nowallet
 export DOCKER_NAME_TAG=ubuntu:18.04  # Use bionic to have one config run the tests in python3.6, see doc/dependencies.md
 export PACKAGES="python3-zmq clang-7 llvm-7 libc++abi-7-dev libc++-7-dev"  # Use clang-7 to test C++17 compatibility, see doc/dependencies.md
-export DEP_OPTS="NO_WALLET=1 CC=clang-7 CXX='clang++-7 -stdlib=libc++'"
+export DEP_OPTS="NO_QT=1 CC=clang-7 CXX='clang++-7 -stdlib=libc++'"
 export GOAL="install"
 export BITCOIN_CONFIG="--enable-reduce-exports CC=clang-7 CXX='clang++-7 -stdlib=libc++'"

@maflcko
Copy link
Member

maflcko commented Sep 22, 2021

Thinking about bumping to clang-8 as well, because debian:stretch will enter commercial ELTS next year. So anyone paying for that can also pay for someone to compile Bitcoin Core. It is not even possible to run the functional tests on stretch, due to python3.5.

@DrahtBot
Copy link
Contributor

DrahtBot commented Sep 22, 2021

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #20744 (Use std::filesystem. Remove Boost Filesystem & System by fanquake)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@fanquake
Copy link
Member Author

Thinking about bumping to clang-8 as well,

If we did do that, we should increase the minimum required libc++ version to 8 as well, and revert #22342. I can't imagine anyone would be building with Clang 8 against libc++ 7.

@laanwj
Copy link
Member

laanwj commented Sep 23, 2021

Concept ACK.

@laanwj
Copy link
Member

laanwj commented Sep 23, 2021

Would this unblock #20457 and #20452?

@fanquake
Copy link
Member Author

Would this unblock #20457 and #20452?

Yes. This PR as is, should be enough to unblock those, as support for the *_chars funcs (Elementary string conversions) landed in libstdc++ 8.

@hebasto
Copy link
Member

hebasto commented Sep 25, 2021

Concept ACK.

export PACKAGES="python3-zmq clang-5.0 llvm-5.0" # Use clang-5 to test C++17 compatibility, see doc/dependencies.md
export DEP_OPTS="NO_WALLET=1"
export PACKAGES="python3-zmq clang-7 llvm-7 libc++abi-7-dev libc++-7-dev" # Use clang-7 to test C++17 compatibility, see doc/dependencies.md
export DEP_OPTS="NO_WALLET=1 CC=clang-7 CXX='clang++-7 -stdlib=libc++'"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

182de7b

Passing CCand CXX to DEP_OPTS does not work as expected. From the log:

...
Configuring qt...
...

Configure summary:

Building on: linux-g++ (x86_64, CPU features: mmx sse sse2)
Building for: linux-g++-64 (x86_64, CPU features: mmx sse sse2)
Target compiler: gcc 7.5.0
...

Reported in #22184.


Another issue:

...
checking for QMinimalIntegrationPlugin (-lqminimal)... no
configure: WARNING: QMinimalIntegrationPlugin not found.; bitcoin-qt frontend will not be built
...

Options used to compile and link:
  external signer = yes
  multiprocess    = no
  with libs       = yes
  with wallet     = no
  with gui / qt   = no
...

Reported in #22344, fixed in #22814, some relevant discussion in #22815 (comment).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passing CC and CXX to DEP_OPTS does not work as expected.

It works as expected with everything except for Qt, and that's not an issue introduced by this PR.

Reported in #22344, fixed in #22814, some relevant discussion in

Another Qt specific issue, that isn't introduced by this PR.

Frankly I'm getting sick of fighting against Qts build system, and don't consider either of this issues blockers for this change, especially if there's a potential fix available. I'll comment in #22814 shortly.

Copy link
Member

@hebasto hebasto Sep 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... isn't introduced by this PR.

This PR builds dependencies with the -stdlib=libc++. It was not the case before.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR builds dependencies with the -stdlib=libc++. It was not the case before.

The underlying issue, which is that the Qt build doesn't work properly in regards to building with -stdlib=libc++, was not introduced in this PR. I don't think it's an issue that we have one less CI building Qt in depends.

@fanquake fanquake merged commit 67eae69 into bitcoin:master Sep 28, 2021
@fanquake fanquake deleted the 23_0_min_compiler_libcpp_requires branch September 28, 2021 06:04
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Sep 28, 2021
hebasto added a commit to hebasto/bitcoin that referenced this pull request Dec 25, 2021
maflcko pushed a commit that referenced this pull request Dec 26, 2021
94a7f09 doc: Drop outdated note (Hennadii Stepanov)

Pull request description:

  It is outdated since #23060.

ACKs for top commit:
  MarcoFalke:
    cr ACK 94a7f09
  theStack:
    Code-review ACK 94a7f09

Tree-SHA512: 5a98cf39c3939845d1abb64cb62dbb9bdb1135aa07a5cd0d85de7b6a6d9a3397b0e5da06cdb89991aac31151cb3c0d38eacf4898c53014cb7f7600e992230f87
fanquake added a commit to bitcoin-core/gui that referenced this pull request Dec 30, 2021
…s with -stdlib=libc++

33796a9 build: Add ability to build qt in depends with -stdlib=libc++ (Hennadii Stepanov)

Pull request description:

  This PR makes possible to build the `qt` package in depends against `libc++` for x86_64 platform.

  Fixes #22344.

  Required for #22815.

  Also this PR [fixes](bitcoin/bitcoin#23060 (comment)) the `[no wallet] [bionic]` task on CI:
  - on master (a8bbd4c), https://api.cirrus-ci.com/v1/task/5558609250615296/logs/ci.log:
  ```
  Options used to compile and link:
    external signer = yes
    multiprocess    = no
    with libs       = yes
    with wallet     = no
    with gui / qt   = no
  ```
  - this PR, https://api.cirrus-ci.com/v1/task/5502605561430016/logs/ci.log:
  ```
  Options used to compile and link:
    external signer = yes
    multiprocess    = no
    with libs       = yes
    with wallet     = no
    with gui / qt   = yes
  ```

ACKs for top commit:
  fanquake:
    ACK 33796a9 - While this sort of string matching is fragile, I think the risk of this causing any actual issues is low.

Tree-SHA512: 586dde2e9864cec7a49aeb4f2b77fb8c4ae96bd10b51f9c6de0cfe8512ad61db15bb7f8d1b0eb6a5a66fd2deee52ac52218f01eb6be107ac12f1a956190de54b
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Dec 30, 2021
…stdlib=libc++

33796a9 build: Add ability to build qt in depends with -stdlib=libc++ (Hennadii Stepanov)

Pull request description:

  This PR makes possible to build the `qt` package in depends against `libc++` for x86_64 platform.

  Fixes bitcoin#22344.

  Required for bitcoin#22815.

  Also this PR [fixes](bitcoin#23060 (comment)) the `[no wallet] [bionic]` task on CI:
  - on master (a8bbd4c), https://api.cirrus-ci.com/v1/task/5558609250615296/logs/ci.log:
  ```
  Options used to compile and link:
    external signer = yes
    multiprocess    = no
    with libs       = yes
    with wallet     = no
    with gui / qt   = no
  ```
  - this PR, https://api.cirrus-ci.com/v1/task/5502605561430016/logs/ci.log:
  ```
  Options used to compile and link:
    external signer = yes
    multiprocess    = no
    with libs       = yes
    with wallet     = no
    with gui / qt   = yes
  ```

ACKs for top commit:
  fanquake:
    ACK 33796a9 - While this sort of string matching is fragile, I think the risk of this causing any actual issues is low.

Tree-SHA512: 586dde2e9864cec7a49aeb4f2b77fb8c4ae96bd10b51f9c6de0cfe8512ad61db15bb7f8d1b0eb6a5a66fd2deee52ac52218f01eb6be107ac12f1a956190de54b
mzumsande pushed a commit to mzumsande/bitcoin that referenced this pull request Jan 17, 2022
rebroad pushed a commit to rebroad/bitcoin that referenced this pull request Feb 3, 2022
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Apr 7, 2022
…stdlib=libc++

33796a9 build: Add ability to build qt in depends with -stdlib=libc++ (Hennadii Stepanov)

Pull request description:

  This PR makes possible to build the `qt` package in depends against `libc++` for x86_64 platform.

  Fixes bitcoin#22344.

  Required for bitcoin#22815.

  Also this PR [fixes](bitcoin#23060 (comment)) the `[no wallet] [bionic]` task on CI:
  - on master (a8bbd4c), https://api.cirrus-ci.com/v1/task/5558609250615296/logs/ci.log:
  ```
  Options used to compile and link:
    external signer = yes
    multiprocess    = no
    with libs       = yes
    with wallet     = no
    with gui / qt   = no
  ```
  - this PR, https://api.cirrus-ci.com/v1/task/5502605561430016/logs/ci.log:
  ```
  Options used to compile and link:
    external signer = yes
    multiprocess    = no
    with libs       = yes
    with wallet     = no
    with gui / qt   = yes
  ```

ACKs for top commit:
  fanquake:
    ACK 33796a9 - While this sort of string matching is fragile, I think the risk of this causing any actual issues is low.

Tree-SHA512: 586dde2e9864cec7a49aeb4f2b77fb8c4ae96bd10b51f9c6de0cfe8512ad61db15bb7f8d1b0eb6a5a66fd2deee52ac52218f01eb6be107ac12f1a956190de54b
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Apr 11, 2022
…stdlib=libc++

33796a9 build: Add ability to build qt in depends with -stdlib=libc++ (Hennadii Stepanov)

Pull request description:

  This PR makes possible to build the `qt` package in depends against `libc++` for x86_64 platform.

  Fixes bitcoin#22344.

  Required for bitcoin#22815.

  Also this PR [fixes](bitcoin#23060 (comment)) the `[no wallet] [bionic]` task on CI:
  - on master (a8bbd4c), https://api.cirrus-ci.com/v1/task/5558609250615296/logs/ci.log:
  ```
  Options used to compile and link:
    external signer = yes
    multiprocess    = no
    with libs       = yes
    with wallet     = no
    with gui / qt   = no
  ```
  - this PR, https://api.cirrus-ci.com/v1/task/5502605561430016/logs/ci.log:
  ```
  Options used to compile and link:
    external signer = yes
    multiprocess    = no
    with libs       = yes
    with wallet     = no
    with gui / qt   = yes
  ```

ACKs for top commit:
  fanquake:
    ACK 33796a9 - While this sort of string matching is fragile, I think the risk of this causing any actual issues is low.

Tree-SHA512: 586dde2e9864cec7a49aeb4f2b77fb8c4ae96bd10b51f9c6de0cfe8512ad61db15bb7f8d1b0eb6a5a66fd2deee52ac52218f01eb6be107ac12f1a956190de54b
gades pushed a commit to cosanta/cosanta-core that referenced this pull request May 12, 2022
…stdlib=libc++

33796a9 build: Add ability to build qt in depends with -stdlib=libc++ (Hennadii Stepanov)

Pull request description:

  This PR makes possible to build the `qt` package in depends against `libc++` for x86_64 platform.

  Fixes bitcoin#22344.

  Required for bitcoin#22815.

  Also this PR [fixes](bitcoin#23060 (comment)) the `[no wallet] [bionic]` task on CI:
  - on master (a8bbd4c), https://api.cirrus-ci.com/v1/task/5558609250615296/logs/ci.log:
  ```
  Options used to compile and link:
    external signer = yes
    multiprocess    = no
    with libs       = yes
    with wallet     = no
    with gui / qt   = no
  ```
  - this PR, https://api.cirrus-ci.com/v1/task/5502605561430016/logs/ci.log:
  ```
  Options used to compile and link:
    external signer = yes
    multiprocess    = no
    with libs       = yes
    with wallet     = no
    with gui / qt   = yes
  ```

ACKs for top commit:
  fanquake:
    ACK 33796a9 - While this sort of string matching is fragile, I think the risk of this causing any actual issues is low.

Tree-SHA512: 586dde2e9864cec7a49aeb4f2b77fb8c4ae96bd10b51f9c6de0cfe8512ad61db15bb7f8d1b0eb6a5a66fd2deee52ac52218f01eb6be107ac12f1a956190de54b
janus pushed a commit to BitgesellOfficial/bitgesell that referenced this pull request Jul 10, 2022
@bitcoin bitcoin locked and limited conversation to collaborators Oct 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants