Skip to content

BLD Use work-around for partial recompilation when building with Meson #29140

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

Merged
merged 3 commits into from
Jun 3, 2024

Conversation

lesteve
Copy link
Member

@lesteve lesteve commented May 30, 2024

Fix #28837

This fixes the reproducer in #28837, the behaviour with this PR is the expected one:

meson setup build/test
# Start from a built project
ninja -C build/test

# ninja is timestamp-based to touching this pxd will cause things to rebuild
touch sklearn/utils/_typedefs.pxd
# 177 targets need to be rebuilt, this is expected
ninja -C build/test

# "no work to do" as expected, i.e. no recompilation happens 
ninja -C build/test

The work-around was suggested by @rgommers in mesonbuild/meson#13212 🙏.

@lesteve lesteve changed the title Fix partial recompilation BLD Use work-around for partial recompilation when building with Meson May 30, 2024
Copy link

github-actions bot commented May 30, 2024

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: ccf1871. Link to the linter CI: here

@lesteve
Copy link
Member Author

lesteve commented May 30, 2024

Hmmm weird failure in the no-OpenMP build on a doctest, I restarted the build.

Maybe a motivation to look at scipy-doctest #29027 😉 ?

The error was:

=================================== FAILURES ===================================
____________ [doctest] sklearn.linear_model._ridge.ridge_regression ____________
[gw2] darwin -- Python 3.12.3 /usr/local/miniconda/envs/testvenv/bin/python
526     >>> import numpy as np
527     >>> from sklearn.datasets import make_regression
528     >>> from sklearn.linear_model import ridge_regression
529     >>> rng = np.random.RandomState(0)
530     >>> X = rng.randn(100, 4)
531     >>> y = 2.0 * X[:, 0] - 1.0 * X[:, 1] + 0.1 * rng.standard_normal(100)
532     >>> coef, intercept = ridge_regression(X, y, alpha=1.0, return_intercept=True)
533     >>> list(coef)
534     [1.9..., -1.0..., -0.0..., -0.0...]
535     >>> intercept
Expected:
    -0.0...
Got:
    0.00013536885328901222

/Users/runner/work/1/s/sklearn/linear_model/_ridge.py:535: DocTestFailure

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.

LGTM. Thanks @lesteve

@adrinjalali adrinjalali merged commit d301304 into scikit-learn:main Jun 3, 2024
30 checks passed
@lesteve lesteve deleted the fix-partial-recompilation branch June 3, 2024 12:14
jeremiedbb pushed a commit to jeremiedbb/scikit-learn that referenced this pull request Jul 2, 2024
@jeremiedbb jeremiedbb mentioned this pull request Jul 2, 2024
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Meson does not fully build the project in one go and need to be run twice ?
3 participants