wbond / package_control

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

Failed dependency installations are incorrectly reported as successful #1605

Closed Nothing4You closed 7 months ago

Nothing4You commented 2 years ago

Dependency installations can fail for a variety of reasons, for example due to incompatible architectures as described in #1425.

Currently package control logs that the installation could not be performed, just after that it logs that the dependency was installed and shows a popup to the user suggesting an application restart to reload it.

There's a lot of similar or related bug reports already, however, I haven't found one detailing this specific issue, as most of them focus on the failure reason, not the incorrect reporting. This bug is not about lxml not being available on my platform but about the incorrect notification that dependencies were successfully installed with no notification outside the Console about the installation failure.

Example:

reloading python 3.3 plugin Package Control.Package Control
reloading python 3.3 plugin Terrafmt.terrafmt
reloading python 3.3 plugin TrailingSpaces.trailing_spaces
reloading python 3.3 plugin xpath.lxml_parser
Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 308, 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 1692, in load_module
    exec(compile(source, source_path, 'exec'), mod.__dict__)
  File "/Users/rsc/Library/Application Support/Sublime Text/Installed Packages/xpath.sublime-package/lxml_parser.py", line 1, in <module>
ImportError: No module named 'lxml'
reloading python 3.3 plugin xpath.sublime_helper
reloading python 3.3 plugin xpath.sublime_input
reloading python 3.3 plugin xpath.sublime_input_quickpanel
reloading python 3.3 plugin xpath.sublime_input_view
reloading python 3.3 plugin xpath.sublime_lxml
Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 308, 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 1692, in load_module
    exec(compile(source, source_path, 'exec'), mod.__dict__)
  File "/Users/rsc/Library/Application Support/Sublime Text/Installed Packages/xpath.sublime-package/sublime_lxml.py", line 2, in <module>
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 1692, in load_module
    exec(compile(source, source_path, 'exec'), mod.__dict__)
  File "/Users/rsc/Library/Application Support/Sublime Text/Installed Packages/xpath.sublime-package/lxml_parser.py", line 1, in <module>
ImportError: No module named 'lxml'
reloading python 3.3 plugin xpath.tests
Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 308, 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 1692, in load_module
    exec(compile(source, source_path, 'exec'), mod.__dict__)
  File "/Users/rsc/Library/Application Support/Sublime Text/Installed Packages/xpath.sublime-package/tests.py", line 6, in <module>
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 1692, in load_module
    exec(compile(source, source_path, 'exec'), mod.__dict__)
  File "/Users/rsc/Library/Application Support/Sublime Text/Installed Packages/xpath.sublime-package/lxml_parser.py", line 1, in <module>
ImportError: No module named 'lxml'
reloading python 3.3 plugin xpath.xpath
Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 308, 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 1692, in load_module
    exec(compile(source, source_path, 'exec'), mod.__dict__)
  File "/Users/rsc/Library/Application Support/Sublime Text/Installed Packages/xpath.sublime-package/xpath.py", line 4, in <module>
ImportError: No module named 'lxml'
plugins loaded
Package Control: Installing 1 missing dependency
Package Control: Fetching list of available packages and dependencies
  Platform: osx-arm64
  Sublime Text Version: 4121
  Package Control Version: 3.4.1
Package Control: Download Debug
  URL: https://packagecontrol.io/channel_v3.json
  Timeout: 30
  Resolved IP: 50.116.34.243
  Resolved IPv6: 2600:3c02::f03c:91ff:fedf:6883
Package Control: Urllib Debug Proxy
  http_proxy: 
  https_proxy: 
  proxy_username: 
  proxy_password: 
Package Control: Found previously exported CA bundle at /Users/rsc/Library/Caches/Sublime Text/Cache/Package Control/oscrypto-ca-bundle.crt (281297 bytes)
Package Control: Urllib HTTPS Debug General
  Connecting to packagecontrol.io on port 443
Package Control: Urllib HTTPS Debug General
  Upgrading connection to SSL using CA certs file at /Users/rsc/Library/Caches/Sublime Text/Cache/Package Control/merged-ca-bundle.crt
  Using hostname "packagecontrol.io" for TLS SNI extension
  Successfully upgraded connection to packagecontrol.io:443 with SSL Using TLSv1/SSLv3 with cipher ECDHE-RSA-AES128-GCM-SHA256
  Server SSL certificate:
    subject: CN=packagecontrol.io
    subject alt name: packagecontrol.io, www.packagecontrol.io
    expire date: Dec 21 12:00:00 2021 GMT
  Certificate validated for packagecontrol.io
Package Control: Urllib HTTPS Debug Write
  GET /channel_v3.json HTTP/1.1
  User-Agent: Package Control v3.4.1
  If-None-Match: "617c9914-5f859"
  Accept-Encoding: bzip2,gzip,deflate
  Host: packagecontrol.io
  If-Modified-Since: Sat, 30 Oct 2021 01:00:04 GMT
  Connection: Keep-Alive
Package Control: Urllib HTTPS Debug Read
  HTTP/1.1 200 OK
  Server: nginx
  Date: Sat, 30 Oct 2021 01:25:44 GMT
  Content-Type: application/json
  Content-Length: 391505
  Last-Modified: Sat, 30 Oct 2021 01:20:04 GMT
  Connection: keep-alive
  ETag: "617c9dc4-5f951"
  Content-Encoding: bzip2
  Vary: Accept-Encoding
  Strict-Transport-Security: max-age=15552000
  Accept-Ranges: bytes
Package Control: Caching https://packagecontrol.io/channel_v3.json in /Users/rsc/Library/Caches/Sublime Text/Cache/Package Control/http_cache/01524fae79697630d0454ba3fabd9414
Package Control: Fixed URL from https://raw.github.com/darinmorrison/sublime-packages/master/packages.json to https://raw.githubusercontent.com/darinmorrison/sublime-packages/master/packages.json
Package Control: Fixed URL from https://raw.github.com/darinmorrison/sublime-packages/master/packages.json to https://raw.githubusercontent.com/darinmorrison/sublime-packages/master/packages.json
Package Control: The dependency "lxml" is either not available on this platform or for this version of Sublime Text
Package Control: Installed missing dependency lxml
Package Control: Skipping automatic upgrade, last run at 2021-10-30 02:55:34, next run at 2021-10-30 03:55:34 or after
error: Package Control

1 missing dependency was just installed. Sublime Text should be restarted, otherwise one or more of the installed packages may not function properly.
Package Control: Urllib HTTPS Debug General
  Closing connection to packagecontrol.io on port 443 after 1 request
deathaxe commented 1 year ago

The dependency "lxml" is either not available on this platform or for this version of Sublime Text

If a depenency is unavailable for current platform or version of Sublime Text, Package Control currently considders the dependency not to be required. Therefore it's handled as success.

Not sure about the origin, if a package doesn't require a library on a certain platform or version of Sublime Text, it should be defined correctly in dependencies.json.