Skip to content
Merged
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
5 changes: 5 additions & 0 deletions .changes/apprun-mirror.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
tauri-bundler: patch:bug
---

The AppImage bundler now pulls the AppRun binaries from our GitHub mirror, fixing 404 errors.
43 changes: 27 additions & 16 deletions .github/workflows/covector-version-or-publish-v1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,26 @@ jobs:
matrix:
project:
- name: core
flags: '--manifest-path=./Cargo.toml --features tracing,compression,wry,linux-protocol-headers,isolation,custom-protocol,api-all,cli,updater,system-tray,windows7-compat,http-multipart,test'
flags: "--manifest-path=./Cargo.toml --features tracing,compression,wry,linux-protocol-headers,isolation,custom-protocol,api-all,cli,updater,system-tray,windows7-compat,http-multipart,test"
- name: bundler
flags: '--manifest-path=./tooling/bundler/Cargo.toml'
toolchain: '1.71.0'
flags: "--manifest-path=./tooling/bundler/Cargo.toml"
toolchain: "1.71.0"
- name: cli
flags: '--manifest-path=./tooling/cli/Cargo.toml'
toolchain: '1.71.0'
flags: "--manifest-path=./tooling/cli/Cargo.toml"
toolchain: "1.71.0"

platform:
- {
target: x86_64-pc-windows-msvc,
os: windows-latest,
toolchain: '1.61.0'
toolchain: "1.61.0",
}
- {
target: x86_64-unknown-linux-gnu,
os: ubuntu-22.04,
toolchain: '1.60.0'
}
- {
target: x86_64-apple-darwin,
os: macos-13,
toolchain: '1.60.0'
toolchain: "1.60.0",
}
- { target: x86_64-apple-darwin, os: macos-13, toolchain: "1.60.0" }
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -99,6 +95,21 @@ jobs:
cargo update -p openssl --precise 0.10.66
cargo update -p openssl-sys --precise 0.9.103
cargo update -p cargo_toml --precise 0.15.2
cargo update -p shared_child --precise 1.0.0
cargo update -p libc:0.2 --precise 0.2.163
cargo update -p os_pipe --precise 1.1.5

- name: Downgrade crates with MSRV conflict (bundler)
if: ${{ matrix.project.name != 'core' }}
env:
CARGO_RESOLVER_INCOMPATIBLE_RUST_VERSIONS: fallback
run: |
cd tooling/bundler
cargo update -p avif-serialize --precise 0.8.3
cargo update -p zune-jpeg --precise 0.4.14
cd ../cli
cargo update -p avif-serialize --precise 0.8.3
cargo update -p zune-jpeg --precise 0.4.14

- name: install rust ${{ matrix.project.toolchain || matrix.platform.toolchain }}
uses: dtolnay/rust-toolchain@master
Expand Down Expand Up @@ -175,7 +186,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 16
registry-url: 'https://registry.npmjs.org'
registry-url: "https://registry.npmjs.org"
cache: yarn
cache-dependency-path: tooling/*/yarn.lock

Expand All @@ -194,7 +205,7 @@ jobs:
CARGO_AUDIT_OPTIONS: ${{ secrets.CARGO_AUDIT_OPTIONS }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
command: 'version-or-publish'
command: "version-or-publish"
createRelease: true
recognizeContributors: true

Expand All @@ -205,8 +216,8 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
branch: release/version-updates-v1
title: Apply Version Updates From Current Changes (v1)
commit-message: 'apply version updates'
labels: 'version updates'
commit-message: "apply version updates"
labels: "version updates"
body: ${{ steps.covector.outputs.change }}

- name: Trigger doc update
Expand Down
10 changes: 3 additions & 7 deletions core/tauri-build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ fn copy_dir(from: &Path, to: &Path) -> Result<()> {

// Copies the framework under `{src_dir}/{framework}.framework` to `{dest_dir}/{framework}.framework`.
fn copy_framework_from(src_dir: &Path, framework: &str, dest_dir: &Path) -> Result<bool> {
let src_name = format!("{}.framework", framework);
let src_name = format!("{framework}.framework");
let src_path = src_dir.join(&src_name);
if src_path.exists() {
copy_dir(&src_path, &dest_dir.join(&src_name))?;
Expand All @@ -140,12 +140,8 @@ fn copy_framework_from(src_dir: &Path, framework: &str, dest_dir: &Path) -> Resu

// Copies the macOS application bundle frameworks to the target folder
fn copy_frameworks(dest_dir: &Path, frameworks: &[String]) -> Result<()> {
std::fs::create_dir_all(dest_dir).with_context(|| {
format!(
"Failed to create frameworks output directory at {:?}",
dest_dir
)
})?;
std::fs::create_dir_all(dest_dir)
.with_context(|| format!("Failed to create frameworks output directory at {dest_dir:?}"))?;
for framework in frameworks.iter() {
if framework.ends_with(".framework") {
let src_path = PathBuf::from(framework);
Expand Down
2 changes: 1 addition & 1 deletion core/tauri/src/test/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ mod tests {
});

app.run(|_app, event| {
println!("{:?}", event);
println!("{event:?}");
});
}
}
2 changes: 1 addition & 1 deletion core/tauri/src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1996,7 +1996,7 @@ pub(crate) fn ipc_scope_not_found_error_message(label: &str, url: &str) -> Strin
}

pub(crate) fn ipc_scope_window_error_message(label: &str) -> String {
format!("Scope not defined for window `{}`. See https://tauri.app/v1/api/config/#securityconfig.dangerousremotedomainipcaccess and https://docs.rs/tauri/1/tauri/scope/struct.IpcScope.html#method.configure_remote_access", label)
format!("Scope not defined for window `{label}`. See https://tauri.app/v1/api/config/#securityconfig.dangerousremotedomainipcaccess and https://docs.rs/tauri/1/tauri/scope/struct.IpcScope.html#method.configure_remote_access")
}

pub(crate) fn ipc_scope_domain_error_message(url: &str) -> String {
Expand Down
2 changes: 1 addition & 1 deletion core/tests/app-updater/tests/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ fn update_app_flow<F: FnOnce(Options<'_>) -> (PathBuf, TauriVersion)>(build_app_
.unwrap_or_else(|_| panic!("failed to read signature file {}", signature_path.display()));

let out_updater_path =
out_bundle_path.with_extension(format!("{}.{}", bundle_updater_ext, updater_zip_ext));
out_bundle_path.with_extension(format!("{bundle_updater_ext}.{updater_zip_ext}"));

(out_updater_path, signature)
} else {
Expand Down
3 changes: 1 addition & 2 deletions tooling/bundler/src/bundle/category.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,7 @@ impl serde::de::Visitor<'_> for AppCategoryVisitor {
match self.did_you_mean {
Some(string) => write!(
formatter,
"a valid app category string (did you mean \"{}\"?)",
string
"a valid app category string (did you mean \"{string}\"?)"
),
None => write!(formatter, "a valid app category string"),
}
Expand Down
20 changes: 7 additions & 13 deletions tooling/bundler/src/bundle/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,12 @@ pub fn copy_file(from: impl AsRef<Path>, to: impl AsRef<Path>) -> crate::Result<
let to = to.as_ref();
if !from.exists() {
return Err(crate::Error::GenericError(format!(
"{:?} does not exist",
from
"{from:?} does not exist"
)));
}
if !from.is_file() {
return Err(crate::Error::GenericError(format!(
"{:?} is not a file",
from
"{from:?} is not a file"
)));
}
let dest_dir = to.parent().expect("No data in parent");
Expand All @@ -96,20 +94,17 @@ pub fn copy_file(from: impl AsRef<Path>, to: impl AsRef<Path>) -> crate::Result<
pub fn copy_dir(from: &Path, to: &Path) -> crate::Result<()> {
if !from.exists() {
return Err(crate::Error::GenericError(format!(
"{:?} does not exist",
from
"{from:?} does not exist"
)));
}
if !from.is_dir() {
return Err(crate::Error::GenericError(format!(
"{:?} is not a Directory",
from
"{from:?} is not a Directory"
)));
}
if to.exists() {
return Err(crate::Error::GenericError(format!(
"{:?} already exists",
from
"{from:?} already exists"
)));
}
let parent = to.parent().expect("No data in parent");
Expand Down Expand Up @@ -154,7 +149,7 @@ impl CommandExt for Command {

fn output_ok(&mut self) -> crate::Result<Output> {
let program = self.get_program().to_string_lossy().into_owned();
debug!(action = "Running"; "Command `{} {}`", program, self.get_args().map(|arg| arg.to_string_lossy()).fold(String::new(), |acc, arg| format!("{} {}", acc, arg)));
debug!(action = "Running"; "Command `{} {}`", program, self.get_args().map(|arg| arg.to_string_lossy()).fold(String::new(), |acc, arg| format!("{acc} {arg}")));

self.stdout(Stdio::piped());
self.stderr(Stdio::piped());
Expand Down Expand Up @@ -210,8 +205,7 @@ impl CommandExt for Command {
Ok(output)
} else {
Err(crate::Error::GenericError(format!(
"failed to run {}",
program
"failed to run {program}"
)))
}
}
Expand Down
26 changes: 13 additions & 13 deletions tooling/bundler/src/bundle/linux/debian.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
settings.version_string(),
arch
);
let package_name = format!("{}.deb", package_base_name);
let package_name = format!("{package_base_name}.deb");

let base_dir = settings.project_out_directory().join("bundle/deb");
let package_dir = base_dir.join(&package_base_name);
if package_dir.exists() {
fs::remove_dir_all(&package_dir)
.with_context(|| format!("Failed to remove old {}", package_base_name))?;
.with_context(|| format!("Failed to remove old {package_base_name}"))?;
}
let package_path = base_dir.join(&package_name);

Expand Down Expand Up @@ -110,7 +110,7 @@ pub fn generate_data(
for bin in settings.binaries() {
let bin_path = settings.binary_path(bin);
common::copy_file(&bin_path, bin_dir.join(bin.name()))
.with_context(|| format!("Failed to copy binary from {:?}", bin_path))?;
.with_context(|| format!("Failed to copy binary from {bin_path:?}"))?;
}

copy_resource_files(settings, &data_dir).with_context(|| "Failed to copy resource files")?;
Expand All @@ -135,7 +135,7 @@ fn generate_changelog_file(settings: &Settings, data_dir: &Path) -> crate::Resul
if let Some(changelog_src_path) = &settings.deb().changelog {
let mut src_file = File::open(changelog_src_path)?;
let bin_name = settings.main_binary_name();
let dest_path = data_dir.join(format!("usr/share/doc/{}/changelog.gz", bin_name));
let dest_path = data_dir.join(format!("usr/share/doc/{bin_name}/changelog.gz"));

let changelog_file = common::create_file(&dest_path)?;
let mut gzip_encoder = GzEncoder::new(changelog_file, Compression::new(9));
Expand All @@ -160,16 +160,16 @@ fn generate_control_file(
let mut file = common::create_file(&dest_path)?;
writeln!(file, "Package: {}", AsKebabCase(settings.product_name()))?;
writeln!(file, "Version: {}", settings.version_string())?;
writeln!(file, "Architecture: {}", arch)?;
writeln!(file, "Architecture: {arch}")?;
// Installed-Size must be divided by 1024, see https://www.debian.org/doc/debian-policy/ch-controlfields.html#installed-size
writeln!(file, "Installed-Size: {}", total_dir_size(data_dir)? / 1024)?;
let authors = settings.authors_comma_separated().unwrap_or_default();
writeln!(file, "Maintainer: {}", authors)?;
writeln!(file, "Maintainer: {authors}")?;
if let Some(section) = &settings.deb().section {
writeln!(file, "Section: {}", section)?;
writeln!(file, "Section: {section}")?;
}
if let Some(priority) = &settings.deb().priority {
writeln!(file, "Priority: {}", priority)?;
writeln!(file, "Priority: {priority}")?;
} else {
writeln!(file, "Priority: optional")?;
}
Expand Down Expand Up @@ -215,13 +215,13 @@ fn generate_control_file(
if long_description.is_empty() {
long_description = "(none)";
}
writeln!(file, "Description: {}", short_description)?;
writeln!(file, "Description: {short_description}")?;
for line in long_description.lines() {
let line = line.trim();
if line.is_empty() {
writeln!(file, " .")?;
} else {
writeln!(file, " {}", line)?;
writeln!(file, " {line}")?;
}
}
file.flush()?;
Expand All @@ -243,14 +243,14 @@ fn generate_md5sums(control_dir: &Path, data_dir: &Path) -> crate::Result<()> {
let mut hash = md5::Context::new();
io::copy(&mut file, &mut hash)?;
for byte in hash.compute().iter() {
write!(md5sums_file, "{:02x}", byte)?;
write!(md5sums_file, "{byte:02x}")?;
}
let rel_path = path.strip_prefix(data_dir)?;
let path_str = rel_path.to_str().ok_or_else(|| {
let msg = format!("Non-UTF-8 path: {:?}", rel_path);
let msg = format!("Non-UTF-8 path: {rel_path:?}");
io::Error::new(io::ErrorKind::InvalidData, msg)
})?;
writeln!(md5sums_file, " {}", path_str)?;
writeln!(md5sums_file, " {path_str}")?;
}
Ok(())
}
Expand Down
2 changes: 1 addition & 1 deletion tooling/bundler/src/bundle/linux/templates/appimage
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ find -L /usr/lib* -name WebKitNetworkProcess -exec mkdir -p "$(dirname '{}')" \;
find -L /usr/lib* -name WebKitWebProcess -exec mkdir -p "$(dirname '{}')" \; -exec cp --parents '{}' "." \; || true
find -L /usr/lib* -name libwebkit2gtkinjectedbundle.so -exec mkdir -p "$(dirname '{}')" \; -exec cp --parents '{}' "." \; || true

( cd "{{tauri_tools_path}}" && ( wget -q -4 -N https://github.com/AppImage/AppImageKit/releases/download/continuous/AppRun-${ARCH} || wget -q -4 -N https://github.com/AppImage/AppImageKit/releases/download/12/AppRun-${ARCH} ) )
( cd "{{tauri_tools_path}}" && ( wget -q -4 -N https://github.com/tauri-apps/binary-releases/releases/download/apprun-old/AppRun-{arch} || wget -q -4 -N https://github.com/AppImage/AppImageKit/releases/download/12/AppRun-${ARCH} ) )
chmod +x "{{tauri_tools_path}}/AppRun-${ARCH}"

# We need AppRun to be installed as {{app_name}}.AppDir/AppRun.
Expand Down
10 changes: 5 additions & 5 deletions tooling/bundler/src/bundle/path_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ where
let from = from.as_ref();
if !from.exists() {
if let Some(msg) = from.to_str() {
let msg = format!("Path \"{}\" does not exist or you don't have access", msg);
let msg = format!("Path \"{msg}\" does not exist or you don't have access");
return Err(crate::Error::PathUtilError(msg));
}
return Err(crate::Error::PathUtilError(
Expand All @@ -115,7 +115,7 @@ where

if !from.is_file() {
if let Some(msg) = from.to_str() {
let msg = format!("Path \"{}\" is not a file!", msg);
let msg = format!("Path \"{msg}\" is not a file!");
return Err(crate::Error::PathUtilError(msg));
}
return Err(crate::Error::PathUtilError(
Expand All @@ -128,7 +128,7 @@ where
}

if let Some(msg) = to.as_ref().to_str() {
let msg = format!("Path \"{}\" is exist", msg);
let msg = format!("Path \"{msg}\" is exist");
return Err(crate::Error::PathUtilError(msg));
}
}
Expand All @@ -146,7 +146,7 @@ where
let from = from.as_ref();
if !from.exists() {
if let Some(msg) = from.to_str() {
let msg = format!("Path \"{}\" does not exist or you don't have access!", msg);
let msg = format!("Path \"{msg}\" does not exist or you don't have access!");
return Err(crate::Error::PathUtilError(msg));
}
return Err(crate::Error::PathUtilError(
Expand All @@ -155,7 +155,7 @@ where
}
if !from.is_dir() {
if let Some(msg) = from.to_str() {
let msg = format!("Path \"{}\" is not a directory!", msg);
let msg = format!("Path \"{msg}\" is not a directory!");
return Err(crate::Error::PathUtilError(msg));
}
return Err(crate::Error::PathUtilError(
Expand Down
4 changes: 2 additions & 2 deletions tooling/bundler/src/bundle/platform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ pub fn target_triple() -> Result<String, crate::Error> {
)));
};

format!("{}-{}", os, env)
format!("{os}-{env}")
};

Ok(format!("{}-{}", arch, os))
Ok(format!("{arch}-{os}"))
}

#[cfg(test)]
Expand Down
3 changes: 1 addition & 2 deletions tooling/bundler/src/bundle/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -810,8 +810,7 @@ impl Settings {
"windows" => vec![PackageType::WindowsMsi, PackageType::Nsis],
os => {
return Err(crate::Error::GenericError(format!(
"Native {} bundles not yet supported.",
os
"Native {os} bundles not yet supported."
)))
}
};
Expand Down
2 changes: 1 addition & 1 deletion tooling/bundler/src/bundle/updater_bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ fn bundle_update_windows(settings: &Settings, bundles: &[Bundle]) -> crate::Resu
p.push(c);
(p, b)
});
let archived_path = archived_path.with_extension(format!("{}.zip", bundle_name));
let archived_path = archived_path.with_extension(format!("{bundle_name}.zip"));

info!(action = "Bundling"; "{}", display_path(&archived_path));

Expand Down
Loading
Loading