Ok last one :smile: I got an exception trying to ...
# development
a
Ok last one 😄 I got an exception trying to run the pants pex that I just built to publish. But if I copy and paste the command it says it's running, and run it in my terminal, it works as expected...
👀 1
Tail end of the script:
Copy code
Built /Users/dwh/src/github.com/pantsbuild/pants/dist/deploy/pex/pants.2.7.0.dev0.pex
Traceback (most recent call last):
  File "/Users/dwh/.cache/pants/named_caches/pex_root/unzipped_pexes/f3f5e11de4a845a8275f7dbfac01d3887f7b7a46/.bootstrap/pex/pex.py", line 484, in execute
    exit_value = self._wrap_coverage(self._wrap_profiling, self._execute)
  File "/Users/dwh/.cache/pants/named_caches/pex_root/unzipped_pexes/f3f5e11de4a845a8275f7dbfac01d3887f7b7a46/.bootstrap/pex/pex.py", line 401, in _wrap_coverage
    return runner(*args)
  File "/Users/dwh/.cache/pants/named_caches/pex_root/unzipped_pexes/f3f5e11de4a845a8275f7dbfac01d3887f7b7a46/.bootstrap/pex/pex.py", line 432, in _wrap_profiling
    return runner(*args)
  File "/Users/dwh/.cache/pants/named_caches/pex_root/unzipped_pexes/f3f5e11de4a845a8275f7dbfac01d3887f7b7a46/.bootstrap/pex/pex.py", line 540, in _execute
    return self.execute_entry(self._pex_info.entry_point)
  File "/Users/dwh/.cache/pants/named_caches/pex_root/unzipped_pexes/f3f5e11de4a845a8275f7dbfac01d3887f7b7a46/.bootstrap/pex/pex.py", line 656, in execute_entry
    return self.execute_pkg_resources(entry_point)
  File "/Users/dwh/.cache/pants/named_caches/pex_root/unzipped_pexes/f3f5e11de4a845a8275f7dbfac01d3887f7b7a46/.bootstrap/pex/pex.py", line 687, in execute_pkg_resources
    runner = entry.resolve()
  File "/Users/dwh/.cache/pants/named_caches/pex_root/unzipped_pexes/f3f5e11de4a845a8275f7dbfac01d3887f7b7a46/.bootstrap/pex/vendor/_vendored/setuptools/pkg_resources/__init__.py", line 2481, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
ModuleNotFoundError: No module named 'pants.bin'
Traceback (most recent call last):
  File "/Users/dwh/src/github.com/pantsbuild/pants/.pants.d/tmpcvhwunp2/release_helper.pex/.bootstrap/pex/pex.py", line 484, in execute
  File "/Users/dwh/src/github.com/pantsbuild/pants/.pants.d/tmpcvhwunp2/release_helper.pex/.bootstrap/pex/pex.py", line 401, in _wrap_coverage
  File "/Users/dwh/src/github.com/pantsbuild/pants/.pants.d/tmpcvhwunp2/release_helper.pex/.bootstrap/pex/pex.py", line 432, in _wrap_profiling
  File "/Users/dwh/src/github.com/pantsbuild/pants/.pants.d/tmpcvhwunp2/release_helper.pex/.bootstrap/pex/pex.py", line 540, in _execute
  File "/Users/dwh/src/github.com/pantsbuild/pants/.pants.d/tmpcvhwunp2/release_helper.pex/.bootstrap/pex/pex.py", line 667, in execute_entry
  File "/Users/dwh/src/github.com/pantsbuild/pants/.pants.d/tmpcvhwunp2/release_helper.pex/.bootstrap/pex/pex.py", line 679, in execute_module
  File "/usr/local/Cellar/python@3.9/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 213, in run_module
    return _run_code(code, {}, init_globals, run_name, mod_spec)
  File "/usr/local/Cellar/python@3.9/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/Users/dwh/src/github.com/pantsbuild/pants/.pants.d/tmpcvhwunp2/build-support/bin/release_helper.py", line 940, in <module>
    main()
  File "/Users/dwh/src/github.com/pantsbuild/pants/.pants.d/tmpcvhwunp2/build-support/bin/release_helper.py", line 928, in main
    build_pex(fetch=True)
  File "/Users/dwh/src/github.com/pantsbuild/pants/.pants.d/tmpcvhwunp2/build-support/bin/release_helper.py", line 615, in build_pex
    subprocess.run([sys.executable, str(dest), "--version"], check=True)
  File "/usr/local/Cellar/python@3.9/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/usr/local/opt/python@3.9/bin/python3.9', '/Users/dwh/src/github.com/pantsbuild/pants/dist/deploy/pex/pants.2.7.0.dev0.pex', '--version']' returned non-zero exit status 1.
~/src/github.com/pantsbuild/pants % PANTS_PEX_RELEASE=STABLE ./build-support/bin/release.sh build-universal-pex'/usr/local/opt/python@3.9/bin/python3.9' '/Users/dwh/src/github.com/pantsbuild/pants/dist/deploy/pex/pants.2.7.0.dev0.pex' '--version'  
usage: release_helper.pex [-h] {publish,publish-apple-silicon,test-release,build-wheels,build-fs-util,build-local-pex,build-universal-pex,validate-roles,list-prebuilt-wheels,check-pants-wheels} ...
release_helper.pex: error: argument command: invalid choice: 'build-universal-pex/usr/local/opt/python@3.9/bin/python3.9' (choose from 'publish', 'publish-apple-silicon', 'test-release', 'build-wheels', 'build-fs-util', 'build-local-pex', 'build-universal-pex', 'validate-roles', 'list-prebuilt-wheels', 'check-pants-wheels')
My re-run:
Copy code
~/src/github.com/pantsbuild/pants % '/usr/local/opt/python@3.9/bin/python3.9' '/Users/dwh/src/github.com/pantsbuild/pants/dist/deploy/pex/pants.2.7.0.dev0.pex' '--version'
23:35:15.95 [INFO] Starting: Resolving plugins: hdrhistogram, toolchain.pants.plugin==0.13.0
23:35:21.08 [INFO] Completed: Resolving plugins: hdrhistogram, toolchain.pants.plugin==0.13.0
23:35:21.61 [INFO] Initializing scheduler...
23:35:22.38 [INFO] Scheduler initialized.
2.7.0.dev0+git5a702605