Commit Graph

65 Commits

Author SHA1 Message Date
Daniel Mensinger d4ac832bf6
Split the monolithic introspection file into chunks 2019-01-06 12:19:29 +01:00
Daniel Mensinger b11df88395
Documentation and unit test update 2019-01-06 12:19:29 +01:00
Daniel Mensinger b034f52656
Filenames are now lists 2019-01-06 12:19:29 +01:00
Daniel Mensinger b91c5aad85
Update intro dump on meson configure 2019-01-06 12:19:29 +01:00
Daniel Mensinger 24d668bea0
Removed determine_installed_path since it is no longer needed 2019-01-06 12:19:28 +01:00
Daniel Mensinger 4addd176db
Removed fallback detection logic 2019-01-06 12:19:28 +01:00
Daniel Mensinger a5be893b19
Some code cleanup 2019-01-06 12:19:28 +01:00
Daniel Mensinger 74274e23ca
Moved the source and compiler generation to the backend 2019-01-06 12:19:28 +01:00
Daniel Mensinger 71d17b44e4
Fixed list_target_files and list_targets 2019-01-06 12:19:28 +01:00
Daniel Mensinger a0d478da39
More refactoring 2019-01-06 12:19:27 +01:00
Daniel Mensinger 98eb7a48ab
Added unit test 2019-01-06 12:19:27 +01:00
Daniel Mensinger b2854e9edc
Fixed rebase error 2019-01-06 12:19:27 +01:00
Daniel Mensinger 111e596200
Fixed tests and benchmarks 2019-01-06 12:19:27 +01:00
Daniel Mensinger f4285f350e
Initial automatic target file generation 2019-01-06 12:19:27 +01:00
Daniel Mensinger a6034d1f19
Added option to force use the new format 2019-01-06 12:15:10 +01:00
Daniel Mensinger 8288555aa1
mintro: Added option to introspect multiple parameters at once 2019-01-06 12:15:10 +01:00
Daniel Mensinger 1a0e1afbdd
Updated format to include sources 2019-01-06 12:15:10 +01:00
mensinda 9d13855544
Fixed hardcode is_cross = False 2019-01-06 12:15:10 +01:00
Daniel Mensinger 0a12594847
Added include_directories and extra_args keys to target introspection 2019-01-06 12:15:04 +01:00
Daniel Mensinger 64372d5cfc
Do not require build dir for introspection 2018-12-29 23:55:45 +01:00
Daniel Mensinger 6864ed60dd mintro: Bug fix for determine_installed_path for multiple target outputs 2018-12-20 23:03:55 +02:00
Daniel Schulte f954eee906 Remove name property from introspect --projectinfo as it is not used 2018-11-26 23:12:00 +01:00
Daniel Schulte 0e62193730 mintro: Allow introspect --projectinfo without build directory.
This variant was added to allow introspection before configuring a build
directory. This is useful for IDE integration to allow displaying and/or
setting options for the initial configuration of the build directory.

It also allows showing basic information about the project even if it's
not yet configured or configuring failed.

The project 'name' field in --projectinfo is used inconsistently:
For the top level project it always shows the name configured in
the top level meson.build file. For subprojects it's referring to the
name of the directory the subproject's meson.build is contained in.

To have a consistent output and preserve the existing behavior this adds
the 'descriptive_name' field which always shows the name set in the
project.

To be consistent the 'descriptive_name' field was also added to the
--projectfiles variant that uses an already configured build.

It also extends the information shown with the list of buildsystem-files.
This is currently only implemented in the variant for unconfigured
projects.
2018-11-26 23:12:00 +01:00
Daniel Schulte bdc9f6846c mintro: Split list_buildsystem_files into generation and command function 2018-11-26 23:10:53 +01:00
Daniel Mensinger 1759fc8f45
Sorted arrays alphabetically 2018-11-24 10:57:22 +01:00
Daniel Mensinger 1f48aa595d
Added 'section' key to buildoptions introspection 2018-11-24 09:49:33 +01:00
Xavier Claessens 37067a53c4 Use a single ArgumentParser for all subcommands
This has the adventage that "meson --help" shows a list of all commands,
making them discoverable. This also reduce the manual parsing of
arguments to the strict minimum needed for backward compatibility.
2018-10-04 09:40:21 -04:00
Xavier Claessens 1e6d72eb5a Remove useless __main__ in files that cannot be executed 2018-08-22 15:15:54 -04:00
Nirbheek Chauhan 96b7fdb723 macos: Rewrite install_name for dependent built libraries on install
On macOS, we set the install_name for built libraries to
@rpath/libfoo.dylib, and when linking to the library, we set the RPATH
to its path in the build directory. This allows all built binaries to
be run as-is from the build directory (uninstalled).

However, on install, we have to strip all the RPATHs because they
point to the build directory, and we change the install_name of all
built libraries to the absolute path to the library. This causes the
install name in binaries to be out of date.

We now change that install name to point to the absolute path to each
built library after installation.

Fixes https://github.com/mesonbuild/meson/issues/3038
Fixes https://github.com/mesonbuild/meson/issues/3077

With this, the default workflow on macOS matches what everyone seems
to do, including Autotools and CMake. The next step is providing a way
for build files to override the install_name that is used after
installation for use with, f.ex., private libraries when combined with
the install_rpath: kwarg on targets.
2018-06-18 06:33:23 +00:00
Thibault Saunier aee9b5a518 mintro: Fix introspecting installation paths
A new custom_install_mode element was added in 05c43cdcd
2018-06-08 12:18:16 +00:00
Nirbheek Chauhan 68001193d3 meson introspect: Fix --installed argument
Traceback (most recent call last):
  File "meson.py", line 29, in <module>
    sys.exit(mesonmain.main())
  File "mesonbuild/mesonmain.py", line 411, in main
    return run(sys.argv[1:], launcher)
  File "mesonbuild/mesonmain.py", line 320, in run
    return mintro.run(remaining_args)
  File "mesonbuild/mintro.py", line 234, in run
    list_installed(installdata)
  File "mesonbuild/mintro.py", line 72, in list_installed
    for path, installdir, aliases, unknown1, unknown2 in installdata.targets:
ValueError: too many values to unpack (expected 5)
2018-06-06 06:59:06 +00:00
Nirbheek Chauhan 6485f04c16 introspect: Fix listing target files that are File objects 2018-05-09 21:01:00 +05:30
Andrei Alexeyev e9860cff41 introspect: default builddir to . to prevent a crash
Fixes #3250
2018-04-11 21:43:59 +03:00
Jussi Pakkanen 9b2e533d87 Always build parser objects anew to avoid leaking old data. 2018-03-27 00:39:45 +03:00
Thibault Saunier f48da481ab introspect: tests: Inform about tests run parallelization 2018-03-18 20:29:35 +02:00
Hemmo Nieminen 7fb8e518b2 Harmonize data pickling.
Try to be more consistent on using save() and load() methods to pickle
data.
2018-03-01 01:06:51 +02:00
Jussi Pakkanen 0204895143 Expose integer options to build option files. 2018-02-07 22:10:04 +02:00
Aleksey Filippov 2cf85ae16f Use os.path: basename() and dirname() instead of split()
According to Python documentation[1] dirname and basename
are defined as follows:
    os.path.dirname() = os.path.split()[0]
    os.path.basename() = os.path.split()[1]
For the purpose of better readability split() is replaced
by appropriate function if only one part of returned tuple
is used.

[1]: https://docs.python.org/3/library/os.path.html#os.path.split
2018-01-30 07:08:22 +11:00
Eric Engestrom 3d63f21b60 Fix `array` type name
c9351ce30c introduced the type as `array`,
so mintro should expose it under the same name.

(while at it, rename test 169 to be coherent)
2017-12-07 21:31:50 +02:00
Jussi Pakkanen 4ae0cadb7f Renamed UserStringArrayOption to UserArrayOption for short. 2017-12-07 00:00:34 +02:00
Eric Engestrom 5f7f5cdb05 Print correct command in help message
Taking mconf for instance:
before:
  $ meson configure --help
  usage: meson [-h] [-D SETS] [--clearcache] [directory [directory ...]]
after:
  $ meson configure --help
  usage: meson configure [-h] [-D SETS] [--clearcache] [directory [directory ...]]
2017-11-09 21:12:34 +02:00
Eric Engestrom 74967bd1d1 introspect: print `build_by_default` field 2017-11-09 21:12:08 +02:00
Martin Ejdestig 76c1faf8bf Modify mesonintrospect --dependencies so 1 element in list is 1 dependency
Makes it less awkward for tools to parse the data.

Was modified to return a list, with two elements for each dependency,
instead of a dictionary in ac1c929f66 .

Closes #2018.
2017-07-20 12:43:55 +02:00
Jussi Pakkanen fa9fde5029 Storage object has changed so use values(). Closes #1963. 2017-06-19 16:45:09 -04:00
Elliott Sales de Andrade e66465369d Use more direct dictionary literals. 2017-05-17 04:24:18 -04:00
Nirbheek Chauhan ac1c929f66 mesonintrospect: Print all deps, not just those with the same name
This breaks the API, but the original API was just broken.
2017-05-09 14:23:15 +05:30
Quentin Glidic 10c435fabe mesonintrospect: List all installed files
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2017-05-08 20:21:29 +02:00
Nirbheek Chauhan b3d5db49e8 mesonintrospect: Normalize install_filename in the output
Without this, we can output a mixture of '/' and '\' on platforms where
os.path.sep is '\' and prefix or outdir uses '/'. Let's always return
the path in the format of the platform we're running on.

This is needed to make the test_install_introspection() unittest work
properly on Windows.
2017-02-18 02:38:54 +05:30
Nirbheek Chauhan 67d3d512ff mesonintrospect: Also print builtins for --buildoptions
This is needed to be able to introspect the value of xxxdir options such
as libdir and prefix.
2017-02-18 02:37:32 +05:30
Thibault Saunier 1d6147a592 Fix mesonintrospect --installed
The prefix has been recently added to the install data
2017-01-26 22:48:02 +02:00