Fix hotpatched assets (#4326)
* wip: fixes to get docsite working again * Fix asset location with PIC in hot patched builds * Add an hidden cli flag to exit early in hot patch tests on failure * add a test for hot patching with assets * fix clippy * fix looks_like_manganis_symbol * longer timeout for hot patching in CI * log page content * log assets * Log asset after write * record a playwright trace * Explicitly enable cargo incremental for hot patching * fix retry for patch test * reset asset * disable hot patching test for new exports * add nightly playwright * use different toolchain names * use beta instead of nightly for less thrashing * add failing test * workaround hot reloading bug * restore swapping asset tests * add toolchain --------- Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
This commit is contained in:
1 parent
6cc379718b
commit
2071be2b67
20 files changed
+365
-125
No files matched your search
@@ -597,26 +597,41 @@ fn create_wasm_jump_table(patch: &Path, cache: &HotpatchModuleCache) -> Result<J
|
||||
{
|
||||
continue;
|
||||
}
|
||||
let name = import.name.as_str().to_string();
|
||||
|
||||
if let Some(table_idx) = name_to_ifunc_old.get(import.name.as_str()) {
|
||||
let name = import.name.as_str().to_string();
|
||||
new.imports.delete(env_func_import);
|
||||
convert_import_to_ifunc_call(
|
||||
&mut new,
|
||||
ifunc_table_initializer,
|
||||
func_id,
|
||||
*table_idx,
|
||||
name,
|
||||
name.clone(),
|
||||
);
|
||||
}
|
||||
|
||||
if name_is_bindgen_symbol(&name) {
|
||||
new.imports.delete(env_func_import);
|
||||
convert_import_to_ifunc_call(&mut new, ifunc_table_initializer, func_id, 0, name);
|
||||
}
|
||||
}
|
||||
|
||||
// Wire up the preserved intrinsic functions that we saved before running wasm-bindgen to the expected
|
||||
// imports from the patch.
|
||||
for import_id in wbg_funcs {
|
||||
let import = new.imports.get_mut(import_id);
|
||||
let ImportKind::Function(func_id) = import.kind else {
|
||||
continue;
|
||||
};
|
||||
|
||||
import.module = "env".into();
|
||||
import.name = format!("__saved_wbg_{}", import.name);
|
||||
|
||||
if name_is_bindgen_symbol(&import.name) {
|
||||
let name = import.name.as_str().to_string();
|
||||
new.imports.delete(import_id);
|
||||
convert_import_to_ifunc_call(&mut new, ifunc_table_initializer, func_id, 0, name);
|
||||
}
|
||||
}
|
||||
|
||||
// Wipe away the unnecessary sections
|
||||
|
||||
Reference in new issue
Block a user