-
Notifications
You must be signed in to change notification settings - Fork 142
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
bundled borg is preferred over system borg (macOS) #2100
Comments
I just restarted vorta, still the same: it wants to use the bundled borg.
|
Just checked out vorta master branch and installed it to a venv: That one finds the homebrew borg:
|
Guess we need some additional logging in the else-branch for |
|
That might be, but something is broken there. My borg is in |
Same issue on my side. |
I think in the case of Thomas, it was Borg that was installed from homebrew. Is there a difference when using Vorta downloaded from Github? (Homebrew also downloads from there, so it should be the same file). In which path is your Borg binary? Also in |
Same for me, both borg and vorta are installed from homebrew
|
BTW, IIRC finding the homebrew borg from vorta has worked for me at some time in the past. I remember installing the Apple Silicon version of borg from homebrew, so that Vorta does not use the bundled Intel version of borg. At that time, I verified that the Apple Silicon version gets invoked by vorta. But that was quite a while ago. Recently, upgraded macOS and also vorta (see top post). |
BTW, I reproduced the issue (see top post) with vorta 0.9.1 installed via brew. It also wants to use the bundled borg and not the one from homebrew. |
Just found out that the |
Here it always gives me the Homebrew version, if it exists. Very mysterious. |
Curious - I noticed an Intel-based borg binary was being used, rather than the available homebrew-provided ARM-native binary. I am using the non-fuse (regular) borg homebrew package, and the mac-packaged Vorta app. Looking at the code that detects a borg binary, when I run this from an (admittedly separate) Python install, I see the correct Homebrew-based borg binary is found.
So the fallback path that uses the built-in binary shouldn't be invoked. Despite this, Vorta still uses the built-in borg binary. I will try to set up a development environment and run Vorta from a virtualenv to see if there is something relating to the packaging for Mac OS that is affecting the behaviour of shutil. Are those seeing the homebrew binary used running Vorta from a source tree, or the regular shipped release .app file? |
I really think we need a debug log line printing the PATH there. Something is not as expected there and that would be a first step confirming that. |
@greigdp See #2100 (comment) - I could not debug the issue because in a source based install it worked as expected (and I could not build the binary). |
Interesting - I have tried a few things there to reproduce the issue, and have noticed one potential quirk. If you launch the shipped signed binary of Vorta directly by double-clicking the .app bundle, the embedded borg binary is shown in About. If you launch the Vorta binary manually from the shell ( Modifying the binary to add logging to the
This showed that, from the perspective of the code running in my build, $PATH was set to:
From the pyinstaller spec, it looks like the PATH for the binary is meant to be set to a suitable value (https://github.com/borgbase/vorta/blob/master/package/vorta.spec#L81) - just this doesn't seem to be the PATH that is in the runtime environment experienced by the app. If I run the Therefore I think the root issue here is, as you expected, the PATH variable, and how it is (or is not) meant to be set when running the app from a double-click on the .App bundle. |
@greigdp Can you use Should show the current PATH as in the vorta process and not create another process for the "echo $PATH". |
Can confirm:
|
This makes it use the homebrew borg for me:
Source: https://stackoverflow.com/a/26586170 Update: only works until logout or reboot, seems like that setting is not persisted. |
I got the same path result as before using |
I think vscode had a similar problem, and they solved it by spawning a shell to fetch the env vars. Implementation: |
Any macOS developer / admin reading? It can't be that hard to modify the PATH so such stuff just works, can it? |
I've managed to create a workaround that at least proves this can be fixed. It might not be ideal from a cross-platform perspective, but it looks like something in Mac OS isn't behaving as you'd expect - this part of the pyinstaller spec is meant to set the Environment that the app runs in. For whatever reason (maybe a change in a newer Mac OS release?), this doesn't appear to work any more, given the wrong path being used. I changed this (blank) line of code to contain the following line of code, as a proof of concept. This should manually set the PATH environment variable at the time it is required, to the value that's meant to be set by the pyinstaller spec file.
After doing this, and rebuilding the app, I see a path of |
Nice one! Looks like a pretty clear solution and I'm surprised it works and the spec file stopped working. Wanna do a mini PR or should I? |
I guess we should "platform-gate" this so it only makes this PATH change on Mac platform? Don't mind if you do the PR or I do. |
It will be easier to credit you, if you add the PR. Yes, I'ld only make the change on macOS. We mostly do Once the PR is up, I'll do test builds for intel and arm, so everyone can confirm the fix. |
Makes sense, will make a PR shortly. |
Thanks for the PR, @greigdp . Here a test build for Arm using the PR branch: https://files.pf7.net/vorta/Vorta-greigdp-fix-2100-arm.dmg One thing I was wondering: Should we append to |
I have pushed an updated PR, which takes the existing PATH and appends to it. This feels neater. |
Works for me. And the test build picks the right Borg version in your situation? |
Yes, confirmed by checking
|
Great! Also solves if for you, @ThomasWaldmann ? Test build: https://files.pf7.net/vorta/Vorta-greigdp-fix-2100-arm.dmg The binary found should also show in About. |
@m3nu works for me! both vorta and borg show as kind "Apple" in activity monitor, path shown in vorta points to the homebrew borg. |
Good to hear. I think we should also append |
Added Intel Homebrew and changed it slightly so we don't fail if there is no |
Fixed by #2166. |
Fixed in 0.10.3. 🎉 |
Description
After stumbling over #2099 I also noticed that vorta seems to prefer the
borg
that comes bundled with it, even if the user has installed another borg on their system.In my case, I have:
And that borg is the Apple Silicon binary, which would be better than the currently bundled Intel binary inside vorta.
Reproduction
OS
macOS 15
Version of Vorta
0.10.0 beta1
What did you install Vorta with?
Binary
Version of Borg
1.4.0
Logs
No response
The text was updated successfully, but these errors were encountered: