1571 Commits

Author SHA1 Message Date
Andrey Semashev
45cc448538 Added GitHub Actions jobs for BSD and Solaris. 2025-12-30 20:30:43 +03:00
Andrey Semashev
9987afefea Use UTF-8 path encoding by default on DragonFly BSD, NetBSD and Solaris.
On DragonFly BSD 6.4.0, std::locale("") fails unless LANG is set to some
locale that is supported in libc.

On Solaris 11.4, std::locale("") fails even if LANG is set correctly in
the environment. Recent versions of Solaris seem to have transitioned
to UTF-8 for filename encoding.

All BSD systems seem to have come to UTF-8 for path encoding by default,
so use utf8_codecvt_facet on all of them, plus Solaris.

Removed duplication of preprocessor checks for whether to use
utf8_codecvt_facet.
2025-12-30 20:23:56 +03:00
Andrey Semashev
2013d901b2 Avoid signed/unsigned mismatch warning on DragonflyBSD.
For some reason, AT_FDCWD is defined as unsigned int on DragonflyBSD,
which causes warnings when int fds are compared against it.
2025-12-30 19:00:59 +03:00
Andrey Semashev
016cafbaf4 Added a check that the platform API macros are in sync with Boost.System.
Check that BOOST_FILESYSTEM_POSIX/WINDOWS_API and BOOST_POSIX/WINDOWS_API
are defined in the same way and error out if not. Allow users to suppress
this check (and keep their code compiling) by defining
BOOST_FILESYSTEM_ALLOW_SYSTEM_API_MISMATCH to 1 to reduce the error to
a warning or to 2 to completely disable the check.

If we diverge in platform API selection with Boost.System again, we may
want to implement our own system category that is guaranteed to be in sync
with the platform API Boost.Filesystem actually uses. But for now the two
libraries are expected to be in sync, and the added check should do.
2025-12-30 15:53:09 +03:00
Andrey Semashev
bebada31a2 Retry operations tests involving Samba shares on Windows.
The tests that access Samba shares sometimes fail on Windows with
ERROR_NETNAME_DELETED. This error code does not tell whether the path
exists or not, so retry the test a few times until a definitive answer
is received.
2025-12-25 15:39:15 +03:00
Andrey Semashev
760091ce6e Use ninja build system in CMake tests on Cygin in GitHub Actions.
This is an attempt to work around CMake failure on Cygwin.
2025-12-25 05:27:25 +03:00
Andrey Semashev
ae458c7884 Switch to POSIX API on Cygwin.
This follows other Boost libraries (in particular, Boost.System) in
treating Cygwin as a POSIX platform rather than Windows. This is
a breaking change, but apparently downstream Boost.Filesystem packages
on Cygwin are patched to the same effect.

As part of this change, AT_NO_AUTOMOUNT is made an optional requirement
to enable POSIX *at APIs. This flag is not POSIX-standard and is not
supported on Cygwin, while *at APIs are.
2025-12-25 04:09:00 +03:00
Andrey Semashev
43ccf9f77d Rearranged code of pushing a directory in recursive_dir_it increment.
Avoid indirectly calling refresh on the directory entry that we are
checking for whether we can descend into it. Calling refresh is
wasteful as it always queries both symlink_status and status and we
already have the actual symlink_status by the time we need status.

Rearranged code to group POSIX branches closer together and slightly
reduce code duplication.
2025-12-25 04:00:12 +03:00
Andrey Semashev
6ebbda28f5 Fix error reported by recursive_dir_it for dangling symlinks.
This only affects POSIX platforms not supporting openat & co.

When the underlying directory iterator does not produce symlink status
during iteration, and the iterator points to a dangling symlink, the
recursive_directory_iterator increment would attempt to refresh file
statuses in the directory_entry. This would fail because the refresh
would query status in addition to symlink_status. This error was
wrongly reported to the caller if following symlinks was disabled for
the recursive iterator.

Fix this by only querying symlink_status. status is checked later,
if the iterator is configured to follow symlinks.
2025-12-25 04:00:12 +03:00
Andrey Semashev
d8eca47d05 Define Boost-Filesystem-specific macros for platform API selection.
Because Boost.System has switched to define BOOST_POSIX_API on Cygwin[1],
Boost.Filesystem now defines its own set of macros for platform API
selection. At this time, we preserve the previous behavior, where
Cygwin is treated as Windows.

[1]: https://github.com/boostorg/system/pull/137
2025-12-23 00:22:54 +03:00
Andrey Semashev
4b70bef5c3 Added a Cygwin GitHub Actions job. 2025-12-23 00:22:50 +03:00
Andrey Semashev
c172ae588c Added clang-21 and macos-26 GitHub Actions jobs. 2025-12-22 23:25:49 +03:00
Andrey Semashev
b6130f0f17 Silence signed/unsigned mismatch warning on Cygwin.
On Cygwin, NTE_BAD_SIGNATURE is defined as HRESULT, which is a signed
integer. This produces a signed/unsigned mismatch warning when it is
compared against a DWORD error code.
2025-12-14 15:29:09 +03:00
Andrey Semashev
3109668842 Replaced macos-13 with macos-15 in GitHub Actions.
The macos-13 image is retired, macos-15 is now available.
2025-12-13 20:40:23 +03:00
Andrey Semashev
868dc76bb6 Downgrade dir_iterator implementation on NTE_BAD_SIGNATURE error on Windows.
This error code is reported to be returned by
GetFileInformationByHandleEx(FileIdExtdDirectoryRestartInfo) in case of
Samba 3.0.2 share accessed from a Windows Server 2019 client, when
RequireSecuritySignature is set to 1 on the client. In the same setup,
GetFileInformationByHandleEx(FileBothDirectoryInformation) is reported
to succeed.

This doesn't seem to reproduce with Samba 4.19 server and Windows 10
client, so it may be specific to the client and server versions, or it
may be something else in the user's setup.

Add NTE_BAD_SIGNATURE to the list of errors on which we non-permanently
downgrade directory_iterator implementation to an older method.

Closes https://github.com/boostorg/filesystem/issues/334.
boost-1.90.0
2025-11-07 17:06:47 +03:00
Andrey Semashev
3420809e37 Merge pull request #340 from Flamefire/fix-cmake-version
Fix required CMake version
boost-1.90.0.beta1
2025-10-01 17:38:44 +03:00
Alexander Grund
c619bbb0f8 Fix required CMake version 2025-10-01 10:17:26 +02:00
Andrey Semashev
ce7a835436 Added a release note for the permissions() ec fix. 2025-08-29 01:14:55 +03:00
Andrey Semashev
d1aa94e9c9 Merge pull request #338 from wangdongustc/develop
Clear ec on successful permission operation
2025-08-29 01:10:53 +03:00
Dong Wang
ddb53416fc Clear ec on successful permission operation 2025-08-29 00:50:10 +08:00
Andrey Semashev
0a2374fc37 Merge pull request #337 from Flamefire/test-link-update
Update Link to regression test matrix in README
2025-08-25 19:04:37 +03:00
Alexander Grund
358a8f9656 Update Link to regression test matrix in README 2025-08-25 17:26:13 +02:00
Andrey Semashev
d316a9d3aa Use std::less to detect string overlap in path::append.
Pointer ordering is unspecified if the pointers are to unrelated
objects, which triggers ASAN warnings. Use std::less to avoid this.

Closes https://github.com/boostorg/filesystem/issues/335.
boost-1.89.0
2025-06-21 03:32:25 +03:00
Andrey Semashev
a737b1947e Simplified path_algorithms::append_separator_if_needed. 2025-06-21 03:32:17 +03:00
Andrey Semashev
8dc455e00b Made has-config-flag more flexible.
The has-config-flag rule now matches any value of the checked macro and
is able to test multiple macros in one call.
2025-06-19 02:51:11 +03:00
Andrey Semashev
f7ed6b5ea9 Change searched-lib to lib in the Jamfile.
Apparently, searched-lib was not supposed to be used in libraries,
and the simple lib target is the preferred way to declare external
libraries.

https://github.com/bfgroup/b2/issues/431#issuecomment-2985057673
2025-06-19 02:44:26 +03:00
Andrey Semashev
3fa413e5f9 Removed MinGW-w64 gcc 6 AppVeyor job.
The compiler doesn't provide synchronization lib, which is needed by
Boost.Atomic.
2025-06-14 12:08:06 +03:00
Andrey Semashev
5a7e76d556 Extend the dllimport workaround to any gcc 12.
At least, gcc on Cygwin also emits the same bogus warnings about
missing dllimport attributes. Presumably, this may also be the case
for visibility attributes, so just disable the warning universally
on any gcc 12.
2025-06-13 18:36:55 +03:00
Andrey Semashev
1be9ea7f04 Disable the gcc 12 warning about dllimport in directory.hpp.
The warnings suppressed in header.hpp can be force-enabled by the user,
so disable the buggy warning in directory.hpp instead. Also make the
workaround more specific to MinGW.
2025-06-13 03:18:50 +03:00
Andrey Semashev
9e11731148 Work around bogus warning in MinGW-w64 gcc 12 about missing dllimport.
Disable the warning for gcc 12.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106395
2025-06-13 03:06:39 +03:00
Andrey Semashev
4a1a4658c4 Added new gcc and clang jobs to GitHub Actions. 2025-06-13 02:57:07 +03:00
Andrey Semashev
53d0780142 Use Azure mirrors of Ubuntu .deb repositories in containers.
This reduces the likelihood of spurious CI failures caused by DDoS filters
being triggered by massive numbers of concurrent CI jobs.
2025-06-13 02:11:52 +03:00
Andrey Semashev
133df3b03b Removed windows-2019 GitHub Actions jobs.
The windows-2019 image is deprecated and is about to be removed.
2025-06-13 02:09:14 +03:00
Andrey Semashev
f4bb6d0f3e Removed usage of obsolete ubuntu-20.04 GHA image. 2025-04-19 18:23:12 +03:00
Andrey Semashev
c7e1448803 Moved symloop_max constant into POSIX-specific section.
The constant is not used in the Windows-specific code and causes
clang warnings.

Closes https://github.com/boostorg/filesystem/pull/332.
2025-04-05 15:29:00 +03:00
Andrey Semashev
30b312e5c0 Removed clang-15 with libc++ job.
We're already testing libc++ with clang-19, so remove the job with clang-15
to save some CI time.
boost-1.88.0.beta1 boost-1.88.0
2024-12-16 00:45:03 +03:00
Andrey Semashev
6a0efe79c2 Updated GitHub Actions CI.
Removed macos-12 job as the image has been removed from GHA. Added
new compilers and updated the old ones to avoid using external
package repositories. Added CMake testing with MinGW-w64.
2024-12-15 21:36:43 +03:00
Andrey Semashev
59433a9984 Added max CMake version 3.16.
This should resolve CMake warnings.
2024-12-15 19:23:28 +03:00
Andrey Semashev
0848f5347b Canonicalize root paths in tests.
Since the current and initial paths on Windows may have non-canonical
root paths (i.e. "c:\" instead of "C:\"), path comparisons may fail
because of the case differences between the canonicalized paths and
the expected paths. To avoid these spurious failures, canonicalize root
paths in all expected paths.
boost-1.87.0.beta1 boost-1.87.0
2024-10-11 16:00:39 +03:00
Andrey Semashev
cf92e38f2f Corrected comments. 2024-10-03 13:47:07 +03:00
Andrey Semashev
bf29b81a36 Added a workaround for dirfd being a macro on FreeBSD 9 and older.
Fixes https://github.com/boostorg/filesystem/issues/328.
2024-10-03 13:26:18 +03:00
Andrey Semashev
fbd23ee0e0 Prevent templated path members from accepting args convertible to path.
This forces the non-templated overloads accepting path to be chosen instead
of the templated members that expect arguments converible to Source.

This resolves overload resolution ambiguities, when the argument of a
user-defined type is convertible to path and multiple other types that qualify
as Source. By preferring the conversion to path we avoid testing other
conversion paths that may be ambiguous.

Fixes https://github.com/boostorg/filesystem/issues/326.
2024-09-30 02:53:06 +03:00
René Ferdinand Rivera Morell
5746b3f0d6 Add support for modular build structure. (#318)
* Make the library modular usable.

* Use searched-lib targets for external/OS/Windows libraries to avoid trying to refer to mangled names for them. And hence failing to find them.

* Use the OS temp dir for creating test dir to avoid putting dirs in random location based on where one runs tests from.

* Switch to library requirements instead of source. As source puts extra source in install targets.

* Updated dependencies.

* Add missing NO_LIB usage requirements.

* Add missing import-search for cconfig/predef checks.

* Add requires-b2 check to top-level build file.

* Bump B2 require to 5.2

* Change all <source> references to <library>.

* Update copyright dates.

* Move inter-lib dependencies to a project variable and into the build targets.

* Split b2 dependencies into public and private.

* Undo temp dir for test change.

* Make winapi dep target-os specific. And remove direct atomic dep as it is already handled by conditional rule.

* Remove bug targets from all build as that's not a regular project.
2024-09-22 19:57:37 +03:00
Andrey Semashev
dc94c80f4b Specify _WIN32_WINNT=0x0A00 in build system scripts to target Windows 10. 2024-09-16 23:55:58 +03:00
Andrey Semashev
11beaba974 Reimplement canonical in terms of GetFinalPathNameByHandleW on Windows.
This moves the common part of v3 and v4 canonical() to a separate
function and changes the Windows implementation to use
GetFinalPathNameByHandleW system call. As a side effect, this converts
drive names to upper case, which makes paths more interoperable.

Additionally, on POSIX systems, avoid adding a trailing directory
separator if the input path has one (which may be the case in v4). This
is consistent with libstdc++ and MSVC implementations of std::filesystem.

Fixes https://github.com/boostorg/filesystem/issues/325.
2024-09-16 21:19:10 +03:00
Andrey Semashev
01cadd08e4 Added C++23 testing to MSYS2 jobs. 2024-08-26 15:16:13 +03:00
Andrey Semashev
c4ffb7bf47 Merge pull request #323 from Flamefire/function-ptr-cast
Avoid -Wcast-function-type in get_proc_addr
2024-08-26 15:14:50 +03:00
Alexander Grund
4a687b1bc1 Avoid -Wcast-function-type in get_proc_addr 2024-08-26 13:32:18 +02:00
Andrey Semashev
35f348ad00 Merge pull request #322 from Flamefire/mingw
Add CI jobs for MinGW32/64
2024-08-26 14:13:04 +03:00
Alexander Grund
51b6ae06a6 Remove actions/checkout and Boost.CI 2024-08-25 20:02:52 +02:00