summaryrefslogtreecommitdiffstats
path: root/zellij-utils/src/plugin_api
diff options
context:
space:
mode:
authorhar7an <99636919+har7an@users.noreply.github.com>2023-08-28 06:24:27 +0000
committerGitHub <noreply@github.com>2023-08-28 06:24:27 +0000
commit8031d6bf645f2de10820d861292efb26358b4af1 (patch)
treeb406d1cafd3290ae17c27cc1607a9332eebc7664 /zellij-utils/src/plugin_api
parentf6b08ddfaa4e1a12199df0ba317a140e4729efbf (diff)
xtask/pipeline: Fix publish task (#2711)
* xtask/pipeline: Fix publish task which was previously stuck in an infinite loop after successfully publishing a crate. The error originated in the code only checking for error conditions but not breaking out of the inner infinite loop in case of success. * xtask: Improve publish failure UX by offering the user more actions to choose from when an error occured. * utils/assets: Add generated prost files to assets to make sure they're available at build time and are picked up by all components. It seems we hit some strange bug with the build script where, when running `cargo publish --dry-run` the build script **is not** run before regularly compiling zellij-utils. This shouldn't happen according to the docs, but I cannot explain what's causing it. So we're using this as a workaround for now to make a smooth release. * xtask: Prevent accidental git commit deletion when dry-running a publish. * utils: Add comments to protobuf-related code to explain why these changes were performed. The comments all include a link to an issue comment explaining the situation in greater detail. * xtask: Build protobuf definitions when building any part of the project, similar to how we build the plugins when required. This should ensure that all crates built through `cargo xtask` (which is the officially supported build method) will receive up-to-date protobuf definitions.
Diffstat (limited to 'zellij-utils/src/plugin_api')
-rw-r--r--zellij-utils/src/plugin_api/mod.rs16
1 files changed, 15 insertions, 1 deletions
diff --git a/zellij-utils/src/plugin_api/mod.rs b/zellij-utils/src/plugin_api/mod.rs
index 4812d468c..40057fde0 100644
--- a/zellij-utils/src/plugin_api/mod.rs
+++ b/zellij-utils/src/plugin_api/mod.rs
@@ -10,6 +10,20 @@ pub mod plugin_ids;
pub mod plugin_permission;
pub mod resize;
pub mod style;
+// NOTE: This code is currently out of order.
+// Refer to [the PR introducing this change][1] to learn more about the reasons.
+// TL;DR: When running `cargo release --dry-run` the build-script in zellij-utils is not executed
+// for unknown reasons, causing compilation to fail. To make a new release possible in the
+// meantime, we decided to temporarily include the protobuf plugin API definitions
+// statically.
+//
+// [1]: https://github.com/zellij-org/zellij/pull/2711#issuecomment-1695015818
+//pub mod generated_api {
+// include!(concat!(env!("OUT_DIR"), "/generated_plugin_api.rs"));
+//}
pub mod generated_api {
- include!(concat!(env!("OUT_DIR"), "/generated_plugin_api.rs"));
+ include!(concat!(
+ env!("CARGO_MANIFEST_DIR"),
+ "/assets/prost/generated_plugin_api.rs"
+ ));
}