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

use typed_kwargs for vs_module_defs #12051

Merged
merged 3 commits into from
Sep 28, 2023

Conversation

dcbaker
Copy link
Member

@dcbaker dcbaker commented Jul 30, 2023

@tristan957 had mentioned this was needed for Executables as well, but I haven't written a test case or doc changes for that yet.

@tristan957 tristan957 added this to the 1.3.0 milestone Jul 31, 2023
@dcbaker dcbaker force-pushed the submit/vs-module-defs-typed branch 3 times, most recently from 5b6c5c3 to 3b13d10 Compare July 31, 2023 12:21
@dcbaker dcbaker force-pushed the submit/vs-module-defs-typed branch from 3b13d10 to 2d5db86 Compare July 31, 2023 18:25
@dcbaker dcbaker marked this pull request as ready for review July 31, 2023 18:26
@dcbaker dcbaker requested a review from jpakkane as a code owner July 31, 2023 18:26
@dcbaker
Copy link
Member Author

dcbaker commented Jul 31, 2023

Rebased on @eli-schwartz's work, tests added, docs added. Should be ready for review now

@dcbaker dcbaker force-pushed the submit/vs-module-defs-typed branch from 2d5db86 to 86af405 Compare July 31, 2023 18:35
mesonbuild/interpreter/kwargs.py Outdated Show resolved Hide resolved
mesonbuild/interpreter/type_checking.py Outdated Show resolved Hide resolved
docs/yaml/functions/shared_library.yaml Outdated Show resolved Hide resolved
test cases/windows/9 vs module defs generated/exe.def Outdated Show resolved Hide resolved
@dcbaker dcbaker force-pushed the submit/vs-module-defs-typed branch 2 times, most recently from cee3f99 to c895eb2 Compare July 31, 2023 21:46
mesonbuild/build.py Outdated Show resolved Hide resolved
Comment on lines +5 to +7
defs = custom_target('generate_module_defs', ...)
shared_library('lib1', vs_module_defs : defs[0])
shared_library('lib2', vs_module_defs : defs[2])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there any actual use cases for this by the way? Because it was only ever discovered by a fuzzer.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from that it's strange to take CustomTarget but not CustomTargetIndex, it's likely niche that there's a real reason for it. The most realistic one I can think of is that you're generating code and the vs_module_defs together from a representative source of some kind, but you want to use a module defs file instead of the pre-processor:

ct = custom_target(
  'from_xml',
  input : 'functions.xml',
  output : ['functions.hpp', 'functions.cpp', 'functions.def'],
  command : ['xml-to-code', '@INPUT@', '@OUTPUT@'],
)
both_library(
  'generated',
  ct[0], ct[1],
  vs_module_defs : ct[2],
)

docs/markdown/snippets/executable_vs_module_defs.md Outdated Show resolved Hide resolved
@dcbaker dcbaker force-pushed the submit/vs-module-defs-typed branch from 6a284fc to 17276d9 Compare August 14, 2023 17:00
mesonbuild/interpreter/kwargs.py Outdated Show resolved Hide resolved
mesonbuild/interpreter/type_checking.py Outdated Show resolved Hide resolved
docs/yaml/functions/shared_module.yaml Outdated Show resolved Hide resolved
mesonbuild/build.py Outdated Show resolved Hide resolved
Copy link
Contributor

@tristan957 tristan957 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. @eli-schwartz did you have anything else to add?

Copy link
Member

@eli-schwartz eli-schwartz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I suggested above, I don't find the second commit compellingly useful. On the other hand, I also don't see a reason to specifically go ahead and reject it, so...

lgtm

@eli-schwartz eli-schwartz merged commit 32be9bd into mesonbuild:master Sep 28, 2023
37 checks passed
@dcbaker dcbaker deleted the submit/vs-module-defs-typed branch September 28, 2023 18:35
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

Successfully merging this pull request may close these issues.

3 participants