From 562e22814f0920ee0e2928b3d317abeafe98103d Mon Sep 17 00:00:00 2001 From: Isaac Clayton Date: Wed, 13 Jul 2022 17:08:43 +0200 Subject: [PATCH] Remove .pre suffix use .epoch and .fuel instead --- crates/plugin_runtime/README.md | 2 ++ crates/plugin_runtime/build.rs | 2 +- crates/zed/src/languages/language_plugin.rs | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/plugin_runtime/README.md b/crates/plugin_runtime/README.md index 8ac843cb02f0491dbdc09250e51734440abe561a..4088041fe67b5f865bb6eec2ed71ea1fe090d141 100644 --- a/crates/plugin_runtime/README.md +++ b/crates/plugin_runtime/README.md @@ -154,6 +154,8 @@ Plugins in the `plugins` directory are automatically recompiled and serialized t - `plugin.wasm.pre` is the plugin compiled to Wasm *and additionally* precompiled to host-platform-agnostic cranelift-specific IR. This should be about 700KB for debug builds and 500KB in release builds. Each plugin takes about 1 or 2 seconds to compile to native code using cranelift, so precompiling plugins drastically reduces the startup time required to begin to run a plugin. +> TODO: Rework precompiled plugins. + For all intents and purposes, it is *highly recommended* that you use precompiled plugins where possible, as they are much more lightweight and take much less time to instantiate. ### Instantiating a plugin diff --git a/crates/plugin_runtime/build.rs b/crates/plugin_runtime/build.rs index b323bdc34e9d22855c233fbf2bf6ac6dc2633e38..8803cb2fb74c0d12595c0db35d69092a305eb99b 100644 --- a/crates/plugin_runtime/build.rs +++ b/crates/plugin_runtime/build.rs @@ -88,7 +88,7 @@ fn precompile(path: &Path, engine: &Engine, engine_name: &str) { .precompile_module(&bytes) .expect("Could not precompile module"); let out_path = path.parent().unwrap().join(&format!( - "{}.{}.pre", + "{}.{}", path.file_name().unwrap().to_string_lossy(), engine_name, )); diff --git a/crates/zed/src/languages/language_plugin.rs b/crates/zed/src/languages/language_plugin.rs index 690e6d385c81bb9d9afc3c15fb85ae32cbd9eead..090dc6b31358f8d868ee3421e77318592a84f878 100644 --- a/crates/zed/src/languages/language_plugin.rs +++ b/crates/zed/src/languages/language_plugin.rs @@ -26,7 +26,7 @@ pub async fn new_json(executor: Arc) -> Result { .map(|output| output.stdout) })? .init(PluginBinary::Precompiled(include_bytes!( - "../../../../plugins/bin/json_language.wasm.epoch.pre" + "../../../../plugins/bin/json_language.wasm.epoch" ))) .await?;