Facilitate parallel build directories for meson-enabled commands?
lagru opened this issue · 5 comments
While making scikit-image compatible with NumPy 2 I often had to switch back and forth between 2 environments with NumPy 1.x and 2 installed. I had to use spin build --clean
each time I switched which even with ccache available took a bit of time. From the initial introduction of meson and it "breaking" inplace editable installs I remember that one of the arguments was that meson would allow having multiple build directories in parallel. Perhaps I missed an obvious way to achieve this with existing capabilities of spin?
If not and going forward, can we facilitate this workflow a bit more in spin? For my scenario I imagined something like a -t, --target TARGET
switch. If not specified the default setup with build/skimage
and build-install
is used. With -t np2
meson-enabled spin commands would use build/np2/skimage
and maybe build-install/np2
?
UI and paths are of course up for discussion but I think it get's the workflow across that I'd like to have. It would enable faster switching and debugging with multiple environments that require recompilation.
This would require either storing some state ("last used build dir"), or specifying the builddir on each run. If you think the latter is acceptable, I can add it.
or specifying the builddir on each run
SciPy's dev.py
does it this way, with a --build-dir
flag that comes before the subcommand. It's quite usable when combined with a shell alias. E.g.:
$ alias dev="python dev.py --build-dir build"
$ alias dev-clang="python dev.py --build-dir build-clang"
$ # run the same tests for the two different builds:
$ dev test -s linalg
$ dev-clang test -s linalg
I'd suggest doing it the same way for spin
, including documenting the alias
trick.
Yeah, even a simple toggle would help with the workflow so it's not really worth it for spin to worry about saving state suddenly. There's also the option to use an environment variable in addition. But probably not worth it since the alias-approach also allows to configure the build dir per shell session or even longer.
We're releasing 0.10 today, aiming to get this into 0.11.