Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
662c0b1
warning fixes
klemens-morgenstern Dec 13, 2024
3fe2033
fixes #431
klemens-morgenstern Dec 13, 2024
0f9dd52
added BOOST_PROCESS_V2_DISABLE_NOTIFY_FORK
klemens-morgenstern Dec 13, 2024
64fc05c
Add ability to auto link process library
tomy2105 Oct 31, 2024
c0a23ae
Fix Github Actions CI (#437)
Flamefire Dec 20, 2024
5cfdf3e
Fix building with CMake on MinGW-w64. (#439)
MehdiChinoune Dec 20, 2024
09a978d
disabled gcc11 on freebsd
klemens-morgenstern Dec 20, 2024
2275057
v2 uses PROC_THREAD_ATTRIBUTE_HANDLE_LIST for limiting fd
klemens-morgenstern Nov 7, 2024
b5eacac
disabled shell for android
klemens-morgenstern Dec 20, 2024
7874a04
switched to asciidoc
klemens-morgenstern Nov 19, 2024
2ccd97c
made v2 the default
klemens-morgenstern Nov 19, 2024
c33828a
reference docs
klemens-morgenstern Nov 19, 2024
3fd8b26
examples are compiled & included.
klemens-morgenstern Dec 20, 2024
298b60c
fixed for v2 namespace inlining.
klemens-morgenstern Dec 20, 2024
65251a2
replace png with svg in install.
klemens-morgenstern Dec 20, 2024
9bd57d6
aded missing include to example/env.cpp
klemens-morgenstern Dec 20, 2024
e1c6a9b
attempting to fix msvc build.
klemens-morgenstern Dec 20, 2024
a6f2a1d
windows fixes.
klemens-morgenstern Dec 20, 2024
d75ffb3
windows link fixes.
klemens-morgenstern Dec 20, 2024
b529769
removed boost::system:: scope spec for error_code.
klemens-morgenstern Dec 20, 2024
3598200
add test case for initializing `process_stdio` with complementary pip…
jgreitemann Jan 12, 2025
4bb8425
add a (failing) test for `process_stdio` move semantics
jgreitemann Jan 12, 2025
e842a06
implement move operations for `process_io_binding` and delete copy op…
jgreitemann Jan 12, 2025
1b5272a
changed cwd comparison to `equivalent`.
klemens-morgenstern Jan 13, 2025
a2d2753
zombie process fixes
klemens-morgenstern Jan 13, 2025
b781b49
doc: fix typo in stdio
rtzoeller Jan 20, 2025
c329e05
chore: remove executable flags from .cpp files
striezel Jan 20, 2025
bb375f5
Fix several typos
striezel Jan 20, 2025
d534ed6
Fix small yet confusing Typo in Doc
jens-diewald Feb 5, 2025
529fb1e
Fix include directives from boost/process/posix/*.hpp having wrong paths
SimonMaracine Jan 23, 2025
ab28b51
fix v1 tests after v2 became the default
jgreitemann Jan 11, 2025
8ae055b
Remove optional dependency on filesystem when not meant to be
SimonMaracine Jan 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ windowsglobalimage="cppalliance/dronevs2019"

def main(ctx):
return [
freebsd_cxx("gcc 11 freebsd", "g++-11", buildtype="boost", buildscript="drone", freebsd_version="13.1", environment={'B2_TOOLSET': 'gcc-11', 'B2_CXXSTD': '17,20', 'B2_LINKFLAGS': '-Wl,-rpath=/usr/local/lib/gcc11'}, globalenv=globalenv),
#freebsd_cxx("gcc 11 freebsd", "g++-11", buildtype="boost", buildscript="drone", freebsd_version="13.1", environment={'B2_TOOLSET': 'gcc-11', 'B2_CXXSTD': '17,20', 'B2_LINKFLAGS': '-Wl,-rpath=/usr/local/lib/gcc11'}, globalenv=globalenv),
freebsd_cxx("clang 14 freebsd", "clang++-14", buildtype="boost", buildscript="drone", freebsd_version="13.1", environment={'B2_TOOLSET': 'clang-14', 'B2_CXXSTD': '17,20'}, globalenv=globalenv),
linux_cxx("docs", "", packages="docbook docbook-xml docbook-xsl xsltproc libsaxonhe-java default-jre-headless flex libfl-dev bison unzip rsync", image="cppalliance/droneubuntu1804:1", buildtype="docs", buildscript="drone", environment={"COMMENT": "docs"}, globalenv=globalenv),
linux_cxx("asan", "g++-8", packages="g++-8", buildtype="boost", buildscript="drone", image=linuxglobalimage, environment={'COMMENT': 'asan', 'B2_VARIANT': 'debug', 'B2_TOOLSET': 'gcc-8', 'B2_CXXSTD': '11', 'B2_ASAN': '1', 'B2_DEFINES': 'BOOST_NO_STRESS_TEST=1', 'DRONE_EXTRA_PRIVILEGED': 'True', 'DRONE_JOB_UUID': '356a192b79'}, globalenv=globalenv, privileged=True),
Expand Down
127 changes: 41 additions & 86 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,101 +13,56 @@ env:

jobs:
posix:
defaults:
run:
shell: bash

strategy:
fail-fast: false
matrix:
include:
- toolset: gcc-5
cxxstd: "11,14,1z"
os: ubuntu-18.04
install: g++-5
- toolset: gcc-6
cxxstd: "11,14,1z"
os: ubuntu-18.04
install: g++-6
- toolset: gcc-7
cxxstd: "11,14,17"
os: ubuntu-18.04
- toolset: gcc-10
cxxstd: "11,14,17,2a"
os: ubuntu-20.04
install: g++-10
- toolset: gcc-12
cxxstd: "11,14,17,20,2b"
os: ubuntu-22.04
install: g++-12
- toolset: clang
compiler: clang++-3.9
cxxstd: "11,14"
os: ubuntu-18.04
install: clang-3.9
- toolset: clang
compiler: clang++-4.0
cxxstd: "11,14"
os: ubuntu-18.04
install: clang-4.0
- toolset: clang
compiler: clang++-5.0
cxxstd: "11,14,1z"
os: ubuntu-18.04
install: clang-5.0
- toolset: clang
compiler: clang++-6.0
cxxstd: "11,14,17"
os: ubuntu-18.04
install: clang-6.0
- toolset: clang
compiler: clang++-7
cxxstd: "11,14,17"
os: ubuntu-18.04
install: clang-7
- toolset: clang
compiler: clang++-8
cxxstd: "11,14,17"
os: ubuntu-20.04
install: clang-8
- toolset: clang
compiler: clang++-9
cxxstd: "11,14,17,2a"
os: ubuntu-20.04
install: clang-9
- toolset: clang
compiler: clang++-10
cxxstd: "11,14,17,2a"
os: ubuntu-20.04
install: clang-10
- toolset: clang
compiler: clang++-11
cxxstd: "11,14,17,2a"
os: ubuntu-20.04
install: clang-11
- toolset: clang
compiler: clang++-12
cxxstd: "11,14,17,2a"
os: ubuntu-20.04
install: clang-12
- toolset: clang
compiler: clang++-13
cxxstd: "11,14,17,20,2b"
os: ubuntu-22.04
install: clang-13
- toolset: clang
compiler: clang++-14
cxxstd: "11,14,17,20,2b"
os: ubuntu-22.04
install: clang-14
- toolset: clang
cxxstd: "11,14,17,2a"
os: macos-11
- { toolset: gcc-5, cxxstd: "11,14,1z", os: ubuntu-latest, container: 'ubuntu:18.04', install: g++-5 }
- { toolset: gcc-6, cxxstd: "11,14,1z", os: ubuntu-latest, container: 'ubuntu:18.04', install: g++-6 }
- { toolset: gcc-7, cxxstd: "11,14,17", os: ubuntu-20.04, install: g++-7 }
- { toolset: gcc-10, cxxstd: "11,14,17,2a", os: ubuntu-22.04, install: g++-10 }
- { toolset: gcc-12, cxxstd: "11,14,17,20,2b", os: ubuntu-22.04, install: g++-12 }
- { toolset: clang, compiler: clang++-3.9, cxxstd: "11,14", os: ubuntu-latest, container: 'ubuntu:18.04', install: clang-3.9 }
- { toolset: clang, compiler: clang++-4.0, cxxstd: "11,14", os: ubuntu-latest, container: 'ubuntu:18.04', install: clang-4.0 }
- { toolset: clang, compiler: clang++-5.0, cxxstd: "11,14,1z", os: ubuntu-latest, container: 'ubuntu:18.04', install: clang-5.0 }
- { toolset: clang, compiler: clang++-6.0, cxxstd: "11,14,17", os: ubuntu-20.04, install: clang-6.0 }
- { toolset: clang, compiler: clang++-7, cxxstd: "11,14,17", os: ubuntu-20.04, install: clang-7 }
- { toolset: clang, compiler: clang++-8, cxxstd: "11,14,17", os: ubuntu-20.04, install: clang-8 }
- { toolset: clang, compiler: clang++-9, cxxstd: "11,14,17,2a", os: ubuntu-20.04, install: clang-9 }
- { toolset: clang, compiler: clang++-10, cxxstd: "11,14,17,2a", os: ubuntu-20.04, install: clang-10 }
- { toolset: clang, compiler: clang++-11, cxxstd: "11,14,17,2a", os: ubuntu-20.04, install: clang-11 }
- { toolset: clang, compiler: clang++-12, cxxstd: "11,14,17,2a", os: ubuntu-20.04, install: clang-12 }
- { toolset: clang, compiler: clang++-13, cxxstd: "11,14,17,20,2b", os: ubuntu-22.04, install: clang-13 }
- { toolset: clang, compiler: clang++-14, cxxstd: "11,14,17,20,2b", os: ubuntu-22.04, install: clang-14 }
- { toolset: clang, cxxstd: "11,14,17,2a", os: macos-13 }

runs-on: ${{matrix.os}}
container:
image: ${{matrix.container}}
volumes:
- /node20217:/node20217:rw,rshared
- ${{ startsWith(matrix.container, 'ubuntu:1') && '/node20217:/__e/node20:ro,rshared' || ' ' }}

steps:
- uses: actions/checkout@v2
- name: Setup container environment
if: matrix.container
run: |
apt-get update
apt-get -y install sudo python3 git g++ curl
if [[ "${{matrix.container}}" == "ubuntu:1"* ]]; then
# Node 20 doesn't work with Ubuntu 16/18 glibc: https://github.com/actions/checkout/issues/1590
curl -sL https://archives.boost.io/misc/node/node-v20.9.0-linux-x64-glibc-217.tar.xz | tar -xJ --strip-components 1 -C /node20217
fi

- uses: actions/checkout@v4

- name: Install packages
if: matrix.install
run: sudo apt install ${{matrix.install}}
run: sudo apt-get -y install ${{matrix.install}}

- name: Setup Boost
run: |
Expand All @@ -127,7 +82,7 @@ jobs:
cd boost-root
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
git submodule update --init tools/boostdep
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
python3 tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
./bootstrap.sh
./b2 -d0 headers

Expand Down Expand Up @@ -207,7 +162,7 @@ jobs:
runs-on: ${{matrix.os}}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup Boost
shell: cmd
Expand Down
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ target_link_libraries(boost_process
Boost::asio
Boost::config
Boost::core
Boost::filesystem
Boost::fusion
Boost::iterator
Boost::move
Expand All @@ -57,7 +56,7 @@ else()
endif()

if (WIN32)
target_link_libraries(boost_process PUBLIC ntdll shell32 advapi32 user32)
target_link_libraries(boost_process PUBLIC ntdll shell32 advapi32 user32 ws2_32)
endif()

if(BUILD_SHARED_LIBS)
Expand Down
121 changes: 23 additions & 98 deletions doc/Jamfile.jam
Original file line number Diff line number Diff line change
@@ -1,106 +1,31 @@
# Copyright (c) 2006, 2007 Julio M. Merino Vidal
# Copyright (c) 2008 Ilya Sokolov, Boris Schaeling
# Copyright (c) 2009 Boris Schaeling
# Copyright (c) 2010 Felipe Tanus, Boris Schaeling
# Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling
#
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
# Copyright 2022 Klemens D. Morgenstern
# Distributed under the Boost Software License, Version 1.0.
# https://www.boost.org/LICENSE_1_0.txt

using boostbook ;
using quickbook ;
using doxygen ;
import asciidoctor ;

html index.html : index.adoc ;

local images = [ glob images/*.svg ] ;
install images : $(images) : <location>html/boost_process ;
install images_glob : $(images) : <location>$(BOOST_ROOT)/doc/html/boost_process ;
install html_ : index.html : <location>html ;

import type ;
type.register XMLPROCESSWORKAROUND : : XML ;
import generators ;
generators.register-standard common.copy : XML : XMLPROCESSWORKAROUND ;
pdf process.pdf : index.adoc ;
explicit process.pdf ;

xmlprocessworkaround posix_pseudocode : v1/posix_pseudocode.xml ;
xmlprocessworkaround windows_pseudocode : v1/windows_pseudocode.xml ;
install pdf_ : process.pdf : <location>pdf ;
explicit pdf_ ;

path-constant INCLUDES : ../include ;

doxygen reference_v1
:
$(INCLUDES)/boost/process/v1.hpp
[ glob $(INCLUDES)/boost/process/v1/*.hpp ]
:
<doxygen:param>EXCLUDE_SYMBOLS=BOOST_ASIO_INITFN_RESULT_TYPE
<doxygen:param>"PREDEFINED=\\
BOOST_PROCESS_DOXYGEN=1 \\
BOOST_PROCESS_V1_INLINE=
"
<doxygen:param>HIDE_UNDOC_CLASSES=YES
<doxygen:param>HIDE_UNDOC_MEMBERS=YES
<doxygen:param>EXAMPLE_PATH=.
<dependency>posix_pseudocode
<dependency>windows_pseudocode
<xsl:path>.
;



doxygen reference_v2
:
$(INCLUDES)/boost/process/v2.hpp
[ glob $(INCLUDES)/boost/process/v2/*.hpp ]
:
<doxygen:param>EXCLUDE_SYMBOLS=BOOST_ASIO_INITFN_RESULT_TYPE
<doxygen:param>PROJECT_NAME="Process V2"
<doxygen:param>PROJECT_BRIEF="The process library"
<doxygen:param>MACRO_EXPANSION=YES
<doxygen:param>EXPAND_ONLY_PREDEF=YES
<doxygen:param>"PREDEFINED=\\
GENERATING_DOCUMENTATION=1 \\
BOOST_PROCESS_V2_ASIO_NAMESPACE=boost::asio \\
\"BOOST_PROCESS_V2_BEGIN_NAMESPACE=namespace boost { namespace process { namespace v2 { \" \\
\"BOOST_PROCESS_V2_END_NAMESPACE= } } }\" \\
BOOST_PROCESS_V2_NAMESPACE=boost::process::v2 \\
BOOST_PROCESS_V2_DECL \\
BOOST_PROCESS_V2_INITFN_AUTO_RESULT_TYPE(x,y)=deduced \\
BOOST_PROCESS_V2_COMPLETION_TOKEN_FOR(X)=Token \\
BOOST_PROCESS_V2_DEFAULT_COMPLETION_TOKEN_TYPE(E)=DEFAULT_TYPE \\
BOOST_ASIO_DEFAULT_COMPLETION_TOKEN=DEFAULT \\
BOOST_CONSTEXPR=constexpr \\
BOOST_CXX14_CONSTEXPR=constexpr \\
BOOST_PROCESS_V2_INLINE= \\
BOOST_ATTRIBUTE_NODISCARD=[[nodiscard]]
"
<doxygen.doxproc.id>reference_v2
<doxygen:param>SHOW_USED_FILES=NO
<doxygen:param>SHOW_FILES=NO
<doxygen:param>SHOW_NAMESPACES=YES
<doxygen:param>CLASS_DIAGRAMS=NO
<doxygen:param>SORT_MEMBERS_CTORS_1ST=YES
<doxygen:param>HIDE_UNDOC_CLASSES=NO
<xsl:path>.
;


boostbook standalone
:
process.qbk
:
<dependency>reference_v1
<dependency>reference_v2
<dependency>images
<dependency>images_glob
<xsl:param>boost.root=../../../..
<xsl:param>html.stylesheet=../../../../doc/src/boostbook.css
;

###############################################################################
alias boostdoc
: standalone/<format>docbook
install images
:
images/posix_exec_err.svg
images/posix_fork_err.svg
images/posix_success.svg
images/windows_exec.svg
:
: <dependency>images_glob
: ;
<location>html/images
;

alias boostdoc ;
explicit boostdoc ;
alias boostrelease ;
explicit boostrelease ;
alias boostrelease : html_ ;
explicit boostrelease ;

8 changes: 4 additions & 4 deletions doc/acknowledgements.qbk → doc/acknowledgements.adoc
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[section Acknowledgements]
= Acknowledgements

The first Boost.Process draft was created in 2006. A lof of people have worked on various drafts since then. Especially Merino Vidal, Ilya Sokolov and Felipe Tanus spent a lot of time working on early drafts. They influenced Boost.Process over the years and wrote code which, to various extents, is still around in the library today.

The design of earlier versions of Boost.Process was not always satisfying. In 2011 Jeff Flinn proposed the executor and initializer concepts Boost.Process is based on today. Without Jeff's idea the overall design of Boost.Process would not look like it does today.

A special thank you goes to [@http://www.intra2net.com/ Intra2net AG] (especially Thomas Jarosch) who sponsored a project to support the development of Boost.Process. It was this sponsorship which made it possible to create a new Boost.Process version in 2012.
A special thank you goes to [http://www.intra2net.com/(Intra2net AG) (especially Thomas Jarosch) who sponsored a project to support the development of Boost.Process. It was this sponsorship which made it possible to create a new Boost.Process version in 2012.

Great thanks also goes to Boris Schaeling, who despite having boost.process rejected, went on to work on it and maintained it up until this day and participated in the development of the current version.

Many Thanks, to [@https://github.com/time-killer-games Samuel Venable] for contributing the v2::ext functionality and all the research that went into it.
Many Thanks, to [https://github.com/time-killer-games](Samuel Venable) for contributing the <<v2::ext>> functionality and all the research that went into it.


[endsect]
11 changes: 11 additions & 0 deletions doc/configuration.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
= Configuration

Boost process v2 can be configured in the following ways:

[cols="1,1"]
|===
| Macro | Description

| `BOOST_PROCESS_V2_STANDALONE` | Build boost.process for standalone asio
| `BOOST_PROCESS_USE_STD_FS` | Use std::filesystem instead of boost::filesystem
| `BOOST_PROCESS_V2_POSIX_FORCE_DISABLE_CLOSE_RANGE` | Disable usage of `close_range`.
41 changes: 12 additions & 29 deletions doc/v2/env.qbk → doc/env.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[section:env Environment]
== Environment

The `environment` namespace provides all sorts of facilities to query and manipulate the environment of the current process.

Expand All @@ -14,35 +14,18 @@ as to have the right value comparisons.

To note is the `find_executable` functions, which searches in an environment for an executable.

```
// search in the current environment
auto exe = environment::find_executable("g++");
.example/env.cpp:19-28
[source,cpp]
----
include::../example/env.cpp[tag=current_env]
----

std::unordered_map<environment::key, environment::value> my_env =
{
{"SECRET", "THIS_IS_A_TEST"},
{"PATH", {"/bin", "/usr/bin"}}
};

auto other_exe = environment::find_executable("g++", my_env);
```

[section:process_env Subprocess environment]
== Subprocess environment

The subprocess environment assignment follows the same constraints:

```
asio::io_context ctx;
std::unordered_map<environment::key, environment::value> my_env =
{
{"SECRET", "THIS_IS_A_TEST"},
{"PATH", {"/bin", "/usr/bin"}}
};
auto exe = find_executable("g++");
process proc(ctx, exe, {"main.cpp"}, process_environment(my_env));
process pro2(ctx, exe, {"test.cpp"}, process_environment(my_env));
```

[endsect]

[endsect]
.example/env.cpp:34-42
[source,cpp,ident=0]
----
include::../example/env.cpp[tag=subprocess_env]
----
Loading
Loading