frerich / clcache

A compiler cache for MSVC, much like ccache for gcc
Other
325 stars 83 forks source link

CLCACHE_PROFILE ignored when clcache is installed as .exe from chocolatey or pip #363

Open Artalus opened 5 years ago

Artalus commented 5 years ago

Apparently, because setup.py mentions

    entry_points={
          'console_scripts': [
              'clcache = clcache.__main__:main',

, the if 'CLCACHE_PROFILE' in os.environ: check is ignored, since it is not located in def main(). I can reproduce this on two machines that has clcache installed as clcache.exe: one was installed from Chocolatey due to lack of MSVC 14.0, another from pip install.

Artalus commented 5 years ago

Also, if I move this check into some def main_wrapper() and make it an entrypoint, cProfile.run will argue that main() is not defined. I had to replace it with cProfile.run('import clcache\nclcache.__main__.main()', ....

Not sure how it was supposed to work for previous 3 years since CLCACHE_PROFILE introduction...