Skip to content

Commit 56fd1ed

Browse files
authored
fix(bundler): Move AppRun to mirror (#13864)
1 parent 3d12981 commit 56fd1ed

File tree

18 files changed

+77
-77
lines changed

18 files changed

+77
-77
lines changed

.changes/apprun-mirror.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
tauri-bundler: patch:bug
3+
---
4+
5+
The AppImage bundler now pulls the AppRun binaries from our GitHub mirror, fixing 404 errors.

.github/workflows/covector-version-or-publish-v1.yml

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,30 +18,26 @@ jobs:
1818
matrix:
1919
project:
2020
- name: core
21-
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'
21+
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"
2222
- name: bundler
23-
flags: '--manifest-path=./tooling/bundler/Cargo.toml'
24-
toolchain: '1.71.0'
23+
flags: "--manifest-path=./tooling/bundler/Cargo.toml"
24+
toolchain: "1.71.0"
2525
- name: cli
26-
flags: '--manifest-path=./tooling/cli/Cargo.toml'
27-
toolchain: '1.71.0'
26+
flags: "--manifest-path=./tooling/cli/Cargo.toml"
27+
toolchain: "1.71.0"
2828

2929
platform:
3030
- {
3131
target: x86_64-pc-windows-msvc,
3232
os: windows-latest,
33-
toolchain: '1.61.0'
33+
toolchain: "1.61.0",
3434
}
3535
- {
3636
target: x86_64-unknown-linux-gnu,
3737
os: ubuntu-22.04,
38-
toolchain: '1.60.0'
39-
}
40-
- {
41-
target: x86_64-apple-darwin,
42-
os: macos-13,
43-
toolchain: '1.60.0'
38+
toolchain: "1.60.0",
4439
}
40+
- { target: x86_64-apple-darwin, os: macos-13, toolchain: "1.60.0" }
4541
steps:
4642
- uses: actions/checkout@v4
4743

@@ -99,6 +95,21 @@ jobs:
9995
cargo update -p openssl --precise 0.10.66
10096
cargo update -p openssl-sys --precise 0.9.103
10197
cargo update -p cargo_toml --precise 0.15.2
98+
cargo update -p shared_child --precise 1.0.0
99+
cargo update -p libc:0.2 --precise 0.2.163
100+
cargo update -p os_pipe --precise 1.1.5
101+
102+
- name: Downgrade crates with MSRV conflict (bundler)
103+
if: ${{ matrix.project.name != 'core' }}
104+
env:
105+
CARGO_RESOLVER_INCOMPATIBLE_RUST_VERSIONS: fallback
106+
run: |
107+
cd tooling/bundler
108+
cargo update -p avif-serialize --precise 0.8.3
109+
cargo update -p zune-jpeg --precise 0.4.14
110+
cd ../cli
111+
cargo update -p avif-serialize --precise 0.8.3
112+
cargo update -p zune-jpeg --precise 0.4.14
102113
103114
- name: install rust ${{ matrix.project.toolchain || matrix.platform.toolchain }}
104115
uses: dtolnay/rust-toolchain@master
@@ -175,7 +186,7 @@ jobs:
175186
- uses: actions/setup-node@v4
176187
with:
177188
node-version: 16
178-
registry-url: 'https://registry.npmjs.org'
189+
registry-url: "https://registry.npmjs.org"
179190
cache: yarn
180191
cache-dependency-path: tooling/*/yarn.lock
181192

@@ -194,7 +205,7 @@ jobs:
194205
CARGO_AUDIT_OPTIONS: ${{ secrets.CARGO_AUDIT_OPTIONS }}
195206
with:
196207
token: ${{ secrets.GITHUB_TOKEN }}
197-
command: 'version-or-publish'
208+
command: "version-or-publish"
198209
createRelease: true
199210
recognizeContributors: true
200211

@@ -205,8 +216,8 @@ jobs:
205216
token: ${{ secrets.GITHUB_TOKEN }}
206217
branch: release/version-updates-v1
207218
title: Apply Version Updates From Current Changes (v1)
208-
commit-message: 'apply version updates'
209-
labels: 'version updates'
219+
commit-message: "apply version updates"
220+
labels: "version updates"
210221
body: ${{ steps.covector.outputs.change }}
211222

212223
- name: Trigger doc update

core/tauri-build/src/lib.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ fn copy_dir(from: &Path, to: &Path) -> Result<()> {
128128

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

141141
// Copies the macOS application bundle frameworks to the target folder
142142
fn copy_frameworks(dest_dir: &Path, frameworks: &[String]) -> Result<()> {
143-
std::fs::create_dir_all(dest_dir).with_context(|| {
144-
format!(
145-
"Failed to create frameworks output directory at {:?}",
146-
dest_dir
147-
)
148-
})?;
143+
std::fs::create_dir_all(dest_dir)
144+
.with_context(|| format!("Failed to create frameworks output directory at {dest_dir:?}"))?;
149145
for framework in frameworks.iter() {
150146
if framework.ends_with(".framework") {
151147
let src_path = PathBuf::from(framework);

core/tauri/src/test/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ mod tests {
360360
});
361361

362362
app.run(|_app, event| {
363-
println!("{:?}", event);
363+
println!("{event:?}");
364364
});
365365
}
366366
}

core/tauri/src/window.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1996,7 +1996,7 @@ pub(crate) fn ipc_scope_not_found_error_message(label: &str, url: &str) -> Strin
19961996
}
19971997

19981998
pub(crate) fn ipc_scope_window_error_message(label: &str) -> String {
1999-
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)
1999+
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")
20002000
}
20012001

20022002
pub(crate) fn ipc_scope_domain_error_message(url: &str) -> String {

core/tests/app-updater/tests/update.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ fn update_app_flow<F: FnOnce(Options<'_>) -> (PathBuf, TauriVersion)>(build_app_
408408
.unwrap_or_else(|_| panic!("failed to read signature file {}", signature_path.display()));
409409

410410
let out_updater_path =
411-
out_bundle_path.with_extension(format!("{}.{}", bundle_updater_ext, updater_zip_ext));
411+
out_bundle_path.with_extension(format!("{bundle_updater_ext}.{updater_zip_ext}"));
412412

413413
(out_updater_path, signature)
414414
} else {

tooling/bundler/src/bundle/category.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,7 @@ impl serde::de::Visitor<'_> for AppCategoryVisitor {
256256
match self.did_you_mean {
257257
Some(string) => write!(
258258
formatter,
259-
"a valid app category string (did you mean \"{}\"?)",
260-
string
259+
"a valid app category string (did you mean \"{string}\"?)"
261260
),
262261
None => write!(formatter, "a valid app category string"),
263262
}

tooling/bundler/src/bundle/common.rs

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,12 @@ pub fn copy_file(from: impl AsRef<Path>, to: impl AsRef<Path>) -> crate::Result<
7272
let to = to.as_ref();
7373
if !from.exists() {
7474
return Err(crate::Error::GenericError(format!(
75-
"{:?} does not exist",
76-
from
75+
"{from:?} does not exist"
7776
)));
7877
}
7978
if !from.is_file() {
8079
return Err(crate::Error::GenericError(format!(
81-
"{:?} is not a file",
82-
from
80+
"{from:?} is not a file"
8381
)));
8482
}
8583
let dest_dir = to.parent().expect("No data in parent");
@@ -96,20 +94,17 @@ pub fn copy_file(from: impl AsRef<Path>, to: impl AsRef<Path>) -> crate::Result<
9694
pub fn copy_dir(from: &Path, to: &Path) -> crate::Result<()> {
9795
if !from.exists() {
9896
return Err(crate::Error::GenericError(format!(
99-
"{:?} does not exist",
100-
from
97+
"{from:?} does not exist"
10198
)));
10299
}
103100
if !from.is_dir() {
104101
return Err(crate::Error::GenericError(format!(
105-
"{:?} is not a Directory",
106-
from
102+
"{from:?} is not a Directory"
107103
)));
108104
}
109105
if to.exists() {
110106
return Err(crate::Error::GenericError(format!(
111-
"{:?} already exists",
112-
from
107+
"{from:?} already exists"
113108
)));
114109
}
115110
let parent = to.parent().expect("No data in parent");
@@ -154,7 +149,7 @@ impl CommandExt for Command {
154149

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

159154
self.stdout(Stdio::piped());
160155
self.stderr(Stdio::piped());
@@ -210,8 +205,7 @@ impl CommandExt for Command {
210205
Ok(output)
211206
} else {
212207
Err(crate::Error::GenericError(format!(
213-
"failed to run {}",
214-
program
208+
"failed to run {program}"
215209
)))
216210
}
217211
}

tooling/bundler/src/bundle/linux/debian.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
5757
settings.version_string(),
5858
arch
5959
);
60-
let package_name = format!("{}.deb", package_base_name);
60+
let package_name = format!("{package_base_name}.deb");
6161

6262
let base_dir = settings.project_out_directory().join("bundle/deb");
6363
let package_dir = base_dir.join(&package_base_name);
6464
if package_dir.exists() {
6565
fs::remove_dir_all(&package_dir)
66-
.with_context(|| format!("Failed to remove old {}", package_base_name))?;
66+
.with_context(|| format!("Failed to remove old {package_base_name}"))?;
6767
}
6868
let package_path = base_dir.join(&package_name);
6969

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

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

140140
let changelog_file = common::create_file(&dest_path)?;
141141
let mut gzip_encoder = GzEncoder::new(changelog_file, Compression::new(9));
@@ -160,16 +160,16 @@ fn generate_control_file(
160160
let mut file = common::create_file(&dest_path)?;
161161
writeln!(file, "Package: {}", AsKebabCase(settings.product_name()))?;
162162
writeln!(file, "Version: {}", settings.version_string())?;
163-
writeln!(file, "Architecture: {}", arch)?;
163+
writeln!(file, "Architecture: {arch}")?;
164164
// Installed-Size must be divided by 1024, see https://www.debian.org/doc/debian-policy/ch-controlfields.html#installed-size
165165
writeln!(file, "Installed-Size: {}", total_dir_size(data_dir)? / 1024)?;
166166
let authors = settings.authors_comma_separated().unwrap_or_default();
167-
writeln!(file, "Maintainer: {}", authors)?;
167+
writeln!(file, "Maintainer: {authors}")?;
168168
if let Some(section) = &settings.deb().section {
169-
writeln!(file, "Section: {}", section)?;
169+
writeln!(file, "Section: {section}")?;
170170
}
171171
if let Some(priority) = &settings.deb().priority {
172-
writeln!(file, "Priority: {}", priority)?;
172+
writeln!(file, "Priority: {priority}")?;
173173
} else {
174174
writeln!(file, "Priority: optional")?;
175175
}
@@ -215,13 +215,13 @@ fn generate_control_file(
215215
if long_description.is_empty() {
216216
long_description = "(none)";
217217
}
218-
writeln!(file, "Description: {}", short_description)?;
218+
writeln!(file, "Description: {short_description}")?;
219219
for line in long_description.lines() {
220220
let line = line.trim();
221221
if line.is_empty() {
222222
writeln!(file, " .")?;
223223
} else {
224-
writeln!(file, " {}", line)?;
224+
writeln!(file, " {line}")?;
225225
}
226226
}
227227
file.flush()?;
@@ -243,14 +243,14 @@ fn generate_md5sums(control_dir: &Path, data_dir: &Path) -> crate::Result<()> {
243243
let mut hash = md5::Context::new();
244244
io::copy(&mut file, &mut hash)?;
245245
for byte in hash.compute().iter() {
246-
write!(md5sums_file, "{:02x}", byte)?;
246+
write!(md5sums_file, "{byte:02x}")?;
247247
}
248248
let rel_path = path.strip_prefix(data_dir)?;
249249
let path_str = rel_path.to_str().ok_or_else(|| {
250-
let msg = format!("Non-UTF-8 path: {:?}", rel_path);
250+
let msg = format!("Non-UTF-8 path: {rel_path:?}");
251251
io::Error::new(io::ErrorKind::InvalidData, msg)
252252
})?;
253-
writeln!(md5sums_file, " {}", path_str)?;
253+
writeln!(md5sums_file, " {path_str}")?;
254254
}
255255
Ok(())
256256
}

tooling/bundler/src/bundle/linux/templates/appimage

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ find -L /usr/lib* -name WebKitNetworkProcess -exec mkdir -p "$(dirname '{}')" \;
4747
find -L /usr/lib* -name WebKitWebProcess -exec mkdir -p "$(dirname '{}')" \; -exec cp --parents '{}' "." \; || true
4848
find -L /usr/lib* -name libwebkit2gtkinjectedbundle.so -exec mkdir -p "$(dirname '{}')" \; -exec cp --parents '{}' "." \; || true
4949

50-
( 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} ) )
50+
( 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} ) )
5151
chmod +x "{{tauri_tools_path}}/AppRun-${ARCH}"
5252

5353
# We need AppRun to be installed as {{app_name}}.AppDir/AppRun.

0 commit comments

Comments
 (0)