HomePhabricator

util: Work around libstdc++ create_directories issue

Description

util: Work around libstdc++ create_directories issue

Summary:
Work around libstdc++ issue [PR101510] with create_directories where the
leaf already exists as a symlink. Fixes #24257, introduced by the switch
to std::filesystem. It is meant to be more thorough than #24266, which
only worked around one instance of the problem.

The issue was fixed upstream in
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=124eaa50e0a34f5f89572c1aa812c50979da58fc,
but unfortunately we'll have to carry a fix for it for a while.

This introduces a function fs::create_directories which wraps
std::filesystem::create_directories. This allows easiliy reverting the
workaround when it is no longer necessary.

This is a backport of core#24338

Depends on D13730

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D13738

Details

Provenance
laanwj <126646+laanwj@users.noreply.github.com>Authored on Feb 14 2022, 12:24
PiRKCommitted on Apr 21 2023, 14:34
PiRKPushed on Apr 21 2023, 14:34
Reviewer
Restricted Project
Differential Revision
D13738: util: Work around libstdc++ create_directories issue
Parents
rABC19b61626b64b: Drop StripRedundantLastElementsOfPath() function
Branches
Unknown
Tags
Unknown