Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .changes/ignore-plugin-build-error-on-docsrs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
"autostart": patch:fix
"autostart-js": patch:fix
"barcode-scanner": patch:fix
"barcode-scanner-js": patch:fix
"biometric": patch:fix
"biometric-js": patch:fix
"cli": patch:fix
"cli-js": patch:fix
"clipboard-manager": patch:fix
"clipboard-manager-js": patch:fix
"deep-link": patch:fix
"deep-link-js": patch:fix
"dialog": patch:fix
"dialog-js": patch:fix
"fs": patch:fix
"fs-js": patch:fix
"geolocation": patch:fix
"geolocation-js": patch:fix
"global-shortcut": patch:fix
"global-shortcut-js": patch:fix
"haptics": patch:fix
"haptics-js": patch:fix
"http": patch:fix
"http-js": patch:fix
"log": patch:fix
"log-js": patch:fix
"nfc": patch:fix
"nfc-js": patch:fix
"notification": patch:fix
"notification-js": patch:fix
"opener": patch:fix
"opener-js": patch:fix
"os": patch:fix
"os-js": patch:fix
"positioner": patch:fix
"positioner-js": patch:fix
"process": patch:fix
"process-js": patch:fix
"shell": patch:fix
"shell-js": patch:fix
"sql": patch:fix
"sql-js": patch:fix
"store": patch:fix
"store-js": patch:fix
"stronghold": patch:fix
"stronghold-js": patch:fix
"updater": patch:fix
"updater-js": patch:fix
"upload": patch:fix
"upload-js": patch:fix
"websocket": patch:fix
"websocket-js": patch:fix
"window-state": patch:fix
"window-state-js": patch:fix
---

When downstream crates depend on `tauri-plugin-*`, the `tauri-plugin` build process may attempt to write to the plugin source directory in certain cases. However, `docs.rs` is a read-only environment, which causes these downstream crates to fail to build on `docs.rs`. Until tauri-apps/tauri#11187 is resolved, we are temporarily suppressing this error.
9 changes: 7 additions & 2 deletions plugins/autostart/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
const COMMANDS: &[&str] = &["enable", "disable", "is_enabled"];

fn main() {
tauri_plugin::Builder::new(COMMANDS)
let result = tauri_plugin::Builder::new(COMMANDS)
.global_api_script_path("./api-iife.js")
.build();
.try_build();

// - FIXME: Temporarily ignore writing errors on docs.rs, this is a mitigation for <https://github.com/tauri-apps/tauri/pull/13597#issuecomment-2961321899>
if !cfg!(docsrs) {
result.unwrap();
}
}
5 changes: 3 additions & 2 deletions plugins/barcode-scanner/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ fn main() {
.ios_path("ios")
.try_build();

// when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation build
if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) {
// - when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation build
// - FIXME: Temporarily ignore writing errors on docs.rs, this is a mitigation for <https://github.com/tauri-apps/tauri/pull/13597#issuecomment-2961321899>
if !cfg!(docsrs) {
result.unwrap();
}
}
5 changes: 3 additions & 2 deletions plugins/biometric/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ fn main() {
.ios_path("ios")
.try_build();

// when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation build
if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) {
// - when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation build
// - FIXME: Temporarily ignore writing errors on docs.rs, this is a mitigation for <https://github.com/tauri-apps/tauri/pull/13597#issuecomment-2961321899>
if !cfg!(docsrs) {
result.unwrap();
}
}
9 changes: 7 additions & 2 deletions plugins/cli/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
const COMMANDS: &[&str] = &["cli_matches"];

fn main() {
tauri_plugin::Builder::new(COMMANDS)
let result = tauri_plugin::Builder::new(COMMANDS)
.global_api_script_path("./api-iife.js")
.build();
.try_build();

// - FIXME: Temporarily ignore writing errors on docs.rs, this is a mitigation for <https://github.com/tauri-apps/tauri/pull/13597#issuecomment-2961321899>
if !cfg!(docsrs) {
result.unwrap();
}
}
5 changes: 3 additions & 2 deletions plugins/clipboard-manager/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ fn main() {
.ios_path("ios")
.try_build();

// when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation build
if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) {
// - when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation build
// - FIXME: Temporarily ignore writing errors on docs.rs, this is a mitigation for <https://github.com/tauri-apps/tauri/pull/13597#issuecomment-2961321899>
if !cfg!(docsrs) {
result.unwrap();
}
}
5 changes: 3 additions & 2 deletions plugins/deep-link/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ fn main() {
.android_path("android")
.try_build();

// when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation build
if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) {
// - when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation build
// - FIXME: Temporarily ignore writing errors on docs.rs, this is a mitigation for <https://github.com/tauri-apps/tauri/pull/13597#issuecomment-2961321899>
if !cfg!(docsrs) {
result.unwrap();
}

Expand Down
5 changes: 3 additions & 2 deletions plugins/dialog/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ fn main() {
.ios_path("ios")
.try_build();

// when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation build
if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) {
// - when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation build
// - FIXME: Temporarily ignore writing errors on docs.rs, this is a mitigation for <https://github.com/tauri-apps/tauri/pull/13597#issuecomment-2961321899>
if !cfg!(docsrs) {
result.unwrap();
}
}
9 changes: 7 additions & 2 deletions plugins/fs/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ permissions = [
}
}

tauri_plugin::Builder::new(
let result = tauri_plugin::Builder::new(
&COMMANDS
.iter()
// FIXME: https://docs.rs/crate/tauri-plugin-fs/2.1.0/builds/1571296
Expand All @@ -220,7 +220,12 @@ permissions = [
.global_api_script_path("./api-iife.js")
.global_scope_schema(schemars::schema_for!(FsScopeEntry))
.android_path("android")
.build();
.try_build();

// - FIXME: Temporarily ignore writing errors on docs.rs, this is a mitigation for <https://github.com/tauri-apps/tauri/pull/13597#issuecomment-2961321899>
if !cfg!(docsrs) {
result.unwrap();
}

// workaround to include nested permissions as `tauri_plugin` doesn't support it
let permissions_dir = autogenerated.join("commands");
Expand Down
5 changes: 3 additions & 2 deletions plugins/geolocation/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ fn main() {
.ios_path("ios")
.try_build();

// when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation build
if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) {
// - when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation build
// - FIXME: Temporarily ignore writing errors on docs.rs, this is a mitigation for <https://github.com/tauri-apps/tauri/pull/13597#issuecomment-2961321899>
if !cfg!(docsrs) {
result.unwrap();
}
}
9 changes: 7 additions & 2 deletions plugins/global-shortcut/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
const COMMANDS: &[&str] = &["register", "unregister", "unregister_all", "is_registered"];

fn main() {
tauri_plugin::Builder::new(COMMANDS)
let result = tauri_plugin::Builder::new(COMMANDS)
.global_api_script_path("./api-iife.js")
.build();
.try_build();

// - FIXME: Temporarily ignore writing errors on docs.rs, this is a mitigation for <https://github.com/tauri-apps/tauri/pull/13597#issuecomment-2961321899>
if !cfg!(docsrs) {
result.unwrap();
}
}
5 changes: 3 additions & 2 deletions plugins/haptics/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ fn main() {
.ios_path("ios")
.try_build();

// when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation build
if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) {
// - when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation build
// - FIXME: Temporarily ignore writing errors on docs.rs, this is a mitigation for <https://github.com/tauri-apps/tauri/pull/13597#issuecomment-2961321899>
if !cfg!(docsrs) {
result.unwrap();
}
}
9 changes: 7 additions & 2 deletions plugins/http/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,13 @@ fn _f() {
}

fn main() {
tauri_plugin::Builder::new(COMMANDS)
let result = tauri_plugin::Builder::new(COMMANDS)
.global_api_script_path("./api-iife.js")
.global_scope_schema(schemars::schema_for!(HttpScopeEntry))
.build();
.try_build();

// - FIXME: Temporarily ignore writing errors on docs.rs, this is a mitigation for <https://github.com/tauri-apps/tauri/pull/13597#issuecomment-2961321899>
if !cfg!(docsrs) {
result.unwrap();
}
}
9 changes: 7 additions & 2 deletions plugins/log/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@
const COMMANDS: &[&str] = &["log"];

fn main() {
tauri_plugin::Builder::new(COMMANDS)
let result = tauri_plugin::Builder::new(COMMANDS)
.global_api_script_path("./api-iife.js")
.ios_path("ios")
.build();
.try_build();

// - FIXME: Temporarily ignore writing errors on docs.rs, this is a mitigation for <https://github.com/tauri-apps/tauri/pull/13597#issuecomment-2961321899>
if !cfg!(docsrs) {
result.unwrap();
}
}
5 changes: 3 additions & 2 deletions plugins/nfc/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ fn main() {
.ios_path("ios")
.try_build();

// when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation build
if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) {
// - when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation build
// - FIXME: Temporarily ignore writing errors on docs.rs, this is a mitigation for <https://github.com/tauri-apps/tauri/pull/13597#issuecomment-2961321899>
if !cfg!(docsrs) {
result.unwrap();
}

Expand Down
5 changes: 3 additions & 2 deletions plugins/notification/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ fn main() {
.ios_path("ios")
.try_build();

// when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation build
if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) {
// - when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation build
// - FIXME: Temporarily ignore writing errors on docs.rs, this is a mitigation for <https://github.com/tauri-apps/tauri/pull/13597#issuecomment-2961321899>
if !cfg!(docsrs) {
result.unwrap();
}
}
9 changes: 7 additions & 2 deletions plugins/opener/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,17 @@ fn _f() {
const COMMANDS: &[&str] = &["open_url", "open_path", "reveal_item_in_dir"];

fn main() {
tauri_plugin::Builder::new(COMMANDS)
let result = tauri_plugin::Builder::new(COMMANDS)
.global_api_script_path("./api-iife.js")
.android_path("android")
.ios_path("ios")
.global_scope_schema(schemars::schema_for!(OpenerScopeEntry))
.build();
.try_build();

// - FIXME: Temporarily ignore writing errors on docs.rs, this is a mitigation for <https://github.com/tauri-apps/tauri/pull/13597#issuecomment-2961321899>
if !cfg!(docsrs) {
result.unwrap();
}

let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap();
let mobile = target_os == "ios" || target_os == "android";
Expand Down
9 changes: 7 additions & 2 deletions plugins/os/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ const COMMANDS: &[&str] = &[
];

fn main() {
tauri_plugin::Builder::new(COMMANDS)
let result = tauri_plugin::Builder::new(COMMANDS)
.global_api_script_path("./api-iife.js")
.build();
.try_build();

// - FIXME: Temporarily ignore writing errors on docs.rs, this is a mitigation for <https://github.com/tauri-apps/tauri/pull/13597#issuecomment-2961321899>
if !cfg!(docsrs) {
result.unwrap();
}
}
9 changes: 7 additions & 2 deletions plugins/positioner/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ const COMMANDS: &[&str] = &[
];

fn main() {
tauri_plugin::Builder::new(COMMANDS)
let result = tauri_plugin::Builder::new(COMMANDS)
.global_api_script_path("./api-iife.js")
.build();
.try_build();

// - FIXME: Temporarily ignore writing errors on docs.rs, this is a mitigation for <https://github.com/tauri-apps/tauri/pull/13597#issuecomment-2961321899>
if !cfg!(docsrs) {
result.unwrap();
}
}
9 changes: 7 additions & 2 deletions plugins/process/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
const COMMANDS: &[&str] = &["exit", "restart"];

fn main() {
tauri_plugin::Builder::new(COMMANDS)
let result = tauri_plugin::Builder::new(COMMANDS)
.global_api_script_path("./api-iife.js")
.build();
.try_build();

// - FIXME: Temporarily ignore writing errors on docs.rs, this is a mitigation for <https://github.com/tauri-apps/tauri/pull/13597#issuecomment-2961321899>
if !cfg!(docsrs) {
result.unwrap();
}
}
9 changes: 7 additions & 2 deletions plugins/shell/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,17 @@ fn _f() {
const COMMANDS: &[&str] = &["execute", "spawn", "stdin_write", "kill", "open"];

fn main() {
tauri_plugin::Builder::new(COMMANDS)
let result = tauri_plugin::Builder::new(COMMANDS)
.global_api_script_path("./api-iife.js")
.global_scope_schema(schemars::schema_for!(ShellScopeEntry))
.android_path("android")
.ios_path("ios")
.build();
.try_build();

// - FIXME: Temporarily ignore writing errors on docs.rs, this is a mitigation for <https://github.com/tauri-apps/tauri/pull/13597#issuecomment-2961321899>
if !cfg!(docsrs) {
result.unwrap();
}

let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap();
let mobile = target_os == "ios" || target_os == "android";
Expand Down
9 changes: 7 additions & 2 deletions plugins/sql/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
const COMMANDS: &[&str] = &["load", "execute", "select", "close"];

fn main() {
tauri_plugin::Builder::new(COMMANDS)
let result = tauri_plugin::Builder::new(COMMANDS)
.global_api_script_path("./api-iife.js")
.build();
.try_build();

// - FIXME: Temporarily ignore writing errors on docs.rs, this is a mitigation for <https://github.com/tauri-apps/tauri/pull/13597#issuecomment-2961321899>
if !cfg!(docsrs) {
result.unwrap();
}
}
9 changes: 7 additions & 2 deletions plugins/store/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ const COMMANDS: &[&str] = &[
];

fn main() {
tauri_plugin::Builder::new(COMMANDS)
let result = tauri_plugin::Builder::new(COMMANDS)
.global_api_script_path("./api-iife.js")
.build();
.try_build();

// - FIXME: Temporarily ignore writing errors on docs.rs, this is a mitigation for <https://github.com/tauri-apps/tauri/pull/13597#issuecomment-2961321899>
if !cfg!(docsrs) {
result.unwrap();
}
}
9 changes: 7 additions & 2 deletions plugins/stronghold/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ const COMMANDS: &[&str] = &[
];

fn main() {
tauri_plugin::Builder::new(COMMANDS)
let result = tauri_plugin::Builder::new(COMMANDS)
.global_api_script_path("./api-iife.js")
.build();
.try_build();

// - FIXME: Temporarily ignore writing errors on docs.rs, this is a mitigation for <https://github.com/tauri-apps/tauri/pull/13597#issuecomment-2961321899>
if !cfg!(docsrs) {
result.unwrap();
}
}
Loading