Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
81 changes: 9 additions & 72 deletions taskfile.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "3"

includes:
deps: "taskfiles/deps.yaml"
deps: "taskfiles/deps/main.yaml"
lint: "taskfiles/lint.yaml"
test: "taskfiles/test.yaml"
utils: "tools/yscope-dev-utils/exports/taskfiles/utils/utils.yaml"
Expand All @@ -11,9 +11,6 @@ vars:
G_CLP_FFI_JS_BUILD_DIR: "{{.G_BUILD_DIR}}/clp-ffi-js"
G_DEPS_DIR: "{{.G_BUILD_DIR}}/deps"
G_DIST_DIR: "{{.ROOT_DIR}}/dist"
G_EMSDK_DIR: "{{.G_BUILD_DIR}}/emsdk"
G_EMSCRIPTEN_CMAKE_TOOLCHAIN_FILE: >-
{{.G_EMSDK_DIR}}/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake

G_CLP_FFI_JS_ENV_NAMES: ["node", "worker"]
G_CLP_FFI_JS_TARGET_PREFIX: "ClpFfiJs-"
Expand All @@ -23,26 +20,16 @@ vars:
G_DEPS_CMAKE_SETTINGS_FILE: "{{.G_DEPS_CMAKE_SETTINGS_DIR}}/settings.cmake"

G_CLP_FFI_JS_CHECKSUM: "{{.G_BUILD_DIR}}/clp-ffi-js.md5"
G_EMSDK_CHECKSUM: "{{.G_BUILD_DIR}}/emsdk.md5"

tasks:
default:
deps: ["clp-ffi-js"]
deps: ["package"]

clean:
run: "once"
cmds:
- task: "clean-emsdk"
- task: "clean-clp-ffi-js"
- "rm -rf '{{.G_BUILD_DIR}}'"

clean-emsdk:
cmds:
- "rm -rf '{{.G_EMSDK_DIR}}'"

clean-clp-ffi-js:
cmds:
- "rm -rf '{{.G_CLP_FFI_JS_BUILD_DIR}}'"

clp-ffi-js:
vars:
CHECKSUM_FILE: "{{.G_CLP_FFI_JS_CHECKSUM}}"
Expand All @@ -54,8 +41,8 @@ tasks:
- "CMakeLists.txt"
- "src/**/*"
generates: ["{{.CHECKSUM_FILE}}"]
run: "once"
deps:
- "emsdk"
- task: "utils:checksum:validate"
vars:
CHECKSUM_FILE: "{{.CHECKSUM_FILE}}"
Expand All @@ -73,47 +60,6 @@ tasks:
CHECKSUM_FILE: "{{.CHECKSUM_FILE}}"
INCLUDE_PATTERNS: ["{{.OUTPUT_DIR}}"]

emsdk:
vars:
CHECKSUM_FILE: "{{.G_EMSDK_CHECKSUM}}"
EMSDK_VERSION: "4.0.10"
OUTPUT_DIR: "{{.G_EMSDK_DIR}}"
sources: ["{{.TASKFILE}}"]
generates: ["{{.CHECKSUM_FILE}}"]
run: "once"
deps:
- "init"
- task: "utils:checksum:validate"
vars:
CHECKSUM_FILE: "{{.CHECKSUM_FILE}}"
EXCLUDE_PATTERNS: &emsdk_checksum_exclude_paths
- "upstream/emscripten/__pycache__"
- "upstream/emscripten/cache/sanity.txt"
- "upstream/emscripten/cache/symbol_lists"
- "upstream/emscripten/cache/symbol_lists.lock"
- "upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/lto"
- "upstream/emscripten/third_party/leb128/__pycache__"
- "upstream/emscripten/tools/__pycache__"
- "upstream/emscripten/tools/ports/__pycache__"
- "upstream/emscripten/tools/ports/contrib/__pycache__"
INCLUDE_PATTERNS: ["{{.OUTPUT_DIR}}"]
cmds:
- task: "clean-emsdk"
- "git clone https://github.com/emscripten-core/emsdk.git '{{.G_EMSDK_DIR}}'"
- |-
cd "{{.G_EMSDK_DIR}}"
./emsdk install {{.EMSDK_VERSION}}
./emsdk activate {{.EMSDK_VERSION}}
- |-
cd "{{.G_EMSDK_DIR}}/upstream/emscripten"
PATH=$(echo {{.G_EMSDK_DIR}}/node/*/bin):$PATH npm install
# This command must be last
- task: "utils:checksum:compute"
vars:
CHECKSUM_FILE: "{{.CHECKSUM_FILE}}"
EXCLUDE_PATTERNS: *emsdk_checksum_exclude_paths
INCLUDE_PATTERNS: ["{{.OUTPUT_DIR}}"]

package:
vars:
CHECKSUM_FILE: "{{.G_BUILD_DIR}}/{{.TASK}}.md5"
Expand All @@ -126,9 +72,10 @@ tasks:
- "{{.G_CLP_FFI_JS_CHECKSUM}}"
- "{{.TASKFILE}}"
generates: ["{{.CHECKSUM_FILE}}"]
run: "once"
deps:
- "clp-ffi-js"
- "node-modules"
- "deps:node-modules"
- task: "utils:checksum:validate"
vars:
CHECKSUM_FILE: "{{.CHECKSUM_FILE}}"
Expand All @@ -141,7 +88,7 @@ tasks:
rsync -a
"{{.G_CLP_FFI_JS_BUILD_DIR}}/{{.G_CLP_FFI_JS_TARGET_PREFIX}}{{.ITEM}}."{d.ts,js,wasm}
"{{.OUTPUT_DIR}}/"
- "npx tsc -p tsconfig.build.json"
- "npm run build:ts -- --outDir '{{.OUTPUT_DIR}}'"
- "npm pack"
# This command must be last
- task: "utils:checksum:compute"
Expand All @@ -158,27 +105,17 @@ tasks:
generates:
- "{{.G_CLP_FFI_JS_BUILD_DIR}}/CMakeCache.txt"
- "{{.G_CLP_FFI_JS_BUILD_DIR}}/compile_commands.json"
run: "once"
deps:
- "deps"
- "emsdk"
- "deps:emsdk"
cmd: |-
cmake \
-DCLP_FFI_JS_SUPPORTED_ENVIRONMENTS="{{.G_CLP_FFI_JS_ENV_NAMES | join ";"}}" \
-DCMAKE_TOOLCHAIN_FILE="{{.G_EMSCRIPTEN_CMAKE_TOOLCHAIN_FILE}}" \
-S "{{.ROOT_DIR}}" \
-B "{{.G_CLP_FFI_JS_BUILD_DIR}}"

node-modules:
internal: true
sources:
- "{{.ROOT_DIR}}/package.json"
- "{{.ROOT_DIR}}/package-lock.json"
- "{{.TASKFILE}}"
generates:
- "{{.ROOT_DIR}}/node_modules/**/*"
cmds:
- "npm clean-install"

init:
internal: true
silent: true
Expand Down
50 changes: 50 additions & 0 deletions taskfiles/deps/emsdk.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
version: "3"

vars:
G_EMSDK_DIR: "{{.G_BUILD_DIR}}/emsdk"

G_EMSCRIPTEN_CMAKE_TOOLCHAIN_FILE: >-
{{.G_EMSDK_DIR}}/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake
G_EMSDK_CHECKSUM: "{{.G_BUILD_DIR}}/emsdk.md5"

tasks:
default:
vars:
CHECKSUM_FILE: "{{.G_EMSDK_CHECKSUM}}"
EMSDK_VERSION: "4.0.10"
OUTPUT_DIR: "{{.G_EMSDK_DIR}}"
sources: ["{{.TASKFILE}}"]
generates: ["{{.CHECKSUM_FILE}}"]
run: "once"
deps:
- "::init"
- task: "::utils:checksum:validate"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

Task (go-task) double colon syntax for nested includes root reference

💡 Result:

In go-task (Task), there is no double colon (::) syntax for nested includes or root references. The colon (:) separates namespaces for calling tasks from included Taskfiles. To call a task from an included Taskfile, use single colon syntax like B:up or for nested includes B:C:up (e.g., A includes B, B includes C). Root reference uses templating variables like {{.ROOT_DIR}} (absolute path of root Taskfile directory) or {{.TASKFILE_DIR}} (current/included Taskfile directory). These are available in cmds, vars, dir, etc. Colon-separated syntax (:) exists only in sources for glob patterns (experimental/recent PR #2404), e.g., sources: [".go:internal//.go"]. Official docs confirm single colon for task calls (usage, schema) and templating vars for paths (templating reference). No :: syntax found in authoritative sources.

Citations:


Replace double-colon syntax with single-colon syntax for task references.

The ::init and ::utils:checksum:validate references use invalid go-task syntax. Double colons (::) are not supported. Use single colons instead: init and utils:checksum:validate.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@taskfiles/deps/emsdk.yaml` around lines 19 - 21, Replace the invalid
double-colon task references in the deps list: change "::init" to "init" and
"::utils:checksum:validate" to "utils:checksum:validate" so the task references
use the supported single-colon syntax; update the deps entries referencing
"::init" and "::utils:checksum:validate" accordingly.

vars:
CHECKSUM_FILE: "{{.CHECKSUM_FILE}}"
EXCLUDE_PATTERNS: &emsdk_checksum_exclude_paths
- "upstream/emscripten/__pycache__"
- "upstream/emscripten/cache/sanity.txt"
- "upstream/emscripten/cache/symbol_lists"
- "upstream/emscripten/cache/symbol_lists.lock"
- "upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/lto"
- "upstream/emscripten/third_party/leb128/__pycache__"
- "upstream/emscripten/tools/__pycache__"
- "upstream/emscripten/tools/ports/__pycache__"
- "upstream/emscripten/tools/ports/contrib/__pycache__"
INCLUDE_PATTERNS: ["{{.OUTPUT_DIR}}"]
cmds:
- "rm -rf '{{.G_EMSDK_DIR}}'"
- "git clone https://github.com/emscripten-core/emsdk.git '{{.G_EMSDK_DIR}}'"
- |-
cd "{{.G_EMSDK_DIR}}"
./emsdk install {{.EMSDK_VERSION}}
./emsdk activate {{.EMSDK_VERSION}}
- |-
cd "{{.G_EMSDK_DIR}}/upstream/emscripten"
PATH=$(echo {{.G_EMSDK_DIR}}/node/*/bin):$PATH npm install
# This command must be last
- task: "::utils:checksum:compute"
vars:
CHECKSUM_FILE: "{{.CHECKSUM_FILE}}"
EXCLUDE_PATTERNS: *emsdk_checksum_exclude_paths
INCLUDE_PATTERNS: ["{{.OUTPUT_DIR}}"]
6 changes: 5 additions & 1 deletion taskfiles/deps.yaml → taskfiles/deps/main.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
version: "3"

includes:
emsdk: "./emsdk.yaml"
node-modules: "./node-modules.yaml"

vars:
# Library names
G_BOOST_LIB_NAME: "Boost"
Expand Down Expand Up @@ -28,7 +32,7 @@ tasks:
desc: "Download, and install (except for clp) all dependencies using Emscripten toolchain."
run: "once"
deps:
- ":emsdk"
- "emsdk"
cmds:
- task: ":utils:cmake:install-deps-and-generate-settings"
vars:
Expand Down
13 changes: 13 additions & 0 deletions taskfiles/deps/node-modules.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: "3"

tasks:
default:
sources:
- "{{.ROOT_DIR}}/package.json"
- "{{.ROOT_DIR}}/package-lock.json"
- "{{.TASKFILE}}"
generates:
- "{{.ROOT_DIR}}/node_modules/**/*"
run: "once"
cmds:
- "npm clean-install"
4 changes: 2 additions & 2 deletions taskfiles/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ tasks:
- task: "check-cpp-static-full"

check-js:
deps: [":node-modules", ":package"]
deps: [":deps:node-modules", ":package"]
cmds:
- "npm run lint:check:js"

Expand All @@ -50,7 +50,7 @@ tasks:
- task: "fix-cpp-static-full"

fix-js:
deps: [":node-modules", ":package"]
deps: [":deps:node-modules", ":package"]
cmds:
- "npm run lint:fix:js"

Expand Down
2 changes: 1 addition & 1 deletion taskfiles/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ tasks:
deps: ["js"]

init:
deps: [":package", ":node-modules"]
deps: [":package", ":deps:node-modules"]
cmd: "npm run test:init"

js:
Expand Down
Loading