wbond / package_control

The Sublime Text package manager
https://packagecontrol.io
4.8k stars 818 forks source link

Does not work on macOS 11 #1475

Closed dangh closed 4 years ago

dangh commented 4 years ago

Related sources:

ST console logs:

Traceback (most recent call last):
  File "/Users/dang/Library/Application Support/Sublime Text/Installed Packages/Package Control.sublime-package/package_control/deps/oscrypto/_osx/_core_foundation.py", line 7, in <module>
ImportError: No module named 'Package Control.package_control.deps.oscrypto._osx._core_foundation_cffi'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 274, in reload_plugin
    m = importlib.import_module(modulename)
  File "./python3.3/importlib/__init__.py", line 90, in import_module
  File "<frozen importlib._bootstrap>", line 1584, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 1425, in load_module
    exec(compile(source, source_path, 'exec'), mod.__dict__)
  File "/Users/dang/Library/Application Support/Sublime Text/Installed Packages/Package Control.sublime-package/2_bootstrap.py", line 26, in <module>
  File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 1425, in load_module
    exec(compile(source, source_path, 'exec'), mod.__dict__)
  File "/Users/dang/Library/Application Support/Sublime Text/Installed Packages/Package Control.sublime-package/package_control/bootstrap.py", line 20, in <module>
  File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 1425, in load_module
    exec(compile(source, source_path, 'exec'), mod.__dict__)
  File "/Users/dang/Library/Application Support/Sublime Text/Installed Packages/Package Control.sublime-package/package_control/download_manager.py", line 24, in <module>
  File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 1425, in load_module
    exec(compile(source, source_path, 'exec'), mod.__dict__)
  File "/Users/dang/Library/Application Support/Sublime Text/Installed Packages/Package Control.sublime-package/package_control/downloaders/__init__.py", line 3, in <module>
  File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 1425, in load_module
    exec(compile(source, source_path, 'exec'), mod.__dict__)
  File "/Users/dang/Library/Application Support/Sublime Text/Installed Packages/Package Control.sublime-package/package_control/downloaders/urllib_downloader.py", line 46, in <module>
  File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 1425, in load_module
    exec(compile(source, source_path, 'exec'), mod.__dict__)
  File "/Users/dang/Library/Application Support/Sublime Text/Installed Packages/Package Control.sublime-package/package_control/ca_certs.py", line 7, in <module>
  File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 1425, in load_module
    exec(compile(source, source_path, 'exec'), mod.__dict__)
  File "/Users/dang/Library/Application Support/Sublime Text/Installed Packages/Package Control.sublime-package/package_control/deps/oscrypto/trust_list.py", line 19, in <module>
  File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 1425, in load_module
    exec(compile(source, source_path, 'exec'), mod.__dict__)
  File "/Users/dang/Library/Application Support/Sublime Text/Installed Packages/Package Control.sublime-package/package_control/deps/oscrypto/_osx/trust_list.py", line 8, in <module>
  File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 1425, in load_module
    exec(compile(source, source_path, 'exec'), mod.__dict__)
  File "/Users/dang/Library/Application Support/Sublime Text/Installed Packages/Package Control.sublime-package/package_control/deps/oscrypto/_osx/_core_foundation.py", line 9, in <module>
  File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 1425, in load_module
    exec(compile(source, source_path, 'exec'), mod.__dict__)
  File "/Users/dang/Library/Application Support/Sublime Text/Installed Packages/Package Control.sublime-package/package_control/deps/oscrypto/_osx/_core_foundation_ctypes.py", line 21, in <module>
Package Control.package_control.deps.oscrypto.errors.LibraryNotFoundError: The library CoreFoundation could not be found
AndrewHoos commented 4 years ago

Looks like this might be related to the dynamic linker changes noted here: https://developer.apple.com/documentation/macos-release-notes/macos-big-sur-11-beta-release-notes

wbond commented 4 years ago

Yeah - there will likely need to be some changes. Hopefully someone who has the macOS 11 beta installed can help find what changes will be necessary. It may just end up being that for the Mac shared libs we just try to open them rather than call find_library().

AndrewHoos commented 4 years ago

Why are you not just doing import Cocoa etc. Using pyobjc?

wbond commented 4 years ago

@AndrewHoos

We just need to figure out what the alternative to find_library() in ctypes will be with Big Sur.

I don't have a macOS 11 VM and won't have time to set one up for a while, so I'm hoping an early adopter can help out.

TerminalFi commented 4 years ago

All system libraries now live in /System/Library/dyld/dyld_shared_cache_x86_64. Looking into what changes would be required to support this.

TerminalFi commented 4 years ago

@wbond as of right now, I think the only options are at the moment

  1. Knowing the paths to the libraries you want.
  2. Opening /System/Library/dyld/dyld_shared_cache_x86_64 and going through it to identify the paths of the files you want.

Once we get the path, everything is the same.


from ctypes import CDLL
core_foundation_path = "/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation"
CoreFoundation = CDLL(core_foundation_path, use_errno=True)
TerminalFi commented 4 years ago

@dangh @wbond the supporting library oscrypto has been updated to support MacOS Big Sur.

@dangh Once the PR on oscrypto is merged, Package Control can be updated to fix this issue with the latest version of oscrypto

max-mykhailenko commented 4 years ago

@wbond may I know when you plan to release it?

wbond commented 4 years ago

No, I don’t have a date. This is a hobby for me that sits behind my day job and taking care of my family. As of right now most of my nights are spoken for this week.

findyy99 commented 4 years ago

So, anyone know how to solve this bug on macOS big Sur? Are there something specific I can do?

TerminalFi commented 4 years ago

@findyy99 see the referenced PR above.

findyy99 commented 4 years ago

@TheSecEng Sorry, did you mean I need to complie the Package Control by myself?

TerminalFi commented 4 years ago

I just mean that there is a PR to fix this. Will Bond just needs to test and validate it first. You can do 1 of three things.

  1. Wait for a new release
  2. Uninstall Package Control; Clone my fork and switch to a working branch
  3. Generate a new package from my branch.

If you do either 2 or 3, you won't receive updates though. I would recommend you wait for Will to push a new release. Shouldn't be too long.

findyy99 commented 4 years ago

@TheSecEng Thank you for your help! I know how to deal with it.

GuruM commented 4 years ago

Sorry if this is bad form or the wrong place to mention it, but I tried your branch and it worked for me @TheSecEng! Thanks so much.

pak-gh commented 4 years ago

Sorry, I new to this forum and fairly new to git. How can I get the branch mentioned about so I can get package control working with Big Sur. I really appreciate the help...

dofy commented 4 years ago

@pak-gh

  1. open the Sublime app

  2. press cmd + shift + p

  3. input Browse Packages and press Enter

  4. this command will open the Finder app

  5. goto the Installed Packages folder and delete the Package Control plugin file if you have

  6. select the Packages folder which in the same level of the Installed Packages folder

  7. cmd + c to copy the folder (path)

  8. open Terminal app

  9. input cd and press cmd + v

  10. you will see the command like this

    cd /Users/USER/Library/Application Support/Sublime Text 3/Packages
  11. press Enter to go into the folder

  12. clone the @TheSecEng 's fork and checkout the update/oscrypto branch

    git clone git@github.com:TheSecEng/package_control.git "Package Control"
    cd Package\ Control
    git checkout origin/update/oscrypto
  13. restart Sublime

ShawnLiii commented 4 years ago

git clone git@github.com:TheSecEng/package_control.git "Package Control"

Hi, thanks for mentioning. However, I met an issue when I executed this command: git checkout origin/update/oscrypto

I got the error: fatal: not a git repository (or any of the parent directories): .git

dofy commented 4 years ago

@ShawnLiii

Oh, sorry...

Before checkout branch, you must go to the Package Control folder first.

ShawnLiii commented 4 years ago

@ShawnLiii

Oh, sorry...

Before checkout branch, you must go to the Package Control folder first.

It works, thanks

pak-gh commented 4 years ago

I was away, just back back and saw this answer. Thanks SO MUCH. However when I try to clone I receive the following error Any thoughts?

pk@Pauls-mbpro-16 Packages % git clone git@github.com:TheSecEng/package_control.git "Package Control" Cloning into 'Package Control'... Warning: Permanently added the RSA host key for IP address '140.82.113.3' to the list of known hosts. git@github.com: Permission denied (publickey). fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

h-jia commented 4 years ago

To avoid confusion, please see

This should fixed in master as of 32e44f7.

However, please be aware I've still got some testing and merging to do before cutting a new build.

findyy99 commented 4 years ago
Error executing: /usr/bin/git symbolic-ref -q HEAD

Working directory: /Users/findyy/Library/Application Support/Sublime Text/Packages/Package Control

VCS-based packages can be ignored by changing the "ignore_vcs_packages" setting to true.

Sublime Text will need to be restarted once the setting is changed.
h-jia commented 4 years ago
  • Sorry, I am confusing when I open Package Install, It always says
Error executing: /usr/bin/git symbolic-ref -q HEAD

Working directory: /Users/findyy/Library/Application Support/Sublime Text/Packages/Package Control

VCS-based packages can be ignored by changing the "ignore_vcs_packages" setting to true.

Sublime Text will need to be restarted once the setting is changed.
  • What is the problem? Did I do something wrong?

You can still use it without problem. Just ignore it and install whatever package you need. Hopefully the official updates will fix all these issues very soon.

findyy99 commented 4 years ago

@h-jia You are right! Thank you!

pak-gh commented 4 years ago

Thanks everyone for the awesome help!!! It's much appreciated. I receive the same error as findyy99 but as h-jia says I'm now able to successfully install packages. Once the official build comes out I'll delete package control and reinstall it. This early release has enabled me to carry on though :-) Awesome!

wbond commented 4 years ago

This should fixed in master as of 32e44f70b6cf28f7071545a0d54b69be372f39ae.

However, please be aware I've still got some testing and merging to do before cutting a new build.

emman-bautista commented 4 years ago

I am having problem at the last command. It seems that branch is missing. Please help.

You can do things below:

git clone https://github.com/TheSecEng/package_control

mv package_control Package\ Control

git checkout origin/update/oscrypto
dofy commented 4 years ago

I am having problem at the last command. It seems that branch is missing. Please help.

You can do things below:

git clone https://github.com/TheSecEng/package_control

mv package_control Package\ Control

git checkout origin/update/oscrypto

You need change the directory to Package Control before checkout

cd Package\ Control
TerminalFi commented 4 years ago

This has been merged into master on this repo. My branch has been deleted

Tekl commented 4 years ago

It still does not work. I don't get "Package Control:" commands after installing it. I've a fresh Sublime installation.

wbond commented 4 years ago

@Tekl If you open a new issue with the requested info, then someone can likely point you in the right direction. https://packagecontrol.io/docs/issues

Tekl commented 4 years ago

Thanks for the fast reply. It's the same error, so I don't think I need to open a new issue. I already tried to install Package Control manually like explained here: https://github.com/wbond/package_control/issues/1483#issuecomment-681316212

But then Sublime just thinks it is not installed.

wbond commented 4 years ago

This issue has been fixed on master. If you are having trouble on master, please open a new issue with the details I requested. There is a reason I asked for those details.

If you are, in fact, getting the same error as this bug report, then you are not currently running master, or did not actually follow the instructions you linked, since the original issue is from a .sublime-package, whereas installing master using the instructions you linked will result in a directory-based install.

Honestly, none of this back and forth would be necessary if you just followed the instructions I linked to and posted your entire console contents in a new issue.

Tekl commented 4 years ago

Sorry, I misunderstood (my English is not the best) the instructions and I did the clone inside the "Installed Packages" folder. Everything is fine now. I first thought the closed issue does mean that Sublime should install the bugfixed version.

glgray commented 4 years ago

For those of us running the release version (3.2.2, Build 3211), do you know when this fix will be pushed out as an update to that version?

wbond commented 4 years ago

After enough people test it on the beta operating system release. My hope is to have an RC in the PC prerelease channel in the next day or so.

No matter what I plan on having this in production release by the time Big Sur is ready for general consumption. For now, if someone can install a beta OS, I don't consider it onerous to clone a git repo and help test software for that beta OS.

glgray commented 4 years ago

After enough people test it on the beta operating system release. My hope is to have an RC in the PC prerelease channel in the next day or so.

No matter what I plan on having this in production release by the time Big Sur is ready for general consumption. For now, if someone can install a beta OS, I don't consider it onerous to clone a git repo and help test software for that beta OS.

Thank you for the quick reply. I am not running the beta of Big Sur, but I expect it will be released any day now and I was simply checking the status of my essential software with it.

wbond commented 4 years ago

I believe they just released beta 7, and that it is expected to be released in October, if previous years are anything to go by.

dave4jr commented 3 years ago

@wbond Hey Will, first off, really appreciate the extra time you spend maintaining this package, I know it's a ton of extra work. So thank you. Just wanted to shoot you a friendly reminder, Big Sur has just been released in production yesterday. Just wanted to check the status here. Thanks man.

wbond commented 3 years ago

Package Control 3.4.0 with Big Sur support was released at least a month ago, if I recall correctly. You’ll need to manually remove your old install, then the built in ST installer will work.

brandonmcconnell commented 3 years ago

For anyone who experiences this issue and needs a full up-to-date solution, here is a blend of @dofy's solution mixed with the update from @wbond about Package Control being updated to resolve this issue.

Here are the full steps to resolve this issue, essentially be deleting and reinstalling Package Control:

  1. Open the Sublime Text app.
  2. Press Cmd+Shift+P
  3. Type "Browse Packages" and press Enter. This command will open the Finder app to the appropriate folder.
  4. Go to the "Installed Packages" folder which is a sibling to the "Packages" folder that was opened in the previous step.
  5. Delete the Package Control plugin file if you have it. It may be named something like this: Package Control.sublime-package
  6. Restart Sublime Text (must restart via quitting Cmd+Q not just closing and reopening).
  7. Once Sublime Text has restarted and is back up, press Cmd+Shift+P again.
  8. Type "Install Package Control"
  9. Restart Sublime Text again for good measure.
  10. Press Cmd+Shift+P
  11. Type "Package Control" — and voila, all your Package Control commands should be back 🎉
temuraru commented 1 year ago

The solution that worked for me was: https://github.com/wbond/package_control/issues/1577#issuecomment-940846543 "The solution is just to remove the /usr/local/lib/libcrypto.dylib which is broken for some reason. After removing it package control works without issues." That file was a symlink: /usr/local/lib/libcrypto.dylib -> ../Cellar/openssl@3/3.1.1_1/lib/libcrypto.dylib. - I'm not sure about any side-effects, though...

deathaxe commented 1 year ago

Not broken, but MacOS ships OpenSSL 3, but Package Control 3.x requires OpenSSL 1.1