pip install overrides existing build configuration

Open
#851 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
python
Domain
build-system

Research direction

Reproduce the issue using the supplied pyproject.toml and meson.build, then compare repro/debug/meson-logs/meson-setup.txt after the two pip install -e commands. Trace how the build directory and setup arguments are handled on the second invocation; done means rerunning without -Csetup-args preserves the existing debug buildtype.

Written by the indexing model from the issue text.

Description

question

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
Dominant language
Python
Stars
180
Forks
93
Avg merge
2d 7h
Merged PRs (30d)
18

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from mesonbuild/meson-python

All issues in mesonbuild/meson-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.