Skip to content

Add support for Meson introspect#1648

Open
jmgeertsma wants to merge 2 commits intoblackducksoftware:masterfrom
jmgeertsma:meson
Open

Add support for Meson introspect#1648
jmgeertsma wants to merge 2 commits intoblackducksoftware:masterfrom
jmgeertsma:meson

Conversation

@jmgeertsma
Copy link

Description

Meson is a build system which compiles source code into a build directory. It creates a meson-info/intro-dependencies.json in the build directory which contains all the dependencies. This pull request will make detect look for the meson-info directory.

Added 2 unit tests for MesonDetectable, 1 functional test MesonDependencyFileParser
Mockito the meson.build and introspect files
Update dita name to match the detector name
Use BufferedReader for the JSON files
Use Generic as forge
@dterrybd
Copy link
Contributor

@jmgeertsma thanks very much for the contribution. We'd be very interested in discussing it further. Would it be possible for you to open a support ticket at https://community.blackduck.com/s/my-support-home so we can determine next steps.

@jmgeertsma
Copy link
Author

I opened case 03686036

@jmgeertsma
Copy link
Author

The case got closed and D-I-171 got opened ... I have no idea where to find that thing, so I don't know if any progress is being made on Meson support. I created the pull request with functioning support. I provided test cases. Meson detect works if the project was build and it doesn't break any other scanners.

Meson is a build system which compiles source code into a build directory.
https://mesonbuild.com/
It is installed with pip or apt and it depends on ninja
pip install meson / apt install meson

meson setup builddir
This setup already parses the meson.build file and displays the dependencies from Ubuntu 24.04
Run-time dependency Boost found: YES 1.83.0 (/usr/include)
Run-time dependency libcurl found: YES 8.5.0

meson compile -C builddir
This compiles the whole project and creates the introspect in the builddir/meson-info/intro-dependencies.json

What else would I need to do to get this merged? My company depends on Meson and without support, Blackduck is useless to us.

@shantyk shantyk self-requested a review February 24, 2026 18:36
<entry>Generic</entry>
<entry>
<p>File: meson.build</p>
<p>File: */meson-info/intro-project.json</p>

Choose a reason for hiding this comment

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

should the filename be "intro-projectinfo.json" ?

Copy link
Author

Choose a reason for hiding this comment

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

The files is generated by Meson when running "meson setup builddir". The build directory can arbitrarily chosen, but the meson-info subdirectory and the intro-projectinfo.json and intro-dependencies.json files are fixed.

More information is available here
https://github.com/mesonbuild/meson/blob/master/docs/markdown/IDE-integration.md

return requirements.result();
}
logger.debug("even though {} is found, also a builddirectory with the introspect files is needed", detectable_file);
return new FilesNotFoundDetectableResult();

Choose a reason for hiding this comment

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

Prefer to include the missing file names or paths

Copy link
Author

Choose a reason for hiding this comment

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

The scan requires the file meson.build in the root of the project, but also the files */meson-info/intro-project.json and */meson-info/intro-dependencies.json. The * can be builddir or any name chosen in the setup.

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