-
Notifications
You must be signed in to change notification settings - Fork 382
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
base: v2
Are you sure you want to change the base?
Feature/fallback targets #2624
Conversation
…gins-workspace into feature/fallback_targets
…gins-workspace into feature/fallback_targets # Conflicts: # plugins/updater/tests/app-updater/tests/update.rs
…gins-workspace into feature/fallback_targets
…gins-workspace into feature/fallback_targets
…ature/fallback_targets
Package Changes Through f75d32bThere are 2 changes which include log with minor, log-js with minor Planned Package VersionsThe following package releases are the planned based on the context of changes in this pull request.
Add another change file through the GitHub UI by following this link. Read about change files or the docs at github.com/jbolda/covector |
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. |
It looks like you ran |
plugins/updater/src/lib.rs
Outdated
/// patching during build | ||
#[unsafe(no_mangle)] | ||
#[link_section = ".data.ta"] | ||
pub static __TAURI_BUNDLE_TYPE: &str = "UNK_BUNDLE"; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
plugins/updater/src/updater.rs
Outdated
@@ -342,11 +383,21 @@ pub struct Updater { | |||
} | |||
|
|||
impl Updater { | |||
fn get_updater_installer(&self) -> Result<Option<Installer>> { | |||
match __TAURI_BUNDLE_TYPE { |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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?
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.