Install pyyaml for ros2_config rule
To run the generate_ros2_config.py script during repository setup, the host system needs to have Python3 and pyyaml modules installed.
- Check if the
python3binary exists in thePATHand error if not - Check if the
pyyamlmodule is installed, and if not, install it viapip
The current solution is inspired by:
-
https://groups.google.com/g/bazel-discuss/c/KOz7jMQb09A
The typical way to call any executable from a repository rule is to just require it to be in the user's $PATH environment variable, and then call it directly.
-
official
maven_ruleschecks if themvnbinary is present on the host system
@bluka4 We have an issue here: we are using the system-installed python3 interpreter. I think we should actually change this in a way that no python interpreter is called during repo setup at all. The lock script should do all the heavy lifting and generate code that does not require any Python processing. So if the lock script directly produces a .bzl file, we should be good.
@bluka4 We have an issue here: we are using the system-installed python3 interpreter. I think we should actually change this in a way that no python interpreter is called during repo setup at all. The lock script should do all the heavy lifting and generate code that does not require any Python processing. So if the lock script directly produces a .bzl file, we should be good.
@kilian-funk I drafted approach here: #15. Let's continue our discussion there.
@kilian-funk @bluka4 why not use the @python_interpreter//:python3 alias to get the Bazel-provided python3 executable instead of the system one?
@kilian-funk @bluka4 why not use the
@python_interpreter//:python3alias to get the Bazel-providedpython3executable instead of the system one?
@evan-flynn-apexai, this is executed during the Bazel repository setup, so Bazel labels are unavailable at this phase. In repository_ctx we only have execute function that is simply running shell commands. But I might miss something; please correct me if I am wrong.