-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get Python 3.8.2 in Windows Dockerfile for Foxy #432
Conversation
I don't have immediate input on issue 1. You're not seeing that error in focal? For part 2, it might be better to support separate dockerfiles for different releases. We started doing that with a VS2017/2019 dockerfile split, but after crystal went eol, we dropped 2017. Perhaps instead we have dashing/eloquent/foxy splits of the dockerfiles? |
Our nightlies are using Focal and we don't see the error.
Sounds fine to me. I guess there may be significant overlap, but it's probably the easiest thing to do. |
Signed-off-by: Jacob Perron <jacob@openrobotics.org> Signed-off-by: Steven! Ragnarök <steven@nuclearsandwich.com>
c4803ce
to
f9357d1
Compare
So, it turns out in Python 3.8 DLLs are loaded differently.
https://docs.python.org/3/whatsnew/3.8.html#bpo-36085-whatsnew We're appending package bin directories (containing DLLs) to After messing around with the new Here's some example code that uses the new import os
import rclpy
dll_dir_handles = []
# We could probably just use PATH here
ament_prefix_path = os.environ['AMENT_PREFIX_PATH'].split(';')
for prefix_path in ament_prefix_path:
# Assuming all DLLs are in 'bin'
prefix_path_bin = os.path.join(prefix_path, 'bin')
if os.path.exists(prefix_path_bin):
# New in Python 3.8: 'add_dll_directory()'
dll_dir_handles.append(os.add_dll_directory(prefix_path_bin))
rclpy.init()
for handle in dll_dir_handles:
handle.close() I think the next step is to figure out a good way to integrate the call to |
Testing |
Looks like the rclpy patch didn't fix things; I'll try out some more things locally. |
I also had to patch rosidl_generator_py (ros2/rosidl_python#113). Now the build passes ( |
Instead of all PRs implementing the same non-trivial logic why not provide a context manager implementing the logic which is then used in all these places? |
And thus begins the creation tale of rpyutils. 😉 |
Since the logic relies on the directories being retrieved from PATH and PATH is set by the template provided by |
voila ros2/rpyutils#2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very tempted to change the 3.8.2 to 3.8.3 and mope for the best. I will let @jacobperron decide and approve either way.
I think the test failures and warnings are already occurring in the latest nightlies. I'm going to merge this and the connected PRs now and open up a second PR to try out Python 3.8.3. |
This is an attempt to switch to Python 3.8.2 for our Windows CI.
This is the version of Python we propose for Foxy ros-infrastructure/rep#217
This is a draft PR for two reasons:
It doesn't actually work. There errors coming from
rclpy
of the nature:It's not clear to me what DLL's are failing to load. Here's an example build: https://ci.ros2.org/job/ci_windows/10081
Should we have an option in our CI config to continue building with Python 3.7.6?
I think the answer is "yes", so that we can continue building for Dashing and Eloquent.
I haven't looked closely, but I think it should be easy to pass in an ARG to the Dockerfile for the Python version.
Feedback on one or both of the above points is appreciated.