-
-
Notifications
You must be signed in to change notification settings - Fork 26k
BLD Fix more build dependencies in meson build #28821
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
Conversation
sklearn/tree/meson.build
Outdated
@@ -16,7 +16,7 @@ tree_extension_metadata = { | |||
foreach ext_name, ext_dict : tree_extension_metadata | |||
py.extension_module( | |||
ext_name, | |||
ext_dict.get('sources'), | |||
ext_dict.get('sources') + utils_cython_tree, |
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.
From looking at the other changes, py.extension_module
accepts a list of list. If that's the case, can we keep how we call py.extension_module
consistent:
ext_dict.get('sources') + utils_cython_tree, | |
[ext_dict.get('sources'), utils_cython_tree], |
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.
OK I followed your suggestion.
I actually learned very recently that there was such a thing as argument flattening Meson, so you can do a variety of different syntaxes that should do the same including some complicated ones with arbitrary nesting like this:
['some-file.pyx'], [['some-file.pxd'], [[utils_cython_tree]]]]
see https://mesonbuild.com/Syntax.html#argument-flattening for more details.
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.
Lets try it.
Thanks, let me know if you see variations of these build errors happen again! |
Improves the situation for #28820. Since I am not able to reproduce the issue, I guess we will just have to wait and see if this kind of issues happen again after this is merged ...
I tested it for the cases that have been seen in the CI by running this kind of commands from an empty Meson build dir:
I also added
utils_cython_tree
in all the places that cimport something fromutils
.You can also check inputs are defined correctly by looking at the
ninja.build
file or with this kind ofninja
commands:Here you can check that cythonizing
sklearn/cluster/_hdbscan/_linkage.pyx
does depend onsklearn/__init__.py
,sklearn/utils/__init__.py
,sklearn/metrics/__init__.py
andutils
+metrics
.pxd
files.