zsh-users / zsh-completions

Additional completion definitions for Zsh.
Other
6.9k stars 713 forks source link

~/.cache/zsh/compacache folder created under current directory #1007

Closed YuruiHong closed 1 year ago

YuruiHong commented 1 year ago

I am not sure if this was caused by zsh-completions, and if it is a bug or feature, but when I ran a python command:

python -m sklearnex myfile.py

A "~/.cache/zsh/compacache folder" was created under my current folder, which looks rather weird:

$ ls \~/.cache/zsh/compcache
total 12
drwx------ 2 hyr hyr 4096 Apr 19 18:25 .
drwx------ 3 hyr hyr 4096 Apr 19 18:25 ..
-rw-r--r-- 1 hyr hyr 4032 Apr 19 18:25 python_modules

and the python_modules included available python modules:

_python_modules=( ${(Q)"${(z)$(<<\EO:_python_modules
'DrugAI-code' '__future__' '_aix_support' '_bootsubprocess' '_collections_abc' '_compat_pickle' '_compression' '_markupbase' '_osx_support' '_py_abc' '_pydecimal' '_pyio' '_sitebuiltins' '_strptime' '_sysconfigdata__linux_x86_64-linux-gnu' '_sysconfigdata_x86_64_conda_cos6_linux_gnu' '_sysconfigdata_x86_64_conda_linux_gnu' '_threading_local' '_weakrefset' 'abc' 'aifc' 'antigravity' 'argparse' 'ast' 'asynchat' 'asyncio' 'asyncore' 'base64' 'bdb' 'binhex' 'bisect' 'bz2' 'cProfile' 'calendar' 'cgi' 'cgitb' 'chunk' 'cmd' 'code' 'codecs' 'codeop' 'collections' 'colorsys' 'compileall' 'concurrent' 'configparser' 'contextlib' 'contextvars' 'copy' 'copyreg' 'crypt' 'csv' 'ctypes' 'curses' 'dataclasses' 'datetime' 'dbm' 'decimal' 'difflib' 'dis' 'distutils' 'doctest' 'email' 'encodings' 'ensurepip' 'enum' 'filecmp' 'fileinput' 'fnmatch' 'fractions' 'ftplib' 'functools' 'genericpath' 'getopt' 'getpass' 'gettext' 'glob' 'graphlib' 'gzip' 'hashlib' 'heapq' 'hmac' 'html' 'http' 'idlelib' 'imaplib' 'imghdr' 'imp' 'importlib' 'inspect' 'io' 'ipaddress' 'json' 'keyword' 'lib2to3' 'linecache' 'locale' 'logging' 'lzma' 'mailbox' 'mailcap' 'mimetypes' 'modulefinder' 'multiprocessing' 'netrc' 'nntplib' 'ntpath' 'nturl2path' 'numbers' 'opcode' 'operator' 'optparse' 'os' 'pathlib' 'pdb' 'pickle' 'pickletools' 'pipes' 'pkgutil' 'platform' 'plistlib' 'poplib' 'posixpath' 'pprint' 'profile' 'pstats' 'pty' 'py_compile' 'pyclbr' 'pydoc' 'pydoc_data' 'queue' 'quopri' 'random' 're' 'reprlib' 'rlcompleter' 'runpy' 'sched' 'secrets' 'selectors' 'shelve' 'shlex' 'shutil' 'signal' 'site' 'smtpd' 'smtplib' 'sndhdr' 'socket' 'socketserver' 'sqlite3' 'sre_compile' 'sre_constants' 'sre_parse' 'ssl' 'stat' 'statistics' 'string' 'stringprep' 'struct' 'subprocess' 'sunau' 'symtable' 'sysconfig' 'tabnanny' 'tarfile' 'telnetlib' 'tempfile' 'test' 'textwrap' 'this' 'threading' 'timeit' 'tkinter' 'token' 'tokenize' 'trace' 'traceback' 'tracemalloc' 'tty' 'turtle' 'turtledemo' 'types' 'typing' 'unittest' 'urllib' 'uu' 'uuid' 'venv' 'warnings' 'wave' 'weakref' 'webbrowser' 'wsgiref' 'xdrlib' 'xml' 'xmlrpc' 'zipapp' 'zipfile' 'zipimport' 'zoneinfo' '_asyncio' '_bisect' '_blake2' '_bz2' '_codecs_cn' '_codecs_hk' '_codecs_iso2022' '_codecs_jp' '_codecs_kr' '_codecs_tw' '_contextvars' '_crypt' '_csv' '_ctypes' '_ctypes_test' '_curses' '_curses_panel' '_datetime' '_decimal' '_elementtree' '_hashlib' '_heapq' '_json' '_lsprof' '_lzma' '_md5' '_multibytecodec' '_multiprocessing' '_opcode' '_pickle' '_posixshmem' '_posixsubprocess' '_queue' '_random' '_sha1' '_sha256' '_sha3' '_sha512' '_socket' '_sqlite3' '_ssl' '_statistics' '_struct' '_testbuffer' '_testcapi' '_testimportmultiple' '_testinternalcapi' '_testmultiphase' '_tkinter' '_uuid' '_xxsubinterpreters' '_xxtestfuzz' '_zoneinfo' 'array' 'audioop' 'binascii' 'cmath' 'fcntl' 'grp' 'math' 'mmap' 'nis' 'ossaudiodev' 'pyexpat' 'readline' 'resource' 'select' 'spwd' 'syslog' 'termios' 'unicodedata' 'xxlimited' 'xxlimited_35' 'zlib' 'astroid' 'colorama' 'diffdir' 'dill' 'isort' 'lazy_object_proxy' 'markdown_it' 'mccabe' 'mdurl' 'neovim' 'path' 'pylint' 'pynvim' 'pyte' 'rich' 'tomli' 'tomlkit' 'typing_extensions' 'wrapt' 'OpenSSL' 'PIL' '_cffi_backend' '_distutils_hack' '_yaml' 'appdirs' 'bottleneck' 'brotli' 'caffe2' 'cairo' 'certifi' 'cffi' 'charset_normalizer' 'coloredlogs' 'conda' 'conda_env' 'conda_package_handling' 'cryptography' 'daal4py' 'dateutil' 'flit_core' 'future' 'gi' 'humanfriendly' 'idna' 'joblib' 'libfuturize' 'libmambapy' 'libpasteurize' 'lxml' 'mamba' 'networkx' 'numexpr' 'numpy' 'onedal' 'packaging' 'pandas' 'past' 'pip' 'pkg_resources' 'png' 'pooch' 'prettytable' 'pycosat' 'pycparser' 'pygtkcompat' 'pyqrcode' 'pytz' 'qrcode' 'requests' 'requests_toolbelt' 'ruamel_yaml' 'scipy' 'setproctitle' 'setuptools' 'six' 'sklearn' 'sklearnex' 'socks' 'sockshandler' 'test_pycosat' 'threadpoolctl' 'tlz' 'toolz' 'torch' 'torchgen' 'tqdm' 'urllib3' 'wcwidth' 'wheel' 'yaml' 'zmq'
EO:_python_modules
)}"} )

I have also seen similar cache folders and files for deb packages, etc., under other circumstances. How to explain those, and is it a bug to fix? I think these would be global caches, and are better stored under $HOME/.cache.

syohex commented 1 year ago

I can't reproduce. And completion files in zsh-completion project do not use such directory.

Do you have any weird environment variables or do you set wrong cache-path zsh variable in your configuration file ?

zstyle ':completion:*' use-cache on
zstyle ':completion:*' cache-path some_wrong_path
msva commented 1 year ago

(or do you use something like oh-my-zsh)

raxod502 commented 1 year ago

I have started experiencing the same issue after enabling zsh-autocomplete. I suspect it may be a bug in that project, as I have been using zsh-completions for many years and only after setting up zsh-autocomplete did this start happening.

YuruiHong commented 1 year ago

Sorry that I forgot about this thread. It is indeed an issue about marlonrichert/zsh-autocomplete and my merged PR there has solved this issue. I think this can be closed.