I'm trying to run a bazel target with bazel run
command from workspace root. And I want to pass relative path as an argument to this target. Currently it doesn't recognize this pass, whilst manual run from console works fine.
So I conclude that bazel`s working dir differs from workspace root at this point .
I have checked for bazel docs, google, and didn't find an explicit way to specify working directory for run command. Does anybody know proper way to do that? Thanks!
P.S.: Namely I'm trying to run mediapipe iris example, which I build with following command (from project root):
bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 mediapipe/examples/desktop/iris_tracking:iris_tracking_cpu
Then if I run it manually (also from project root) it works fine:
GLOG_logtostderr=1 bazel-bin/mediapipe/examples/desktop/hand_tracking/hand_tracking_gpu --calculator_graph_config_file=mediapipe/graphs/hand_tracking/hand_tracking_mobile.pbtxt
Now if I run it with bazel run
it fails:
bazel run -c dbg --define MEDIAPIPE_DISABLE_GPU=1 mediapipe/examples/desktop/iris_tracking:iris_tracking_cpu -- --calculator_graph_config_file=mediapipe/graphs/iris_tracking/iris_tracking_cpu.pbtxt
Not, that using $PWD
in front of graph path doesn't help, for mediapipe engine still relies on relative path and proper CWD value.