Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 5 additions & 9 deletions .drone.star.disabled → .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ def main(ctx):
return generate(
# Compilers
[
'gcc >=5.0',
'clang >=3.9',
'gcc >=12.0',
'clang >=17.0',
'msvc >=14.1',
'arm64-gcc latest',
's390x-gcc latest',
Expand All @@ -27,16 +27,12 @@ def main(ctx):
'x86-msvc latest'
],
# Standards
'>=11',
'>=20',
# Asan is delegated to GHA
asan=False,
docs=False,
cache_dir='cache') + [
linux_cxx("GCC 12 (no-mutex)", "g++-12", packages="g++-12", buildscript="drone", buildtype="boost",
image="cppalliance/droneubuntu2204:1",
environment={'B2_TOOLSET': 'gcc-12', 'B2_DEFINES': 'BOOST_URL_DISABLE_THREADS=1',
'B2_CXXSTD': '17'}, globalenv={'B2_CI_VERSION': '1', 'B2_VARIANT': 'release'}),
]
coverage=False,
cache_dir='cache')


# from https://github.com/cppalliance/ci-automation
Expand Down
47 changes: 47 additions & 0 deletions .drone/drone.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@

@ECHO ON
setlocal enabledelayedexpansion

set TRAVIS_OS_NAME=windows

IF "!DRONE_BRANCH!" == "" (
for /F %%i in ("!GITHUB_REF!") do @set TRAVIS_BRANCH=%%~nxi
) else (
SET TRAVIS_BRANCH=!DRONE_BRANCH!
)

if "%DRONE_JOB_BUILDTYPE%" == "boost" (

echo "Running boost job"
echo '==================================> INSTALL'
REM there seems to be some problem with b2 bootstrap on Windows
REM when CXX env variable is set
SET "CXX="

git clone https://github.com/boostorg/boost-ci.git boost-ci-cloned --depth 1
cp -prf boost-ci-cloned/ci .
rm -rf boost-ci-cloned
Comment on lines +22 to +23
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# First, locate the .drone/drone.bat file
fd -g "drone.bat" -t f

# Then examine its contents with line numbers
if [ -f ".drone/drone.bat" ]; then
  wc -l ".drone/drone.bat"
  cat -n ".drone/drone.bat"
fi

Repository: cppalliance/capy

Length of output: 1690


🏁 Script executed:

#!/bin/bash
# Check for .gitattributes files in the repository
fd -g '.gitattributes' -t f --exec cat {}

Repository: cppalliance/capy

Length of output: 267


🏁 Script executed:

#!/bin/bash
# Look for context about the CI/CD setup (check if Git for Windows is explicitly required/configured)
fd -g '*.md' -t f | head -5 | xargs grep -l -i "git.*windows\|windows.*git" 2>/dev/null || echo "No direct references found"
fd -g 'appveyor*' -t f || echo "No AppVeyor config found"
fd -g '.drone.yml' -t f

Repository: cppalliance/capy

Length of output: 311


🏁 Script executed:

#!/bin/bash
# Search for .gitattributes with hidden files enabled
fd -g '.gitattributes' -H -t f --exec cat {}

Repository: cppalliance/capy

Length of output: 78


🏁 Script executed:

#!/bin/bash
# Search for any CI documentation or setup files
fd -E 'node_modules' -E '.git' -t f \( -name '*.md' -o -name 'README*' -o -name 'INSTALL*' \) | head -10

Repository: cppalliance/capy

Length of output: 290


🏁 Script executed:

#!/bin/bash
# Look for references to cp or rm in batch/bash scripts to see execution pattern
rg -t batch -t shell "cp|rm" --max-count 20

Repository: cppalliance/capy

Length of output: 89


🏁 Script executed:

#!/bin/bash
# Check if there are shell scripts that might set up the environment
fd -g '*.sh' -t f | head -10 | xargs -I {} sh -c 'echo "=== {} ===" && head -5 {}'

Repository: cppalliance/capy

Length of output: 305


🏁 Script executed:

#!/bin/bash
# Search for .drone.yml or drone configuration
fd -g '.drone.yml' -o -g '.drone.yaml' -H -t f --exec cat {}

Repository: cppalliance/capy

Length of output: 176


🏁 Script executed:

#!/bin/bash
# Search for README or CI documentation
fd -H -t f -E 'node_modules' -E '.git' '(README|CI|CONTRIBUTE)' | head -5 | xargs -I {} sh -c 'echo "=== {} ===" && head -20 {}'

Repository: cppalliance/capy

Length of output: 3403


🏁 Script executed:

#!/bin/bash
# Look for other .bat files to see patterns
fd -g '*.bat' -t f --exec sh -c 'echo "=== {} ===" && cat {}'

Repository: cppalliance/capy

Length of output: 717


🏁 Script executed:

#!/bin/bash
# Search for any documentation about Windows builds
rg -i "windows|batch|cmd|drone" --type md --max-count 30 | head -40

Repository: cppalliance/capy

Length of output: 2502


Replace Unix commands with native Windows equivalents in batch script.

Lines 22–23 use cp and rm, which are not standard Windows commands and require external tools (Git for Windows, etc.). The repository's own batch file (doc/build_antora.bat) demonstrates the correct pattern by using only native Windows commands. Use xcopy and rmdir for consistency and robustness.

Proposed fix
-cp -prf boost-ci-cloned/ci .
-rm -rf boost-ci-cloned
+xcopy /s /e /y /q boost-ci-cloned\ci ci\
+rmdir /s /q boost-ci-cloned
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
cp -prf boost-ci-cloned/ci .
rm -rf boost-ci-cloned
xcopy /s /e /y /q boost-ci-cloned\ci ci\
rmdir /s /q boost-ci-cloned
🤖 Prompt for AI Agents
In @.drone/drone.bat around lines 22 - 23, Replace the Unix commands in the
batch script: instead of using "cp -prf boost-ci-cloned/ci .", copy the
directory with the native Windows command xcopy using recursive and overwrite
flags to copy boost-ci-cloned\ci into the current folder (preserve
subdirectories and files); and instead of "rm -rf boost-ci-cloned", remove the
source directory with rmdir using /s /q to recursively delete without prompts.
Update the commands referencing boost-ci-cloned and ci accordingly (use xcopy
and rmdir) so the .drone/drone.bat script uses only native Windows commands.

REM source ci/travis/install.sh
REM The contents of install.sh below:

for /F %%i in ("%DRONE_REPO%") do @set SELF=%%~nxi
SET BOOST_CI_TARGET_BRANCH=!TRAVIS_BRANCH!
SET BOOST_CI_SRC_FOLDER=%cd%
if "%BOOST_BRANCH%" == "" (
SET BOOST_BRANCH=develop
if "%BOOST_CI_TARGET_BRANCH%" == "master" set BOOST_BRANCH=master
)

call ci\common_install.bat

echo '==================================> ZLIB'
git clone --branch v1.2.13 https://github.com/madler/zlib.git !BOOST_ROOT!\zlib-src --depth 1
set ZLIB_SOURCE=!BOOST_ROOT!\zlib-src

echo '==================================> COMPILE'

REM set B2_TARGETS=libs/!SELF!/test libs/!SELF!/example
set B2_TARGETS=libs/!SELF!/test
call !BOOST_ROOT!\libs\!SELF!\ci\build.bat

)
Comment on lines +1 to +47
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Unix line endings (LF) in a .bat file will cause parsing failures on Windows.

The Windows batch parser has known issues with LF-only line endings, including label parsing failures at 512-byte boundaries. This file must use CRLF line endings. Consider adding a .gitattributes entry:

.drone/*.bat text eol=crlf
🧰 Tools
🪛 Blinter (1.0.112)

[error] 1-1: Unix line endings detected. Explanation: Batch file uses Unix line endings (LF-only) which can cause GOTO/CALL label parsing failures and script malfunction due to Windows batch parser 512-byte boundary bugs. Recommendation: Convert file to Windows line endings (CRLF). Use tools like dos2unix, notepad++, or configure git with 'git config core.autocrlf true'. Context: File uses Unix line endings (LF-only) - 47 LF sequences found

(E018)


[error] 10-10: Unsafe SET command usage. Explanation: SET commands without proper validation or quoting can cause security issues. Recommendation: Always quote SET values and validate input: SET "var=safe value". Context: SET command value should be quoted for safety

(SEC002)

🤖 Prompt for AI Agents
In @.drone/drone.bat around lines 1 - 47, The .drone/drone.bat file must use
CRLF line endings to avoid Windows batch parser failures; convert
.drone/drone.bat to CRLF line endings (ensure the file in the repo is saved with
CRLF) and add a .gitattributes entry to force CRLF for .bat files (e.g., add a
line targeting .drone/*.bat such as " .drone/*.bat text eol=crlf" in
.gitattributes) so future commits preserve CRLF; ensure you commit the updated
.drone/drone.bat and .gitattributes so CI on Windows parses labels and commands
like the IF/SET/CALL blocks correctly.

150 changes: 150 additions & 0 deletions .drone/drone.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
#!/bin/bash

# Copyright 2020 Rene Rivera, Sam Darwin
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE.txt or copy at http://boost.org/LICENSE_1_0.txt)

set -xe

export DRONE_BUILD_DIR=$(pwd)
export VCS_COMMIT_ID=$DRONE_COMMIT
export GIT_COMMIT=$DRONE_COMMIT
export REPO_NAME=$DRONE_REPO
export USER=$(whoami)
export CC=${CC:-gcc}
export PATH=~/.local/bin:/usr/local/bin:$PATH
export TRAVIS_BUILD_DIR=$(pwd)
export TRAVIS_BRANCH=$DRONE_BRANCH
export TRAVIS_EVENT_TYPE=$DRONE_BUILD_EVENT

common_install () {
if [ -z "$SELF" ]; then
export SELF=`basename $REPO_NAME`
fi

git clone https://github.com/boostorg/boost-ci.git boost-ci-cloned --depth 1
[ "$SELF" == "boost-ci" ] || cp -prf boost-ci-cloned/ci .
rm -rf boost-ci-cloned

if [ "$TRAVIS_OS_NAME" == "osx" ]; then
unset -f cd
fi

export BOOST_CI_TARGET_BRANCH="$TRAVIS_BRANCH"
export BOOST_CI_SRC_FOLDER=$(pwd)

. ./ci/common_install.sh
}

if [[ $(uname) == "Linux" && "$B2_ASAN" == "1" ]]; then
echo 0 | sudo tee /proc/sys/kernel/randomize_va_space > /dev/null
fi

if [ "$DRONE_JOB_BUILDTYPE" == "boost" ]; then

echo '==================================> INSTALL'

common_install

echo '==================================> SCRIPT'

. $BOOST_ROOT/libs/$SELF/ci/build.sh

elif [ "$DRONE_JOB_BUILDTYPE" == "codecov" ]; then

echo '==================================> INSTALL'

common_install

echo '==================================> SCRIPT'

cd $BOOST_ROOT/libs/$SELF
ci/travis/codecov.sh

elif [ "$DRONE_JOB_BUILDTYPE" == "valgrind" ]; then

echo '==================================> INSTALL'

common_install

echo '==================================> SCRIPT'

cd $BOOST_ROOT/libs/$SELF
ci/travis/valgrind.sh

elif [ "$DRONE_JOB_BUILDTYPE" == "coverity" ]; then

echo '==================================> INSTALL'

common_install

echo '==================================> SCRIPT'

if [ -n "${COVERITY_SCAN_NOTIFICATION_EMAIL}" -a \( "$TRAVIS_BRANCH" = "develop" -o "$TRAVIS_BRANCH" = "master" \) -a \( "$DRONE_BUILD_EVENT" = "push" -o "$DRONE_BUILD_EVENT" = "cron" \) ] ; then
cd $BOOST_ROOT/libs/$SELF
ci/travis/coverity.sh
fi

elif [ "$DRONE_JOB_BUILDTYPE" == "cmake1" ]; then

set -xe

echo '==================================> INSTALL'

# already in the image
# pip install --user cmake

echo '==================================> SCRIPT'

export SELF=`basename $REPO_NAME`
BOOST_BRANCH=develop && [ "$DRONE_BRANCH" == "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

mkdir -p libs/$SELF
cp -r $DRONE_BUILD_DIR/* libs/$SELF
# git submodule update --init tools/boostdep
git submodule update --init --recursive

cd libs/$SELF
mkdir __build__ && cd __build__
cmake -DCMAKE_INSTALL_PREFIX=~/.local ..
cmake --build . --target install

elif [ "$DRONE_JOB_BUILDTYPE" == "cmake-superproject" ]; then

echo '==================================> INSTALL'

common_install

echo '==================================> COMPILE'

# Warnings as errors -Werror not building. Remove for now:
# export CXXFLAGS="-Wall -Wextra -Werror"
export CXXFLAGS="-Wall -Wextra"
export CMAKE_OPTIONS=${CMAKE_OPTIONS:--DBUILD_TESTING=ON}
export CMAKE_SHARED_LIBS=${CMAKE_SHARED_LIBS:-1}

mkdir __build_static
cd __build_static
cmake -DBOOST_ENABLE_CMAKE=1 -DBoost_VERBOSE=1 ${CMAKE_OPTIONS} \
-DBOOST_INCLUDE_LIBRARIES=$SELF ..
cmake --build .
ctest --output-on-failure -R boost_$SELF

cd ..

if [ "$CMAKE_SHARED_LIBS" = 1 ]; then

mkdir __build_shared
cd __build_shared
cmake -DBOOST_ENABLE_CMAKE=1 -DBoost_VERBOSE=1 ${CMAKE_OPTIONS} \
-DBOOST_INCLUDE_LIBRARIES=$SELF -DBUILD_SHARED_LIBS=ON ..
cmake --build .
ctest --output-on-failure -R boost_$SELF

fi

fi
28 changes: 15 additions & 13 deletions doc/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
* xref:index.adoc[Introduction]
* xref:why-capy.adoc[Why Capy?]
* xref:why-not-cobalt.adoc[Why Not Cobalt?]
* xref:why-not-cobalt-2.adoc[Why Not Cobalt Concepts?]
* xref:why-not-tmc.adoc[Why Not TooManyCooks?]
* xref:quick-start.adoc[Quick Start]
* xref:2.cpp20-coroutines/2.intro.adoc[Introduction To {cpp}20 Coroutines]
** xref:2.cpp20-coroutines/2a.foundations.adoc[Part I: Foundations]
Expand Down Expand Up @@ -48,14 +45,19 @@
** xref:7.examples/7i.echo-server-corosio.adoc[Echo Server with Corosio]
** xref:7.examples/7j.stream-pipeline.adoc[Stream Pipeline]
* xref:8.design/8.intro.adoc[Design]
** xref:8.design/8a.ReadStream.adoc[ReadStream]
** xref:8.design/8b.ReadSource.adoc[ReadSource]
** xref:8.design/8c.BufferSource.adoc[BufferSource]
** xref:8.design/8d.WriteStream.adoc[WriteStream]
** xref:8.design/8e.WriteSink.adoc[WriteSink]
** xref:8.design/8f.BufferSink.adoc[BufferSink]
** xref:8.design/8g.RunApi.adoc[Run API]
** xref:8.design/8h.TypeEraseAwaitable.adoc[Type-Erasing Awaitables]
** xref:8.design/8i.any_buffer_sink.adoc[AnyBufferSink]
** xref:8.design/8j.Executor.adoc[Executor]
** xref:8.design/8a.CapyLayering.adoc[Layered Abstractions]
** xref:8.design/8b.Separation.adoc[Why Capy Is Separate]
** xref:8.design/8c.ReadStream.adoc[ReadStream]
** xref:8.design/8d.ReadSource.adoc[ReadSource]
** xref:8.design/8e.BufferSource.adoc[BufferSource]
** xref:8.design/8f.WriteStream.adoc[WriteStream]
** xref:8.design/8g.WriteSink.adoc[WriteSink]
** xref:8.design/8h.BufferSink.adoc[BufferSink]
** xref:8.design/8i.TypeEraseAwaitable.adoc[Type-Erasing Awaitables]
** xref:8.design/8j.any_buffer_sink.adoc[AnyBufferSink]
** xref:8.design/8k.Executor.adoc[Executor]
** xref:8.design/8l.RunApi.adoc[Run API]
** xref:8.design/8m.WhyNotCobalt.adoc[Why Not Cobalt?]
** xref:8.design/8n.WhyNotCobaltConcepts.adoc[Why Not Cobalt Concepts?]
** xref:8.design/8o.WhyNotTMC.adoc[Why Not TooManyCooks?]
* xref:reference:boost/capy.adoc[Reference]
Loading
Loading