tauri
tauri copied to clipboard
fix(cli): handle symlinks in updater bundler, closes #3933
What kind of change does this PR introduce?
- [x] Bugfix
- [ ] Feature
- [ ] Docs
- [ ] New Binding issue #___
- [ ] Code style update
- [ ] Refactor
- [ ] Build-related changes
- [ ] Other, please describe:
Does this PR introduce a breaking change?
- [ ] Yes, and the changes were approved in issue #___
- [x] No
Checklist
- [x] When resolving issues, they are referenced in the PR's title (e.g
fix: remove a typo, closes #___, #___) - [ ] A change file is added if any packages will require a version bump due to this PR per the instructions in the readme.
- [ ] I have added a convincing reason for adding this feature, if necessary
Other information
Nice catch! Though linking frameworks shows how slow the extract process is. I'll address that in another PR.
Do we also need to handle symlinks here? I'm not sure how macOS links frameworks in the app bundle.
Ooh yeah, probably need to handle symlinks at extraction time too. I imagine otherwise it’ll end up creating hard directories and files and/or falling over.
The #3963 change is essential for frameworks in the updater bundle since the extract process was super slow (and a framework folder has a lot of files).
I added a test to check that symlinks inside frameworks extract correctly, and updated the extract function to handle symlinks. I noticed the built-in entry.unpack() function seems to handle all the different types of files, so I went with that. (it didn't handle directories unfortunately, so I left the branch that deals with those).
Even though the test is passing and the symlinks look good after a test run, this isn't working in my actual app. Not sure why yet...
Update: oof, nevermind me. I had built and installed a local copy of tauri-cli but my app was still building against the rc10 from crates.io instead of this version with the fixes 🤦♂️ Once I point my Cargo.toml at this copy it works fine.
Heads up that I think I found an issue with this where it's making symlinks to absolute paths, maybe only sometimes, maybe only if the app name has a space in it. I'm looking into it, but just wanted to leave a note here not to merge this yet.
I think this is good now. I've been running with the last fix ("avoid broken symlinks in updater bundle") for a few releases of my app, haven't seen any problems myself, and haven't had any complaints from users about Mac updates being broken.
Hello,
Just stumbled upon the issue linked to this PR while working on https://github.com/spacedriveapp/spacedrive/pull/768. Our app requires a framework to be bundled, but after linking it in tauri.macOS.frameworks the bundle step for the updater started to fail with the error message Failed to tar.gz update directory: 'Is a directory (os error 21)'.
Is there anything else that needs to be addressed for this PR to move forward?
Let's try to release it on 1.4, I'll let the auditors know about this.
@lucasfernog what's breaking changes in this PR?
There's no breaking changes, it could be a patch too.
There's no breaking changes, it could be a patch too.
It would be great if this could be included in a patch release.
Also, the failed test seems to be just a typo: bundle_path should be bundle_paths here https://github.com/tauri-apps/tauri/pull/3934/files#diff-e7c0c60e9bef4a36a5940e86d4b58739b653f64ce5b116a84a6bd3a64f7268aaR317
can we have this in v2 as well?
Yeah @morajabi we'll merge 1.x into dev for the last time when 1.5 lands.