fs: consistently use fsbridge:: for ifstream / ofstream #23857

pull fanquake wants to merge 3 commits into bitcoin:master from fanquake:always_use_fsbridge changing 9 files +11 −9
  1. fanquake commented at 8:51 am on December 24, 2021: member
    Two of these changes are part of #20744, but are ok to do now, and reduce the diff that will eventually need to be reviewed in that PR. See commit messages for details.
  2. fs: consistently use fsbridge for {i,o}fstream
    Part of #20744, but this can be done now, and will simplify the diff.
    2da5bc557d
  3. fs: add missing <cassert> include
    This is needed to prevent compilation failures once boost is removed,
    however is still correct to include now, and reduces the diff in #20744.
    
    <string> is extracted from the defines because it is used for Windows
    and non-Windows code, i.e get_filesystem_error_message().
    5668ad4339
  4. fs: consistently use fsbridge for fopen() bcb36762ee
  5. MarcoFalke commented at 8:54 am on December 24, 2021: member
    Please clarify if this changes behavior in any way or if this is a refactor.
  6. fanquake added the label Refactoring on Dec 24, 2021
  7. hebasto commented at 9:05 am on December 24, 2021: member

    https://cirrus-ci.com/task/6421734977961984:

    0bench/bench.cpp: In function void {anonymous}::GenerateTemplateResults(const std::vector<ankerl::nanobench::Result>&, const string&, const char*):
    1bench/bench.cpp:30:37: error: use of deleted function fs::path::path(std::string)
    2   30 |     fsbridge::ofstream fout{filename};
    3      |                                     ^
    4In file included from ./test/util/setup_common.h:9,
    5                 from bench/bench.cpp:7:
    6./fs.h:50:5: note: declared here
    7   50 |     path(std::string) = delete;
    8      |     ^~~~
    9make[2]: *** [Makefile:13538: bench/bench_bitcoin-bench.o] Error 1
    
  8. DrahtBot commented at 6:34 pm on December 24, 2021: member

    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.

  9. fanquake commented at 11:52 am on January 7, 2022: member
    Closing as this is going in as part of #20744.
  10. fanquake closed this on Jan 7, 2022

  11. fanquake deleted the branch on Jan 8, 2022
  12. MarcoFalke commented at 9:01 am on January 26, 2022: member

    Not sure why this was closed?

    It looks like the CI failure hinted at a bug that needs fixup? In all other places where strings from the command line are converted to paths, PathFromString is used, but not here in bench.

  13. fanquake commented at 9:06 am on January 26, 2022: member

    Not sure why this was closed?

    It’s part of #20744.

  14. MarcoFalke commented at 9:17 am on January 26, 2022: member
    I think it might be worthwhile to fix the presumed bug in bench before 20744, in which case this should compile and can also be done before 20744?
  15. fanquake commented at 2:05 pm on January 26, 2022: member
    Ok. I had deleted the branch, but can open a new PR.
  16. fanquake referenced this in commit d87a37a4ab on Jan 27, 2022
  17. sidhujag referenced this in commit f9de29fcb9 on Jan 28, 2022
  18. fanquake locked this on Jan 31, 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-09-29 01:12 UTC

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