facebookincubator / xar

executable archive format
Other
1.57k stars 55 forks source link

make_xar fails to find __main__ #21

Closed apt-itude closed 5 years ago

apt-itude commented 5 years ago

Problem

Running make_xar on a directory containing a __main__.py file (which the documentation suggests is a supported behavior) fails with the following stack trace:

$ make_xar --python runfiles/ --python-interpreter python3.6 --output testxar
Traceback (most recent call last):
  File "/Users/athompson/.pyenv/versions/xar/bin/make_xar", line 11, in <module>
    sys.exit(main())
  File "/Users/athompson/.pyenv/versions/3.7.0/envs/xar/lib/python3.7/site-packages/xar/make_xar.py", line 123, in main
    entry_point = entry_point or xar_util.get_python_main(opts.python)
AttributeError: module 'xar.xar_util' has no attribute 'get_python_main'

Looking at the code, it actually does look like this function is not implemented.

Environment

terrelln commented 5 years ago

Looks like the function got accidentally removed during file shuffles. I'll put a fix up today, but in the meantime you should be able to set --python-entry-point __main__ to work around the issue.

terrelln commented 5 years ago

This should be fixed in the master branch. I'll release a new version soon.