fix: temporarily suppress plugin build errors on `docs.rs`

pull/2771/head
WSH032 1 month ago
parent ce9888a2d4
commit 30a01adbb5
No known key found for this signature in database

@ -0,0 +1,60 @@
---
"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
"autostart": patch:fix
"autostart-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.

@ -5,7 +5,12 @@
const COMMANDS: &[&str] = &["enable", "disable", "is_enabled"]; const COMMANDS: &[&str] = &["enable", "disable", "is_enabled"];
fn main() { fn main() {
tauri_plugin::Builder::new(COMMANDS) let result = tauri_plugin::Builder::new(COMMANDS)
.global_api_script_path("./api-iife.js") .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();
}
} }

@ -18,8 +18,9 @@ fn main() {
.ios_path("ios") .ios_path("ios")
.try_build(); .try_build();
// when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation 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")) { // - 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(); result.unwrap();
} }
} }

@ -11,8 +11,9 @@ fn main() {
.ios_path("ios") .ios_path("ios")
.try_build(); .try_build();
// when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation 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")) { // - 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(); result.unwrap();
} }
} }

@ -5,7 +5,12 @@
const COMMANDS: &[&str] = &["cli_matches"]; const COMMANDS: &[&str] = &["cli_matches"];
fn main() { fn main() {
tauri_plugin::Builder::new(COMMANDS) let result = tauri_plugin::Builder::new(COMMANDS)
.global_api_script_path("./api-iife.js") .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();
}
} }

@ -18,8 +18,9 @@ fn main() {
.ios_path("ios") .ios_path("ios")
.try_build(); .try_build();
// when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation 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")) { // - 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(); result.unwrap();
} }
} }

@ -62,8 +62,9 @@ fn main() {
.android_path("android") .android_path("android")
.try_build(); .try_build();
// when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation 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")) { // - 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(); result.unwrap();
} }

@ -11,8 +11,9 @@ fn main() {
.ios_path("ios") .ios_path("ios")
.try_build(); .try_build();
// when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation 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")) { // - 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(); result.unwrap();
} }
} }

@ -209,7 +209,7 @@ permissions = [
} }
} }
tauri_plugin::Builder::new( let result = tauri_plugin::Builder::new(
&COMMANDS &COMMANDS
.iter() .iter()
// FIXME: https://docs.rs/crate/tauri-plugin-fs/2.1.0/builds/1571296 // FIXME: https://docs.rs/crate/tauri-plugin-fs/2.1.0/builds/1571296
@ -220,7 +220,12 @@ permissions = [
.global_api_script_path("./api-iife.js") .global_api_script_path("./api-iife.js")
.global_scope_schema(schemars::schema_for!(FsScopeEntry)) .global_scope_schema(schemars::schema_for!(FsScopeEntry))
.android_path("android") .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 // workaround to include nested permissions as `tauri_plugin` doesn't support it
let permissions_dir = autogenerated.join("commands"); let permissions_dir = autogenerated.join("commands");

@ -17,8 +17,9 @@ fn main() {
.ios_path("ios") .ios_path("ios")
.try_build(); .try_build();
// when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation 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")) { // - 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(); result.unwrap();
} }
} }

@ -5,7 +5,12 @@
const COMMANDS: &[&str] = &["register", "unregister", "unregister_all", "is_registered"]; const COMMANDS: &[&str] = &["register", "unregister", "unregister_all", "is_registered"];
fn main() { fn main() {
tauri_plugin::Builder::new(COMMANDS) let result = tauri_plugin::Builder::new(COMMANDS)
.global_api_script_path("./api-iife.js") .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();
}
} }

@ -16,8 +16,9 @@ fn main() {
.ios_path("ios") .ios_path("ios")
.try_build(); .try_build();
// when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation 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")) { // - 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(); result.unwrap();
} }
} }

@ -60,8 +60,13 @@ fn _f() {
} }
fn main() { fn main() {
tauri_plugin::Builder::new(COMMANDS) let result = tauri_plugin::Builder::new(COMMANDS)
.global_api_script_path("./api-iife.js") .global_api_script_path("./api-iife.js")
.global_scope_schema(schemars::schema_for!(HttpScopeEntry)) .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();
}
} }

@ -5,8 +5,13 @@
const COMMANDS: &[&str] = &["log"]; const COMMANDS: &[&str] = &["log"];
fn main() { fn main() {
tauri_plugin::Builder::new(COMMANDS) let result = tauri_plugin::Builder::new(COMMANDS)
.global_api_script_path("./api-iife.js") .global_api_script_path("./api-iife.js")
.ios_path("ios") .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();
}
} }

@ -11,8 +11,9 @@ fn main() {
.ios_path("ios") .ios_path("ios")
.try_build(); .try_build();
// when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation 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")) { // - 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(); result.unwrap();
} }

@ -28,8 +28,9 @@ fn main() {
.ios_path("ios") .ios_path("ios")
.try_build(); .try_build();
// when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation 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")) { // - 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(); result.unwrap();
} }
} }

@ -113,12 +113,17 @@ fn _f() {
const COMMANDS: &[&str] = &["open_url", "open_path", "reveal_item_in_dir"]; const COMMANDS: &[&str] = &["open_url", "open_path", "reveal_item_in_dir"];
fn main() { fn main() {
tauri_plugin::Builder::new(COMMANDS) let result = tauri_plugin::Builder::new(COMMANDS)
.global_api_script_path("./api-iife.js") .global_api_script_path("./api-iife.js")
.android_path("android") .android_path("android")
.ios_path("ios") .ios_path("ios")
.global_scope_schema(schemars::schema_for!(OpenerScopeEntry)) .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 target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap();
let mobile = target_os == "ios" || target_os == "android"; let mobile = target_os == "ios" || target_os == "android";

@ -14,7 +14,12 @@ const COMMANDS: &[&str] = &[
]; ];
fn main() { fn main() {
tauri_plugin::Builder::new(COMMANDS) let result = tauri_plugin::Builder::new(COMMANDS)
.global_api_script_path("./api-iife.js") .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,7 +9,12 @@ const COMMANDS: &[&str] = &[
]; ];
fn main() { fn main() {
tauri_plugin::Builder::new(COMMANDS) let result = tauri_plugin::Builder::new(COMMANDS)
.global_api_script_path("./api-iife.js") .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,7 +5,12 @@
const COMMANDS: &[&str] = &["exit", "restart"]; const COMMANDS: &[&str] = &["exit", "restart"];
fn main() { fn main() {
tauri_plugin::Builder::new(COMMANDS) let result = tauri_plugin::Builder::new(COMMANDS)
.global_api_script_path("./api-iife.js") .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();
}
} }

@ -166,12 +166,17 @@ fn _f() {
const COMMANDS: &[&str] = &["execute", "spawn", "stdin_write", "kill", "open"]; const COMMANDS: &[&str] = &["execute", "spawn", "stdin_write", "kill", "open"];
fn main() { fn main() {
tauri_plugin::Builder::new(COMMANDS) let result = tauri_plugin::Builder::new(COMMANDS)
.global_api_script_path("./api-iife.js") .global_api_script_path("./api-iife.js")
.global_scope_schema(schemars::schema_for!(ShellScopeEntry)) .global_scope_schema(schemars::schema_for!(ShellScopeEntry))
.android_path("android") .android_path("android")
.ios_path("ios") .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 target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap();
let mobile = target_os == "ios" || target_os == "android"; let mobile = target_os == "ios" || target_os == "android";

@ -5,7 +5,12 @@
const COMMANDS: &[&str] = &["load", "execute", "select", "close"]; const COMMANDS: &[&str] = &["load", "execute", "select", "close"];
fn main() { fn main() {
tauri_plugin::Builder::new(COMMANDS) let result = tauri_plugin::Builder::new(COMMANDS)
.global_api_script_path("./api-iife.js") .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();
}
} }

@ -20,7 +20,12 @@ const COMMANDS: &[&str] = &[
]; ];
fn main() { fn main() {
tauri_plugin::Builder::new(COMMANDS) let result = tauri_plugin::Builder::new(COMMANDS)
.global_api_script_path("./api-iife.js") .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();
}
} }

@ -17,7 +17,12 @@ const COMMANDS: &[&str] = &[
]; ];
fn main() { fn main() {
tauri_plugin::Builder::new(COMMANDS) let result = tauri_plugin::Builder::new(COMMANDS)
.global_api_script_path("./api-iife.js") .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,9 +5,14 @@
const COMMANDS: &[&str] = &["check", "download", "install", "download_and_install"]; const COMMANDS: &[&str] = &["check", "download", "install", "download_and_install"];
fn main() { fn main() {
tauri_plugin::Builder::new(COMMANDS) let result = tauri_plugin::Builder::new(COMMANDS)
.global_api_script_path("./api-iife.js") .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();
}
let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap(); let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap();
let mobile = target_os == "ios" || target_os == "android"; let mobile = target_os == "ios" || target_os == "android";

@ -5,7 +5,12 @@
const COMMANDS: &[&str] = &["download", "upload"]; const COMMANDS: &[&str] = &["download", "upload"];
fn main() { fn main() {
tauri_plugin::Builder::new(COMMANDS) let result = tauri_plugin::Builder::new(COMMANDS)
.global_api_script_path("./api-iife.js") .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,7 +5,12 @@
const COMMANDS: &[&str] = &["connect", "send"]; const COMMANDS: &[&str] = &["connect", "send"];
fn main() { fn main() {
tauri_plugin::Builder::new(COMMANDS) let result = tauri_plugin::Builder::new(COMMANDS)
.global_api_script_path("./api-iife.js") .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,7 +5,12 @@
const COMMANDS: &[&str] = &["save_window_state", "restore_state", "filename"]; const COMMANDS: &[&str] = &["save_window_state", "restore_state", "filename"];
fn main() { fn main() {
tauri_plugin::Builder::new(COMMANDS) let result = tauri_plugin::Builder::new(COMMANDS)
.global_api_script_path("./api-iife.js") .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…
Cancel
Save