meson icon indicating copy to clipboard operation
meson copied to clipboard

Introspection data does not include `generator` inputs

Open apache-hb opened this issue 1 year ago • 3 comments

Describe the bug meson-info/intro-targets.json has no reference to input files used in generator.process.

To Reproduce

// main.h
#include <stdio.h>
int main() { puts("hello world"); }
# meson.build
project('example', 'c')
cp = generator(find_program('cp'),
  arguments : [ '@INPUT@', '@OUTPUT@' ],
  output : '@[email protected]'
)
executable('example', cp.process('main.h'))
meson setup build
meson introspect build --targets | jq .[0].target_sources
[
  {
    "language": "c",
    "compiler": [
      "cc"
    ],
    "parameters": [
      "-I/home/elliot/example/build/example.p",
      "-I/home/elliot/example/build",
      "-I/home/elliot/example",
      "-fdiagnostics-color=always",
      "-D_FILE_OFFSET_BITS=64",
      "-Wall",
      "-Winvalid-pch",
      "-O0",
      "-g"
    ],
    "sources": [],
    "generated_sources": [
      "/home/elliot/example/build/example.p/main.h.c"
    ]
  }
]

Expected behavior the output of sh meson introspect build --targets | jq .[0].target_sources contains mention of main.h as an input/source

system parameters

  • meson 1.5.0

apache-hb avatar Aug 25 '24 18:08 apache-hb

I just checked what happens with custom_targets, and they have the same behavior, so I think this might be "working as expected"?

dcbaker avatar Aug 26 '24 16:08 dcbaker

"working as expected"

oof, perhaps a new field to track generator inputs per target could be added to the introspection data?

apache-hb avatar Aug 30 '24 03:08 apache-hb

Yeah, I think that's perfectly reasonable.

dcbaker avatar Aug 30 '24 21:08 dcbaker