From 94738c9065a342cf202ec2c99f29f4d42337728d Mon Sep 17 00:00:00 2001 From: Ryan Mast Date: Sat, 29 Feb 2020 09:12:12 -0800 Subject: [PATCH 1/4] Static cast to fix conversion error on 32-bit processors --- include/ghc/filesystem.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/ghc/filesystem.hpp b/include/ghc/filesystem.hpp index ba4302c..51aac0f 100644 --- a/include/ghc/filesystem.hpp +++ b/include/ghc/filesystem.hpp @@ -3961,8 +3961,8 @@ GHC_INLINE void last_write_time(const path& p, file_time_type new_time, std::err struct ::timespec times[2]; times[0].tv_sec = 0; times[0].tv_nsec = UTIME_OMIT; - times[1].tv_sec = std::chrono::duration_cast(d).count(); - times[1].tv_nsec = std::chrono::duration_cast(d).count() % 1000000000; + times[1].tv_sec = static_cast(std::chrono::duration_cast(d).count()); + times[1].tv_nsec = static_cast(std::chrono::duration_cast(d).count() % 1000000000); if (::utimensat(AT_FDCWD, p.c_str(), times, AT_SYMLINK_NOFOLLOW) != 0) { ec = detail::make_system_error(); } From 6c806a7145b461eaca685decb67cad0e5ff1bf4b Mon Sep 17 00:00:00 2001 From: Ryan Mast Date: Fri, 28 Feb 2020 20:53:19 -0800 Subject: [PATCH 2/4] Add FreeBSD build on Cirrus CI --- .ci/unix-build.sh | 4 ++++ .ci/unix-test.sh | 6 ++++++ .cirrus.yml | 13 +++++++++++++ 3 files changed, 23 insertions(+) create mode 100755 .ci/unix-build.sh create mode 100755 .ci/unix-test.sh create mode 100644 .cirrus.yml diff --git a/.ci/unix-build.sh b/.ci/unix-build.sh new file mode 100755 index 0000000..914befa --- /dev/null +++ b/.ci/unix-build.sh @@ -0,0 +1,4 @@ +#!/bin/sh +mkdir build && cd build +cmake -DCMAKE_BUILD_TYPE=Release .. +cmake --build . diff --git a/.ci/unix-test.sh b/.ci/unix-test.sh new file mode 100755 index 0000000..3d6c865 --- /dev/null +++ b/.ci/unix-test.sh @@ -0,0 +1,6 @@ +#!/bin/sh +cd build +ctest -E Windows +if [ -f "test/std_filesystem_test" ]; then + test/std_filesystem_test || true +fi diff --git a/.cirrus.yml b/.cirrus.yml new file mode 100644 index 0000000..6e4cd62 --- /dev/null +++ b/.cirrus.yml @@ -0,0 +1,13 @@ +freebsd_instance: + image_family: freebsd-12-1 + +task: + install_script: | + pkg install -y cmake + pw groupadd testgrp + pw useradd testuser -g testgrp -w none -m + chown -R testuser:testgrp . + build_script: | + sudo -u testuser .ci/unix-build.sh + test_script: | + sudo -u testuser .ci/unix-test.sh From 37fafe5f1af1cfb27169ea94acad6d4dcae1a093 Mon Sep 17 00:00:00 2001 From: Ryan Mast Date: Fri, 28 Feb 2020 21:00:03 -0800 Subject: [PATCH 3/4] Add ARM builds on Drone CI --- .ci/unix-build.sh | 4 ++++ .ci/unix-test.sh | 6 ++++++ .drone.yml | 43 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100755 .ci/unix-build.sh create mode 100755 .ci/unix-test.sh create mode 100644 .drone.yml diff --git a/.ci/unix-build.sh b/.ci/unix-build.sh new file mode 100755 index 0000000..914befa --- /dev/null +++ b/.ci/unix-build.sh @@ -0,0 +1,4 @@ +#!/bin/sh +mkdir build && cd build +cmake -DCMAKE_BUILD_TYPE=Release .. +cmake --build . diff --git a/.ci/unix-test.sh b/.ci/unix-test.sh new file mode 100755 index 0000000..3d6c865 --- /dev/null +++ b/.ci/unix-test.sh @@ -0,0 +1,6 @@ +#!/bin/sh +cd build +ctest -E Windows +if [ -f "test/std_filesystem_test" ]; then + test/std_filesystem_test || true +fi diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..da967a4 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,43 @@ +kind: pipeline +name: arm + +platform: + os: linux + arch: arm + +steps: +- name: build + image: alpine + failure: ignore + commands: + - apk update + - apk add --no-cache build-base cmake sudo + - addgroup testgrp + - adduser --disabled-password testuser testgrp + - passwd testuser -u -d + - chown -R testuser:testgrp . + - sudo -u testuser .ci/unix-build.sh + - sudo -u testuser .ci/unix-test.sh + +--- + +kind: pipeline +name: arm64 + +platform: + os: linux + arch: arm64 + +steps: +- name: build + image: alpine + failure: ignore + commands: + - apk update + - apk add --no-cache build-base cmake + - addgroup testgrp + - adduser --disabled-password testuser testgrp + - passwd testuser -u -d + - chown -R testuser:testgrp . + - su -c "./.ci/unix-build.sh" testuser + - su -c "./.ci/unix-test.sh" testuser From a778e6d76e331d827d4130d6c6fdee7c05b5b474 Mon Sep 17 00:00:00 2001 From: jnhyatt Date: Wed, 4 Mar 2020 04:54:15 -0700 Subject: [PATCH 4/4] Remove leading whitespace when first character is whitespace --- include/ghc/filesystem.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/ghc/filesystem.hpp b/include/ghc/filesystem.hpp index ba4302c..df0e845 100644 --- a/include/ghc/filesystem.hpp +++ b/include/ghc/filesystem.hpp @@ -2951,7 +2951,8 @@ template inline std::basic_istream& operator>>(std::basic_istream& is, path& p) { std::basic_string tmp; - auto c = is.get(); + charT c; + is >> c; if (c == '"') { auto sf = is.flags(); is >> std::noskipws;