mesonbuild / meson

The Meson Build System
http://mesonbuild.com
Apache License 2.0
5.51k stars 1.6k forks source link

Introspection data does not include `generator` inputs #13599

Open apache-hb opened 2 weeks ago

apache-hb commented 2 weeks ago

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 : '@PLAINNAME@.c'
)
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

dcbaker commented 2 weeks ago

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

apache-hb commented 2 weeks ago

"working as expected"

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

dcbaker commented 1 week ago

Yeah, I think that's perfectly reasonable.