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
Enhancement: configuration summary printing #757
Comments
Although I do agree that the proposed approach may cover almost all cases, there are some different ones. Based on my what I've seen on different packages, usually the summary prints different options values which are split in different sections. There are also some packages that might also show messages with different values. For example:
Following the first proposal, I would extend it with the following changes:
As you can see, some values has also descriptions ( Using the other proposal would be something like this:
|
Also for consideration, is how to manage printing out of lists of components, potentially with 20+ items in the list. For example, in DPDK, we have dozens of drivers in multiple categories, which would make listing them vertically as yes/no infeasible. Therefore I think we may want to have different types of summary sections, for example, "yes-no", "name-value" or "component-list". The former two are shown as above, while latter would be configured by e.g:
Then at the end of the meson run the summary list would include a horiztonal list, word-wrapped appropriately:
I'm also assuming that the APIs are designed for calling throughout the various meson files, and that summary printing is only done at the end? |
Something like that yes but preferably something simpler: delayed_status_message('Some setting', 'its value') |
I think the concept of summaries being sub-divided into sections of sort is an essential requirement, so something super-simple probably won't cut it. This is the kind of thing that starts out simple but may need to be tweaked and extended later, so doing something object-based from the start might make sense?
Alternatively, one could do away with the
or just use
instead and rely on Meson printing it automatically at the end if any have been registered. I would assume that anything related to this API is either automatically delayed to the end or to the moment some |
Or possibly something like: final_status_message(type : 'Thingy name',
value : 'its value',
section : 'Platform') Section can be empty, all those would be grouped in one. |
Maybe a bit crazy idea, but I'm wondering if this summary message could be partly automatic, based on 'feature' options. Most of the time what's interesting to know in the summary is if it found "auto" features, right? When doing |
I've gotten multiple requests for this feature so I'm looking into adding it. What about using a dict for the summary? |
Not sure if doing something just based on feature options is enough. There are many things which are not decided/covered by feature options (manual detection of things; combos etc.). @dcbaker: How would a dict work exactly? Would it be a dict per section or a dict with sub-dicts or? I still think explicit/non-clever API is best, because whatever we do we will inevitably want to extend it in future. But I haven't seen how you want to use dicts of course. Can you give examples? |
I agree, non-clever is best: I'm imagining something like: sec1 = {'foo' : true, 'bar' : 'thing'}
sec2 = { 'boo' : 1, 'arb' : ['some', 'things']}
summary(
'Section 1 options' : sec1,
'Section 2 options' : sec2,
) With summary taking keyword arguments for each section, with the argument as the name, and it would print something like: Section 1 options:
foo = true
bar = 'thing'
Section 2 options:
boo = 1
arb = ['some', 'things'] |
Or better yet, just use a single nested dictionary: sec1 = {'foo' : true, 'bar' : 'thing'}
sec2 = { 'boo' : 1, 'arb' : ['some', 'things']}
summary({
'Section 1 options' : sec1,
'Section 2 options' : sec2,
}) Have I mentioned it's annoying that lists are mutable but dicts are immutable? |
I think it should also be okay to pass an unnested dict which is probably useful for simpler projects. |
This has been requested multiple times in the mesa/xorg community, and apparently in the GStreamer community as well. This is a very simple function that takes a single dictionary as an argument, that dictionary may define scalar or container values which will be printed as summaries. It treats nested dictionaries as another level of configuration options, which allows grouping options together. For example: ```meson sec1 = {'driver' : 'foobar', 'OS' : 'Linux', 'API' : 1.7} ... sec2 = {'driver' : 'dive comp', 'OS' : 'Minix', 'API' : 1.1.2} summary({ 'Backend' : 'OpenGL', 'Server' : sec1, 'Client' : sec2, }) ``` Which would print something like: ```txt Configuration Summary: Backend = OpenGL Server: driver = foobar OS = Linux API = 1.7 Client: driver = dive comp OS = Minix API = 1.1.2 ``` Fixes mesonbuild#757
This has been requested multiple times in the mesa/xorg community, and apparently in the GStreamer community as well. This is a very simple function that takes a single dictionary as an argument, that dictionary may define scalar or container values which will be printed as summaries. It treats 1 leve of nested dictionaries as another level of configuration options, which allows grouping options together. For example: ```meson sec1 = {'driver' : 'foobar', 'OS' : 'Linux', 'API' : 1.7} ... sec2 = {'driver' : 'dive comp', 'OS' : 'Minix', 'API' : 1.1.2} ... sec3 = {'with' : {'mesa' : true, 'gbm' : false}} summary({ 'Backend' : 'OpenGL', 'Server' : sec1, 'Client' : sec2, 'Misc' : sec3, }) ``` Which would print something like: ```txt Configuration Summary: Backend = OpenGL Server: driver = foobar OS = Linux API = 1.7 Client: driver = dive comp OS = Minix API = 1.1.2 Misc: with = {'mesa : true, 'gbm' : false} ``` Fixes mesonbuild#757
This has been requested multiple times in the mesa/xorg community, and apparently in the GStreamer community as well. This function can be called one per project (so subprojects can call it as well), and takes up to a single positional argument, and an unlimited number of free form keyword arguments, the values of which must be dictionaries. At the end of the configuration phase all of the information passed to the summary function is printed, separating the main project from each subproject, and printing the group information. For example: ```meson sec1 = {'driver' : 'foobar', 'OS' : 'Linux', 'API' : 1.7} ... sec2 = {'driver' : 'dive comp', 'OS' : 'Minix', 'API' : 1.1.2} ... sec3 = {'with' : {'mesa' : true, 'gbm' : false}} summary( {'Backend' : 'OpenGL'}, 'Server' : sec1, 'Client' : sec2, 'Misc' : sec3, ) ``` Which would print something like: ```txt Configuration Summary: Backend = OpenGL Server: driver = foobar OS = Linux API = 1.7 Client: driver = dive comp OS = Minix API = 1.1.2 Misc: with = {'mesa : true, 'gbm' : false} ``` Fixes mesonbuild#757
There is also #4643... |
I'm not opposed to 4643, but I like my approach better :) For my use, 100% of the reason to have this is to print the configuration summary at the end of the configuration, (what auto options got selected, what's turned on, etc). From that point of view building a data structure (dict) of key value pairs and letting meson do the formatting for me is better than having to manually do the formatting in strings. Also different, though possibly solvable, is that my solution integrates subproject messages into the final summary, but separates them in a way that is (hopefully) clear. Oh, and mine makes it easy to group like things because it doesn't depend on the order that the function is called in. even with |
I'm going to go try both of them in mesa and see how they work out. |
Okay, I wired up prototypes of both in mesa, and here's my take away: In mesa I want to group the summary into groups like "core options", "dri drivers", "gallium", "vulkan drivers", "window systems", "llvm", but some of those thing are intermixed. When you use an auto option, for example, we might need to figure out the drivers, then the platforms, then gallium state trackers (dx, opengl, opencl, media). Or I might figure out the dri drivers, then the gallium drivers, then other dri settings. Here's the two patches for reference: |
The Half the job of the function is formatting IMHO, nice indentation, perhaps even column spacing, maybe more. I quite like the |
The |
This has been requested multiple times in the mesa/xorg community, and apparently in the GStreamer community as well. This function can be called one per project (so subprojects can call it as well), and takes up to a single positional argument, and an unlimited number of free form keyword arguments, the values of which must be dictionaries. At the end of the configuration phase all of the information passed to the summary function is printed, separating the main project from each subproject, and printing the group information. For example: ```meson sec1 = {'driver' : 'foobar', 'OS' : 'Linux', 'API' : 1.7} ... sec2 = {'driver' : 'dive comp', 'OS' : 'Minix', 'API' : 1.1.2} ... sec3 = {'with' : {'mesa' : true, 'gbm' : false}} summary( {'Backend' : 'OpenGL'}, Server : sec1, Client : sec2, Misc : sec3, ) ``` Which would print something like: ```txt Configuration Summary: Backend = OpenGL Server: driver = foobar OS = Linux API = 1.7 Client: driver = dive comp OS = Minix API = 1.1.2 Misc: with = {'mesa : true, 'gbm' : false} ``` Fixes mesonbuild#757
This has been requested multiple times in the mesa/xorg community, and apparently in the GStreamer community as well. This function can be called one per project (so subprojects can call it as well), and takes up to a single positional argument, and an unlimited number of free form keyword arguments, the values of which must be dictionaries. At the end of the configuration phase all of the information passed to the summary function is printed, separating the main project from each subproject, and printing the group information. For example: ```meson sec1 = {'driver' : 'foobar', 'OS' : 'Linux', 'API' : 1.7} ... sec2 = {'driver' : 'dive comp', 'OS' : 'Minix', 'API' : 1.1.2} ... sec3 = {'with' : {'mesa' : true, 'gbm' : false}} summary( {'Backend' : 'OpenGL'}, Server : sec1, Client : sec2, Misc : sec3, ) ``` Which would print something like: ```txt Configuration Summary: Backend = OpenGL Server: driver = foobar OS = Linux API = 1.7 Client: driver = dive comp OS = Minix API = 1.1.2 Misc: with = {'mesa : true, 'gbm' : false} ``` Fixes mesonbuild#757
This has been requested multiple times in the mesa/xorg community, and apparently in the GStreamer community as well. This function can be called one per project (so subprojects can call it as well), and takes up to a single positional argument, and an unlimited number of free form keyword arguments, the values of which must be dictionaries. At the end of the configuration phase all of the information passed to the summary function is printed, separating the main project from each subproject, and printing the group information. For example: ```meson sec1 = {'driver' : 'foobar', 'OS' : 'Linux', 'API' : 1.7} ... sec2 = {'driver' : 'dive comp', 'OS' : 'Minix', 'API' : 1.1.2} ... sec3 = {'with' : {'mesa' : true, 'gbm' : false}} summary( {'Backend' : 'OpenGL'}, Server : sec1, Client : sec2, Misc : sec3, ) ``` Which would print something like: ```txt Configuration Summary: Backend = OpenGL Server: driver = foobar OS = Linux API = 1.7 Client: driver = dive comp OS = Minix API = 1.1.2 Misc: with = {'mesa : true, 'gbm' : false} ``` Fixes mesonbuild#757
Based on patch from Dylan Baker. Fixes mesonbuild#757
Based on patch from Dylan Baker. Fixes mesonbuild#757
Based on patch from Dylan Baker. Fixes mesonbuild#757
Based on patch from Dylan Baker. Fixes mesonbuild#757
Based on patch from Dylan Baker. Fixes mesonbuild#757
Based on patch from Dylan Baker. Fixes mesonbuild#757
Based on patch from Dylan Baker. Fixes mesonbuild#757
Based on patch from Dylan Baker. Fixes mesonbuild#757
Based on patch from Dylan Baker. Fixes mesonbuild#757
Based on patch from Dylan Baker. Fixes mesonbuild#757
Based on patch from Dylan Baker. Fixes mesonbuild#757
Based on patch from Dylan Baker. Fixes mesonbuild#757
Based on patch from Dylan Baker. Fixes mesonbuild#757
Based on patch from Dylan Baker. Fixes mesonbuild#757
Based on patch from Dylan Baker. Fixes mesonbuild#757
Based on patch from Dylan Baker. Fixes mesonbuild#757
Based on patch from Dylan Baker. Fixes mesonbuild#757
Based on patch from Dylan Baker. Fixes mesonbuild#757
Based on patch from Dylan Baker. Fixes mesonbuild#757
Many configure scripts have something like this at the end:
It would be nice if we had dedicated API for this in Meson. It would provide two features:
API-wise it could be something like:
or
The text was updated successfully, but these errors were encountered: