Commit Graph

40 Commits

Author SHA1 Message Date
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
Nirbheek Chauhan f762e896d2 mintro.py: Assume the current dir is a builddir if not specified
Also fix running with backends other than Ninja by not assuming that
install.dat is always available.
2017-01-22 22:12:44 +02:00
Igor Gnatenko f0b30baa39 style: fix E225 violations
E225: missing whitespace around operator

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2017-01-01 12:02:05 -05:00
Jussi Pakkanen b55235dfbd Fix space before :. 2016-12-31 16:28:15 +02:00
Thibault Saunier 925f880e6b introspect: Allow listing all installed files 2016-12-15 22:19:43 +02:00
Jussi Pakkanen b28da68faf Expose project information with mesonintrospect. Closes #1118. 2016-12-06 20:27:59 +02:00
Thibault Saunier 6c9f75f082 mintro: Allow serializing EnvironmentVariables objects
Otherwise trying to introspect tests might lead to:

Traceback (most recent call last):
  File "/home/thiblahute/devel/gstreamer/gst-build/meson/mesonintrospect.py", line 20, in <module>
    sys.exit(mintro.run(sys.argv[1:]))
  File "/home/thiblahute/devel/gstreamer/gst-build/meson/mesonbuild/mintro.py", line 213, in run
    list_tests(testdata)
  File "/home/thiblahute/devel/gstreamer/gst-build/meson/mesonbuild/mintro.py", line 178, in list_tests
    print(json.dumps(result))
  File "/usr/lib/python3.5/json/__init__.py", line 230, in dumps
    return _default_encoder.encode(obj)
  File "/usr/lib/python3.5/json/encoder.py", line 198, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/lib/python3.5/json/encoder.py", line 256, in iterencode
    return _iterencode(o, 0)
  File "/usr/lib/python3.5/json/encoder.py", line 179, in default
    raise TypeError(repr(o) + " is not JSON serializable")
TypeError: <mesonbuild.build.EnvironmentVariables object at 0x7f83e8fa8c18> is not JSON serializable
2016-12-03 22:35:29 +02:00
Jussi Pakkanen 6762d30c6a Exposes the install names of targets in introspection. Closes #829. 2016-10-30 06:46:08 -07:00
Jussi Pakkanen 1f4cce86ad Remove shebangs on files that are not runnable and add execute bits to those that are. 2016-10-07 21:10:33 +03:00
Elliott Sales de Andrade 4c71695e41 Use context manager for file I/O.
There are a few cases where a context manager cannot be used, such as
the logger.
2016-08-27 18:29:55 -04:00
Jussi Pakkanen b6e8809f25 Added minsize build type that optimizes for binary size. 2016-06-23 22:38:18 +03:00
Hemmo Nieminen 95c86b5c42 Use CoreData.get_builtin_option() to get builtin option values. 2016-05-10 20:47:58 +03:00
Jussi Pakkanen 79de463993 Converted precompiled headers into a base option. 2016-03-20 19:35:42 +02:00
Jussi Pakkanen 0c63f75aaf Converted coverage into a base option. 2016-03-20 19:16:49 +02:00
Jussi Pakkanen de03ae5af0 Fix mesonintrospect. 2016-03-17 21:08:07 +02:00
Jussi Pakkanen 23b98cd6e6 Renamed meson package to mesonbuild so that we can have a script named meson in the same toplevel dir. 2016-01-16 17:35:29 +02:00