fix: Fix bundler&cli MSRV (#10499)

* chore(deps) Update Tauri Bundler

* ci: Also check bundler and cli in msrv check

* fix

* 1

* 2

* 3

* msrv

* downgrade handlebars again

* x

* x

* x

* x

* x

* x

* this makes no sense

* srsly wtf

* me dumb dumb

* bufreader

* x

* x

* changefile

* fix permissions

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
This commit is contained in:
Fabian-Lars 2024-08-08 21:50:13 +02:00 committed by GitHub
parent 1aba10963e
commit 297cd55c44
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
14 changed files with 5051 additions and 845 deletions

View File

@ -0,0 +1,6 @@
---
tauri-bundler: patch:bug
tauri-cli: patch:bug
---
Changed the MSRV in Cargo.toml for `tauri-bundler` and `tauri-cli` to 1.71. The crates effectively required 1.70/1.71 to build for a while already.

View File

@ -16,6 +16,16 @@ jobs:
strategy:
fail-fast: false
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'
- name: bundler
flags: '--manifest-path=./tooling/bundler/Cargo.toml'
toolchain: '1.71.0'
- name: cli
flags: '--manifest-path=./tooling/cli/Cargo.toml'
toolchain: '1.71.0'
platform:
- {
target: x86_64-pc-windows-msvc,
@ -35,13 +45,11 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: install rust ${{ matrix.platform.toolchain }}
uses: actions-rs/toolchain@v1
- name: install rust ${{ matrix.project.toolchain || matrix.platform.toolchain }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.platform.toolchain }}
toolchain: ${{ matrix.project.toolchain || matrix.platform.toolchain }}
target: ${{ matrix.platform.target }}
override: true
default: true
- name: install Linux dependencies
if: contains(matrix.platform.target, 'unknown-linux')
@ -51,10 +59,19 @@ jobs:
- uses: Swatinem/rust-cache@v2
- name: delete lockfile
run: rm Cargo.lock
- name: regen lockfile
run: |
rm Cargo.lock
rm tooling/bundler/Cargo.lock
rm tooling/cli/Cargo.lock
cargo generate-lockfile
cd tooling/bundler
cargo generate-lockfile
cd ../cli
cargo generate-lockfile
- name: Downgrade crates with MSRV conflict
- name: Downgrade crates with MSRV conflict (core)
if: ${{ matrix.project.name == 'core' }}
# The --precise flag can only be used once per invocation.
run: |
cargo update -p system-deps:6.2.2 --precise 6.1.1
@ -113,9 +130,30 @@ jobs:
cargo update -p derive_more --precise 0.99.17
cargo update -p native-tls --precise 0.2.11
cargo update -p ppv-lite86 --precise 0.2.17
cargo update -p xml-rs --precise 0.8.20
- name: Downgrade crates with MSRV conflict (bundler)
# This is for the bundler but since cli depends on the bundler we enable it for the cli too
if: ${{ matrix.project.name != 'core' }}
# The --precise flag can only be used once per invocation.
run: |
cd tooling/bundler
cargo update -p ravif --precise 0.11.5
cargo update -p bitstream-io --precise 2.3.0
# Not really required since it's a binary
- name: Downgrade crates with MSRV conflict (cli)
if: ${{ matrix.project.name == 'cli' }}
# The --precise flag can only be used once per invocation.
run: |
cd tooling/cli
cargo update -p clap_complete --precise 4.4.10
cargo update -p clap --precise 4.4.18
cargo update -p ravif --precise 0.11.5
cargo update -p bitstream-io --precise 2.3.0
- name: test build
run: cargo check --target ${{ matrix.platform.target }} --features tracing,compression,wry,linux-protocol-headers,isolation,custom-protocol,api-all,cli,updater,system-tray,windows7-compat,http-multipart,test
run: cargo check --target ${{ matrix.platform.target }} ${{ matrix.project.flags }}
run-integration-tests:
runs-on: ${{ matrix.platform }}
@ -132,9 +170,7 @@ jobs:
with:
fetch-depth: 0
- name: install stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
uses: dtolnay/rust-toolchain@stable
- name: install Linux dependencies
if: matrix.platform == 'ubuntu-latest'
run: |
@ -148,10 +184,7 @@ jobs:
tooling/cli
- name: build CLI
uses: actions-rs/cargo@v1
with:
command: build
args: --manifest-path ./tooling/cli/Cargo.toml
run: cargo build --manifest-path ./tooling/cli/Cargo.toml
- name: run integration tests
run: cargo test --test '*' -- --ignored
@ -167,6 +200,10 @@ jobs:
version-or-publish:
runs-on: ubuntu-latest
timeout-minutes: 65
permissions:
actions: write # required for workflow_dispatch
contents: write # required to create new releases
pull-requests: write # required to open version update pr
outputs:
change: ${{ steps.covector.outputs.change }}
commandRan: ${{ steps.covector.outputs.commandRan }}
@ -178,7 +215,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v2
- uses: actions/setup-node@v4
with:
node-version: 16
registry-url: 'https://registry.npmjs.org'
@ -229,7 +266,7 @@ jobs:
contains(steps.covector.outputs.packagesPublished, '@tauri-apps/cli')
run: gh workflow run 31554138 -r 1.x -f releaseId=${{ steps.covector.outputs['-tauri-apps-cli-releaseId'] }}
env:
GH_TOKEN: ${{ secrets.ORG_TAURI_BOT_PAT }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Trigger `tauri-cli` publishing workflow
if: |
@ -237,4 +274,4 @@ jobs:
contains(steps.covector.outputs.packagesPublished, 'tauri-cli')
run: gh workflow run 31554139 -r 1.x
env:
GH_TOKEN: ${{ secrets.ORG_TAURI_BOT_PAT }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -1,5 +1,4 @@
target
Cargo.lock
.DS_Store
*.rs.bk
*~

3871
tooling/bundler/Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -13,41 +13,41 @@ keywords = [ "bundle", "cargo", "tauri" ]
repository = "https://github.com/tauri-apps/tauri"
description = "Wrap rust executables in OS-specific app bundles for Tauri"
edition = "2021"
rust-version = "1.60"
rust-version = "1.71"
exclude = [ "CHANGELOG.md", "/target", "rustfmt.toml" ]
[dependencies]
tauri-utils = { version = "1.6.0", path = "../../core/tauri-utils", features = [ "resources" ] }
image = "0.24.7"
image = "0.25"
flate2 = "1.0"
anyhow = "1.0"
thiserror = "1.0"
serde_json = "1.0"
serde = { version = "1.0", features = [ "derive" ] }
strsim = "0.10.0"
tar = "0.4.40"
strsim = "0.11"
tar = "0.4"
walkdir = "2"
handlebars = "4.5"
tempfile = "3.8.1"
log = { version = "0.4.21", features = [ "kv" ] }
dirs-next = "2.0"
handlebars = "4" # v5 raised msrv
tempfile = "3"
log = { version = "0.4.21", features = [ "kv" ] } # Force min version due to breaking changes
dirs = "5"
os_pipe = "1"
ureq = { version = "2.9.1", default-features = false, features = [ "socks-proxy" ] }
ureq = { version = "2", default-features = false, features = [ "socks-proxy" ] }
native-tls = { version = "0.2", optional = true }
hex = "0.4"
semver = "1"
sha1 = "0.10"
sha2 = "0.10"
zip = "0.6"
zip = "0.6" # v2 raised msrv, v1 looks off
dunce = "1"
[target."cfg(target_os = \"windows\")".dependencies]
uuid = { version = "1", features = [ "v4", "v5" ] }
windows-registry = "0.1.1"
windows-registry = "0.2"
glob = "0.3"
[target."cfg(target_os = \"windows\")".dependencies.windows-sys]
version = "0.48"
version = "0.48" # Other crates still use this version
features = [
"Win32_System_SystemInformation",
"Win32_System_Diagnostics_Debug"
@ -63,9 +63,9 @@ regex = "1"
[target."cfg(target_os = \"linux\")".dependencies]
heck = "0.5"
ar = "0.9.0"
md5 = "0.7.0"
rpm = "0.14.0"
ar = "0.9"
md5 = "0.7"
rpm = "0.14" # 0.15 raised msrv
[lib]
name = "tauri_bundler"

View File

@ -59,7 +59,7 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
let tauri_tools_path = settings
.local_tools_directory()
.map(|d| d.join(".tauri"))
.unwrap_or_else(|| dirs_next::cache_dir().unwrap().join("tauri"));
.unwrap_or_else(|| dirs::cache_dir().unwrap().join("tauri"));
std::fs::create_dir_all(&tauri_tools_path)?;
let tauri_tools_path_str = tauri_tools_path.to_string_lossy();

View File

@ -18,6 +18,7 @@
use std::collections::BTreeMap;
use std::ffi::OsStr;
use std::fs::{read_to_string, File};
use std::io::BufReader;
use std::path::{Path, PathBuf};
use anyhow::Context;
@ -60,7 +61,7 @@ pub fn list_icon_files(
}
// Put file in scope so that it's closed when copying it
let icon = {
let decoder = PngDecoder::new(File::open(&icon_path)?)?;
let decoder = PngDecoder::new(BufReader::new(File::open(&icon_path)?))?;
let width = decoder.dimensions().0;
let height = decoder.dimensions().1;
let is_high_density = common::is_retina(&icon_path);

View File

@ -310,7 +310,7 @@ fn copy_frameworks_to_bundle(
framework
)));
}
if let Some(home_dir) = dirs_next::home_dir() {
if let Some(home_dir) = dirs::home_dir() {
if copy_framework_from(&dest_dir, framework, &home_dir.join("Library/Frameworks/"))? {
continue;
}

View File

@ -23,7 +23,7 @@ use std::{
collections::BTreeSet,
ffi::OsStr,
fs::{self, File},
io::Write,
io::{BufReader, Write},
path::{Path, PathBuf},
};
@ -91,7 +91,7 @@ fn generate_icon_files(bundle_dir: &Path, settings: &Settings) -> crate::Result<
if icon_path.extension() != Some(OsStr::new("png")) {
continue;
}
let decoder = PngDecoder::new(File::open(&icon_path)?)?;
let decoder = PngDecoder::new(BufReader::new(File::open(&icon_path)?))?;
let width = decoder.dimensions().0;
let height = decoder.dimensions().1;
let is_retina = common::is_retina(&icon_path);
@ -128,7 +128,7 @@ fn generate_icon_files(bundle_dir: &Path, settings: &Settings) -> crate::Result<
let dest_path = get_dest_path(width, height, is_retina);
icon.write_to(
&mut common::create_file(&dest_path)?,
image::ImageOutputFormat::Png,
image::ImageFormat::Png,
)?;
}
}

View File

@ -427,7 +427,7 @@ pub fn notarize_auth() -> Result<NotarizeAuth, NotarizeAuthError> {
let mut key_path = None;
let mut search_paths = vec!["./private_keys".into()];
if let Some(home_dir) = dirs_next::home_dir() {
if let Some(home_dir) = dirs::home_dir() {
search_paths.push(home_dir.join("private_keys"));
search_paths.push(home_dir.join(".private_keys"));
search_paths.push(home_dir.join(".appstoreconnect").join("private_keys"));

View File

@ -29,7 +29,7 @@ pub fn bundle_project(settings: &Settings, updater: bool) -> crate::Result<Vec<P
let tauri_tools_path = settings
.local_tools_directory()
.map(|d| d.join(".tauri"))
.unwrap_or_else(|| dirs_next::cache_dir().unwrap().join("tauri"));
.unwrap_or_else(|| dirs::cache_dir().unwrap().join("tauri"));
let wix_path = tauri_tools_path.join("WixTools314");

View File

@ -66,7 +66,7 @@ pub fn bundle_project(settings: &Settings, updater: bool) -> crate::Result<Vec<P
let tauri_tools_path = settings
.local_tools_directory()
.map(|d| d.join(".tauri"))
.unwrap_or_else(|| dirs_next::cache_dir().unwrap().join("tauri"));
.unwrap_or_else(|| dirs::cache_dir().unwrap().join("tauri"));
if !tauri_tools_path.exists() {
create_dir_all(&tauri_tools_path)?;
@ -184,7 +184,7 @@ fn build_nsis_app_installer(
#[cfg(not(target_os = "windows"))]
{
let mut dir = dirs_next::cache_dir().unwrap();
let mut dir = dirs::cache_dir().unwrap();
dir.extend(["tauri", "NSIS", "Plugins", "x86-unicode"]);
data.insert("additional_plugins_path", to_json(dir));
}

1890
tooling/cli/Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,7 @@ name = "tauri-cli"
version = "1.6.0"
authors = [ "Tauri Programme within The Commons Conservancy" ]
edition = "2021"
rust-version = "1.70"
rust-version = "1.71"
categories = [ "gui", "web-programming" ]
license = "Apache-2.0 OR MIT"
homepage = "https://tauri.app"