Skip to content

refactor(bindings): Refactor Taskfiles to avoid rebuilds if source unchanged#1261

Open
Tehsmash wants to merge 11 commits intomainfrom
rust_build_task_status
Open

refactor(bindings): Refactor Taskfiles to avoid rebuilds if source unchanged#1261
Tehsmash wants to merge 11 commits intomainfrom
rust_build_task_status

Conversation

@Tehsmash
Copy link
Member

Description

Refactor the Taskfiles to avoid rebuild the rust code if the libraries we want are already present and newer than the rust source code. This should work locally and in CI where we reload the files through artifacts to avoid rust builds getting triggered.

Type of Change

  • Bugfix
  • New Feature
  • Breaking Change
  • Refactor
  • Documentation
  • Other (please describe)

Checklist

  • I have read the contributing guidelines
  • Existing issues have been referenced (where applicable)
  • I have verified this change is not present in other open pull requests
  • Functionality is documented
  • All code style checks pass
  • New code contribution is covered by automated tests
  • All new and existing tests pass

@github-actions
Copy link
Contributor

github-actions bot commented Feb 23, 2026

The latest Buf updates on your PR. Results from workflow Buf CI / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedFeb 26, 2026, 2:02 PM

@codecov
Copy link

codecov bot commented Feb 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Tehsmash Tehsmash force-pushed the rust_build_task_status branch 4 times, most recently from e1a675e to 8f47a1c Compare February 25, 2026 11:02
@Tehsmash Tehsmash marked this pull request as ready for review February 26, 2026 14:02
@Tehsmash Tehsmash requested a review from a team as a code owner February 26, 2026 14:02
Build artifacts are no longer renamed before upload; original filenames
(libslim_bindings.{a,so,dylib}, slim_bindings.{dll,lib}) are preserved.
Downstream CI jobs restore each bindings-{TARGET} artifact directly into
data-plane/target/{TARGET}/release/, matching the local build layout.

Taskfile changes to align all language bindings with the target folder:

- rust/Taskfile.yaml: add sources/generates fingerprinting so
  bindings:build:all is skipped when outputs are already up to date.

- go/Taskfile.yaml: rewrite copy-library to scan target/*/release/ for
  all available platforms and derive platform-specific destination names
  from the target triple; remove the CI-vs-local-build distinction.

- dotnet/Taskfile.yaml: add rust:bindings:build:all as a declared dep of
  generate (fingerprinting prevents rebuilds when library is present);
  rewrite copy:runtimes to scan target/*/release/ instead of an
  artifacts/ directory; remove ARTIFACTS_DIR variable.

Signed-off-by: Sam Betts <1769706+Tehsmash@users.noreply.github.com>
The glob pattern was hardcoded to */release/; use {{.PROFILE}} so
debug builds are found correctly.

Signed-off-by: Sam Betts <1769706+Tehsmash@users.noreply.github.com>
The glob pattern was hardcoded to */release/; use {{.PROFILE}} so
debug builds are found correctly.

Signed-off-by: Sam Betts <1769706+Tehsmash@users.noreply.github.com>
Move the library path into a task-level var (LIB_FILE) and pass it
directly to uniffi-bindgen-cs, matching how the Go bindings task uses
LIB_PATH. The dep on rust:bindings:build:all guarantees the library
exists, so the manual shell existence check is no longer needed.

Signed-off-by: Sam Betts <1769706+Tehsmash@users.noreply.github.com>
This makes sure that the fingerprinting is "stateless" and doesn't need
to maintain a checksum in a separate file.

Signed-off-by: Sam Betts <1769706+Tehsmash@users.noreply.github.com>
Signed-off-by: Sam Betts <1769706+Tehsmash@users.noreply.github.com>
Signed-off-by: Sam Betts <1769706+Tehsmash@users.noreply.github.com>
Replace the loop that scanned all target directories with a direct copy
of the single library pointed to by LIB_PATH for the current TARGET and
PROFILE, deriving the destination name from the target triple.

Signed-off-by: Sam Betts <1769706+Tehsmash@users.noreply.github.com>
Signed-off-by: Sam Betts <1769706+Tehsmash@users.noreply.github.com>
Signed-off-by: Sam Betts <1769706+Tehsmash@users.noreply.github.com>
Signed-off-by: Sam Betts <1769706+Tehsmash@users.noreply.github.com>
@Tehsmash Tehsmash force-pushed the rust_build_task_status branch from 8f47a1c to 8aef839 Compare February 26, 2026 14:02
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.

2 participants