fix: workspace hotpatch cache thrashing, feat: add compile profiling, cleanup + refactor + document cli request.rs file (#5479)
* it works! * fix wasm hotpatch error * bump wasmopt * rename wasmopt flag * rename ldd_keep_exports * add build profiling * undo bundle ignore * some cleanups * more cleanups * wip: hoist up telemetry to builder * fix compile * wip: flamegraph rewrite * clean up flamegraph impl * cleanup profiling engine * add comment on spans obj * cleanup more phases * more cleanup * small cleanups * bit more cleanups * cleanup phases * sign with tokio, not std proc * split out the specific platform helpers * cleanup a bit * more cleanups * more cleanups * more cleanups * more cleanups * pull out fingerprint logic * wip... I think I have a slightly better approach. saving checkpoint * hm I think it's better now? * fix: also seems to work not in workspace mode juuust yet * okay yay almost there * clooose but not there yet * fix: manually export __wasm_apply_data_relocs since got relocations weren't firing WASM workspace hotpatching: export __wasm_apply_global_relocs to fix call_indirect type mismatch When workspace crates are recompiled with -Crelocation-model=pic for hotpatching, wasm-ld generates GOT.func.internal globals that hold element-segment-relative offsets (e.g., MetricCardProps::memoize = 31). These need __table_base added at runtime by __wasm_apply_global_relocs to become absolute table indices. wasm-ld generates __wasm_apply_global_relocs but treats it as an internal synthetic function -- neither --export nor --export-if-defined will export it. Without the export, the runtime's call silently failed (the old code used unchecked_into on undefined), leaving the globals unrelocated. Function pointers then pointed to index 31 in the original module's table (some unrelated function) instead of table_base + 31 (the patched function), causing call_indirect to a signature that does not match. Three changes: patch.rs: After walrus processing, find __wasm_apply_global_relocs by name and add it as an export before emitting the patched wasm. lib.rs: Replace unchecked_into with dyn_into for calling relocation functions, so missing exports are handled gracefully instead of silently swallowed. link.rs: Remove the ineffective --export-if-defined flags that were added during debugging. * cleanup * fix scope dir * change up naming a bit * more tidying up * more cleanups * ignore early return * clean er up * more comprehensive cache bustign * bust fingerprints of dag * move bust_fingerprint back to request.rs * add better rustdoc * more idiomatic * more cleanups * fix panic, typos * more lints * only delete workspace prints in fat mod * clippy
This commit is contained in:
1 parent
348208d1cb
commit
fb855b7088
37 files changed
+7276
-6865
No files matched your search
@@ -1,6 +1,7 @@
|
||||
use crate::BundledAsset;
|
||||
use const_serialize::{ConstStr, SerializeConst};
|
||||
use const_serialize_08 as const_serialize;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::hash::Hash;
|
||||
|
||||
/// Unified symbol data that can represent both assets and permissions
|
||||
@@ -79,7 +80,7 @@ pub struct PlatformIdentifiers {
|
||||
}
|
||||
|
||||
/// Metadata describing an Android plugin artifact (.aar) that must be copied into the host Gradle project.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, SerializeConst)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, SerializeConst, Serialize, Deserialize)]
|
||||
pub struct AndroidArtifactMetadata {
|
||||
pub plugin_name: ConstStr,
|
||||
pub artifact_path: ConstStr,
|
||||
@@ -101,7 +102,7 @@ impl AndroidArtifactMetadata {
|
||||
}
|
||||
|
||||
/// Metadata for a Swift package that needs to be linked into the app (iOS/macOS).
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, SerializeConst)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, SerializeConst, Serialize, Deserialize)]
|
||||
pub struct SwiftPackageMetadata {
|
||||
pub plugin_name: ConstStr,
|
||||
pub package_path: ConstStr,
|
||||
|
||||
Reference in new issue
Block a user