Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
henryiii opened this issue Apr 9, 2024 · 0 comments
Open

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

henryiii opened this issue Apr 9, 2024 · 0 comments

Comments

@henryiii
Copy link
Contributor

henryiii commented Apr 9, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant