Remove str from build.CustomTarget sources#15595
Open
bonzini wants to merge 14 commits intomesonbuild:masterfrom
Open
Remove str from build.CustomTarget sources#15595bonzini wants to merge 14 commits intomesonbuild:masterfrom
bonzini wants to merge 14 commits intomesonbuild:masterfrom
Conversation
Contributor
Author
|
#9012 never worked for This can be seen with this test: diff --git a/test cases/frameworks/4 qt/subfolder/copyfile.py b/test cases/frameworks/4 qt/subfolder/copyfile.py
new file mode 100644
index 000000000..ff42ac359
--- /dev/null
+++ b/test cases/frameworks/4 qt/subfolder/copyfile.py
@@ -0,0 +1,6 @@
+#!/usr/bin/env python3
+
+import sys
+import shutil
+
+shutil.copyfile(sys.argv[1], sys.argv[2])
diff --git a/test cases/frameworks/4 qt/subfolder/meson.build b/test cases/frameworks/4 qt/subfolder/meson.build
index f1b84e6ae..2295b1993 100644
--- a/test cases/frameworks/4 qt/subfolder/meson.build
+++ b/test cases/frameworks/4 qt/subfolder/meson.build
@@ -30,3 +30,8 @@ endif
app = executable('subfolder', 'main.cpp', qresources, dependencies : qtdep, cpp_args: extra_cpp_args)
test(qt + 'subfolder', app)
+
+# Test compile_resources with a custom_target source, to ensure that
+# custom target outputs are correctly converted to File objects.
+ct_qrc = custom_target('stuff3_ct.qrc', output: 'stuff3_ct.qrc', input: 'resources/stuff3.qrc', command: ['python3', files('copyfile.py'), '@INPUT@', '@OUTPUT@'])
+qtmodule.compile_resources(sources : ct_qrc, method : get_option('method')) |
f6be0ae to
9f0dad1
Compare
8bbb447 to
669faa7
Compare
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
The changes introduced by PR 9012 never worked for compile_resources because the call to _parse_qrc_deps fails to find the generated file. Raise an error similar to the one in gnome.compile_resources(). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
…om_target input Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
a7a4a6e to
8f6ec77
Compare
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
"j" is used in an earlier loop iterating target.sources. Before changing the type of the sources, rename the variable. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
The function is using source_strings_to_files, and that makes it trivial to pass generated sources to the CustomTarget constructor. Fixes: mesonbuild#2748 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is inspired by #14885, which reported that a source of type
strto a custom target would be exported to the introspection data as os.path.join(meson_root, relative_path).However, considering that the testcase for it had to use
i18n.merge_file, I checked instead whetherstrsources could be removed altogether. It seems like they can, and the hardest part is actually gettingmypyto comply.I'm still not 100% sure about the handling of theget_outputs()case in the qt module, so I'm marking this as draft until I write a testcase for that.Fixes: #2748