meson: CMake subproject sandbox violation
Describe the bug Meson seems to be hitting a sandbox violation when using a CMake subproject.
Offending CMake code: https://github.com/mongodb/mongo-c-driver/blob/master/src/libbson/CMakeLists.txt#L122=.
Log: https://github.com/hse-project/hse/runs/7198083520?check_suite_focus=true#step%3A12%3A360=
To Reproduce Use mongo-c-driver as a subproject. You can clone hse-project/hse and -Dwrap_mode=forcefallback.
Expected behavior Not hit a sandbox violation using the cmake module.
system parameters
- Is this a cross build or just a plain native build (for the same computer)? no
- what operating system (e.g. MacOS Catalina, Windows 10, CentOS 8.0, Ubuntu 18.04, etc.) fc36
- what Python version are you using 3.10.5
- what
meson --version
0.63.0 - what
ninja --version
if it’s a Ninja build 1.10.2
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 20 (19 by maintainers)
Commits related to this issue
- Pin meson version to 0.62.2 due to 0.63.0 regression https://github.com/mesonbuild/meson/issues/10566 Signed-off-by: Tristan Partin <tpartin@micron.com> — committed to hse-project/hse by tristan957 2 years ago
- Pin meson version to 0.62.2 due to 0.63.0 regression (#320) https://github.com/mesonbuild/meson/issues/10566 Signed-off-by: Tristan Partin <tpartin@micron.com> — committed to hse-project/hse by tristan957 2 years ago
- Workaround mesonbuild/meson#10566 Forbid the buggy Meson version and don't build-wrapped until this is fixed. Revert after Meson fix. — committed to DevilishSpirits/arcollect by DevilishSpirits 2 years ago
- cmake: Add rule relaxations for CMake subprojects fixes #10566 — committed to mensinda/meson by mensinda 2 years ago
- cmake: Add rule relaxations for CMake subprojects fixes #10566 — committed to mesonbuild/meson by mensinda 2 years ago
- cmake: Add rule relaxations for CMake subprojects fixes #10566 — committed to AHSauge/meson by mensinda 2 years ago
- cmake: Add rule relaxations for CMake subprojects fixes #10566 — committed to lb90/meson by mensinda 2 years ago
A consensus will be reached and this will get fixed.
The comments I make about how it should get fixed, don’t affect whether it will get fixed.
@mensinda
I mean, let’s face it, the generated AST isn’t exactly clean either. 😄 Absolute paths, any case where the AST is relying on only being run after cmake in order to obtain output files produced by cmake, these are both cases where I’m not 100% on board with saying “this is just regular Meson logic”.
So I think it’s not too bad in cases where there’s no other choice AND the file in question is bridging cmake for configuration and meson for building, that we add exceptions.
Again, I don’t think so. We already emit a warning for specifically custom_target:
We have 3 possible states when passing strings to the builddir:
files()
– used to be overlooked, is now an errorcustom_target()
– raises a warning, but is permitted purely for the benefit of valaCurrent Meson design is I think clear that we don’t generally want people to do this, and the only use cases for it seem to be:
shared_library()
produces output files that aren’t in its return valueI don’t want to generally allow it because the former is an implementation detail of the cmake module, and the latter is a bug to be fixed (
input: meson.current_build_dir() / 'Foo-1.0.gir',
for crying out loud).