Skip to content
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

Brew cask running really slow on OSX #5185

Closed
realsirjoe opened this issue May 12, 2020 · 17 comments
Closed

Brew cask running really slow on OSX #5185

realsirjoe opened this issue May 12, 2020 · 17 comments
Assignees

Comments

@realsirjoe
Copy link

@realsirjoe realsirjoe commented May 12, 2020

hello there, I installed borgbackup via brew cask and its running really slow.

borg help 0.88s user 0.25s system 8% cpu 13.565 total

I am running OSX 10.15.4 Catalina. I also tried installing from source and pip3 which also leads to the same problem. Is there an easy fix to this and is anybody else experiencing similar issues?

Thanks a lot!

@infectormp
Copy link
Contributor

@infectormp infectormp commented May 12, 2020

@ThomasWaldmann
Copy link
Member

@ThomasWaldmann ThomasWaldmann commented May 12, 2020

Maybe try vorta or the borg that comes with it.

IIRC, @m3nu (vorta author) solved it at least to the extend that the delay caused by macOS only happens once.

@m3nu
Copy link
Contributor

@m3nu m3nu commented May 12, 2020

Yes, you can copy the Resources/borg-dir folder from the Vorta app. It's the same as the binary release, but not packaged. Since it stays in-place, macOS only validates it once. So after the first start, it will be fast.

Or, if you only want Borg, install it via PIP.

@m3nu
Copy link
Contributor

@m3nu m3nu commented May 12, 2020

If @ThomasWaldmann is fine with it, I could add some code to build a directory-style release for macOS in macOS Vagrant? As an extra option for macOS. I tried many things and the fat binary will be hard to bring back, unless we use another packager (there are a few). The method PyInstaller uses isn't working any more.

I'd also use this dir-style release in Vorta. Would make it more official.

@realsirjoe
Copy link
Author

@realsirjoe realsirjoe commented May 12, 2020

mine also does not work from pip maybe I am facing a different issue?

@m3nu
Copy link
Contributor

@m3nu m3nu commented May 12, 2020

Yes. Then you may face a different issue.

Pip keeps all the files and binaries in the same place and macOS gatekeeper should be quick to verify them only once.

You can look for network activity by a process called syspolicyd or check the Console for related messages (not sure which text, but you will get lots of messages when running it.)

@realsirjoe
Copy link
Author

@realsirjoe realsirjoe commented May 12, 2020

also i tried it with the vorta borg build which gives better but still not good results:
./borg.exe 0.26s user 0.06s system 6% cpu 5.342 total

tested a couple times takes 5-7s

@realsirjoe
Copy link
Author

@realsirjoe realsirjoe commented May 12, 2020

Still though I l checked console and syspolicyd is causing it, so somehow these fixes are not working for me

@m3nu
Copy link
Contributor

@m3nu m3nu commented May 12, 2020

5s is still pretty long. There may be something else going on. Comparison: My borg.exe runs in 0.2s.

$ time ./borg.exe --version
borg.exe 1.1.11.dev128+gae78914c
./borg.exe --version  0.18s user 0.04s system 93% cpu 0.235 total
@ThomasWaldmann
Copy link
Member

@ThomasWaldmann ThomasWaldmann commented Jul 25, 2020

@m3nu guess adding a directory-based macos borg build to the vagrantfile would be good. for now, also keep the single file.

first master, later 1.1-maint also.

@ThomasWaldmann ThomasWaldmann added this to the hydrogen-alpha9 milestone Jul 25, 2020
@m3nu
Copy link
Contributor

@m3nu m3nu commented Jul 25, 2020

No problem. I also prefer to ship an "official" build with Vorta, rather than my own.

Best if you assign it to me and I'll get to it in about a week.

@ThomasWaldmann
Copy link
Member

@ThomasWaldmann ThomasWaldmann commented Aug 15, 2020

@m3nu this is the last thing on the alpha9 milestone, can you do it soon?

@m3nu
Copy link
Contributor

@m3nu m3nu commented Aug 16, 2020

I’ll add the single folder setup today, but not the notarization since it’s probably not necessary for CLI apps and needs a $99/year Apple subscription and private keys.

@m3nu
Copy link
Contributor

@m3nu m3nu commented Aug 16, 2020

I've added a PR for this, but didn't test it on Vagrant yet, since the download takes a while.

In addition, I've added a new Homebrew formula that uses the Python release of Borg instead of the pre-built binary. This is probably less risky in terms of dependencies and doesn't cause any Gatekeeper issues.

@m3nu
Copy link
Contributor

@m3nu m3nu commented Aug 17, 2020

I found that none of the old Vagrant virtualbox macOS VMs are working any more. Most just kernel panic while booting. The version referenced in Vagrant is also quite old. 10.12, with 10.16 about to come out. So 10.14 would be a reasonable "oldstable". That's what I'm trying currently.

In general macOS users are probably best served by using the Python/Homebrew formula, which will be smallest and most portable. Only drawback is that it needs Homebrew installed. Trying to get this approved over the next days.

@ThomasWaldmann
Copy link
Member

@ThomasWaldmann ThomasWaldmann commented Aug 17, 2020

I use older machines for building the pyinstaller binaries because usually the resulting binaries then can be used on any same or newer OS version.

Last time I tried, my local vagrant macOS box worked.

And yes, of course a real package made for / compiled on the target OS is best.

The pyinstaller-made fat binaries were primarily meant for situations where this is not available or too much work, e.g. when trying to restore a machine from a live USB stick.

@m3nu
Copy link
Contributor

@m3nu m3nu commented Aug 17, 2020

The pyinstaller-made fat binaries were primarily meant for situations where this is not available or too much work, e.g. when trying to restore a machine from a live USB stick.

In such a situation, they can probably live with a 10-20 second delay when starting it and I'd keep the current fat binary for its simplicity.

Then my contributions here will be:

  • Improving the Homebrew package to NOT use the fat binary, but a normal Python installation. (Fully solves the issue reported here, after added to Homebrew)
  • Update the Vagrant build to 10.14 and use a public VM. (Couldn't get earlier macOS versions to work.) Resulting binary should still work on 10.13, which is the oldest version supported by Apple and Homebrew.
m3nu added a commit to m3nu/borg that referenced this issue Aug 18, 2020
m3nu added a commit to m3nu/borg that referenced this issue Aug 18, 2020
m3nu added a commit to m3nu/borg that referenced this issue Aug 18, 2020
ThomasWaldmann added a commit that referenced this issue Aug 18, 2020
Update Homebrew install instructions. See #5185
m3nu added a commit to m3nu/borg that referenced this issue Aug 19, 2020
ThomasWaldmann added a commit that referenced this issue Aug 19, 2020
Update Homebrew install instructions. See #5185
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

4 participants
You can’t perform that action at this time.