From b8491ae81a2e2efad350b0b32c8c7d6cb802b1ed Mon Sep 17 00:00:00 2001 From: davidlion <6627627+davidlion@users.noreply.github.com> Date: Tue, 30 Jun 2026 17:55:59 -0400 Subject: [PATCH 1/5] fix(taskfiles): Always default to a special JOBS variable that can be set by a user for concurrency related variables; Tasks that use the concurrency value default to nprocs. --- exports/taskfiles/utils/boost.yaml | 19 +++++++++---------- exports/taskfiles/utils/cmake.yaml | 17 +++++++++-------- exports/taskfiles/utils/misc.yaml | 4 ++++ 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/exports/taskfiles/utils/boost.yaml b/exports/taskfiles/utils/boost.yaml index d286a3d..1ab17ae 100644 --- a/exports/taskfiles/utils/boost.yaml +++ b/exports/taskfiles/utils/boost.yaml @@ -2,11 +2,16 @@ version: "3" includes: checksum: "checksum.yaml" + misc: "misc.yaml" remote: "remote.yaml" set: ["u", "pipefail"] shopt: ["globstar"] +# `JOBS` is a special variable name and is used for concurrency related variables to allow users to +# override all concurrency when invoking task. Callers using these tasks should default to `JOBS` to +# propagate any user set value. + tasks: # Generates `GENERATE_DIR` by copying `SOURCE_DIR` and then running boost's bootstrap step. # @@ -61,9 +66,8 @@ tasks: # @param {string} BUILD_DIR 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 {int} [JOBS] The maximum number of concurrent processes to use when building. If - # omitted, the b2 default number is used. Before 1.76.0, the number was 1. Since 1.76.0, the - # default is the number of cores. + # @param {int} [JOBS=G_NPROCS] The maximum number of concurrent processes to use when building. If + # omitted, the number of cores is used. # @param {string} [CMAKE_SETTINGS_DIR] If set, the directory where the project's CMake settings # file should be stored. build-and-install: @@ -71,8 +75,7 @@ tasks: vars: EXTRA_ARGS: ref: "default (list) .EXTRA_ARGS" - JOBS: >- - {{default "" .JOBS}} + JOBS: "{{default .G_NPROCS .JOBS}}" requires: vars: ["GENERATE_DIR", "BUILD_DIR", "INSTALL_PREFIX"] cmds: @@ -121,9 +124,7 @@ tasks: # # Boost build-and-install parameters # @param {string} [BUILD_DIR={{.WORK_DIR}}/boost-build] Directory in which to build the project. - # @param {int} [JOBS] The maximum number of concurrent processes to use when building. If - # omitted, the b2 default number is used. Before 1.76.0, the number was 1. Since 1.76.0, the - # default is the number of cores. + # @param {int} [JOBS] The maximum number of concurrent processes to use when building. # @param {string[]} [BUILD_AND_INSTALL_ARGS] Any additional arguments to pass to boost's build # and install command. # @param {string} [CMAKE_SETTINGS_DIR] If set, the directory where the project's CMake settings @@ -155,8 +156,6 @@ tasks: {{default (printf "%s/boost-build" .WORK_DIR) .BUILD_DIR}} BUILD_AND_INSTALL_ARGS: ref: "default (list) .BUILD_AND_INSTALL_ARGS" - JOBS: >- - {{default "" .JOBS}} CMAKE_SETTINGS_DIR: >- {{default "" .CMAKE_SETTINGS_DIR}} requires: diff --git a/exports/taskfiles/utils/cmake.yaml b/exports/taskfiles/utils/cmake.yaml index f14699c..bb4027f 100644 --- a/exports/taskfiles/utils/cmake.yaml +++ b/exports/taskfiles/utils/cmake.yaml @@ -7,6 +7,10 @@ includes: set: ["u", "pipefail"] shopt: ["globstar"] +# `JOBS` is a special variable name and is used for concurrency related variables to allow users to +# override all concurrency when invoking task. Callers using these tasks should default to `JOBS` to +# propagate any user set value. + tasks: # Runs the CMake build step for the given build directory. The caller must have previously called # `generate` on `BUILD_DIR` for this task to succeed. We purposely omit `sources` and `generates` @@ -14,8 +18,8 @@ tasks: # # @param {string} BUILD_DIR Directory containing the generated build system to use. # @param {string[]} [EXTRA_ARGS] Any additional arguments to pass to the build command. - # @param {int} [JOBS] The maximum number of concurrent processes to use when building. If - # omitted, the native build tool's default number is used. See `man cmake`. + # @param {int} [JOBS=G_NPROCS] The maximum number of concurrent processes to use when building. If + # omitted, the number of cores is used. # @param {string[]} [TARGETS] A list of specific targets to build instead of the default target. build: internal: true @@ -23,8 +27,7 @@ tasks: vars: EXTRA_ARGS: ref: "default (list) .EXTRA_ARGS" - JOBS: >- - {{default "" .JOBS}} + JOBS: "{{default .G_NPROCS .JOBS}}" TARGETS: ref: "default (list) .TARGETS" requires: @@ -153,8 +156,7 @@ tasks: # command. # @param {string[]} [CMAKE_INSTALL_ARGS] Any additional arguments to pass to the CMake install # command. - # @param {int} [CMAKE_JOBS] The maximum number of concurrent processes to use when building. If - # omitted, the native build tool's default number is used. See `man cmake`. + # @param {int} [CMAKE_JOBS] The maximum number of concurrent processes to use when building. # @param {string} [CMAKE_SETTINGS_DIR] The directory where the project's CMake settings file # should be stored. # @param {string} [CMAKE_SOURCE_DIR=.] The path, within the extraction directory, containing the @@ -172,8 +174,7 @@ tasks: ref: "default (list) .CMAKE_GEN_ARGS" CMAKE_INSTALL_ARGS: ref: "default (list) .CMAKE_INSTALL_ARGS" - CMAKE_JOBS: >- - {{default "" .CMAKE_JOBS}} + CMAKE_JOBS: "{{default .JOBS .CMAKE_JOBS}}" CMAKE_SETTINGS_DIR: >- {{default "" .CMAKE_SETTINGS_DIR}} CMAKE_SOURCE_DIR: >- diff --git a/exports/taskfiles/utils/misc.yaml b/exports/taskfiles/utils/misc.yaml index 5bd3801..33c1999 100644 --- a/exports/taskfiles/utils/misc.yaml +++ b/exports/taskfiles/utils/misc.yaml @@ -3,6 +3,10 @@ version: "3" set: ["u", "pipefail"] shopt: ["globstar"] +vars: + G_NPROCS: + sh: "getconf _NPROCESSORS_ONLN" + tasks: replace-text: desc: "Replaces some text in a file using sed." From 8166db9bd562dcd1564122e6778fb505ee11e237 Mon Sep 17 00:00:00 2001 From: davidlion <6627627+davidlion@users.noreply.github.com> Date: Wed, 8 Jul 2026 19:50:37 -0400 Subject: [PATCH 2/5] swap to TASK_JOBS env var --- exports/taskfiles/utils/boost.yaml | 10 +++------- exports/taskfiles/utils/cmake.yaml | 11 +++-------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/exports/taskfiles/utils/boost.yaml b/exports/taskfiles/utils/boost.yaml index 1ab17ae..8f1e201 100644 --- a/exports/taskfiles/utils/boost.yaml +++ b/exports/taskfiles/utils/boost.yaml @@ -8,10 +8,6 @@ includes: set: ["u", "pipefail"] shopt: ["globstar"] -# `JOBS` is a special variable name and is used for concurrency related variables to allow users to -# override all concurrency when invoking task. Callers using these tasks should default to `JOBS` to -# propagate any user set value. - tasks: # Generates `GENERATE_DIR` by copying `SOURCE_DIR` and then running boost's bootstrap step. # @@ -66,8 +62,8 @@ tasks: # @param {string} BUILD_DIR 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 {int} [JOBS=G_NPROCS] The maximum number of concurrent processes to use when building. If - # omitted, the number of cores is used. + # @param {int} [JOBS={{default .G_NPROCS (env "TASK_JOBS")}}] The maximum number of concurrent + # processes to use when building. # @param {string} [CMAKE_SETTINGS_DIR] If set, the directory where the project's CMake settings # file should be stored. build-and-install: @@ -75,7 +71,7 @@ tasks: vars: EXTRA_ARGS: ref: "default (list) .EXTRA_ARGS" - JOBS: "{{default .G_NPROCS .JOBS}}" + JOBS: '{{default (default .G_NPROCS (env "TASK_JOBS")) .JOBS}}' requires: vars: ["GENERATE_DIR", "BUILD_DIR", "INSTALL_PREFIX"] cmds: diff --git a/exports/taskfiles/utils/cmake.yaml b/exports/taskfiles/utils/cmake.yaml index bb4027f..9e10952 100644 --- a/exports/taskfiles/utils/cmake.yaml +++ b/exports/taskfiles/utils/cmake.yaml @@ -7,10 +7,6 @@ includes: set: ["u", "pipefail"] shopt: ["globstar"] -# `JOBS` is a special variable name and is used for concurrency related variables to allow users to -# override all concurrency when invoking task. Callers using these tasks should default to `JOBS` to -# propagate any user set value. - tasks: # Runs the CMake build step for the given build directory. The caller must have previously called # `generate` on `BUILD_DIR` for this task to succeed. We purposely omit `sources` and `generates` @@ -18,8 +14,8 @@ tasks: # # @param {string} BUILD_DIR Directory containing the generated build system to use. # @param {string[]} [EXTRA_ARGS] Any additional arguments to pass to the build command. - # @param {int} [JOBS=G_NPROCS] The maximum number of concurrent processes to use when building. If - # omitted, the number of cores is used. + # @param {int} [JOBS={{default .G_NPROCS (env "TASK_JOBS")}}] The maximum number of concurrent + # processes to use when building. # @param {string[]} [TARGETS] A list of specific targets to build instead of the default target. build: internal: true @@ -27,7 +23,7 @@ tasks: vars: EXTRA_ARGS: ref: "default (list) .EXTRA_ARGS" - JOBS: "{{default .G_NPROCS .JOBS}}" + JOBS: '{{default (default .G_NPROCS (env "TASK_JOBS")) .JOBS}}' TARGETS: ref: "default (list) .TARGETS" requires: @@ -174,7 +170,6 @@ tasks: ref: "default (list) .CMAKE_GEN_ARGS" CMAKE_INSTALL_ARGS: ref: "default (list) .CMAKE_INSTALL_ARGS" - CMAKE_JOBS: "{{default .JOBS .CMAKE_JOBS}}" CMAKE_SETTINGS_DIR: >- {{default "" .CMAKE_SETTINGS_DIR}} CMAKE_SOURCE_DIR: >- From 69e32f9373b2e7f9de6f3ad1d129c784e6fec4b5 Mon Sep 17 00:00:00 2001 From: davidlion <6627627+davidlion@users.noreply.github.com> Date: Wed, 8 Jul 2026 20:14:41 -0400 Subject: [PATCH 3/5] TASK_JOBS -> TASK_EXTERNAL_TOOL_CONCURRENCY --- exports/taskfiles/utils/boost.yaml | 6 +++--- exports/taskfiles/utils/cmake.yaml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/exports/taskfiles/utils/boost.yaml b/exports/taskfiles/utils/boost.yaml index 8f1e201..2f40eb9 100644 --- a/exports/taskfiles/utils/boost.yaml +++ b/exports/taskfiles/utils/boost.yaml @@ -62,8 +62,8 @@ tasks: # @param {string} BUILD_DIR 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 {int} [JOBS={{default .G_NPROCS (env "TASK_JOBS")}}] The maximum number of concurrent - # processes to use when building. + # @param {int} [JOBS={{default .G_NPROCS (env "TASK_EXTERNAL_TOOL_CONCURRENCY")}}] The maximum + # number of concurrent processes to use when building. # @param {string} [CMAKE_SETTINGS_DIR] If set, the directory where the project's CMake settings # file should be stored. build-and-install: @@ -71,7 +71,7 @@ tasks: vars: EXTRA_ARGS: ref: "default (list) .EXTRA_ARGS" - JOBS: '{{default (default .G_NPROCS (env "TASK_JOBS")) .JOBS}}' + JOBS: '{{default (default .G_NPROCS (env "TASK_EXTERNAL_TOOL_CONCURRENCY")) .JOBS}}' requires: vars: ["GENERATE_DIR", "BUILD_DIR", "INSTALL_PREFIX"] cmds: diff --git a/exports/taskfiles/utils/cmake.yaml b/exports/taskfiles/utils/cmake.yaml index 9e10952..ae318b8 100644 --- a/exports/taskfiles/utils/cmake.yaml +++ b/exports/taskfiles/utils/cmake.yaml @@ -14,8 +14,8 @@ tasks: # # @param {string} BUILD_DIR Directory containing the generated build system to use. # @param {string[]} [EXTRA_ARGS] Any additional arguments to pass to the build command. - # @param {int} [JOBS={{default .G_NPROCS (env "TASK_JOBS")}}] The maximum number of concurrent - # processes to use when building. + # @param {int} [JOBS={{default .G_NPROCS (env "TASK_EXTERNAL_TOOL_CONCURRENCY")}}] The maximum + # number of concurrent processes to use when building. # @param {string[]} [TARGETS] A list of specific targets to build instead of the default target. build: internal: true @@ -23,7 +23,7 @@ tasks: vars: EXTRA_ARGS: ref: "default (list) .EXTRA_ARGS" - JOBS: '{{default (default .G_NPROCS (env "TASK_JOBS")) .JOBS}}' + JOBS: '{{default (default .G_NPROCS (env "TASK_EXTERNAL_TOOL_CONCURRENCY")) .JOBS}}' TARGETS: ref: "default (list) .TARGETS" requires: From 3272ac58b528525b7bf8743b1e73972018c5fbce Mon Sep 17 00:00:00 2001 From: davidlion <6627627+davidlion@users.noreply.github.com> Date: Wed, 8 Jul 2026 20:16:40 -0400 Subject: [PATCH 4/5] Reverse quote nesting for linter/style. --- exports/taskfiles/utils/boost.yaml | 2 +- exports/taskfiles/utils/cmake.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/exports/taskfiles/utils/boost.yaml b/exports/taskfiles/utils/boost.yaml index 2f40eb9..f7978e8 100644 --- a/exports/taskfiles/utils/boost.yaml +++ b/exports/taskfiles/utils/boost.yaml @@ -71,7 +71,7 @@ tasks: vars: EXTRA_ARGS: ref: "default (list) .EXTRA_ARGS" - JOBS: '{{default (default .G_NPROCS (env "TASK_EXTERNAL_TOOL_CONCURRENCY")) .JOBS}}' + JOBS: "{{default (default .G_NPROCS (env 'TASK_EXTERNAL_TOOL_CONCURRENCY')) .JOBS}}" requires: vars: ["GENERATE_DIR", "BUILD_DIR", "INSTALL_PREFIX"] cmds: diff --git a/exports/taskfiles/utils/cmake.yaml b/exports/taskfiles/utils/cmake.yaml index ae318b8..bd8b095 100644 --- a/exports/taskfiles/utils/cmake.yaml +++ b/exports/taskfiles/utils/cmake.yaml @@ -23,7 +23,7 @@ tasks: vars: EXTRA_ARGS: ref: "default (list) .EXTRA_ARGS" - JOBS: '{{default (default .G_NPROCS (env "TASK_EXTERNAL_TOOL_CONCURRENCY")) .JOBS}}' + JOBS: "{{default (default .G_NPROCS (env 'TASK_EXTERNAL_TOOL_CONCURRENCY')) .JOBS}}" TARGETS: ref: "default (list) .TARGETS" requires: From ffee50c34ef87c2fc5605686bdee8367d0e5a969 Mon Sep 17 00:00:00 2001 From: davidlion <6627627+davidlion@users.noreply.github.com> Date: Wed, 8 Jul 2026 20:20:46 -0400 Subject: [PATCH 5/5] task+yaml = hard syntax --- exports/taskfiles/utils/boost.yaml | 3 ++- exports/taskfiles/utils/cmake.yaml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/exports/taskfiles/utils/boost.yaml b/exports/taskfiles/utils/boost.yaml index f7978e8..d6b1185 100644 --- a/exports/taskfiles/utils/boost.yaml +++ b/exports/taskfiles/utils/boost.yaml @@ -71,7 +71,8 @@ tasks: vars: EXTRA_ARGS: ref: "default (list) .EXTRA_ARGS" - JOBS: "{{default (default .G_NPROCS (env 'TASK_EXTERNAL_TOOL_CONCURRENCY')) .JOBS}}" + JOBS: >- + {{default (default .G_NPROCS (env "TASK_EXTERNAL_TOOL_CONCURRENCY")) .JOBS}} requires: vars: ["GENERATE_DIR", "BUILD_DIR", "INSTALL_PREFIX"] cmds: diff --git a/exports/taskfiles/utils/cmake.yaml b/exports/taskfiles/utils/cmake.yaml index bd8b095..39525cf 100644 --- a/exports/taskfiles/utils/cmake.yaml +++ b/exports/taskfiles/utils/cmake.yaml @@ -23,7 +23,8 @@ tasks: vars: EXTRA_ARGS: ref: "default (list) .EXTRA_ARGS" - JOBS: "{{default (default .G_NPROCS (env 'TASK_EXTERNAL_TOOL_CONCURRENCY')) .JOBS}}" + JOBS: >- + {{default (default .G_NPROCS (env "TASK_EXTERNAL_TOOL_CONCURRENCY")) .JOBS}} TARGETS: ref: "default (list) .TARGETS" requires: