tauri icon indicating copy to clipboard operation
tauri copied to clipboard

Feature/binary patch bundle types

Open kandrelczyk opened this issue 8 months ago • 4 comments

This is first PR to address https://github.com/tauri-apps/plugins-workspace/issues/2277

Thanks to this the updater plugin will be able to determine which installer to download.

There is a breaking change here requiring updater plugin and tauri-cli to be compatible since we need __TAURI_BUNDLE_TYPE variable to be present in the binary. In case the variable is not found error is reported. Not sure if it's ok or if we need a better solution here.

kandrelczyk avatar Apr 11 '25 20:04 kandrelczyk

Package Changes Through 4ff1d8cc69ee97804eb6d972ebfa9772e816b60a

There are 4 changes which include @tauri-apps/api with patch, tauri-cli with patch, tauri-bundler with patch, tauri-utils with patch

Planned Package Versions

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

package current next
@tauri-apps/api 2.6.0 2.6.1
tauri-utils 2.5.0 2.5.1
tauri-bundler 2.5.0 2.5.1
tauri-runtime 2.7.0 2.7.1
tauri-runtime-wry 2.7.1 2.7.2
tauri-codegen 2.3.0 2.3.1
tauri-macros 2.3.1 2.3.2
tauri-plugin 2.3.0 2.3.1
tauri-build 2.3.0 2.3.1
tauri 2.6.2 2.6.3
@tauri-apps/cli 2.6.2 2.6.3
tauri-cli 2.6.2 2.6.3

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


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

github-actions[bot] avatar Apr 12 '25 00:04 github-actions[bot]

i think we should consider using https://github.com/denoland/sui it has an easy to use API

lucasfernog avatar Apr 12 '25 23:04 lucasfernog

i think we should consider using https://github.com/denoland/sui it has an easy to use API

Definitely looks simpler than goblin. Wish I knew about it before :)

Should I just change the patching implementation?

kandrelczyk avatar Apr 13 '25 08:04 kandrelczyk

@lucasfernog I've pushed some of the suggested changes. I decided no to use sui as this would add dependency to the app, not just the builder. If there anything else missing here?

kandrelczyk avatar May 18 '25 16:05 kandrelczyk

Didn't look at it yet, but it seems like the ubuntu build is failing https://github.com/tauri-apps/tauri/actions/runs/16120739808/job/45485616619

Legend-Master avatar Jul 09 '25 02:07 Legend-Master

@Legend-Master I've just checked and the tests I added to plugins-workspace/plugins/updater/tests/app-updater still pass. I will check the build ASAP.

kandrelczyk avatar Jul 09 '25 19:07 kandrelczyk

@Legend-Master pushed the fix. Turns out my tests used --debug but the failing test don't. In release mode the bundle type variable was stripped even though it's referenced in public method. I've added #[used] to it and release builds work now.

...Now I see this PR was closed already. Do I have to create a new PR with the fix?

kandrelczyk avatar Jul 10 '25 21:07 kandrelczyk

...Now I see this PR was closed already. Do I have to create a new PR with the fix?

Yeah, that's how we usually do it

Legend-Master avatar Jul 11 '25 00:07 Legend-Master

@Legend-Master Submitted here: https://github.com/tauri-apps/tauri/pull/13808

kandrelczyk avatar Jul 11 '25 06:07 kandrelczyk

Hey, Looks like the patcher is modifying the binary after code signing. This is rendering the signing to be invalid. maybe move the signing to after binary is patched?

kittuov avatar Jul 22 '25 02:07 kittuov

@kittuov Hey, can you point me to the place were we sign the binary? I'm only familiar wit generating the signatures files for the bundles.

kandrelczyk avatar Jul 22 '25 06:07 kandrelczyk

@kittuov Hey, can you point me to the place were we sign the binary? I'm only familiar wit generating the signatures files for the bundles.

It was signing the main executable on Windows (you sign both the binaries and the bundles on Windows instead of just the bundles on Linux, and we don't do binary patching on macOS yet), should be fixed in #13870 (we sign the binaries first before generating all the bundles, but now we need to sign them after the binary patching)

Thanks for taking a look anyways 🙃

Legend-Master avatar Jul 22 '25 06:07 Legend-Master