Skip to content

Conversation

@Bill-hbrhbr
Copy link
Contributor

@Bill-hbrhbr Bill-hbrhbr commented Feb 6, 2026

Description

This PR rewrites the Boost generate and install tasks to use the literal block scalar |- instead of the previously used folded block scalar >-. Combined with explicit use of the line continuation character \ and the command separator ;, the literal block scalar preserves line breaks and spacing exactly as written, which avoids unintended loss of line breaks or whitespace. This ensures shell commands are written and interpreted more consistently within Taskfiles.

Folded block scalars used inside other exported Taskfiles should also be replaced in future PRs to ensure consistency.

Checklist

  • The PR satisfies the contribution guidelines.
  • This is a breaking change and that has been indicated in the PR title, OR this isn't a
    breaking change.
  • Necessary docs have been updated, OR no docs need to be updated.

Validation performed

  • Works with clp and clp-ffi-js.

Summary by CodeRabbit

  • Refactor
    • Streamlined the Boost build and generate tasks to run within explicit task directories, removing redundant directory switching.
    • Standardized multi-step command formatting and continuation handling for clearer execution flow.
    • Added an explicit working-directory configuration for the install step to improve clarity and reliability.

(Word count: 56 words - Minimal user-facing impact.)

@Bill-hbrhbr Bill-hbrhbr requested a review from a team as a code owner February 6, 2026 19:58
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 6, 2026

Walkthrough

Updated the Boost taskfile to switch command blocks from folded to literal style, remove explicit pushd/popd directory changes by declaring a working-directory context, adjust multi-line bootstrap/b2 argument formatting, and add a dir entry under the build-and-install task requirements.

Changes

Cohort / File(s) Summary
Boost Build Task Configuration
exports/taskfiles/utils/boost.yaml
Rewrote command blocks from folded to literal style; replaced pushd/popd directory switching by adding dir: "{{.GENERATE_DIR}}" to the build-and-install task requires section and running commands in that context; reformatted bootstrap and b2 install multi-line arguments (backslash continuations) and conditional -j{{.JOBS}} handling.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'fix(boost): Fix Boost task argument expansions.' directly relates to the main change: reformatting command blocks and removing unnecessary quoting around option flags to fix shell parsing issues, plus simplifying directory handling via the dir attribute.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@exports/taskfiles/utils/boost.yaml`:
- Around line 77-90: The Taskfile task uses dir: "{{.GENERATE_DIR}}" which makes
all commands run relative to GENERATE_DIR, so update the task's `@param`
documentation to explicitly require absolute paths for GENERATE_DIR, BUILD_DIR
and CMAKE_SETTINGS_DIR (or state that callers must pass absolute paths or they
will be resolved relative to GENERATE_DIR); mention that dir applies to all
commands (including the CMake echo) and optionally suggest callers convert
relative inputs to absolute before invoking the task so there is no silent path
resolution.

Comment on lines 77 to 90
requires:
vars: ["GENERATE_DIR", "BUILD_DIR", "INSTALL_PREFIX"]
dir: "{{.GENERATE_DIR}}"
cmds:
- >-
pushd "{{.GENERATE_DIR}}";
./b2
install
--build-dir="{{.BUILD_DIR}}"
{{- range .EXTRA_ARGS}}
"{{.}}"
{{.}}
{{- end}}
{{- if .JOBS}}
"-j{{.JOBS}}"
{{- end}};
popd;
-j{{.JOBS}}
{{- end}}
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Good use of dir to replace pushd/popd; note the implicit absolute-path contract.

Using dir: "{{.GENERATE_DIR}}" is cleaner and idiomatic for Taskfile. However, because dir applies to all commands in this task (including the CMake echo on line 97), every path variable used here (BUILD_DIR, CMAKE_SETTINGS_DIR) must be absolute. The current defaults derived from WORK_DIR / ROOT_DIR satisfy this, but callers providing custom relative paths would silently resolve against GENERATE_DIR. Consider documenting in the @param block that these paths are expected to be absolute.

📝 Suggested doc tweak
-  # `@param` {string} BUILD_DIR Directory in which to build boost.
+  # `@param` {string} BUILD_DIR Absolute directory in which to build boost.
   # `@param` {string} INSTALL_PREFIX Path prefix of where the project should be installed.
   # `@param` {string[]} [EXTRA_ARGS] Any additional arguments to pass to the build command.
   ...
-  # `@param` {string} [CMAKE_SETTINGS_DIR] If set, the directory where the project's CMake settings
+  # `@param` {string} [CMAKE_SETTINGS_DIR] If set, the absolute directory where the project's CMake settings
🤖 Prompt for AI Agents
In `@exports/taskfiles/utils/boost.yaml` around lines 77 - 90, The Taskfile task
uses dir: "{{.GENERATE_DIR}}" which makes all commands run relative to
GENERATE_DIR, so update the task's `@param` documentation to explicitly require
absolute paths for GENERATE_DIR, BUILD_DIR and CMAKE_SETTINGS_DIR (or state that
callers must pass absolute paths or they will be resolved relative to
GENERATE_DIR); mention that dir applies to all commands (including the CMake
echo) and optionally suggest callers convert relative inputs to absolute before
invoking the task so there is no silent path resolution.

Copy link
Member

@junhaoliao junhaoliao left a comment

Choose a reason for hiding this comment

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

lgtm! left a question

for the title, how about:

fix(boost): Fix Boost task argument expansion.

--with-libraries={{(join "," .TARGETS)}}
{{- range .EXTRA_ARGS}}
"{{.}}"
{{.}}
Copy link
Member

Choose a reason for hiding this comment

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

if removing "" around the expansion can fix the issue, do we still need to remove the "extra" indent?

Copy link
Member

Choose a reason for hiding this comment

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

see https://github.com/y-scope/yscope-dev-utils/pull/103/changes#r2777307786

i believe we should just remove the indents. the quotes should be kept

Suggested change
{{.}}
"{{.}}"

--build-dir="{{.BUILD_DIR}}"
{{- range .EXTRA_ARGS}}
"{{.}}"
{{.}}
Copy link
Member

Choose a reason for hiding this comment

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

in fact, if we keep the indent, i don't think simply removing the quotes is a good idea, like if i use

      - >-
        ./b2
        install
        --build-dir="{{.BUILD_DIR}}"
        {{- range .EXTRA_ARGS}}
          {{.}}
        {{- end}}
        {{- if .JOBS}}
          -j{{.JOBS}}
        {{- end}};

with this task:

  download-boost:
    internal: true
    vars:
      BOOST_VERSION: "1.88.0"
      B2_USER_CONFIG_FILE: "{{.G_DEPS_DIR}}/b2-user-config.jam"
    run: "once"
    deps:
      - ":emsdk"
    cmds:
      - >-
        echo 'using emscripten : : "{{.G_EMSDK_DIR}}/upstream/emscripten/emcc" ;'
        > "{{.B2_USER_CONFIG_FILE}}"
      - task: ":utils:boost:download-and-install"
        vars:
          CMAKE_SETTINGS_DIR: "{{.G_DEPS_CMAKE_SETTINGS_DIR}}"
          FILE_SHA256: "85138e4a185a7e7535e82b011179c5b5fb72185bea9f59fe8e2d76939b2f5c51"
          URL: "https://github.com/boostorg/boost/releases/download/boost-{{.BOOST_VERSION}}\
            /boost-{{.BOOST_VERSION}}-b2-nodocs.tar.gz"
          WORK_DIR: "{{.G_DEPS_DIR}}"
          TARGETS: [
            "headers",
            "exception",
          ]
          BUILD_AND_INSTALL_ARGS:
            - "toolset=emscripten"
            - "--user-config={{.B2_USER_CONFIG_FILE}}"

i get

task: [utils:boost:build-and-install] ./b2 install --build-dir="/home/junhao/workspace/clp-ffi-js/build/deps/boost-build"                           
  toolset=emscripten                                                                                                                                
  --user-config=/home/junhao/workspace/clp-ffi-js/build/deps/b2-user-config.jam;

...

stat /home/junhao/workspace/clp-ffi-js/build/deps/boost-generate/--user-config=/home/junhao/workspace/clp-ffi-js/build/deps/b2-user-config.jam: no such file or directory

so i think the quotes are not an issue. the extra indent is.

we should just remove the indent then?

Suggested change
{{.}}
"{{.}}"

"-j{{.JOBS}}"
{{- end}};
popd;
-j{{.JOBS}}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
-j{{.JOBS}}
"-j{{.JOBS}}"

--with-libraries={{(join "," .TARGETS)}}
{{- range .EXTRA_ARGS}}
"{{.}}"
{{.}}
Copy link
Member

Choose a reason for hiding this comment

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

see https://github.com/y-scope/yscope-dev-utils/pull/103/changes#r2777307786

i believe we should just remove the indents. the quotes should be kept

Suggested change
{{.}}
"{{.}}"

@Bill-hbrhbr Bill-hbrhbr changed the title fix(boost): Remove quotes around option flags to fix shell parsing issues. fix(boost): Use literal block scalar to ensure consistent shell line breaks and whitespace folding. Feb 7, 2026
Copy link
Member

@junhaoliao junhaoliao left a comment

Choose a reason for hiding this comment

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

the code looks cleaner than the attempt to remove the indent, and it works perfectly with the changes in y-scope/clp-ffi-js#113

Before merging, as @Bill-hbrhbr suggested, let's wait for the approval from @davidlion

@Bill-hbrhbr Bill-hbrhbr changed the title fix(boost): Use literal block scalar to ensure consistent shell line breaks and whitespace folding. fix(boost): Fix Boost task argument expansions. Feb 9, 2026
Copy link
Member

@davidlion davidlion left a comment

Choose a reason for hiding this comment

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

lgtm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 9, 2026

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

@davidlion: I'll create an issue to track the unification of job/parallelism parameters across build systems.


🏁 Script executed:

#!/bin/bash

# Create GitHub issue for unifying build system parallelism parameters
gh issue create \
  --repo y-scope/yscope-dev-utils \
  --title "Unify job/parallelism parameter across build systems (cmake, b2)" \
  --body "## Description

This issue tracks the need to unify the job/parallelism parameter handling across different build systems used in the repository, specifically cmake and b2.

## Requirements

- Standardize the parameter name and usage for specifying build parallelism across cmake and b2
- Ensure these parameters can be overridden via CLI definition
- Consider consistency with other build system integrations in the future

## Context

This issue was identified during the review of PR `#103` by `@davidlion`.

**Backlinks:**
- PR: https://github.com/y-scope/yscope-dev-utils/pull/103" \
  --assignee davidlion

echo "Issue created successfully"

Length of output: 81


@davidlion: I've created issue #104 to track the unification of job/parallelism parameters across build systems (cmake and b2) with CLI override support.

🔗 #104

The issue has been assigned to you and includes a backlink to this PR.


🧠 Learnings used
Learnt from: Bill-hbrhbr
Repo: y-scope/yscope-dev-utils PR: 91
File: exports/taskfiles/utils/misc.yaml:70-90
Timestamp: 2025-10-13T19:09:44.404Z
Learning: In the yscope-dev-utils repository Taskfiles, prefer minimal guardrails that only protect against benevolent mistakes (e.g., enforcing absolute paths where required) rather than defensive checks like rejecting root paths, empty paths, or validating file vs directory types.

Learnt from: AVMatthews
Repo: y-scope/yscope-dev-utils PR: 13
File: taskfiles/utils.yml:0-0
Timestamp: 2024-10-30T22:08:49.844Z
Learning: In `taskfiles/utils.yml`, when using `xargs`, we are removing the `-r` flag entirely without replacing it with `--no-run-if-empty`.

@Bill-hbrhbr
Copy link
Contributor Author

@coderabbitai Why are the unit tests not running

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 9, 2026

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash

# Check the PR status and CI checks
echo "=== PR Status and Checks ==="
gh pr view 103 --repo y-scope/yscope-dev-utils --json statusCheckRollup,state,checks | jq '.'

echo -e "\n=== Workflow Runs for this PR ==="
gh run list --repo y-scope/yscope-dev-utils --branch fix-boost-option-quotes --limit 10

echo -e "\n=== Recent workflow runs (all branches for context) ==="
gh run list --repo y-scope/yscope-dev-utils --limit 15

echo -e "\n=== Check for workflow files ==="
fd -t f -e yml -e yaml . .github/workflows

echo -e "\n=== List workflow files content ==="
if [ -d .github/workflows ]; then
  ls -la .github/workflows/
fi

Length of output: 4125


🏁 Script executed:

#!/bin/bash

echo "=== pr-title-checks.yaml ==="
cat .github/workflows/pr-title-checks.yaml

echo -e "\n=== unit-tests.yaml ==="
cat .github/workflows/unit-tests.yaml

echo -e "\n=== code-linting-checks.yaml ==="
cat .github/workflows/code-linting-checks.yaml

Length of output: 2908


🏁 Script executed:

#!/bin/bash

echo "=== Files changed in PR `#103` ==="
gh pr view 103 --repo y-scope/yscope-dev-utils --json files | jq -r '.files[] | .path'

echo -e "\n=== PR details ==="
gh pr view 103 --repo y-scope/yscope-dev-utils --json statusCheckRollup,isDraft,state | jq '.'

echo -e "\n=== Check if workflows exist on the PR branch ==="
git fetch origin fix-boost-option-quotes 2>/dev/null
git show origin/fix-boost-option-quotes:.github/workflows/unit-tests.yaml > /dev/null 2>&1 && echo "unit-tests.yaml exists on PR branch" || echo "unit-tests.yaml NOT found on PR branch"
git show origin/fix-boost-option-quotes:.github/workflows/code-linting-checks.yaml > /dev/null 2>&1 && echo "code-linting-checks.yaml exists on PR branch" || echo "code-linting-checks.yaml NOT found on PR branch"

Length of output: 1984


🏁 Script executed:

#!/bin/bash

echo "=== When were the workflow files added to main? ==="
for workflow in unit-tests.yaml code-linting-checks.yaml pr-title-checks.yaml; do
  echo -e "\n--- $workflow ---"
  git log --follow --diff-filter=A --pretty=format:"%H %ai %s" -- .github/workflows/$workflow | head -1
done

echo -e "\n\n=== When was the PR branch created? ==="
gh pr view 103 --repo y-scope/yscope-dev-utils --json createdAt | jq -r '.createdAt'

echo -e "\n=== Base commit of PR branch ==="
git merge-base origin/main origin/fix-boost-option-quotes

echo -e "\n=== Check if workflows exist at the merge-base ==="
merge_base=$(git merge-base origin/main origin/fix-boost-option-quotes)
echo "Merge base: $merge_base"
for workflow in unit-tests.yaml code-linting-checks.yaml; do
  git show $merge_base:.github/workflows/$workflow > /dev/null 2>&1 && echo "$workflow exists at merge-base" || echo "$workflow NOT at merge-base"
done

Length of output: 992


@Bill-hbrhbr: The unit tests aren't running because the workflow files don't exist on your PR branch fix-boost-option-quotes.

Here's what's happening:

Why pr-title-checks runs but others don't:

  • pr-title-checks uses the pull_request_target trigger, which reads workflow files from the base branch (main) for security reasons
  • unit-tests and code-linting-checks use the pull_request trigger, which reads workflow files from the PR branch (your branch)

The root cause:
The workflow files (unit-tests.yaml and code-linting-checks.yaml) were added to main in May 2025, but they don't exist on your fix-boost-option-quotes branch. This suggests your branch was created from an older commit or hasn't been synced with main recently.

Solution:
Update your PR branch with the latest changes from main:

# Option 1: Merge main into your branch
git checkout fix-boost-option-quotes
git merge origin/main
git push

# Option 2: Rebase your branch on main (cleaner history)
git checkout fix-boost-option-quotes
git rebase origin/main
git push --force-with-lease

After updating your branch, the workflow files will be present and both unit-tests and code-linting-checks will run automatically on your PR. The code-linting-checks should especially run since your PR modifies a .yaml file, which matches its path filters.


🧠 Learnings used
Learnt from: Bill-hbrhbr
Repo: y-scope/yscope-dev-utils PR: 91
File: exports/taskfiles/utils/misc.yaml:70-90
Timestamp: 2025-10-13T19:09:44.404Z
Learning: In the yscope-dev-utils repository Taskfiles, prefer minimal guardrails that only protect against benevolent mistakes (e.g., enforcing absolute paths where required) rather than defensive checks like rejecting root paths, empty paths, or validating file vs directory types.

Learnt from: AVMatthews
Repo: y-scope/yscope-dev-utils PR: 13
File: taskfiles/utils.yml:0-0
Timestamp: 2024-10-30T22:08:49.844Z
Learning: In `taskfiles/utils.yml`, when using `xargs`, we are removing the `-r` flag entirely without replacing it with `--no-run-if-empty`.

@Bill-hbrhbr
Copy link
Contributor Author

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain
🏁 Script executed:

#!/bin/bash

# Check the PR status and CI checks
echo "=== PR Status and Checks ==="
gh pr view 103 --repo y-scope/yscope-dev-utils --json statusCheckRollup,state,checks | jq '.'

echo -e "\n=== Workflow Runs for this PR ==="
gh run list --repo y-scope/yscope-dev-utils --branch fix-boost-option-quotes --limit 10

echo -e "\n=== Recent workflow runs (all branches for context) ==="
gh run list --repo y-scope/yscope-dev-utils --limit 15

echo -e "\n=== Check for workflow files ==="
fd -t f -e yml -e yaml . .github/workflows

echo -e "\n=== List workflow files content ==="
if [ -d .github/workflows ]; then
  ls -la .github/workflows/
fi

Length of output: 4125

🏁 Script executed:

#!/bin/bash

echo "=== pr-title-checks.yaml ==="
cat .github/workflows/pr-title-checks.yaml

echo -e "\n=== unit-tests.yaml ==="
cat .github/workflows/unit-tests.yaml

echo -e "\n=== code-linting-checks.yaml ==="
cat .github/workflows/code-linting-checks.yaml

Length of output: 2908

🏁 Script executed:

#!/bin/bash

echo "=== Files changed in PR `#103` ==="
gh pr view 103 --repo y-scope/yscope-dev-utils --json files | jq -r '.files[] | .path'

echo -e "\n=== PR details ==="
gh pr view 103 --repo y-scope/yscope-dev-utils --json statusCheckRollup,isDraft,state | jq '.'

echo -e "\n=== Check if workflows exist on the PR branch ==="
git fetch origin fix-boost-option-quotes 2>/dev/null
git show origin/fix-boost-option-quotes:.github/workflows/unit-tests.yaml > /dev/null 2>&1 && echo "unit-tests.yaml exists on PR branch" || echo "unit-tests.yaml NOT found on PR branch"
git show origin/fix-boost-option-quotes:.github/workflows/code-linting-checks.yaml > /dev/null 2>&1 && echo "code-linting-checks.yaml exists on PR branch" || echo "code-linting-checks.yaml NOT found on PR branch"

Length of output: 1984

🏁 Script executed:

#!/bin/bash

echo "=== When were the workflow files added to main? ==="
for workflow in unit-tests.yaml code-linting-checks.yaml pr-title-checks.yaml; do
  echo -e "\n--- $workflow ---"
  git log --follow --diff-filter=A --pretty=format:"%H %ai %s" -- .github/workflows/$workflow | head -1
done

echo -e "\n\n=== When was the PR branch created? ==="
gh pr view 103 --repo y-scope/yscope-dev-utils --json createdAt | jq -r '.createdAt'

echo -e "\n=== Base commit of PR branch ==="
git merge-base origin/main origin/fix-boost-option-quotes

echo -e "\n=== Check if workflows exist at the merge-base ==="
merge_base=$(git merge-base origin/main origin/fix-boost-option-quotes)
echo "Merge base: $merge_base"
for workflow in unit-tests.yaml code-linting-checks.yaml; do
  git show $merge_base:.github/workflows/$workflow > /dev/null 2>&1 && echo "$workflow exists at merge-base" || echo "$workflow NOT at merge-base"
done

Length of output: 992

@Bill-hbrhbr: The unit tests aren't running because the workflow files don't exist on your PR branch fix-boost-option-quotes.

Here's what's happening:

Why pr-title-checks runs but others don't:

  • pr-title-checks uses the pull_request_target trigger, which reads workflow files from the base branch (main) for security reasons
  • unit-tests and code-linting-checks use the pull_request trigger, which reads workflow files from the PR branch (your branch)

The root cause: The workflow files (unit-tests.yaml and code-linting-checks.yaml) were added to main in May 2025, but they don't exist on your fix-boost-option-quotes branch. This suggests your branch was created from an older commit or hasn't been synced with main recently.

Solution: Update your PR branch with the latest changes from main:

# Option 1: Merge main into your branch
git checkout fix-boost-option-quotes
git merge origin/main
git push

# Option 2: Rebase your branch on main (cleaner history)
git checkout fix-boost-option-quotes
git rebase origin/main
git push --force-with-lease

After updating your branch, the workflow files will be present and both unit-tests and code-linting-checks will run automatically on your PR. The code-linting-checks should especially run since your PR modifies a .yaml file, which matches its path filters.

🧠 Learnings used

They exist. It's just it's been some time since I've ran these workflows on my fork, they went dormant.

@junhaoliao junhaoliao marked this pull request as draft February 9, 2026 18:50
@junhaoliao junhaoliao marked this pull request as ready for review February 9, 2026 18:50
@junhaoliao
Copy link
Member

closing and will be re-opening to trigger the stale unit-tests workflow

@junhaoliao junhaoliao closed this Feb 10, 2026
@junhaoliao junhaoliao reopened this Feb 10, 2026
@Bill-hbrhbr Bill-hbrhbr merged commit e2a1aed into y-scope:main Feb 10, 2026
7 checks passed
@Bill-hbrhbr Bill-hbrhbr deleted the fix-boost-option-quotes branch February 10, 2026 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants