Page MenuHomePhabricator

[cmake] link necessary lib for std::filesystem
ClosedPublic

Authored by PiRK on Sep 21 2022, 09:07.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC1989436a88e5: [cmake] link necessary lib for std::filesystem
Summary

This is needed for the backport of core#20744

Depends on D13735

Test Plan

ninja all check-all

CI builds

Event Timeline

@bot build-win64 build-osx build-master

use CHECK_CXX_COMPILER_FLAG

@bot build-win64 build-osx

use add_cxx_compiler_flags (and style changes)

try method from core#25797

PiRK edited the summary of this revision. (Show Details)

actually link the library

Failed tests logs:

====== Bitcoin ABC functional tests: feature_init.py ======

------- Stdout: -------
2022-11-24T16:53:52.193000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20221124_165104/feature_init_33
2022-11-24T16:53:52.664000Z TestFramework (INFO): Starting node and will exit after line 'scheduler thread start'
2022-11-24T16:53:52.667000Z TestFramework (INFO): Starting node and will exit after line 'Loading P2P addresses'
2022-11-24T16:53:52.908000Z TestFramework (INFO): Starting node and will exit after line 'Loading banlist'
2022-11-24T16:53:53.146000Z TestFramework (INFO): Starting node and will exit after line 'Loading block index'
2022-11-24T16:53:53.385000Z TestFramework (INFO): Starting node and will exit after line 'Switching active chainstate'
2022-11-24T16:53:53.641000Z TestFramework (INFO): Starting node and will exit after line 'Loaded best chain:'
2022-11-24T16:53:53.919000Z TestFramework (INFO): Starting node and will exit after line 'init message: Verifying blocks'
2022-11-24T16:53:54.177000Z TestFramework (INFO): Starting node and will exit after line 'loadblk thread start'
2022-11-24T16:53:54.621000Z TestFramework (INFO): Starting node and will exit after line 'net thread start'
2022-11-24T16:53:55.014000Z TestFramework (INFO): Starting node and will exit after line 'addcon thread start'
2022-11-24T16:53:55.392000Z TestFramework (INFO): Starting node and will exit after line 'msghand thread start'
2022-11-24T16:53:55.771000Z TestFramework (INFO): Starting node and will exit after line 'Verifying wallet'
2022-11-24T16:53:56.414000Z TestFramework (INFO): Terminate at some random point in the init process (max logs: 124)
2022-11-24T16:54:08.013000Z TestFramework (INFO): Test startup errors after removing certain essential files
2022-11-24T16:54:08.013000Z TestFramework (INFO): Tweaking file to ensure failure /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20221124_165104/feature_init_33/node0/regtest/blocks/index/000084.ldb
2022-11-24T16:55:08.015000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_node.py", line 655, in assert_start_raises_init_error
    ret = self.process.wait(timeout=self.rpc_timeout)
  File "/usr/lib/python3.9/subprocess.py", line 1189, in wait
    return self._wait(timeout=timeout)
  File "/usr/lib/python3.9/subprocess.py", line 1911, in _wait
    raise TimeoutExpired(self.args, timeout)
subprocess.TimeoutExpired: Command '['/work/abc-ci-builds/build-debug/src/bitcoind', '-datadir=/work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20221124_165104/feature_init_33/node0', '-logtimemicros', '-logthreadnames', '-logsourcelocations', '-debug', '-debugexclude=libevent', '-debugexclude=leveldb', '-uacomment=testnode-0']' timed out after 60 seconds

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 133, in main
    self.run_test()
  File "/work/test/functional/feature_init.py", line 175, in run_test
    node.assert_start_raises_init_error(
  File "/work/test/functional/test_framework/test_node.py", line 686, in assert_start_raises_init_error
    self._raise_assertion_error(assert_msg)
  File "/work/test/functional/test_framework/test_node.py", line 213, in _raise_assertion_error
    raise AssertionError(self._node_msg(msg))
AssertionError: [node 0] bitcoind should have exited within 60s with expected error Error opening block database.
2022-11-24T16:55:08.066000Z TestFramework (INFO): Stopping nodes
2022-11-24T16:55:08.066000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20221124_165104/feature_init_33
2022-11-24T16:55:08.066000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20221124_165104/feature_init_33/test_framework.log
2022-11-24T16:55:08.066000Z TestFramework (ERROR): 
2022-11-24T16:55:08.067000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20221124_165104/feature_init_33' to consolidate all logs
2022-11-24T16:55:08.067000Z TestFramework (ERROR): 
2022-11-24T16:55:08.067000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2022-11-24T16:55:08.067000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2022-11-24T16:55:08.067000Z TestFramework (ERROR):

Each failure log is accessible here:
Bitcoin ABC functional tests: feature_init.py

Failed tests logs:

====== Bitcoin ABC functional tests: feature_init.py ======
...

Unrelated (probably fixed by https://github.com/bitcoin/bitcoin/pull/23737

@bot build-win64 build-osx build-linux64 gitian-linux

PiRK published this revision for review.Apr 16 2023, 08:03
PiRK planned changes to this revision.Apr 16 2023, 10:22
PiRK edited the summary of this revision. (Show Details)

rebase

Is there any downside in just adding these flags if supported ? like add_linker_flags(-lstdc++fs -lc++fs)

cmake/modules/CheckStdFilesystem.cmake
1 ↗(On Diff #39791)

Macro whatyearisit:

Is there any downside in just adding these flags if supported ? like add_linker_flags(-lstdc++fs -lc++fs)

I can try. I don't remember all the long process that lead to the current iteration, but there was a lot of ignorance of CMake involved.

try a simpler solution. It works locally.

@bot build-linux64 build-win64 build-osx

Fabien requested changes to this revision.Apr 21 2023, 10:34
Fabien added inline comments.
src/CMakeLists.txt
311 ↗(On Diff #39802)

Here is a better place

312 ↗(On Diff #39802)

unrelated

466 ↗(On Diff #39802)

Please add a comment to explain where this comes from.
Also you want to move this before the first lib is created (it is a global option that apply to all projects/libs AFTER this call)

This revision now requires changes to proceed.Apr 21 2023, 10:34

move linker_flags to global options

Fabien added inline comments.
src/CMakeLists.txt
316

There was a hint :)

This revision is now accepted and ready to land.Apr 21 2023, 14:17
This revision was automatically updated to reflect the committed changes.