1538 Commits

Author SHA1 Message Date
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
Alexander Grund
f1bf0e01e2
Fix build on MinGW-w64 x86
32 bit version of MinGW-64 __MINGW64__ is not defined
2024-08-25 18:56:45 +02:00
Alexander Grund
3f26465afb
Remove C++03 build 2024-08-25 18:56:45 +02:00
Alexander Grund
ac94c483e5
Add CI jobs for MinGW32/64 2024-08-25 17:55:38 +02:00
Andrey Semashev
5dc58be3cd Changed suppression of signed/unsigned mismatch to explicit casts.
Turns out, suppressing -Wsign-compare doesn't work on gcc 8 in MinGW-w64
at least in one instance. So we have to do it the hard way and explicitly
cast NTSTATUS values on every comparison.
2024-08-25 18:09:53 +03:00
Andrey Semashev
bfb06365b3 Disable -Wsign-compare on Windows.
STATUS_* constants defined in ntstatus.h are defined as DWORDs, and NTSTATUS
is long. This results in signed/unsigned mismatch warnings emitted by gcc and
clang. Consider that a platform bug and disable the warning.

Closes https://github.com/boostorg/filesystem/issues/321.
2024-08-25 16:12:07 +03:00
Andrey Semashev
41a990ef14 Fix weakly_canonical with relative input paths.
When weakly_canonical was called with a relative input path, the operation
would test path elements for existence, which meant resolving them relative
to the current path instead of the base path specified in the call. To
mitigate this, make the source path absolute using the specified base path.

As a side effect, this fixes incorrect path produced on Windows if the
input path started with "..". The algorithm was unable to remove the last
element of the head path because there was none. As a result, the remaining
elements of the input path were appended to the full base path by canonical.

Fixes to https://github.com/boostorg/filesystem/issues/311.
boost-1.86.0.beta1 boost-1.86.0
2024-07-03 15:02:47 +03:00
Andrey Semashev
c8093eeb7a Update test order to avoid spurious test failures due to timing.
copy_file_tests with copy_options::update_existing used to fail sometimes,
when the last modification timestamps on the test files were close enough.
Run the tests after a pause to make sure the timestamps are far enough apart.
2024-06-29 14:39:56 +03:00
Andrey Semashev
9f8dea7353 Don't throw in directory_entry::refresh if the file doesn't exist.
This makes directory_entry::status, directory_entry::symlink_status, as well
as related methods behave similarly to the equivalent standalone operations.

std::filesystem specification for directory_entry::refresh doesn't explicitly
say that the file not existing is not an error, but it does say that
directory_entry::status and directory_entry::symlink_status should behave
the same way as the standalone operations. Currently, libstdc++, libc++
and MSVC standard library all avoid throwing the exception from
directory_entry::refresh if the file doesn't exist.

Closes https://github.com/boostorg/filesystem/issues/314.
2024-06-29 14:00:49 +03:00
Andrey Semashev
7ff9487376 Corrected test console output. 2024-06-19 13:48:26 +03:00
Andrey Semashev
5d16e6bd00 Fixed file_size and is_empty for symlinks on Windows. Reworked is_empty.
GetFileAttributesExW that was used to implement file_size and is_empty
on Windows returns information about the symlink rather than the file
the symlink refers to. Fix this by opening the file and using
GetFileInformationByHandle to obtain the file size and attributes.

Additionally, reworked is_empty implementation to reuse the file handle
(and fd on POSIX systems) to create the directory iterator if the
operation is invoked on a directory. On POSIX systems, implement a
more lightweight version of is_empty_directory when readdir is safe
to use. Reusing the file handle/fd improves protection against
filesystem races, when the file that is being tested by is_empty
is initially a directory and then, when we create a directory
iterator, it is not.

Fixes https://github.com/boostorg/filesystem/issues/313.
2024-06-18 22:33:20 +03:00
Andrey Semashev
3274d64e2a Added macos-12 and 13 testing in addition to latest (which is 14). 2024-05-21 01:09:26 +03:00
Andrey Semashev
94132ebe49 Use macos-latest image as macos-11 is being removed. 2024-05-21 01:01:59 +03:00
Andrey Semashev
a0c8edba38 Documentation fixes. boost-1.85.0 2024-03-24 00:10:13 +03:00
Andrey Semashev
6f174ba143 Moved Boost.Core to private dependencies in CMakeLists.txt. boost-1.85.0.beta1 2024-02-20 04:10:50 +03:00
Andrey Semashev
4fa79df681 Removed unnecessary include. 2024-02-20 04:07:33 +03:00
Andrey Semashev
7bdccb0d2f Use <type_traits>, when possible. 2024-02-20 01:38:29 +03:00
Andrey Semashev
46af0a9514 Use unique_ptr instead of Boost.SmartPtr scoped_* pointers. 2024-02-20 01:04:32 +03:00
Andrey Semashev
8dd5b0e0ad Use unique_resource on Windows to wrap HANDLEs. 2024-02-20 00:55:43 +03:00
Andrey Semashev
e9621c0585 Reworked directory iterator construction with parameters.
Instead of passing a base directory fd, pass the directory fd to iterate over.
This simplifies code a little and makes it closer to Windows version.

Also, use unique_fd from Boost.Scope instead of a custom fd wrapper. Also
added handling of EINTR returned from open/openat in more places.
2024-02-19 02:57:16 +03:00
Andrey Semashev
9f6bf1a433 Use openat-style APIs on Windows to implement recursive_dir_iterator.
This makes recursive_directory_iterator more protected against filesystem
changes during iteration.
2024-02-18 03:25:47 +03:00
Andrey Semashev
081d00509b Added more NTSTATUS errors. 2024-02-17 20:16:42 +03:00
Andrey Semashev
7eece0064a On POSIX systems, use *at APIs in recursive_directory_iterator.
This makes the iterator more resilient to concurrent filesystem
modifications.
2024-02-12 01:07:44 +03:00
Andrey Semashev
d3f4ad6fb1 Updated tut6 examples, added their targets to Jamfile. 2024-02-12 01:05:14 +03:00
Andrey Semashev
6db7c58ff8 Removed MinGW32 AppVeyor job.
This compiler is no longer supported by Boost.System.

https://github.com/boostorg/system/issues/116
2024-02-06 23:56:37 +03:00
Andrey Semashev
06cb8d4007 Added gcc-13 CI job. 2024-02-06 00:46:17 +03:00
Andrey Semashev
da43e63ce9 Reduced CI job timeouts. 2024-02-05 23:53:24 +03:00
Andrey Semashev
55fb00c7ad Replaced actions/checkout usage with manual download commands.
This fixes the deprecation warnings for actions/checkout@v3. actions/checkout@v4
is not functional because of the upstream bug:

https://github.com/actions/checkout/issues/1590
2024-02-05 23:50:42 +03:00
Andrey Semashev
a10762e8b1 Removed usage of removed is_regular function. 2024-01-27 01:15:34 +03:00
Andrey Semashev
a668706004 Added docs for replacements for removed APIs in convenience.hpp. 2024-01-27 01:06:38 +03:00
Andrey Semashev
183cd3f3f5 Removed gcc-4.7 from GHA CI.
Boost.System has dropped support for gcc-4.7.
2024-01-20 04:21:04 +03:00
Andrey Semashev
47dd78b32f Fixed mismatching HTML tags in docs. 2024-01-20 03:21:56 +03:00
Andrey Semashev
5156746cd9 Partly restore documentation of the removed deprecated APIs.
This partly restores documentation removed in
5df060e95ca844fe91b29001b4ae22bdb65635c6 and moves the features from
"deprecated" table to a new "removed" table. This provides users
with suggested replacements for the removed features.
2024-01-18 20:16:04 +03:00
Andrey Semashev
90fe5e8980 Updated C++23 switch for clang-17. 2024-01-14 22:34:16 +03:00