Problem in our `meson.build` files: modifying a `.pxd` does not rebuild the associated shared library

When you touch a `.pxd` it doesn't cythonize the associated `.pyx` and doesn't rebuild the associated shared library (`.so` on Linux) which is wrong.

For example when in meson editable mode:
```
touch sklearn/tree/_partitioner.pxd
python -c "import sklearn"
```

I would expect `sklearn/tree/_partitioner.pyx` to be turned into a `.c` file and then the `sklearn.tree/_partitioner.so` to be generated but nothing is rebuilt.

I think it's an unforunate side-effect of https://github.com/scikit-learn/scikit-learn/pull/31212 because we are using custom meson generator rather than built-in meson Cython integration to avoid long generated paths which may be a problem on Windows.

I would need to think a bit more about what is the best way forward ideally meson would deal with long paths  ... 

As a stop gap solution, we could follow what scipy is doing by defining all the dependencies manually, but this is a bit cumbersome see e.g. https://github.com/scipy/scipy/blob/2ee4675fb1d1cfe70828cfc287e6078b33d8be72/scipy/linalg/meson.build#L40-L43

In practice, I think nobody noticed for a long time, until we started modifying many Cython files at once in #32315. Basically I am not in a hurry to fix this, but anyone should feel free to voice a different opinion 😉.

COMMENT:
That sounds familiar: I've been editing `.pxd` a bit in some branches, and whenever I switch to a branch that changed a `.pxd`, I might get this kind of bug:

* Switching https://github.com/scikit-learn/scikit-learn/pull/32100 from to `main`:
  ```
  AttributeError: module 'sklearn.tree._utils' has no attribute 'WeightedHeap'
  ```
  (`WeightedHeap` is defined in #32100 but not in `main`)
  
* Switching from `main` to https://github.com/scikit-learn/scikit-learn/pull/32100:
  ```
  AttributeError: module 'sklearn.tree._utils' has no attribute 'WeightedPQueue'
  ```
  (same thing)
  
This type is not too inconvenient, because it only triggers when you have a big change, and the error is clear. Another type I had a lot when doing changes, are those errors: 

* When switching from `main` to https://github.com/scikit-learn/scikit-learn/pull/32119, I might get:
  ```
  <frozen importlib._bootstrap>:488: RuntimeWarning: sklearn.tree._criterion.Criterion size changed, may indicate binary incompatibility. Expected 752 from C header, got 760 from PyObject
  <frozen importlib._bootstrap>:488: RuntimeWarning: sklearn.tree._criterion.ClassificationCriterion size changed, may indicate binary incompatibility. Expected 1800 from C header, got 1808 from PyObject
  <frozen importlib._bootstrap>:488: RuntimeWarning: sklearn.tree._criterion.RegressionCriterion size changed, may indicate binary incompatibility. Expected 1592 from C header, got 1600 from PyObject
  Erreur de segmentation (core dumped)
  ```
  Or:
  ```
  ValueError: sklearn.tree._criterion.Criterion size changed, may indicate binary incompatibility. Expected 752 from C header, got 728 from PyObject
  ```

Note: maybe the errors I get are not related to this issue but only to the way I build sklearn:
```bash
uv venv --delete sklearn-env
rm -rf build
rm -rf .mypy_cache/
rm -rf .pytest_cache/
rm -rf .ruff_cache/
uv venv sklearn-env
source sklearn-env/bin/activate
uv pip install numpy scipy cython meson-python ninja matplotlib polars
uv pip install jupyter pre-commit pytest pandas tabulate pytest-repeat py-spy
uv pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
uv pip install --editable . \
   --verbose --no-build-isolation \
   --config-settings editable-verbose=true
```

My knowledge on build technologies is really low, I don't even remember why I chose to go with `uv` rather than following the standard build instructions... 😅

Labels: Build / CI, Low Priority