Skip to content

Commit a813792

Browse files
authored
fix(core): compilation issues without execute or sidecar features (#6621)
1 parent 09d5dd5 commit a813792

2 files changed

Lines changed: 12 additions & 7 deletions

File tree

.changes/fix-shell-build.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri": patch
3+
---
4+
5+
Fix compilation issues without the shell API features.

core/tauri/src/endpoints/shell.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,9 @@
55
#![allow(unused_imports)]
66

77
use super::InvokeContext;
8-
use crate::{
9-
api::{
10-
ipc::CallbackFn,
11-
process::{CommandEvent, TerminatedPayload},
12-
},
13-
Runtime,
14-
};
8+
#[cfg(any(shell_execute, shell_sidecar))]
9+
use crate::api::process::{CommandEvent, TerminatedPayload};
10+
use crate::{api::ipc::CallbackFn, Runtime};
1511
#[cfg(shell_scope)]
1612
use crate::{Manager, Scopes};
1713
use encoding_rs::Encoding;
@@ -38,6 +34,7 @@ fn command_child_store() -> &'static ChildStore {
3834
&STORE
3935
}
4036

37+
#[cfg(any(shell_execute, shell_sidecar))]
4138
#[derive(Debug, Clone, Serialize)]
4239
#[serde(tag = "event", content = "payload")]
4340
#[non_exhaustive]
@@ -52,6 +49,7 @@ enum JSCommandEvent {
5249
Terminated(TerminatedPayload),
5350
}
5451

52+
#[cfg(any(shell_execute, shell_sidecar))]
5553
fn get_event_buffer(line: Vec<u8>, encoding: EncodingWrapper) -> Result<Buffer, FromUtf8Error> {
5654
match encoding {
5755
EncodingWrapper::Text(character_encoding) => match character_encoding {
@@ -64,6 +62,7 @@ fn get_event_buffer(line: Vec<u8>, encoding: EncodingWrapper) -> Result<Buffer,
6462
}
6563
}
6664

65+
#[cfg(any(shell_execute, shell_sidecar))]
6766
impl JSCommandEvent {
6867
pub fn new(event: CommandEvent, encoding: EncodingWrapper) -> Self {
6968
match event {
@@ -87,6 +86,7 @@ pub enum Buffer {
8786
Raw(Vec<u8>),
8887
}
8988

89+
#[cfg(any(shell_execute, shell_sidecar))]
9090
#[derive(Debug, Copy, Clone)]
9191
pub enum EncodingWrapper {
9292
Raw,

0 commit comments

Comments
 (0)