Skip to content
Open
Show file tree
Hide file tree
Changes from 3 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
54 changes: 54 additions & 0 deletions taskfiles/tests/clp-ffi-js.yaml
Copy link
Member

Choose a reason for hiding this comment

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

if there's no easy way to set up clp-ffi-js as one of deps for build-and-test-node and build-and-test-browser, how do you feel about adding this to both tasks:

    preconditions:
      - msg: "clp-ffi-js is not set up. Run `task tests:clp-ffi-js` first."
        sh: "test -d {{.G_CLP_FFI_JS_BUILD_DIR}}"

Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
version: "3"

includes:
yscope-dev-utils: "../../tools/yscope-dev-utils/exports/taskfiles/utils/utils.yaml"

vars:
G_CLP_FFI_JS_SRC_DIR: "{{.G_BUILD_DIR}}/clp-ffi-js"
G_CLP_FFI_JS_BUILD_DIR: "{{.G_CLP_FFI_JS_SRC_DIR}}/build/clp-ffi-js"

G_CLP_FFI_JS_CHECKSUM_FILE: "{{.G_BUILD_DIR}}/clp-ffi-js.md5"

# NOTE: By default, clp-ffi-js builds its WASM binaries against the internally pinned CLP source.
# For CLP development and integration testing, we override `CLP_FFI_JS_CLP_SOURCE_DIRECTORY` so the
# build uses the CLP repository in the current workspace.
# We achieve this by running an early, intentionally non-fatal CMake configure step to inject the
# cache variable without triggering a full build. The normal clp-ffi-js test workflow is then
# executed, which builds the package as part of the process.
tasks:
default:
deps: ["download-src"]
dir: "{{.G_CLP_FFI_JS_SRC_DIR}}"
cmds:
- task: "inject-clp-src-dir"
- task: "symlink-yscope-dev-utils"
- |-
task test

download-src:
deps:
- "::init"
cmds:
- task: "yscope-dev-utils:remote:download-and-extract-tar"
vars:
CHECKSUM_FILE: "{{.G_CLP_FFI_JS_CHECKSUM_FILE}}"
FILE_SHA256: "5ab1c27031caafb014198d4db711a71b3fbb1661b396bcd4e46764194e2b1f61"
OUTPUT_DIR: "{{.G_BUILD_DIR}}/clp-ffi-js"
TAR_FILE: "{{.G_BUILD_DIR}}/clp-ffi-js.tar.gz"
URL: "https://github.com/y-scope/clp-ffi-js/archive/4cc6a7c.tar.gz"
Copy link
Member

Choose a reason for hiding this comment

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

do you think it's worth adding a docstring to explain when this commit was available? / in the future if we pin those commit ids at specific clp-ffi-js releases, it's better to comment with the release versions as well

Copy link
Member

Choose a reason for hiding this comment

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

something like

# clp-ffi-js @ v0.X.Y (March 2, 2026)


inject-clp-src-dir:
internal: true
silent: true
cmds:
- |-
cmake -S "{{.G_CLP_FFI_JS_SRC_DIR}}" -B "{{.G_CLP_FFI_JS_BUILD_DIR}}" \
-DCLP_FFI_JS_CLP_SOURCE_DIRECTORY="{{.ROOT_DIR}}" >/dev/null 2>&1 || true

symlink-yscope-dev-utils:
internal: true
cmds:
- |-
rm -rf "{{.G_CLP_FFI_JS_SRC_DIR}}/tools/yscope-dev-utils"
ln -s "{{.ROOT_DIR}}/tools/yscope-dev-utils" \
"{{.G_CLP_FFI_JS_SRC_DIR}}/tools/yscope-dev-utils"
1 change: 1 addition & 0 deletions taskfiles/tests/main.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
version: "3"

includes:
clp-ffi-js: "clp-ffi-js.yaml"
integration: "integration.yaml"
toolchains: "../toolchains.yaml"

Expand Down
2 changes: 1 addition & 1 deletion tools/scripts/deps-download/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
project_root_dir="$script_dir/../../../"
download_dep_script="$script_dir/download-dep.py"

readonly YSCOPE_DEV_UTILS_COMMIT_SHA="6ec46856cfda8cbfb65d9386affbe3bc429186cb"
readonly YSCOPE_DEV_UTILS_COMMIT_SHA="e2a1aed32095b05d45b74c5cf52a9c9e176f1c40"
python3 "${download_dep_script}" \
"https://github.com/y-scope/yscope-dev-utils/archive/${YSCOPE_DEV_UTILS_COMMIT_SHA}.zip" \
"yscope-dev-utils-${YSCOPE_DEV_UTILS_COMMIT_SHA}" \
Expand Down
2 changes: 1 addition & 1 deletion tools/yscope-dev-utils
Loading