use strict;
use warnings;
print("Hello from Perl!\n");
python.py:
import subprocess
from pprint import pprint
from rules_python.python.runfiles import runfiles
my_runfiles = runfiles.Create()
perl_script = my_runfiles.Rlocation("perlrulesbug/perl")
subprocess.call([perl_script])
Test:
$ bazel run //:python
INFO: Analyzed target //:python (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //:python up-to-date:
bazel-bin/python
INFO: Elapsed time: 0.051s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Build completed successfully, 1 total action
Traceback (most recent call last):
File "/home/user1/.cache/bazel/_bazel_user1/ed6bf9cf7ba68480a3230f4c79ec9c4c/execroot/perlrulesbug/bazel-out/k8-fastbuild/bin/python.runfiles/perlrulesbug/python.py", line 8, in <module>
subprocess.call([perl_script])
File "/usr/lib/python3.9/subprocess.py", line 349, in call
with Popen(*popenargs, **kwargs) as p:
File "/usr/lib/python3.9/subprocess.py", line 951, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.9/subprocess.py", line 1696, in _execute_child
and os.path.dirname(executable)
File "/usr/lib/python3.9/posixpath.py", line 152, in dirname
p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not NoneType
Despite the data dependency, the runfiles library cannot find perlrulesbug/perl.
It does not appear in the file bazel-out/k8-fastbuild/bin/python.runfiles_manifest or anywhere in the directory bazel-out/k8-fastbuild/bin/python.runfiles. It's like the data dependency just does not work at all. Is perl_binary not communicating its files correctly via DefaultInfo?
Example:
BUILD:
WORKSPACE:
perl.pl:
python.py:
Test:
Despite the data dependency, the runfiles library cannot find
perlrulesbug/perl
.It does not appear in the file
bazel-out/k8-fastbuild/bin/python.runfiles_manifest
or anywhere in the directorybazel-out/k8-fastbuild/bin/python.runfiles
. It's like the data dependency just does not work at all. Isperl_binary
not communicating its files correctly viaDefaultInfo
?Example repo: https://github.com/jesseschalken/perlrulesbug