Skip to content

Override merge of dictionary: merge by dict keys? #1803

Closed
@henryiii

Description

Description

I think I see a problem with override merging. I've set the following in TOML:

[tool.cibuildwheel.config-settings]
"cmake.define.RUN_CMAKE_TEST" = "ON"

[tool.cibuildwheel.linux.config-settings]
"cmake.define.OPENSSL_ROOT_DIR" = "/usr/local/ssl"
"cmake.define.CMAKE_JOB_POOL_COMPILE" = "compile"
"cmake.define.CMAKE_JOB_POOL_LINK" = "link"
"cmake.define.CMAKE_JOB_POOLS" = "compile=4;link=1"
"cmake.define.RUN_CMAKE_TEST" = "ON"

[[tool.cibuildwheel.overrides]]
select = ["*-musllinux_*",]
inherit.config-settings = "append"
config-settings."cmake.define.RUN_CMAKE_TEST_EXCLUDE" = "BootstrapTest|ExportImport|RunCMake.install|RunCMake.RuntimePath|RunCMake.file-GET_RUNTIME_DEPENDENCIES"

[[tool.cibuildwheel.overrides]]
select = ["*linux_aarch64", "*linux_ppc64le", "*linux_s390x"]
inherit.config-settings = "append"
config-settings."cmake.define.RUN_CMAKE_TEST" = "OFF"

And got:

 config_settings: 
    *: cmake.define.OPENSSL_ROOT_DIR=/usr/local/ssl cmake.define.CMAKE_JOB_POOL_COMPILE=compile cmake.define.CMAKE_JOB_POOL_LINK=link cmake.define.CMAKE_JOB_POOLS='compile=4;link=1' cmake.define.RUN_CMAKE_TEST=ON
    cp39-musllinux_s390x: cmake.define.OPENSSL_ROOT_DIR=/usr/local/ssl cmake.define.CMAKE_JOB_POOL_COMPILE=compile cmake.define.CMAKE_JOB_POOL_LINK=link cmake.define.CMAKE_JOB_POOLS='compile=4;link=1' cmake.define.RUN_CMAKE_TEST=ON cmake.define.RUN_CMAKE_TEST_EXCLUDE='BootstrapTest|ExportImport|RunCMake.install|RunCMake.RuntimePath|RunCMake.file-GET_RUNTIME_DEPENDENCIES' cmake.define.RUN_CMAKE_TEST=OFF

And it seems to be running the tests when building on these platforms. In theory, I would have expected it to merge config settings by key. Instead it seems to be appending strings.

python -m pip wheel /project --wheel-dir=/tmp/cibuildwheel/built_wheel --no-deps --config-settings=cmake.define.OPENSSL_ROOT_DIR=/usr/local/ssl --config-settings=cmake.define.CMAKE_JOB_POOL_COMPILE=compile --config-settings=cmake.define.CMAKE_JOB_POOL_LINK=link '--config-settings=cmake.define.CMAKE_JOB_POOLS=compile=4;link=1' --config-settings=cmake.define.RUN_CMAKE_TEST=ON '--config-settings=cmake.define.RUN_CMAKE_TEST_EXCLUDE=BootstrapTest|ExportImport|RunCMake.install|RunCMake.RuntimePath|RunCMake.file-GET_RUNTIME_DEPENDENCIES' --config-settings=cmake.define.RUN_CMAKE_TEST=OFF -v

Build (and now pip) will make a list if it gets the same value several times, that's how you make lists. So this produces {"cmake.define.RUN_CMAKE_TEST": ["ON", "OFF"]}, which seems to count for me as true.

I have a feeling that this was broken by #1730 (comment).

Build log

https://github.com/scikit-build/cmake-python-distributions/actions/runs/8609018236

CI config

No response

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions