Skip to content

pip install overrides existing build configuration #851

@Alvaro-Kothe

Description

@Alvaro-Kothe

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions