Open lalten opened 1 week ago
OK, I see the big picture here. Please consider this: one writes a python launch file, uses deps for Python != 3.10 (e.g. numpy) and uses that file to launch nodes. What happens is that ros2_launch implicitly depends on Python 3.10 (if the user paid attention to look at which Python rules_ros2 depends on) and the launch app depends on both deps for Python 3.10 and some other Python. This asks for trouble.
This situation may even fail at build time because multi_toolchains go through Bazel transitions -- never tried this TBH.
WDYT?
Split off https://github.com/mvukov/rules_ros2/pull/238
OK so this one is a slightly bigger change. What's happening is that it changes the rules_ros2 machinery to use its own bundled 3.10 interpreter. This way we can ensure that all the pip requirements we depend on will actually work. The other reason for this change, including the funky
python_register_multi_toolchains
that registers only a single version, is that this makes it compatible to the Bzlmod way of pinning the interpreter like this.See also https://rules-python.readthedocs.io/en/latest/toolchains.html#library-modules-with-version-constraints