Skip to content

Add specific compile step, and require compile step to complete#13325

Open
Caleb-T-Owens wants to merge 1 commit intomasterfrom
f-copilot/compile-step
Open

Add specific compile step, and require compile step to complete#13325
Caleb-T-Owens wants to merge 1 commit intomasterfrom
f-copilot/compile-step

Conversation

@Caleb-T-Owens
Copy link
Copy Markdown
Contributor

dev only required package, but the but-sdk compile was considered a build.

This adds a specific compile step for tasks that compiles rust, and fix the dependencies.

I’ve also updated the dependencies to use the ^ notation, which AFAIK means that we actually wait for the dependency to complete before continuing (which seems like sane default behaviour?) so this probably makes sense.

Copilot AI review requested due to automatic review settings April 15, 2026 16:10
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a dedicated Turborepo compile task intended to separate Rust/but-sdk generation from the existing package/build pipeline, and updates the @gitbutler/but-sdk scripts accordingly.

Changes:

  • Introduces a new compile task in turbo.json and rewires task dependencies.
  • Updates dev/check/test task dependency lists to include the new compile phase.
  • Renames @gitbutler/but-sdk scripts from build:* to compile:*.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

File Description
turbo.json Adds compile task and adjusts dependsOn relationships across tasks
packages/but-sdk/package.json Renames build scripts to compile scripts for NAPI + type generation

Comment thread packages/but-sdk/package.json
Comment thread turbo.json Outdated
Comment thread turbo.json Outdated
Comment thread turbo.json Outdated
Comment thread turbo.json
Comment thread turbo.json
@Caleb-T-Owens Caleb-T-Owens force-pushed the f-copilot/compile-step branch from e11dd87 to 8780481 Compare April 16, 2026 10:12
Copilot AI review requested due to automatic review settings April 16, 2026 10:13
@Caleb-T-Owens Caleb-T-Owens force-pushed the f-copilot/compile-step branch from 8780481 to e35f4c3 Compare April 16, 2026 10:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread turbo.json
},
"dev": {
"dependsOn": ["package"],
"dependsOn": ["package", "compile"],
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

dev.dependsOn includes "compile" without the ^ prefix, so Turbo won’t run dependency compiles (notably @gitbutler/but-sdk) before starting dev servers. Since desktop/lite import types/runtime from @gitbutler/but-sdk, consider switching this to ^compile (and optionally compile if the package has its own compile step).

Suggested change
"dependsOn": ["package", "compile"],
"dependsOn": ["package", "^compile", "compile"],

Copilot uses AI. Check for mistakes.
Comment thread turbo.json
Comment on lines 11 to 13
"build": {
"dependsOn": ["package"],
"dependsOn": ["package", "compile"],
"passThroughEnv": ["SENTRY_AUTH_TOKEN", "GITHUB_TOKEN"],
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

build.dependsOn includes "compile" without the ^ prefix, so Turbo will only try to run compile in the same package. Apps like @gitbutler/desktop don’t have a compile script, and this won’t force @gitbutler/but-sdk to compile before the app build even though it’s a dependency. Use ^compile here (and keep compile too only if the package itself needs it).

Copilot uses AI. Check for mistakes.
@Caleb-T-Owens Caleb-T-Owens force-pushed the f-copilot/compile-step branch from e35f4c3 to 6d4a319 Compare April 16, 2026 10:37
`dev` only required `package`, but the but-sdk compile was considered a `build`.

This adds a specific `compile` step for tasks that compiles rust, and fix the dependencies.

I’ve also updated the dependencies to use the `^` notation, which AFAIK means that we actually wait for the dependency to complete before continuing (which seems like sane default behaviour?) so this probably makes sense.
Copilot AI review requested due to automatic review settings April 16, 2026 10:38
@Caleb-T-Owens Caleb-T-Owens force-pushed the f-copilot/compile-step branch from 6d4a319 to dcff13e Compare April 16, 2026 10:38
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread turbo.json
"tasks": {
"compile": {
"outputs": ["dist/**", ".svelte-kit/**", "src/generated/**"]
},
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

compile in @gitbutler/but-sdk depends on Rust sources outside the package directory (../../crates/but-napi, but-ts, and likely but-api schemas). With Turbo caching enabled and no explicit inputs/globalDependencies, changes in those crates may not invalidate the compile cache, leaving src/generated stale. Consider adding explicit inputs for the relevant crates/** paths (and Cargo.lock), or mark compile as non-cacheable if correctness is more important than caching.

Suggested change
},
},
"@gitbutler/but-sdk#compile": {
"inputs": [
"$TURBO_DEFAULT$",
"$TURBO_ROOT$/Cargo.lock",
"$TURBO_ROOT$/crates/but-napi/**",
"$TURBO_ROOT$/crates/but-ts/**",
"$TURBO_ROOT$/crates/but-api/**"
],
"outputs": ["dist/**", ".svelte-kit/**", "src/generated/**"]
},

Copilot uses AI. Check for mistakes.
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