Work on CI support for MingW, fixing some MingW issues

This commit is contained in:
Steffen Schuemann 2019-05-14 08:42:29 +02:00
parent 3117060ed9
commit 91e02dc2c4
5 changed files with 75 additions and 36 deletions

View File

@ -1,13 +1,47 @@
image: Visual Studio 2017
environment:
matrix:
- platform: x86
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
generator: "Visual Studio 14 2015"
compiler: msvc
configuration: Release
platform:
- Win32
- x64
- platform: x64
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
generator: "Visual Studio 14 2015 Win64"
compiler: msvc
configuration: Release
- platform: x86
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
generator: "Visual Studio 15 2017"
compiler: msvc
configuration: Release
- platform: x64
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
generator: "Visual Studio 15 2017 Win64"
compiler: msvc
configuration: Release
- platform: x86
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
generator: "MinGW Makefiles"
compiler: mingw
TOOLCHAIN_PATH: C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1/mingw32\bin
CC: C:/mingw-w64/i686-6.3.0-posix-dwarf-rt_v5-rev1/mingw32/bin/gcc.exe
CXX: C:/mingw-w64/i686-6.3.0-posix-dwarf-rt_v5-rev1/mingw32/bin/g++.exe
configuration: Release
- platform: x64
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
generator: "MinGW Makefiles"
compiler: mingw
TOOLCHAIN_PATH: C:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\bin
CC: C:/mingw-w64/x86_64-7.2.0-posix-seh-rt_v5-rev1/mingw64/bin/gcc.exe
CXX: C:/mingw-w64/x86_64-7.2.0-posix-seh-rt_v5-rev1/mingw64/bin/g++.exe
configuration: Release
configuration:
- Debug
- Release
matrix:
fast_finish: false
@ -17,17 +51,18 @@ init:
install:
- cmd: reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"
- cmd: ren "C:\Program Files\Git\usr\bin\sh.exe" _sh.exe
before_build:
- cmake . -Bbuild -A%PLATFORM% -DCMAKE_BUILD_TYPE=%configuration%
build:
project: build/ghcfilesystem.sln
parallel: true
verbosity: minimal
build_script:
- mkdir build
- cd build
- if [%compiler%]==[msvc] cmake -G"%generator%" ..
- if [%compiler%]==[mingw] set PATH=%TOOLCHAIN_PATH%;%PATH%
- if [%compiler%]==[mingw] cmake -G"%generator%" -DCMAKE_C_COMPILER=%CC% -DCMAKE_CXX_COMPILER=%CXX% -DCMAKE_SH=CMAKE_SH-NOTFOUND -DCMAKE_BUILD_TYPE=%configuration% ..
- cmake --build . --config %configuration%
test_script:
- cd build
- cd %APPVEYOR_BUILD_FOLDER%\build
- set CTEST_OUTPUT_ON_FAILURE=1
- ctest -C %configuration%
- cd ..

View File

@ -21,5 +21,5 @@ BraceWrapping:
SplitEmptyNamespace: true
BreakConstructorInitializers: BeforeComma
ConstructorInitializerAllOnOneLineOrOnePerLine: false
IndentPPDirectives: None
...

View File

@ -61,8 +61,8 @@ of the UTF-8 preference on Windows).
Unit tests are currently run with:
* macOS 10.12: XCode 9.2 (clang-900.0.39.2), GCC 8.1.0, Clang 7.0.0
* Windows 10: Visual Studio 2017 15.8.5, MingW GCC 5.3
* macOS 10.12: Xcode 9.2 (clang-900.0.39.2), Xcode 10.2, GCC 8.1.0, Clang 7.0.0
* Windows: Visual Studio 2017, Visual Studio 2015, MingW GCC 6.3 (Win32), GCC 7.2 (Win64)
* Linux (Ubuntu): GCC (5.5, 6.5, 7.4, 8.1, 8.2), Clang (5.0, 6.0, 7.1, 8.0)
@ -410,7 +410,7 @@ just a more complicated syntax for the `fs::create_symlink` or `fs::create_hardl
and I don't want to believe, that this was the intention of the original writing.
As there is another issue related to copy, with a different take on the description.
*Note:* With v1.1.2 I decided to integrate a behavior switch for this and make the LWG #2682
**Note:** With v1.1.2 I decided to integrate a behavior switch for this and make the LWG #2682
the default.
## Open Issues
@ -445,6 +445,11 @@ to the expected behavior.
## Release Notes
### v1.1.5 (wip)
* Added MingW 32/64 and Visual Studio 2015 builds to the CI configuration.
* Fixed additional compilation issues on MingW.
### [v1.1.4](https://github.com/gulrak/filesystem/releases/tag/v1.1.4)
* Additional Bugfix for ([#12](https://github.com/gulrak/filesystem/issues/12)),

View File

@ -1057,7 +1057,7 @@ GHC_INLINE std::error_code make_error_code(portable_error err)
return std::error_code(ERROR_INVALID_PARAMETER, std::system_category());
case portable_error::is_a_directory:
#ifdef ERROR_DIRECTORY_NOT_SUPPORTED
return std::error_code(ERROR_DIRECTORY_NOT_SUPPORTED, std::system_category());
return std::error_code(ERROR_DIRECTORY_NOT_SUPPORTED, std::system_category());
#else
return std::error_code(ERROR_NOT_SUPPORTED, std::system_category());
#endif
@ -1388,15 +1388,15 @@ namespace detail {
GHC_INLINE bool equals_simple_insensitive(const char* str1, const char* str2)
{
#ifdef GHC_OS_WINDOWS
# ifdef __GNUC__
#ifdef __GNUC__
while (::tolower((unsigned char)*str1) == ::tolower((unsigned char)*str2++)) {
if (*str1++ == 0)
return true;
}
return false;
# else
#else
return 0 == ::_stricmp(str1, str2);
# endif
#endif
#else
return 0 == ::strcasecmp(str1, str2);
#endif
@ -1555,7 +1555,7 @@ GHC_INLINE path resolveSymlink(const path& p, std::error_code& ec)
UCHAR DataBuffer[1];
} GenericReparseBuffer;
} DUMMYUNIONNAME;
} REPARSE_DATA_BUFFER, *PREPARSE_DATA_BUFFER;
} REPARSE_DATA_BUFFER;
#ifndef MAXIMUM_REPARSE_DATA_BUFFER_SIZE
#define MAXIMUM_REPARSE_DATA_BUFFER_SIZE (16 * 1024)
#endif
@ -1567,18 +1567,17 @@ GHC_INLINE path resolveSymlink(const path& p, std::error_code& ec)
return path();
}
char buffer[MAXIMUM_REPARSE_DATA_BUFFER_SIZE] = {0};
REPARSE_DATA_BUFFER& reparseData = *(REPARSE_DATA_BUFFER*)buffer;
std::shared_ptr<REPARSE_DATA_BUFFER> reparseData((REPARSE_DATA_BUFFER*)std::calloc(1, MAXIMUM_REPARSE_DATA_BUFFER_SIZE), std::free);
ULONG bufferUsed;
path result;
if (DeviceIoControl(file.get(), FSCTL_GET_REPARSE_POINT, 0, 0, &reparseData, sizeof(buffer), &bufferUsed, 0)) {
if (IsReparseTagMicrosoft(reparseData.ReparseTag)) {
switch (reparseData.ReparseTag) {
if (DeviceIoControl(file.get(), FSCTL_GET_REPARSE_POINT, 0, 0, reparseData.get(), MAXIMUM_REPARSE_DATA_BUFFER_SIZE, &bufferUsed, 0)) {
if (IsReparseTagMicrosoft(reparseData->ReparseTag)) {
switch (reparseData->ReparseTag) {
case IO_REPARSE_TAG_SYMLINK:
result = std::wstring(&reparseData.SymbolicLinkReparseBuffer.PathBuffer[reparseData.SymbolicLinkReparseBuffer.PrintNameOffset / sizeof(WCHAR)], reparseData.SymbolicLinkReparseBuffer.PrintNameLength / sizeof(WCHAR));
result = std::wstring(&reparseData->SymbolicLinkReparseBuffer.PathBuffer[reparseData->SymbolicLinkReparseBuffer.PrintNameOffset / sizeof(WCHAR)], reparseData->SymbolicLinkReparseBuffer.PrintNameLength / sizeof(WCHAR));
break;
case IO_REPARSE_TAG_MOUNT_POINT:
result = std::wstring(&reparseData.MountPointReparseBuffer.PathBuffer[reparseData.MountPointReparseBuffer.PrintNameOffset / sizeof(WCHAR)], reparseData.MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR));
result = std::wstring(&reparseData->MountPointReparseBuffer.PathBuffer[reparseData->MountPointReparseBuffer.PrintNameOffset / sizeof(WCHAR)], reparseData->MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR));
break;
default:
break;
@ -3772,7 +3771,7 @@ GHC_INLINE void permissions(const path& p, perms prms, perm_options opts, std::e
}
}
#ifdef GHC_OS_WINDOWS
# ifdef __GNUC__
#ifdef __GNUC__
auto oldAttr = GetFileAttributesW(p.wstring().c_str());
if (oldAttr != INVALID_FILE_ATTRIBUTES) {
DWORD newAttr = ((prms & perms::owner_write) == perms::owner_write) ? oldAttr & ~FILE_ATTRIBUTE_READONLY : oldAttr | FILE_ATTRIBUTE_READONLY;
@ -3781,7 +3780,7 @@ GHC_INLINE void permissions(const path& p, perms prms, perm_options opts, std::e
}
}
ec = std::error_code(::GetLastError(), std::system_category());
# else
#else
int mode = 0;
if ((prms & perms::owner_read) == perms::owner_read) {
mode |= _S_IREAD;
@ -3792,7 +3791,7 @@ GHC_INLINE void permissions(const path& p, perms prms, perm_options opts, std::e
if (::_wchmod(p.wstring().c_str(), mode) != 0) {
ec = std::error_code(::GetLastError(), std::system_category());
}
# endif
#endif
#else
if ((opts & perm_options::nofollow) != perm_options::nofollow) {
if (::chmod(p.c_str(), static_cast<mode_t>(prms)) != 0) {

View File

@ -212,7 +212,7 @@ inline bool isWow64Proc()
bIsWow64 = FALSE;
}
}
return bIsWow64;
return bIsWow64 == TRUE;
}
static bool is_symlink_creation_supported()