Skip to content

Commit

Permalink
Merge branch 'boostorg:develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
zhixingchen0629 committed Jul 23, 2024
2 parents 3112564 + 5f80218 commit 59d5a88
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 13 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
12 changes: 12 additions & 0 deletions build/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 <define>BOOST_PROCESS_SOURCE=1
<link>shared:<define>BOOST_PROCESS_DYN_LINK=1
<boost.process.fs>boost:<library>/boost//filesystem
<target-os>windows:<library>shell32
<target-os>windows:<library>user32
<target-os>windows:<library>Ntdll
<target-os>windows:<library>Advapi32
: usage-requirements
<link>shared:<define>BOOST_PROCESS_DYN_LINK=1
<boost.process.fs>boost:<library>/boost//filesystem
Expand Down
12 changes: 6 additions & 6 deletions include/boost/process/v2/detail/environment_win.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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)
Expand All @@ -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);
Expand Down
6 changes: 5 additions & 1 deletion src/posix/close_handles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <gnu/libc-version.h>
// version is included by stdlib.h #include <gnu/libc-version.h>
#if (__GLIBC__ >= 2 && __GLIBC_MINOR__ >= 34) // glibc is compiled with close_range support
// https://man7.org/linux/man-pages/man2/close_range.2.html

Expand All @@ -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);
Expand Down
5 changes: 0 additions & 5 deletions test/v2/Jamfile.jam
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,10 @@ exe target : target.cpp :
<target-os>windows:<source>Ntdll
;


lib test_impl : test_impl.cpp filesystem /boost//process :
<define>BOOST_PROCESS_V2_SEPARATE_COMPILATION=1
<define>BOOST_TEST_IGNORE_SIGCHLD=1
<link>static
<target-os>windows:<source>shell32
<target-os>windows:<source>user32
<target-os>windows:<source>Ntdll
<target-os>windows:<source>Advapi32
;

test-suite standalone :
Expand Down

0 comments on commit 59d5a88

Please sign in to comment.