Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
154 changes: 151 additions & 3 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,8 @@ jobs:
include:
- os: ubuntu-24.04
updates: updates-appimage
- os: windows-latest
updates: updates-velopack
runs-on: ${{ matrix.os }}
timeout-minutes: ${{ matrix.os == 'windows-latest' && 90 || 60 }}
timeout-minutes: 60
env:
RUST_BACKTRACE: "1"
steps:
Expand Down Expand Up @@ -271,6 +269,156 @@ jobs:
if: ${{ always() }}
run: python scripts/cache-budget.py ${{ runner.os == 'Windows' && '--targets' || '' }}

windows-smoke:
needs: gate
runs-on: windows-latest
timeout-minutes: 60
env:
RUST_BACKTRACE: "1"
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@1.98.0
with:
components: rustfmt, clippy
- uses: ilammy/msvc-dev-cmd@v1
if: runner.os == 'Windows'
- uses: Swatinem/rust-cache@v2
with:
prefix-key: v3-rake-ci-windows-split
cache-all-crates: false
cache-workspace-crates: false
shared-key: desktop-windows-smoke
cache-targets: true
save-if: ${{ github.ref == 'refs/heads/main' }}
# tauri-bundler 2.10.4: dirs::cache_dir()/tauri (no local_tools_directory).
- name: Cache Windows bundler tools
if: runner.os == 'Windows'
id: bundler-tools
uses: actions/cache@v5
with:
path: |
~/AppData/Local/tauri/WixTools314
~/AppData/Local/tauri/NSIS
key: windows-tauri-bundler-2.10.4-v1
- name: Prepare Windows bundler tools
if: runner.os == 'Windows' && steps.bundler-tools.outputs.cache-hit != 'true'
shell: pwsh
run: .github/workflows/prepare-bundler-tools.ps1
- name: Windows private files and native endpoints
if: runner.os == 'Windows'
run: |
cargo test -p rake-client --locked
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
cargo test -p rake-app --no-default-features --test local_control --locked
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
- name: Windows supervisor and terminal output
if: runner.os == 'Windows'
run: |
cargo test -p rake-app-cli --bin rake project_build:: --locked
- name: Default desktop lints
run: >-
cargo clippy -p rake-app -p rake-desktop-example -p rake-notes
-p rake-kit-example -p rake-ui -p rake-view -p rake-files
-p rake-tray -p rake-autostart --all-targets --locked -- -D warnings
# Surface graphics failures before the longer workspace/trybuild suites.
- name: Build real desktop smoke app
id: smoke-build
if: ${{ !cancelled() }}
run: cargo build -p rake-desktop-example --features native-smoke --locked
- name: Render a GPUI frame on Windows (D3D11)
if: ${{ !cancelled() && steps.smoke-build.outcome == 'success' && runner.os == 'Windows' }}
timeout-minutes: 2
run: python scripts/desktop-smoke.py target/debug/rake-desktop-example.exe
- name: Build Windows inspection fixtures
if: ${{ !cancelled() && steps.smoke-build.outcome == 'success' && runner.os == 'Windows' }}
run: |
cargo build -p rake-app-cli -p rake-desktop-example --features rake-desktop-example/native-smoke,rake-desktop-example/devtools --locked
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
- name: Inspect a real Windows GUI and open source outside owned Jobs
if: ${{ !cancelled() && steps.smoke-build.outcome == 'success' && runner.os == 'Windows' }}
timeout-minutes: 12
run: |
node --test scripts/test-embedded-devtools.mjs
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
python scripts/windows-inspection-smoke.py target/debug/rake.exe
- uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: desktop-smoke-windows-latest
path: target/desktop-smoke.log
if-no-files-found: warn
retention-days: 7
- name: Estimate dependency cache size
if: ${{ always() }}
run: python scripts/cache-budget.py ${{ runner.os == 'Windows' && '--targets' || '' }}

windows-tests:
needs: gate
runs-on: windows-latest
timeout-minutes: 60
env:
RUST_BACKTRACE: "1"
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@1.98.0
with:
components: rustfmt, clippy
- uses: ilammy/msvc-dev-cmd@v1
if: runner.os == 'Windows'
- uses: Swatinem/rust-cache@v2
with:
prefix-key: v3-rake-ci-windows-split
cache-all-crates: false
cache-workspace-crates: false
shared-key: desktop-windows-tests
cache-targets: true
save-if: ${{ github.ref == 'refs/heads/main' }}
# tauri-bundler 2.10.4: dirs::cache_dir()/tauri (no local_tools_directory).
- name: Cache Windows bundler tools
if: runner.os == 'Windows'
id: bundler-tools
uses: actions/cache@v5
with:
path: |
~/AppData/Local/tauri/WixTools314
~/AppData/Local/tauri/NSIS
key: windows-tauri-bundler-2.10.4-v1
- name: Prepare Windows bundler tools
if: runner.os == 'Windows' && steps.bundler-tools.outputs.cache-hit != 'true'
shell: pwsh
run: .github/workflows/prepare-bundler-tools.ps1
- name: Workspace tests (default native GPUI)
if: ${{ !cancelled() }}
run: cargo test --workspace --locked --no-fail-fast
- name: View tests without devtools or kit
if: ${{ !cancelled() }}
run: >-
cargo test -p rake-app -p rake-ui -p rake-view -p rake-notes
--features rake-app/view-test-support,rake-view/view-test-support,rake-notes/view-test-support
--locked --no-fail-fast
- name: Devtools view tests without kit
if: ${{ !cancelled() }}
run: >-
cargo test -p rake-app --features view-test-support,devtools
--lib --test view_state --test element_inspection --locked --no-fail-fast
- name: Estimate dependency cache size
if: ${{ always() }}
run: python scripts/cache-budget.py ${{ runner.os == 'Windows' && '--targets' || '' }}

windows-desktop:
# Preserve the existing required-check name across both parallel Windows jobs.
name: desktop (windows-latest)
if: ${{ always() }}
needs: [windows-smoke, windows-tests]
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Require both Windows desktop jobs
env:
SMOKE_RESULT: ${{ needs.windows-smoke.result }}
TESTS_RESULT: ${{ needs.windows-tests.result }}
run: test "$SMOKE_RESULT" = success && test "$TESTS_RESULT" = success

windows-features:
needs: gate
runs-on: windows-latest
Expand Down
3 changes: 2 additions & 1 deletion crates/rake-cli/src/distribution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ pub(crate) fn run(arguments: &[String]) -> Result<bool, Box<dyn std::error::Erro
None
};

let explicit_target = target;
let target = target.or(host.as_deref());

if compatibility && formats.is_empty() {
Expand Down Expand Up @@ -368,7 +369,7 @@ pub(crate) fn run(arguments: &[String]) -> Result<bool, Box<dyn std::error::Erro
manifest,
package: package.map(str::to_owned),
platform,
target: target.map(str::to_owned),
target: explicit_target.map(str::to_owned),
formats,
output,
binary,
Expand Down
18 changes: 15 additions & 3 deletions crates/rake-dist/src/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ struct JobInput {

struct JobOptions {
platform: Platform,
host_build: bool,
output: PathBuf,
release: bool,
features: Vec<String>,
Expand All @@ -301,6 +302,7 @@ impl From<&BundleRequest> for JobOptions {
fn from(r: &BundleRequest) -> Self {
Self {
platform: r.platform,
host_build: r.compatibility && r.target.is_none(),
output: r.output.clone(),
release: r.release,
features: r.features.clone(),
Expand Down Expand Up @@ -481,6 +483,7 @@ pub fn execute_source_worker(

let options = JobOptions {
platform: request.platform,
host_build: false,
output: resolved.output,
release: request.release,
features,
Expand Down Expand Up @@ -687,7 +690,11 @@ fn execute_job(
build(
selected,
binary,
target,
if request.host_build && target == host_target()? {
None
} else {
Some(target)
},
request.release,
item,
selected
Expand Down Expand Up @@ -1512,7 +1519,7 @@ pub(crate) fn native_platform() -> Result<Platform, Error> {
fn build(
selected: &crate::Package,
binary: &str,
target: &str,
target: Option<&str>,
release: bool,
package_plan: &rake_dist_core::PackagePlan,
facade: Option<&str>,
Expand All @@ -1536,7 +1543,12 @@ fn build(
"--manifest-path",
])
.arg(manifest)
.args(["--package", package, "--bin", binary, "--target", target]);
.args(["--package", package, "--bin", binary]);

// Native dev compatibility builds share Cargo's host-default dependency graph.
if let Some(target) = target {
command.args(["--target", target]);
}

if !context.features.is_empty() {
command.arg("--features").arg(context.features.join(","));
Expand Down
5 changes: 4 additions & 1 deletion scripts/windows-inspection-smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,15 @@ def main():
app_log, cdp_log = root / "app.log", root / "cdp.log"
with app_log.open("w", encoding="utf-8") as app_output, cdp_log.open("w", encoding="utf-8") as cdp_output:
try:
# Native dev bundles use an explicit target triple; warm that graph before readiness.
# Warm native dev packaging before readiness using the host-default build.
subprocess.run(
[str(rake), "bundle", "--native", "--compat", "--json", "--manifest-path", "examples/desktop/Cargo.toml",
"--package", "rake-desktop-example", "--bin", "rake-desktop-example", "--output", str(root / "warm"),
"--debug", "--features", "native-smoke,devtools"],
env=env, stdout=app_output, stderr=subprocess.STDOUT, timeout=420, check=True,
)
assert Path("target/debug/rake-desktop-example.exe").is_file()
assert not Path("target/x86_64-pc-windows-msvc/debug/rake-desktop-example.exe").exists(), "Native dev rebuilt the explicit-target graph"
application = subprocess.Popen(
[str(rake), "dev", "--compiler", "cargo", "--manifest-path", "examples/desktop/Cargo.toml",
"--package", "rake-desktop-example", "--features", "native-smoke", "--cdp", "--no-open",
Expand Down Expand Up @@ -293,6 +295,7 @@ def ready():
assert not list(control.glob("*.json")), "GUI discovery survived shutdown"
for handle in observed:
assert kernel.WaitForSingleObject(handle, 5000) == 0, "A supervised Windows process survived shutdown"
assert not Path("target/x86_64-pc-windows-msvc/debug/rake-desktop-example.exe").exists(), "Native dev rebuilt the explicit-target graph"
assert "RAKE_DESKTOP_SMOKE_FRAME" in app_log.read_text(errors="replace")
assert kernel.WaitForSingleObject(editor_handle, 100) == 258, "Stopping dev killed the source editor"
print("Windows desktop dev/CDP, real GUI inspect, reload, shutdown and editor Job survival passed")
Expand Down
Loading