bazel_rules_pex icon indicating copy to clipboard operation
bazel_rules_pex copied to clipboard

pex_binary: Support PEXes with no entry points (interpreters)

Open evanj opened this issue 7 years ago • 1 comments

When using pex without any entry points, it creates a PEX that is an interpreter that uses the bundled environment. This can be useful to distribute in order to execute other scripts.

interpreter_only_test.py: Verify that the PEX starts an interpreter.

Fixes the following Skylark exceptions in pex_binary:

File ".../bazel_rules_pex/examples/BUILD", line 24
  pex_binary(name = 'interpreter_only')
File ".../bazel_rules_pex/pex/pex_rules.bzl", line 177, in _pex_binary_impl
  pex_file_types.filter(ctx.files.srcs)[0]
index out of range (index is 0, but sequence has 0 elements)

File ".../bazel_rules_pex/examples/BUILD", line 24
  pex_binary(name = 'interpreter_only')
File ".../bazel_rules_pex/pex/pex_rules.bzl", line 225, in _pex_binary_impl
  main_pkg
name 'main_pkg' is not defined

evanj avatar Jan 08 '18 20:01 evanj

This will unfortunately conflict with #61 . If you merge one of them, I'll happily fix the merge/rebase conflicts on the other for you. Thanks!

evanj avatar Jan 08 '18 20:01 evanj