Unable to run a Python action with remote execution enabled
- Dominant language
- Rust
- Stars
- 4.4k
- Forks
- 394
- PR merge metrics
- No merged PRs in 30d
Description
I have a tiny little example program that runs a simple Python program to generate a C++ header. You can see the full example here: https://github.com/andyfriesen/buck2-demo/tree/main/remote-execution. The Buildbarn config is all there too.
When remote execution is not used, this example works just fine.
When using RE with Buildbarn, the Python action instead fails with this text:
```
Traceback (most recent call last):
File "/worker/build/486b47aca52ecd75/root/buck-out/v2/gen/root/524f8da68ea2a374/__txn_tables_h__/srcs/../../../80b8ee2fabeb8b7c/__build_txn_tables__/build_txn_tablesNone", line 244, in
os.execv(sys.executable, args + sys.argv[1:])
ValueError: execv() arg 2 first element cannot be empty
```
It looks like `sys.executable` is the empty string. I don't have any great theories as to why that might be.
The important part of BUILD reads thus:
```python
python_library(
name="build_txn_tables_library",
srcs=["build_txn_tables.py"],
)
python_binary(
name="build_txn_tables",
main_module="build_txn_tables",
deps=[":build_txn_tables_library"]
)
genrule(
name="txn_tables_h",
srcs=["en.json", "jp.json"],
out="txn_tables.h",
cmd='$(exe :build_txn_tables) $SRCS -o $OUT'
)
```
Contributor guide
Assessment
This issue has not been assessed yet.