Skip to content

Fix schema generator binary recompilation during release bundling.#9632

Merged
vorporeal merged 2 commits intomasterfrom
david/fix-schema-generator-recompilation-during-release-bundling
Apr 30, 2026
Merged

Fix schema generator binary recompilation during release bundling.#9632
vorporeal merged 2 commits intomasterfrom
david/fix-schema-generator-recompilation-during-release-bundling

Conversation

@vorporeal
Copy link
Copy Markdown
Contributor

@vorporeal vorporeal commented Apr 30, 2026

Description

The release bundling workflow runs prepare_bundled_resources after the main cargo build, and that script in turn invokes cargo run --bin generate_settings_schema. Until now we passed neither --features nor --target to this run, so cargo's resolver-v2 saw a different per-package feature unification than the main build and recompiled every dependency whose enabled features differed (rust-embed with debug-embed, warp_core's release_bundle, sentry, jemalloc, etc.). This added significant time to release builds and pulled in extra system dependencies (e.g. protoc) for jobs that should otherwise just be packaging the prebuilt binary.

There was a secondary correctness issue: the schema generator iterates settings registered via inventory::submit!, and #[cfg(feature = \"...\")]-gated settings were silently omitted from the schema in any context whose feature set didn't match the main binary.

The fix threads the build's feature set (and target, where applicable) through to the schema-generator invocation, and makes package selection explicit with -p warp. With matching features and target, cargo reuses the existing compilation artifacts; with the same feature set, the generated schema is also faithful to what the bundled binary actually exposes.

Testing

Verified bash -n syntax for the modified bash scripts and parsed the modified PowerShell files via pwsh. Bundling, schema generation, and CI behavior will be exercised by this PR's release builds.

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

Conversation

@cla-bot cla-bot Bot added the cla-signed label Apr 30, 2026
Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@vorporeal vorporeal marked this pull request as ready for review April 30, 2026 17:30
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented Apr 30, 2026

@vorporeal

I'm starting a first review of this pull request.

I completed the review and posted feedback on this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

You can view the conversation on Warp.

I completed the review and posted feedback on this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

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

Overview

This PR threads cargo features, profiles, targets, and explicit package selection into settings-schema generation during bundled-resource preparation so release jobs can better reuse build artifacts and include feature-gated settings.

Concerns

  • Windows arm64 packaging runs on the same x64 windows-latest-large runner as x64 packaging, but the new target forwarding makes cargo run build and execute generate_settings_schema for aarch64-pc-windows-msvc. That target binary is not executable on the x64 runner, so the arm64 release job will fail during bundled-resource preparation.
  • Supplemental security pass: no security issues found in the changed command construction; shell/PowerShell invocations pass feature and target values as argv elements rather than interpolating them into an evaluated shell string.

Verdict

Found: 0 critical, 1 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment thread script/windows/bundle.ps1 Outdated
$BUNDLED_RESOURCES_DIR = "$CARGO_TARGET_OUTPUT_DIR\resources"
Write-Output "Preparing bundled resources..."
& "$WINDOWS_INSTALLER_DIR\prepare_bundled_resources.ps1" -DestinationDir "$BUNDLED_RESOURCES_DIR" -Channel "$CHANNEL" -CargoProfile "$CARGO_PROFILE"
& "$WINDOWS_INSTALLER_DIR\prepare_bundled_resources.ps1" -DestinationDir "$BUNDLED_RESOURCES_DIR" -Channel "$CHANNEL" -CargoProfile "$CARGO_PROFILE" -CargoFeatures "$FEATURES" -CargoTarget "$PLATFORM_TARGET"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ [IMPORTANT] This breaks the Windows arm64 release job: the matrix uses the x64 windows-latest-large runner for --arch arm64, so passing -CargoTarget aarch64-pc-windows-msvc makes cargo run build and try to execute an arm64 generate_settings_schema binary on an x64 host. Only pass CargoTarget when the target is runnable on the current host, or leave schema generation as a host-target run for cross-compiled Windows artifacts.

@vorporeal vorporeal force-pushed the david/fix-schema-generator-recompilation-during-release-bundling branch from fc767b1 to 03226f0 Compare April 30, 2026 19:18
Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

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

Overview

This PR threads the bundling feature set and runnable cargo target into settings schema generation across the Linux, macOS, and Windows resource-preparation scripts, while making the schema generator package selection explicit.

Concerns

  • script/macos/run still drops the selected --profile when --generate-schema is used, so that local path can compile the schema generator with the default dev profile even when cargo bundle used another profile.
  • Supplemental security pass: no command-injection or secret-handling issues found in the changed argument forwarding; shell and PowerShell invocations keep user-supplied feature/target strings as single argv entries.

Verdict

Found: 0 critical, 0 important, 1 suggestions

Approve with nits

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment thread script/macos/run
Comment on lines +119 to +122
# Pass FEATURES through (and an empty cargo profile, since this script does
# not configure one) so that the schema generation reuses the same compiled
# artifacts as the cargo bundle invocation above.
NO_LICENSES=1 "${REPO_ROOT}/script/prepare_bundled_resources" "$WARP_APP_PATH/Contents/Resources" "$WARP_CHANNEL" "" "$FEATURES"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 [SUGGESTION] --profile is parsed above into PROFILE and forwarded to cargo bundle; passing an empty profile here makes --generate-schema --profile ... compile the schema generator in dev instead of reusing the bundle profile.

Suggested change
# Pass FEATURES through (and an empty cargo profile, since this script does
# not configure one) so that the schema generation reuses the same compiled
# artifacts as the cargo bundle invocation above.
NO_LICENSES=1 "${REPO_ROOT}/script/prepare_bundled_resources" "$WARP_APP_PATH/Contents/Resources" "$WARP_CHANNEL" "" "$FEATURES"
# Pass the cargo profile and features through so schema generation can reuse
# the same compiled artifacts as the cargo bundle invocation above.
NO_LICENSES=1 "${REPO_ROOT}/script/prepare_bundled_resources" "$WARP_APP_PATH/Contents/Resources" "$WARP_CHANNEL" "${PROFILE:-}" "$FEATURES"

@vorporeal vorporeal merged commit f61ef1d into master Apr 30, 2026
27 checks passed
@vorporeal vorporeal deleted the david/fix-schema-generator-recompilation-during-release-bundling branch April 30, 2026 19:57
kevinchevalier added a commit that referenced this pull request Apr 30, 2026
zerx-lab pushed a commit to zerx-lab/warp that referenced this pull request May 3, 2026
…arpdotdev#9632)

## Description
The release bundling workflow runs `prepare_bundled_resources` after the
main `cargo build`, and that script in turn invokes `cargo run --bin
generate_settings_schema`. Until now we passed neither `--features` nor
`--target` to this run, so cargo's resolver-v2 saw a different
per-package feature unification than the main build and recompiled every
dependency whose enabled features differed (`rust-embed` with
`debug-embed`, `warp_core`'s `release_bundle`, sentry, jemalloc, etc.).
This added significant time to release builds and pulled in extra system
dependencies (e.g. protoc) for jobs that should otherwise just be
packaging the prebuilt binary.

There was a secondary correctness issue: the schema generator iterates
settings registered via `inventory::submit!`, and `#[cfg(feature =
\"...\")]`-gated settings were silently omitted from the schema in any
context whose feature set didn't match the main binary.

The fix threads the build's feature set (and target, where applicable)
through to the schema-generator invocation, and makes package selection
explicit with `-p warp`. With matching features and target, cargo reuses
the existing compilation artifacts; with the same feature set, the
generated schema is also faithful to what the bundled binary actually
exposes.

## Testing
Verified `bash -n` syntax for the modified bash scripts and parsed the
modified PowerShell files via `pwsh`. Bundling, schema generation, and
CI behavior will be exercised by this PR's release builds.

## Agent Mode
- [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode


[Conversation](https://staging.warp.dev/conversation/1bd5574f-df28-4c2e-867d-40d71ed7e827)
wolverine2k pushed a commit to wolverine2k/warp that referenced this pull request May 5, 2026
Leejaywell pushed a commit to Leejaywell/warp that referenced this pull request May 5, 2026
Leejaywell pushed a commit to Leejaywell/warp that referenced this pull request May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants