Adds support for v1 compatible binary names in the bundler #1
+53
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🚧
Work in progressabandoned 🚧👉 This task was picked up in tauri-apps#10938
This allows users of a Tauri v1 application to be able to smoothly update to a Tauri v2 application via the updater.
Background:
This change in Tauri https:/tauri-apps/tauri/pull/9375/files, which is noted as a refactor is in fact a breaking change as far as the app updater is concerned.
The impact is that because the binary now has a different name, it is not possible to smoothly update a Tauri application via the updater if the initial version of the app is using
v1.x
and the new version is usingv2.x
.Related upstream issues
tauri-apps#10548
tauri-apps/tauri-docs#2523 (docs)
Approach:
I'm introducing here an option for the
tauri-cli
(tauri-bundler
) for producing the same binary names it did inv1
, allowing users to update the app via the updater. In order to enable this behavior, set the environment variblePreviously, the bundler did the rename just after building the binary. I poked and tried doing the same once again, but because quite a lot of the code in that bundler changed since that was merged, it felt possibly more error prone (since now the rest of the code can safely assume that the binary is the crate name)
So, instead, my approach is to do the rename the binary at the last moment (i.e. in the
bundle_project
function in eg. app.rs)Steps: