Trying to produce a binary with `pants.backend.exp...
# general
Trying to produce a binary with
and hitting an issue with argsparse. I’ve been able to successfully run
pants package
, but when running the resulting binary I get an error that seems to stem from the use of
Copy code
❯ dist/src.python.mdevxp.code_ownership/code-ownership/aarch64-apple-darwin/debug/install/code-ownership
Traceback (most recent call last):
  File "runpy", line 196, in _run_module_as_main
  File "runpy", line 86, in _run_code
  File "mdevxp.code_ownership.code_ownership_mapper", line 258, in <module>
  File "mdevxp.code_ownership.code_ownership_mapper", line 50, in cli
  File "argparse", line 1717, in __init__
  File "posixpath", line 142, in basename
TypeError: expected str, bytes or os.PathLike object, not NoneType
The same entry point works with pex. If I replace my entrypoint to a script within the same pants package, it works, so it seems like something is not being configured correctly between pyoxidizer and what argsparse expected. Before I go down that rabbit hole, was wondering if anyone has already hit and solved this issue.
Related? PyOx strips the sys.argv (argv[0]), or something equally wonky
Alternatively.......... If you're not married to PyOxidizer, you might be able to make a
out of it? I've moved away from PyOx due to slow compilation/bundling time, and because of one off weirdness. But the
uses IndyGreg's awesome python-build-standalone, all from the same family of tooling.
Alternatively.......... If you’re not married to PyOxidizer, you might be able to make a
out of it?
Just prototyping at this point. Will take a look at
to compare.