Skip to content

Commit c34ee37

Browse files
GertyPeli-schwartz
authored andcommitted
fix the use of setup --profile-self in combination with --genvslite
After the recent change to the backend `generate(...)` signature for '--genvslite', `profile.runctx('...')` needs to construct the correct cmd string and also extract the return result from `locals()`.
1 parent 77d4db5 commit c34ee37

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

mesonbuild/msetup.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ def _generate(self, env: environment.Environment, capture: bool, vslite_ctx: dic
231231
raise
232232

233233
cdf: T.Optional[str] = None
234-
captured_compile_args = None
234+
captured_compile_args: T.Optional[dict] = None
235235
try:
236236
dumpfile = os.path.join(env.get_scratch_dir(), 'build.dat')
237237
# We would like to write coredata as late as possible since we use the existence of
@@ -246,7 +246,9 @@ def _generate(self, env: environment.Environment, capture: bool, vslite_ctx: dic
246246
if self.options.profile:
247247
fname = f'profile-{intr.backend.name}-backend.log'
248248
fname = os.path.join(self.build_dir, 'meson-logs', fname)
249-
profile.runctx('intr.backend.generate()', globals(), locals(), filename=fname)
249+
profile.runctx('gen_result = intr.backend.generate(capture, vslite_ctx)', globals(), locals(), filename=fname)
250+
captured_compile_args = locals()['gen_result']
251+
assert captured_compile_args is None or isinstance(captured_compile_args, dict)
250252
else:
251253
captured_compile_args = intr.backend.generate(capture, vslite_ctx)
252254

0 commit comments

Comments
 (0)