Skip to content

Feature/fallback targets #2624

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 24 commits into
base: v2
Choose a base branch
from

Conversation

kandrelczyk
Copy link

Here are the changes for updater to handle #2277

I'm using the patched __TAURI_BUNDLE_TYPE variable to download the proper installer with fallback as described in #2277.

I've added some additional test on both Linux and Windows. Not sure if something needs to be done on other platforms.

@kandrelczyk kandrelczyk requested a review from a team as a code owner April 11, 2025 21:07
Copy link
Contributor

github-actions bot commented Apr 12, 2025

Package Changes Through f75d32b

There are 2 changes which include log with minor, log-js with minor

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
api-example 2.0.24 2.0.25
api-example-js 2.0.20 2.0.21
log 2.3.1 2.4.0
log-js 2.3.1 2.4.0

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

@kandrelczyk
Copy link
Author

Windows and Linux tests are failing because they require tauri-cli with tauri-apps/tauri#13209 change.

MacOS test is failing because of some compliation issue. I will have access to a mac next week so I will fix it.

@FabianLars
Copy link
Member

MacOS test is failing because of some compliation issue. I will have access to a mac next week so I will fix it.

It looks like you ran cargo update - if you revert the Cargo.lock file changes it should compile again.

/// patching during build
#[unsafe(no_mangle)]
#[link_section = ".data.ta"]
pub static __TAURI_BUNDLE_TYPE: &str = "UNK_BUNDLE";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, if possible it may make sense to move that into the main tauri crate (or utils idk) because a few people asked for this in the past regardless of the updater

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had it in the main tauri crate originally but build (cargo test) was failing during linking. I will try to move it to utils.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah yeah i remember you mentioning this

@@ -342,11 +383,21 @@ pub struct Updater {
}

impl Updater {
fn get_updater_installer(&self) -> Result<Option<Installer>> {
match __TAURI_BUNDLE_TYPE {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

__TAURI_BUNDLE_TYPE shouldn't be exported from Tauri, but we should map it to a PackageFormat type directly from tauri instead of doing the check here, it would make it type safe (instead of relying on string matching from tauri-cli)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do we want to do for Mac, iOS and Android? Or in general case when the binary was not patched and we don't know the bundle type? I think the simplest thing to do would be to return PackageFormat::Unknown in case the binary was not patched and use #[cfg(target_os = "macos")] to return PackageFormat::Dmg for Mac.

We have BundleType in tauri::utils::config but if we want to return Unknown I would have to create new type. What would be the best place to put it? tauri::utils::config? some new module?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants