When using meson-python with editable installs, running pip install -e a second time, reusing the build directory, but without repeating the buildtype argument overwrites the existing build configuration.
Reproduction
#!/usr/bin/env bash
mkdir repro
# Create files for meson-python
cat <<EOF > repro/pyproject.toml
[project]
name = "foo"
version = "0.0.1"
[build-system]
build-backend = "mesonpy"
requires = ["meson-python"]
EOF
cat <<EOF > repro/meson.build
project('foo', 'c', version: '0.1.0')
EOF
python -m pip install meson-python
# Create a debug build
pip install --no-build-isolation -e repro -Csetup-args=-Dbuildtype=debug -Cbuild-dir=debug
grep buildtype repro/debug/meson-logs/meson-setup.txt
# buildtype : debug
# If I decide to reuse this build directory,
# and I call `pip install` without `-Csetup-args=-Dbuildtype=debug`
# it reconfigures to have `buildtype=release` instead of reusing the current configuration.
pip install --no-build-isolation -e repro -Cbuild-dir=debug
grep buildtype repro/debug/meson-logs/meson-setup.txt
# buildtype : release
When using
meson-pythonwith editable installs, runningpip install -ea second time, reusing the build directory, but without repeating thebuildtypeargument overwrites the existing build configuration.Reproduction