Skip to content

MNT Fix Pyodide build errors due to incompatible function pointer types #25831

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

lesteve
Copy link
Member

@lesteve lesteve commented Mar 13, 2023

Reference Issues/PRs

The Pyodide build of the scikit-learn development version started failing a few days ago with errors like these:

sklearn/svm/_libsvm.c:5709:30: error: incompatible function pointer types       
assigning to 'dot_func' (aka 'double (*)(int, double *, int, double *, int)')   
from 'double (*)(int, const double *, int, const double *, int)'                
[-Wincompatible-function-pointer-types]                                         
  __pyx_v_blas_functions.dot =                                                  
__pyx_fuse_1__pyx_f_7sklearn_5utils_12_cython_blas__dot;                        

See https://github.com/lesteve/scipy-tests-pyodide/actions/runs/4400682262/jobs/7706203301 for the full build log.

The problem was very likely introduced by #25791. It seems like the emscripten compiler builds by default with -Wincompatible-function-pointer-types which is not the case for our build. cc @jjerphan @jeremiedbb @OmarManzoor.

What does this implement/fix? Explain your changes.

With these changes I can build locally the scikit-learn development version with pyodide build.

Copy link
Member

@glemaitre glemaitre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to add this compilation flag on our side as well? Would it avoid further issues when it comes to pyodide if we create inconsistencies in the signature?

Copy link
Contributor

@OmarManzoor OmarManzoor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you for fixing this.

Copy link
Member

@jjerphan jjerphan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you, @lesteve!

Would it make sense to add this compilation flag on our side as well? Would it avoid further issues when it comes to pyodide if we create inconsistencies in the signature?

Yes, definitely we should add such flags once all warnings have been removed (see #24875).

@jjerphan jjerphan enabled auto-merge (squash) March 13, 2023 09:49
@jjerphan jjerphan merged commit 9df1322 into scikit-learn:main Mar 13, 2023
@lesteve lesteve deleted the fix-pyodide-incompatible-function-pointer-types branch March 13, 2023 10:38
Veghit pushed a commit to Veghit/scikit-learn that referenced this pull request Apr 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants