diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 688abf222..f58158ac2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -141,6 +141,43 @@ jobs: cd ../boost-root ./b2 -j3 libs/$LIBRARY/test toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} variant=debug,release + alpine-linux: + runs-on: ubuntu-latest + container: + image: alpine:3.20.1 + steps: + - name: Install packages + run: apk add g++ git python3 linux-headers + + - uses: actions/checkout@v4 + + - name: Setup Boost + run: | + echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY + LIBRARY=${GITHUB_REPOSITORY#*/} + echo LIBRARY: $LIBRARY + echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV + echo GITHUB_BASE_REF: $GITHUB_BASE_REF + echo GITHUB_REF: $GITHUB_REF + REF=${GITHUB_BASE_REF:-$GITHUB_REF} + REF=${REF#refs/heads/} + echo REF: $REF + BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true + echo BOOST_BRANCH: $BOOST_BRANCH + cd .. + git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root + cd boost-root + cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY + git submodule update --init tools/boostdep + python3 tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY + ./bootstrap.sh + ./b2 -d0 headers + + - name: Run tests + run: | + cd ../boost-root + ./b2 -j3 libs/$LIBRARY/test toolset=gcc cxxstd=23 variant=debug,release + windows: strategy: fail-fast: false diff --git a/CMakeLists.txt b/CMakeLists.txt index bdb83c64e..c009f2f66 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,7 +57,7 @@ else() endif() if (WIN32) - target_link_libraries(boost_process PUBLIC ntdll) + target_link_libraries(boost_process PUBLIC ntdll shell32 Advapi32 user32) endif() if(BUILD_SHARED_LIBS) diff --git a/build/Jamfile b/build/Jamfile index 1a1c34511..2166181cb 100644 --- a/build/Jamfile +++ b/build/Jamfile @@ -40,11 +40,23 @@ alias process_sources shell.cpp ; +if [ os.name ] = NT +{ + lib shell32 ; + lib Advapi32 ; + lib Ntdll ; + lib user32 ; +} + lib boost_process : process_sources : requirements BOOST_PROCESS_SOURCE=1 shared:BOOST_PROCESS_DYN_LINK=1 boost:/boost//filesystem + windows:shell32 + windows:user32 + windows:Ntdll + windows:Advapi32 : usage-requirements shared:BOOST_PROCESS_DYN_LINK=1 boost:/boost//filesystem diff --git a/include/boost/process/v2/detail/environment_win.hpp b/include/boost/process/v2/detail/environment_win.hpp index 3ddd419e8..c36dfd752 100644 --- a/include/boost/process/v2/detail/environment_win.hpp +++ b/include/boost/process/v2/detail/environment_win.hpp @@ -57,7 +57,7 @@ struct key_char_traits return to_lower(c1) < to_lower(c2); } - BOOST_CONSTEXPR static + BOOST_CXX14_CONSTEXPR static int compare(const char_type* s1, const char_type* s2, size_t n) BOOST_NOEXCEPT { auto itrs = std::mismatch(s1, s1 + n, s2, &eq); @@ -69,17 +69,17 @@ struct key_char_traits return (c1 < c2 ) ? -1 : 1; } - BOOST_CONSTEXPR static size_t length(const char* s) BOOST_NOEXCEPT { return std::strlen(s); } - BOOST_CONSTEXPR static size_t length(const wchar_t* s) BOOST_NOEXCEPT { return std::wcslen(s); } + static size_t length(const char* s) BOOST_NOEXCEPT { return std::strlen(s); } + static size_t length(const wchar_t* s) BOOST_NOEXCEPT { return std::wcslen(s); } - BOOST_CONSTEXPR static + BOOST_CXX14_CONSTEXPR static const char_type* find(const char_type* s, size_t n, const char_type& a) BOOST_NOEXCEPT { const char_type u = to_lower(a); return std::find_if(s, s + n, [u](char_type c){return to_lower(c) == u;}); } - BOOST_CONSTEXPR static + BOOST_CXX14_CONSTEXPR static char_type* move(char_type* s1, const char_type* s2, size_t n) BOOST_NOEXCEPT { if (s1 < s2) @@ -94,7 +94,7 @@ struct key_char_traits return std::copy(s2, s2 + n, s1); } - BOOST_CONSTEXPR static + BOOST_CXX14_CONSTEXPR static char_type* assign(char_type* s, size_t n, char_type a) BOOST_NOEXCEPT { std::fill(s, s + n, a); diff --git a/src/posix/close_handles.cpp b/src/posix/close_handles.cpp index f4892f566..39d63e6dd 100644 --- a/src/posix/close_handles.cpp +++ b/src/posix/close_handles.cpp @@ -47,7 +47,7 @@ int fdwalk(int (*func)(void *, int), void *cd); #if LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0) // kernel has close_range -#include +// version is included by stdlib.h #include #if (__GLIBC__ >= 2 && __GLIBC_MINOR__ >= 34) // glibc is compiled with close_range support // https://man7.org/linux/man-pages/man2/close_range.2.html @@ -60,6 +60,10 @@ int fdwalk(int (*func)(void *, int), void *cd); #if defined(SYS_close_range) #define BOOST_PROCESS_V2_HAS_CLOSE_RANGE 1 +#if !defined(CLOSE_RANGE_UNSHARE) +#define CLOSE_RANGE_UNSHARE 2 +#endif + int close_range(unsigned int first, unsigned int last, int flags) { return ::syscall(SYS_close_range, first, last, flags); diff --git a/test/v2/Jamfile.jam b/test/v2/Jamfile.jam index fcaa81303..58baacf0f 100644 --- a/test/v2/Jamfile.jam +++ b/test/v2/Jamfile.jam @@ -43,15 +43,10 @@ exe target : target.cpp : windows:Ntdll ; - lib test_impl : test_impl.cpp filesystem /boost//process : BOOST_PROCESS_V2_SEPARATE_COMPILATION=1 BOOST_TEST_IGNORE_SIGCHLD=1 static - windows:shell32 - windows:user32 - windows:Ntdll - windows:Advapi32 ; test-suite standalone :