From f6918fe65c8b9526bc359bea8a6e8517b39b4ec5 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Mon, 30 Jun 2025 13:45:57 -0700 Subject: mesonmain: mark getting a language from another subproject as broken Currently, you can call `meson.get_compiler('c')`, if you haven't initialized 'c' for your project, but a super-project has initialized it. This happens because we check the wrong set of compilers (the global list vs the per-subproject one). Because of how fragile this is, we can mark it as broken an move on. --- docs/markdown/snippets/getting-language-from-other-project.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 docs/markdown/snippets/getting-language-from-other-project.md (limited to 'docs/markdown') diff --git a/docs/markdown/snippets/getting-language-from-other-project.md b/docs/markdown/snippets/getting-language-from-other-project.md new file mode 100644 index 000000000..79f19baee --- /dev/null +++ b/docs/markdown/snippets/getting-language-from-other-project.md @@ -0,0 +1,6 @@ +## Using `meson.get_compiler()` to get a language from another project is marked broken + +Meson currently will return a compiler instance from the `meson.get_compiler()` +call, if that language has been initialized in any project. This can result in +situations where a project can only work as a subproject, or if a dependency is +provided by a subproject rather than by a pre-built dependency. -- cgit v1.2.3