-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
do @ variable substitution when parsing cmake format #13987
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for looking at this, I had noticed this but never had time to fix it.
It would be really good to get test coverage for this in the test cases/common/14 configure file
test
703a1b6
to
5c75876
Compare
the upstream behavior of configure_file in cmake parses both @var@ and ${VAR} and only supports disabling the bracket variables through the `@ONLY` argument, meson needs to follow this behavior for compatibility
rebasing to un-screw CI |
fde245b
to
1c33bdc
Compare
This is not a known or preexisting failure. I would venture to say something about this PR is in conflict with behavior that that test case was relying on, but I haven't had a chance to review the implementation. |
We have a file, enums.h.in: meson/test cases/frameworks/7 gnome/mkenums/enums.h.in Lines 7 to 21 in 8156e12
We convert it to enums6.h.in and then use it as a template for meson/test cases/frameworks/7 gnome/mkenums/meson.build Lines 143 to 155 in 8156e12
The replacement tokens must be parsed by glib-mkenums, not configure_file. We use configure_file in order to copy a file without modifications, and that's what this PR causes to stop behaving the way it used to behave. If you configure the test case before and after this PR: File created by glib-mkenums: diff --git a/builddir-old/mkenums/enums6.h b/builddir-new/mkenums/enums6.h
index 313d846ff..950175623 100644
--- a/builddir-old/mkenums/enums6.h
+++ b/builddir-new/mkenums/enums6.h
@@ -8,11 +8,11 @@
G_BEGIN_DECLS
-/* enumerations from "meson-sample.h" */
-GType meson_the_xenum_get_type(void) G_GNUC_CONST;
-#define MESON_TYPE_THE_XENUM (meson_the_xenum_get_type())
-GType meson_the_flags_enum_get_type(void) G_GNUC_CONST;
-#define MESON_TYPE_THE_FLAGS_ENUM (meson_the_flags_enum_get_type())
+/* enumerations from "" */
+GType _get_type(void) G_GNUC_CONST;
+#define _TYPE_ (_get_type())
+GType _get_type(void) G_GNUC_CONST;
+#define _TYPE_ (_get_type())
G_END_DECLS
File created by configure_file: diff --git a/builddir-old/mkenums/enums6.h.in b/builddir-new/mkenums/enums6.h.in
index 479867fd1..7f6a50107 100644
--- a/builddir-old/mkenums/enums6.h.in
+++ b/builddir-new/mkenums/enums6.h.in
@@ -9,11 +9,11 @@ G_BEGIN_DECLS
/*** BEGIN file-production ***/
-/* enumerations from "@basename@" */
+/* enumerations from "" */
/*** END file-production ***/
/*** BEGIN value-header ***/
-GType @enum_name@_get_type(void) G_GNUC_CONST;
-#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type())
+GType _get_type(void) G_GNUC_CONST;
+#define _TYPE_ (_get_type())
/*** END value-header ***/
/*** BEGIN file-tail ***/ |
I think what this means is that the existing testcase code was relying on Or something. Those |
296f16b
to
27e20aa
Compare
the upstream behavior of configure_file in cmake parses both @var@ and ${VAR} and only supports disabling the bracket variables through the
@ONLY
argument, meson needs to follow this behavior for compatibilitythis is an ugly solution but I think its best considering the alternatives:
do_conf_str
twice with both formats