Support of Cygwin
albert-github opened this issue · 8 comments
Describe the bug
Under Cygwin filesystem does not compile.
For doxygen an easy fix was possible by changing the line
#elif defined(__linux__)
into
#elif defined(__linux__) || defined(__CYGWIN__)
though when applying this fix to the official repository and running make
to check the tests we get:
Scanning dependencies of target filesystem_test
[ 4%] Building CXX object test/CMakeFiles/filesystem_test.dir/filesystem_test.cpp.o
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:62:
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp: In function ‘bool ghc::filesystem::detail::equals_simple_insensitive(const value_type*, const value_type*)’:
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp:1794:19: error: ‘::strcasecmp’ has not been declared; did you mean ‘strncmp’?
1794 | return 0 == ::strcasecmp(str1, str2);
| ^~~~~~~~~~
| strncmp
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp: In function ‘void ghc::filesystem::detail::create_symlink(const ghc::filesystem::path&, const ghc::filesystem::path&, bool, std::error_code&)’:
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp:1915:11: error: ‘::symlink’ has not been declared; did you mean ‘ghc::filesystem::file_type::symlink’?
1915 | if (::symlink(target_name.c_str(), new_symlink.c_str()) != 0) {
| ^~~~~~~
| ghc::filesystem::file_type::symlink
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp:687:5: note: ‘ghc::filesystem::file_type::symlink’ declared here
687 | symlink,
| ^~~~~~~
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp: In function ‘ghc::filesystem::path ghc::filesystem::detail::resolveSymlink(const ghc::filesystem::path&, std::error_code&)’:
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp:2056:21: error: ‘::readlink’ has not been declared
2056 | auto rc = ::readlink(p.c_str(), buffer.data(), buffer.size());
| ^~~~~~~~
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:62:
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp: In function ‘void ghc::filesystem::last_write_time(const ghc::filesystem::path&, ghc::filesystem::file_time_type, std::error_code&)’:
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp:4460:11: error: ‘::utimensat’ has not been declared; did you mean ‘utimes’?
4460 | if (::utimensat(AT_FDCWD, p.c_str(), times, AT_SYMLINK_NOFOLLOW) != 0) {
| ^~~~~~~~~
| utimes
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp:4460:21: error: ‘AT_FDCWD’ was not declared in this scope
4460 | if (::utimensat(AT_FDCWD, p.c_str(), times, AT_SYMLINK_NOFOLLOW) != 0) {
| ^~~~~~~~
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp:4460:49: error: ‘AT_SYMLINK_NOFOLLOW’ was not declared in this scope
4460 | if (::utimensat(AT_FDCWD, p.c_str(), times, AT_SYMLINK_NOFOLLOW) != 0) {
| ^~~~~~~~~~~~~~~~~~~
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp: In function ‘void ghc::filesystem::resize_file(const ghc::filesystem::path&, uintmax_t, std::error_code&)’:
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp:4767:11: error: ‘::truncate’ has not been declared
4767 | if (::truncate(p.c_str(), static_cast<off_t>(size)) != 0) {
| ^~~~~~~~
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:62:
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp: In instantiation of ‘std::string ghc::filesystem::detail::systemErrorText(ErrorNumber) [with ErrorNumber = int; std::string = std::basic_string<char>]’:
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp:3467:66: required from here
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp:1840:39: error: ‘strerror_r’ was not declared in this scope; did you mean ‘_strerror_r’?
1840 | return strerror_adapter(strerror_r(code ? code : errno, buffer, sizeof(buffer)), buffer);
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| _strerror_r
make[2]: *** [test/CMakeFiles/filesystem_test.dir/build.make:83: test/CMakeFiles/filesystem_test.dir/filesystem_test.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:153: test/CMakeFiles/filesystem_test.dir/all] Error 2
make: *** [Makefile:161: all] Error 2
To Reproduce
- change the menioned line
- run the tests as indicated in the README
Expected behavior
Official support for Cygwin
Additional context
Used GCC version: gcc (GCC) 10.2.0
Thanks for the report. I admit I never tested with Cygwin, but I'll look into it.
Cygwin should now work. I set up Cygwin on a VM and got the tests and examples to build and the tests where run successful.
Still I would call Cygwin support preliminary as I'm not using it myself and I currently don't have the resources to do the research on how to add Cygwin support to the Appveyor CI configuration. Without CI support I wouldn't dare to call it officially supported. If anyone knows enough about that to manage this, PRs are welcome. 😉
Still, it works and I'll support it in the way that I look into bugs found on that platform and try to fix them.
Thanks that is fast!!
In the README.md I read it is possible to run some tests, but it is not clear how to run the tests. I followed the CMake
instructions and some executables are build, a.o.:
./test/exception.exe
./test/filesystem_test.exe
./test/filesystem_test_cpp17.exe
./test/filesystem_test_cpp20.exe
./test/fwd_impl_test.exe
./test/multifile_test.exe
./test/std_filesystem_test.exe
- is it sufficient to start
./test/filesystem_test.exe
?
Maybe a bit more information in the README.md would not hurt.
Regarding Appveyor and Cygwin, unfortunately I have no experience with it, it looks like Appveyor is supporting the recent version of Cygwin (3.1.7) so it should be possible.
(doxygen isn't using Appveyor and Travis anymore, we recently switched to Github Actions. The number of platforms is limited. The reason for was the change of the conditions on Travis for free builds for Open Source builds which in short would mean we had to request free licenses regularly. Also their communication about it was not that clear. At the same time we also abandoned Appveyor as all sub jibs were run in sequence and an complete job on Appveyor ran for around 2 hours).
Compiling the tests on Cygwin with GCC 10.0.2 gives me some warning / information messages:
Scanning dependencies of target filesystem_test_cpp20
[ 54%] Building CXX object test/CMakeFiles/filesystem_test_cpp20.dir/filesystem_test.cpp.o
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:84:
/cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp: In function ‘void ____C_A_T_C_H____T_E_S_T____20()’:
/cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:595:45: warning: ‘ghc::filesystem::path ghc::filesystem::u8path(const Source&) [with Source = char [7]; <template-parameter-1-2> = ghc::filesystem::path]’ is deprecated: use ghc::filesystem::path::path() with std::u8string instead [-Wdeprecated-declarations]
595 | CHECK(fs::u8path("\xc3\xa4/\xe2\x82\xac").native() == fs::path::string_type("\xc3\xa4/\xe2\x82\xac"));
| ^
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:62:
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp:1761:13: note: declared here
1761 | inline path u8path(const Source& source)
| ^~~~~~
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:84:
/cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:595:45: warning: ‘ghc::filesystem::path ghc::filesystem::u8path(const Source&) [with Source = char [7]; <template-parameter-1-2> = ghc::filesystem::path]’ is deprecated: use ghc::filesystem::path::path() with std::u8string instead [-Wdeprecated-declarations]
595 | CHECK(fs::u8path("\xc3\xa4/\xe2\x82\xac").native() == fs::path::string_type("\xc3\xa4/\xe2\x82\xac"));
| ^
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:62:
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp:1761:13: note: declared here
1761 | inline path u8path(const Source& source)
| ^~~~~~
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:84:
/cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:596:55: warning: ‘ghc::filesystem::path ghc::filesystem::u8path(const Source&) [with Source = char [7]; <template-parameter-1-2> = ghc::filesystem::path]’ is deprecated: use ghc::filesystem::path::path() with std::u8string instead [-Wdeprecated-declarations]
596 | CHECK(!::strcmp(fs::u8path("\xc3\xa4/\xe2\x82\xac").c_str(), "\xc3\xa4/\xe2\x82\xac"));
| ^
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:62:
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp:1761:13: note: declared here
1761 | inline path u8path(const Source& source)
| ^~~~~~
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:84:
/cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:596:55: warning: ‘ghc::filesystem::path ghc::filesystem::u8path(const Source&) [with Source = char [7]; <template-parameter-1-2> = ghc::filesystem::path]’ is deprecated: use ghc::filesystem::path::path() with std::u8string instead [-Wdeprecated-declarations]
596 | CHECK(!::strcmp(fs::u8path("\xc3\xa4/\xe2\x82\xac").c_str(), "\xc3\xa4/\xe2\x82\xac"));
| ^
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:62:
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp:1761:13: note: declared here
1761 | inline path u8path(const Source& source)
| ^~~~~~
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:84:
/cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:597:58: warning: ‘ghc::filesystem::path ghc::filesystem::u8path(const Source&) [with Source = char [7]; <template-parameter-1-2> = ghc::filesystem::path]’ is deprecated: use ghc::filesystem::path::path() with std::u8string instead [-Wdeprecated-declarations]
597 | CHECK((std::string)fs::u8path("\xc3\xa4/\xe2\x82\xac") == std::string("\xc3\xa4/\xe2\x82\xac"));
| ^
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:62:
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp:1761:13: note: declared here
1761 | inline path u8path(const Source& source)
| ^~~~~~
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:84:
/cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:597:58: warning: ‘ghc::filesystem::path ghc::filesystem::u8path(const Source&) [with Source = char [7]; <template-parameter-1-2> = ghc::filesystem::path]’ is deprecated: use ghc::filesystem::path::path() with std::u8string instead [-Wdeprecated-declarations]
597 | CHECK((std::string)fs::u8path("\xc3\xa4/\xe2\x82\xac") == std::string("\xc3\xa4/\xe2\x82\xac"));
| ^
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:62:
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp:1761:13: note: declared here
1761 | inline path u8path(const Source& source)
| ^~~~~~
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:84:
/cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:598:45: warning: ‘ghc::filesystem::path ghc::filesystem::u8path(const Source&) [with Source = char [7]; <template-parameter-1-2> = ghc::filesystem::path]’ is deprecated: use ghc::filesystem::path::path() with std::u8string instead [-Wdeprecated-declarations]
598 | CHECK(fs::u8path("\xc3\xa4/\xe2\x82\xac").string() == std::string("\xc3\xa4/\xe2\x82\xac"));
| ^
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:62:
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp:1761:13: note: declared here
1761 | inline path u8path(const Source& source)
| ^~~~~~
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:84:
/cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:598:45: warning: ‘ghc::filesystem::path ghc::filesystem::u8path(const Source&) [with Source = char [7]; <template-parameter-1-2> = ghc::filesystem::path]’ is deprecated: use ghc::filesystem::path::path() with std::u8string instead [-Wdeprecated-declarations]
598 | CHECK(fs::u8path("\xc3\xa4/\xe2\x82\xac").string() == std::string("\xc3\xa4/\xe2\x82\xac"));
| ^
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:62:
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp:1761:13: note: declared here
1761 | inline path u8path(const Source& source)
| ^~~~~~
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:84:
/cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:599:45: warning: ‘ghc::filesystem::path ghc::filesystem::u8path(const Source&) [with Source = char [7]; <template-parameter-1-2> = ghc::filesystem::path]’ is deprecated: use ghc::filesystem::path::path() with std::u8string instead [-Wdeprecated-declarations]
599 | CHECK(fs::u8path("\xc3\xa4/\xe2\x82\xac").wstring() == std::wstring(L"ä/€"));
| ^
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:62:
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp:1761:13: note: declared here
1761 | inline path u8path(const Source& source)
| ^~~~~~
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:84:
/cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:599:45: warning: ‘ghc::filesystem::path ghc::filesystem::u8path(const Source&) [with Source = char [7]; <template-parameter-1-2> = ghc::filesystem::path]’ is deprecated: use ghc::filesystem::path::path() with std::u8string instead [-Wdeprecated-declarations]
599 | CHECK(fs::u8path("\xc3\xa4/\xe2\x82\xac").wstring() == std::wstring(L"ä/€"));
| ^
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:62:
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp:1761:13: note: declared here
1761 | inline path u8path(const Source& source)
| ^~~~~~
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:84:
/cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:601:45: warning: ‘ghc::filesystem::path ghc::filesystem::u8path(const Source&) [with Source = char [7]; <template-parameter-1-2> = ghc::filesystem::path]’ is deprecated: use ghc::filesystem::path::path() with std::u8string instead [-Wdeprecated-declarations]
601 | CHECK(fs::u8path("\xc3\xa4/\xe2\x82\xac").u8string() == std::u8string(u8"\xc3\xa4/\xe2\x82\xac"));
| ^
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:62:
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp:1761:13: note: declared here
1761 | inline path u8path(const Source& source)
| ^~~~~~
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:84:
/cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:601:45: warning: ‘ghc::filesystem::path ghc::filesystem::u8path(const Source&) [with Source = char [7]; <template-parameter-1-2> = ghc::filesystem::path]’ is deprecated: use ghc::filesystem::path::path() with std::u8string instead [-Wdeprecated-declarations]
601 | CHECK(fs::u8path("\xc3\xa4/\xe2\x82\xac").u8string() == std::u8string(u8"\xc3\xa4/\xe2\x82\xac"));
| ^
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:62:
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp:1761:13: note: declared here
1761 | inline path u8path(const Source& source)
| ^~~~~~
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:84:
/cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:605:45: warning: ‘ghc::filesystem::path ghc::filesystem::u8path(const Source&) [with Source = char [7]; <template-parameter-1-2> = ghc::filesystem::path]’ is deprecated: use ghc::filesystem::path::path() with std::u8string instead [-Wdeprecated-declarations]
605 | CHECK(fs::u8path("\xc3\xa4/\xe2\x82\xac").u16string() == std::u16string(u"\u00E4/\u20AC"));
| ^
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:62:
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp:1761:13: note: declared here
1761 | inline path u8path(const Source& source)
| ^~~~~~
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:84:
/cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:605:45: warning: ‘ghc::filesystem::path ghc::filesystem::u8path(const Source&) [with Source = char [7]; <template-parameter-1-2> = ghc::filesystem::path]’ is deprecated: use ghc::filesystem::path::path() with std::u8string instead [-Wdeprecated-declarations]
605 | CHECK(fs::u8path("\xc3\xa4/\xe2\x82\xac").u16string() == std::u16string(u"\u00E4/\u20AC"));
| ^
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:62:
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp:1761:13: note: declared here
1761 | inline path u8path(const Source& source)
| ^~~~~~
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:84:
/cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:607:61: warning: ‘ghc::filesystem::path ghc::filesystem::u8path(const Source&) [with Source = char [11]; <template-parameter-1-2> = ghc::filesystem::path]’ is deprecated: use ghc::filesystem::path::path() with std::u8string instead [-Wdeprecated-declarations]
607 | CHECK(fs::u8path("\xc3\xa4/\xe2\x82\xac\xf0\x9d\x84\x9e").u16string() == std::u16string(u"\u00E4/\u20AC\U0001D11E"));
| ^
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:62:
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp:1761:13: note: declared here
1761 | inline path u8path(const Source& source)
| ^~~~~~
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:84:
/cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:607:61: warning: ‘ghc::filesystem::path ghc::filesystem::u8path(const Source&) [with Source = char [11]; <template-parameter-1-2> = ghc::filesystem::path]’ is deprecated: use ghc::filesystem::path::path() with std::u8string instead [-Wdeprecated-declarations]
607 | CHECK(fs::u8path("\xc3\xa4/\xe2\x82\xac\xf0\x9d\x84\x9e").u16string() == std::u16string(u"\u00E4/\u20AC\U0001D11E"));
| ^
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:62:
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp:1761:13: note: declared here
1761 | inline path u8path(const Source& source)
| ^~~~~~
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:84:
/cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:608:45: warning: ‘ghc::filesystem::path ghc::filesystem::u8path(const Source&) [with Source = char [7]; <template-parameter-1-2> = ghc::filesystem::path]’ is deprecated: use ghc::filesystem::path::path() with std::u8string instead [-Wdeprecated-declarations]
608 | CHECK(fs::u8path("\xc3\xa4/\xe2\x82\xac").u32string() == std::u32string(U"\U000000E4/\U000020AC"));
| ^
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:62:
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp:1761:13: note: declared here
1761 | inline path u8path(const Source& source)
| ^~~~~~
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:84:
/cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:608:45: warning: ‘ghc::filesystem::path ghc::filesystem::u8path(const Source&) [with Source = char [7]; <template-parameter-1-2> = ghc::filesystem::path]’ is deprecated: use ghc::filesystem::path::path() with std::u8string instead [-Wdeprecated-declarations]
608 | CHECK(fs::u8path("\xc3\xa4/\xe2\x82\xac").u32string() == std::u32string(U"\U000000E4/\U000020AC"));
| ^
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:62:
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp:1761:13: note: declared here
1761 | inline path u8path(const Source& source)
| ^~~~~~
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:84:
/cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp: In function ‘void ____C_A_T_C_H____T_E_S_T____23()’:
/cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:631:45: warning: ‘ghc::filesystem::path ghc::filesystem::u8path(const Source&) [with Source = char [7]; <template-parameter-1-2> = ghc::filesystem::path]’ is deprecated: use ghc::filesystem::path::path() with std::u8string instead [-Wdeprecated-declarations]
631 | CHECK(fs::u8path("\xc3\xa4/\xe2\x82\xac").generic_string() == std::string("\xc3\xa4/\xe2\x82\xac"));
| ^
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:62:
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp:1761:13: note: declared here
1761 | inline path u8path(const Source& source)
| ^~~~~~
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:84:
/cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:631:45: warning: ‘ghc::filesystem::path ghc::filesystem::u8path(const Source&) [with Source = char [7]; <template-parameter-1-2> = ghc::filesystem::path]’ is deprecated: use ghc::filesystem::path::path() with std::u8string instead [-Wdeprecated-declarations]
631 | CHECK(fs::u8path("\xc3\xa4/\xe2\x82\xac").generic_string() == std::string("\xc3\xa4/\xe2\x82\xac"));
| ^
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:62:
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp:1761:13: note: declared here
1761 | inline path u8path(const Source& source)
| ^~~~~~
/cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:633:48: warning: ‘ghc::filesystem::path ghc::filesystem::u8path(const Source&) [with Source = char [7]; <template-parameter-1-2> = ghc::filesystem::path]’ is deprecated: use ghc::filesystem::path::path() with std::u8string instead [-Wdeprecated-declarations]
633 | auto t = fs::u8path("\xc3\xa4/\xe2\x82\xac").generic_string<char, std::char_traits<char>, TestAllocator<char>>();
| ^
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:62:
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp:1761:13: note: declared here
1761 | inline path u8path(const Source& source)
| ^~~~~~
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:84:
/cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:636:45: warning: ‘ghc::filesystem::path ghc::filesystem::u8path(const Source&) [with Source = char [7]; <template-parameter-1-2> = ghc::filesystem::path]’ is deprecated: use ghc::filesystem::path::path() with std::u8string instead [-Wdeprecated-declarations]
636 | CHECK(fs::u8path("\xc3\xa4/\xe2\x82\xac").generic_wstring() == std::wstring(L"ä/€"));
| ^
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:62:
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp:1761:13: note: declared here
1761 | inline path u8path(const Source& source)
| ^~~~~~
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:84:
/cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:636:45: warning: ‘ghc::filesystem::path ghc::filesystem::u8path(const Source&) [with Source = char [7]; <template-parameter-1-2> = ghc::filesystem::path]’ is deprecated: use ghc::filesystem::path::path() with std::u8string instead [-Wdeprecated-declarations]
636 | CHECK(fs::u8path("\xc3\xa4/\xe2\x82\xac").generic_wstring() == std::wstring(L"ä/€"));
| ^
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:62:
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp:1761:13: note: declared here
1761 | inline path u8path(const Source& source)
| ^~~~~~
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:84:
/cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:638:45: warning: ‘ghc::filesystem::path ghc::filesystem::u8path(const Source&) [with Source = char [7]; <template-parameter-1-2> = ghc::filesystem::path]’ is deprecated: use ghc::filesystem::path::path() with std::u8string instead [-Wdeprecated-declarations]
638 | CHECK(fs::u8path("\xc3\xa4/\xe2\x82\xac").generic_u8string() == std::u8string(u8"\xc3\xa4/\xe2\x82\xac"));
| ^
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:62:
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp:1761:13: note: declared here
1761 | inline path u8path(const Source& source)
| ^~~~~~
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:84:
/cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:638:45: warning: ‘ghc::filesystem::path ghc::filesystem::u8path(const Source&) [with Source = char [7]; <template-parameter-1-2> = ghc::filesystem::path]’ is deprecated: use ghc::filesystem::path::path() with std::u8string instead [-Wdeprecated-declarations]
638 | CHECK(fs::u8path("\xc3\xa4/\xe2\x82\xac").generic_u8string() == std::u8string(u8"\xc3\xa4/\xe2\x82\xac"));
| ^
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:62:
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp:1761:13: note: declared here
1761 | inline path u8path(const Source& source)
| ^~~~~~
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:84:
/cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:642:45: warning: ‘ghc::filesystem::path ghc::filesystem::u8path(const Source&) [with Source = char [7]; <template-parameter-1-2> = ghc::filesystem::path]’ is deprecated: use ghc::filesystem::path::path() with std::u8string instead [-Wdeprecated-declarations]
642 | CHECK(fs::u8path("\xc3\xa4/\xe2\x82\xac").generic_u16string() == std::u16string(u"\u00E4/\u20AC"));
| ^
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:62:
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp:1761:13: note: declared here
1761 | inline path u8path(const Source& source)
| ^~~~~~
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:84:
/cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:642:45: warning: ‘ghc::filesystem::path ghc::filesystem::u8path(const Source&) [with Source = char [7]; <template-parameter-1-2> = ghc::filesystem::path]’ is deprecated: use ghc::filesystem::path::path() with std::u8string instead [-Wdeprecated-declarations]
642 | CHECK(fs::u8path("\xc3\xa4/\xe2\x82\xac").generic_u16string() == std::u16string(u"\u00E4/\u20AC"));
| ^
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:62:
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp:1761:13: note: declared here
1761 | inline path u8path(const Source& source)
| ^~~~~~
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:84:
/cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:643:45: warning: ‘ghc::filesystem::path ghc::filesystem::u8path(const Source&) [with Source = char [7]; <template-parameter-1-2> = ghc::filesystem::path]’ is deprecated: use ghc::filesystem::path::path() with std::u8string instead [-Wdeprecated-declarations]
643 | CHECK(fs::u8path("\xc3\xa4/\xe2\x82\xac").generic_u32string() == std::u32string(U"\U000000E4/\U000020AC"));
| ^
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:62:
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp:1761:13: note: declared here
1761 | inline path u8path(const Source& source)
| ^~~~~~
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:84:
/cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:643:45: warning: ‘ghc::filesystem::path ghc::filesystem::u8path(const Source&) [with Source = char [7]; <template-parameter-1-2> = ghc::filesystem::path]’ is deprecated: use ghc::filesystem::path::path() with std::u8string instead [-Wdeprecated-declarations]
643 | CHECK(fs::u8path("\xc3\xa4/\xe2\x82\xac").generic_u32string() == std::u32string(U"\U000000E4/\U000020AC"));
| ^
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:62:
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp:1761:13: note: declared here
1761 | inline path u8path(const Source& source)
| ^~~~~~
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:84:
/cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp: In function ‘void ____C_A_T_C_H____T_E_S_T____39()’:
/cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:1165:31: warning: ‘ghc::filesystem::path ghc::filesystem::u8path(const Source&) [with Source = char [8]; <template-parameter-1-2> = ghc::filesystem::path]’ is deprecated: use ghc::filesystem::path::path() with std::u8string instead [-Wdeprecated-declarations]
1165 | CHECK(fs::u8path("foo/bar") == fs::path("foo/bar"));
| ^
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:62:
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp:1761:13: note: declared here
1761 | inline path u8path(const Source& source)
| ^~~~~~
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:84:
/cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:1165:31: warning: ‘ghc::filesystem::path ghc::filesystem::u8path(const Source&) [with Source = char [8]; <template-parameter-1-2> = ghc::filesystem::path]’ is deprecated: use ghc::filesystem::path::path() with std::u8string instead [-Wdeprecated-declarations]
1165 | CHECK(fs::u8path("foo/bar") == fs::path("foo/bar"));
| ^
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:62:
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp:1761:13: note: declared here
1761 | inline path u8path(const Source& source)
| ^~~~~~
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:84:
/cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:1166:31: warning: ‘ghc::filesystem::path ghc::filesystem::u8path(const Source&) [with Source = char [8]; <template-parameter-1-2> = ghc::filesystem::path]’ is deprecated: use ghc::filesystem::path::path() with std::u8string instead [-Wdeprecated-declarations]
1166 | CHECK(fs::u8path("foo/bar") == fs::path("foo/bar"));
| ^
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:62:
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp:1761:13: note: declared here
1761 | inline path u8path(const Source& source)
| ^~~~~~
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:84:
/cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:1166:31: warning: ‘ghc::filesystem::path ghc::filesystem::u8path(const Source&) [with Source = char [8]; <template-parameter-1-2> = ghc::filesystem::path]’ is deprecated: use ghc::filesystem::path::path() with std::u8string instead [-Wdeprecated-declarations]
1166 | CHECK(fs::u8path("foo/bar") == fs::path("foo/bar"));
| ^
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:62:
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp:1761:13: note: declared here
1761 | inline path u8path(const Source& source)
| ^~~~~~
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:84:
/cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:1168:44: warning: ‘ghc::filesystem::path ghc::filesystem::u8path(InputIterator, InputIterator) [with InputIterator = __gnu_cxx::__normal_iterator<char*, std::basic_string<char> >]’ is deprecated: use ghc::filesystem::path::path() with std::u8string instead [-Wdeprecated-declarations]
1168 | CHECK(fs::u8path(str.begin(), str.end()) == str);
| ^
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:62:
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp:1766:13: note: declared here
1766 | inline path u8path(InputIterator first, InputIterator last)
| ^~~~~~
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:84:
/cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:1168:44: warning: ‘ghc::filesystem::path ghc::filesystem::u8path(InputIterator, InputIterator) [with InputIterator = __gnu_cxx::__normal_iterator<char*, std::basic_string<char> >]’ is deprecated: use ghc::filesystem::path::path() with std::u8string instead [-Wdeprecated-declarations]
1168 | CHECK(fs::u8path(str.begin(), str.end()) == str);
| ^
In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:62:
/cygdrive/e/Programs/github_repositories/forked/filesystem/include/ghc/filesystem.hpp:1766:13: note: declared here
1766 | inline path u8path(InputIterator first, InputIterator last)
| ^~~~~~
[ 58%] Linking CXX executable filesystem_test_cpp20.exe
[ 58%] Built target filesystem_test_cpp20
Cmake generation information:
$ cmake -DCMAKE_BUILD_TYPE=Debug ..
-- The C compiler identification is GNU 10.2.0
-- The CXX compiler identification is GNU 10.2.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++.exe
-- Check for working CXX compiler: /usr/bin/c++.exe - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Generating test runner for normal test...
-- Configuring done
-- Generating done
- I'm not sure how important they are.
Thanks that is fast!!
You are welcome, as a long time Doxygen user I am happy to be able to give something back. 😄
In the README.md I read it is possible to run some tests, but it is not clear how to run the tests. I followed the
CMake
instructions and some executables are build, a.o.:./test/exception.exe ./test/filesystem_test.exe ./test/filesystem_test_cpp17.exe ./test/filesystem_test_cpp20.exe ./test/fwd_impl_test.exe ./test/multifile_test.exe ./test/std_filesystem_test.exe
That is great.
- is it sufficient to start
./test/filesystem_test.exe
?
Maybe a bit more information in the README.md would not hurt.
Yeah, I should make that more clear. The ghc::filesystem
tests are all registered in CTest.
On a Makefile/Ninja based generator it is sufficient to use the default CMake way:
$ ctest
Test project /cygdrive/c/Development/GHC/filesystem/cmake-build-debug-cygwin
Start 1: filesystem_test:Temporary Directory
1/203 Test #1: filesystem_test:Temporary Directory ...................................... Passed 0.08 sec
Start 2: filesystem_test:fs::detail::fromUtf8
2/203 Test #2: filesystem_test:fs::detail::fromUtf8 ..................................... Passed 0.04 sec
Start 3: filesystem_test:fs::detail::toUtf8
3/203 Test #3: filesystem_test:fs::detail::toUtf8 ....................................... Passed 0.04 sec
...
When building for Visual Studio or Xcode, the CMake configuration needs to be given (case is significant):
$ ctest -C Release
I was able to run those on my Cygwin Environment without errors.
Regarding Appveyor and Cygwin, unfortunately I have no experience with it, it looks like Appveyor is supporting the recent version of Cygwin (3.1.7) so it should be possible.
(doxygen isn't using Appveyor and Travis anymore, we recently switched to Github Actions. The number of platforms is limited. The reason for was the change of the conditions on Travis for free builds for Open Source builds which in short would mean we had to request free licenses regularly. Also their communication about it was not that clear. At the same time we also abandoned Appveyor as all sub jibs were run in sequence and an complete job on Appveyor ran for around 2 hours).
Yeah, I expect my Travic-ci.org pipeline to stop working any week, but as long as it works and I don't migrate
to Travis-ci.com I keep them running and the Message on the travis-ci.org page still says "Please stay tuned here for more information." so I guess it is okay to stay tuned. But I plan to replace it with Github Actions soon, I just can not have the same amount of platforms as I estimate the 3000 Github Pro Minutes would be drained fast. Currently I have about 25 Configurations over all CI systems and an average running time of 4 minutes so that would allow for 30 pushes or PR runs and I have other (and private) projects too. So I guess I would have to reduce the build variants as well.
Compiling the tests on Cygwin with GCC 10.0.2 gives me some warning / information messages:
Scanning dependencies of target filesystem_test_cpp20 [ 54%] Building CXX object test/CMakeFiles/filesystem_test_cpp20.dir/filesystem_test.cpp.o In file included from /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:84: /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp: In function ‘void ____C_A_T_C_H____T_E_S_T____20()’: /cygdrive/e/Programs/github_repositories/forked/filesystem/test/filesystem_test.cpp:595:45: warning: ‘ghc::filesystem::path ghc::filesystem::u8path(const Source&) [with Source = char [7]; <template-parameter-1-2> = ghc::filesystem::path]’ is deprecated: use ghc::filesystem::path::path() with std::u8string instead [-Wdeprecated-declarations] 595 | CHECK(fs::u8path("\xc3\xa4/\xe2\x82\xac").native() == fs::path::string_type("\xc3\xa4/\xe2\x82\xac")); | ^ [...] [ 58%] Linking CXX executable filesystem_test_cpp20.exe [ 58%] Built target filesystem_test_cpp20
These warnings are actually in a way part of the test. The issue is, that ghc::filesystem
mimics std::filesystem
and the interface u8path
is deprecated in C++20, but still available, so I have to test it when building with C++20, to make sure it is still there (expect it to be removed in C++23), working and that it is deprecated. So the correct behavior is for these warnings only to appear when building the target filesystem_test_cpp20
.
I just ran the tests, no problems (203 tests on Cygwin, 270 on Windows).
Besides starting the tests by means of ctest
it is also possible to start the tests on Cygwin by make test
(strangely doesn't work on Windows with nmake test
, gives straight away"'test' is up-to-date").