Browse Source

fix stale hotpatches and crate count

Jonathan Kelley 5 days ago
parent
commit
abb2514c1d
2 changed files with 10 additions and 1 deletions
  1. 5 1
      packages/cli/src/build/request.rs
  2. 5 0
      packages/cli/src/serve/runner.rs

+ 5 - 1
packages/cli/src/build/request.rs

@@ -2651,7 +2651,7 @@ impl BuildRequest {
 
         let output = tokio::process::Command::new("cargo")
             .arg("+nightly")
-            .arg("build")
+            .arg("rustc")
             .arg("--unit-graph")
             .arg("-Z")
             .arg("unstable-options")
@@ -2665,6 +2665,10 @@ impl BuildRequest {
             .await?;
 
         if !output.status.success() {
+            tracing::trace!(
+                "Failed to get unit count: {}",
+                String::from_utf8_lossy(&output.stderr)
+            );
             bail!("Failed to get unit count");
         }
 

+ 5 - 0
packages/cli/src/serve/runner.rs

@@ -478,6 +478,11 @@ impl AppServer {
             }
         }
 
+        // If the client is in a failed state, any changes to rsx should trigger a rebuild/hotpatch
+        if self.client.stage == BuildStage::Failed && !templates.is_empty() {
+            needs_full_rebuild = true
+        }
+
         // todo - we need to distinguish between hotpatchable rebuilds and true full rebuilds.
         //        A full rebuild is required when the user modifies static initializers which we haven't wired up yet.
         if needs_full_rebuild {