Commit Graph

80 Commits

Author SHA1 Message Date
Daniel Mensinger ea1ad718aa mconf: Limit the line length of the choices column 2019-02-17 20:19:34 +02:00
Jussi Pakkanen 82e4cb7731
Merge pull request #4743 from dcbaker/native-file-extended
Extend native files to store install path information
2019-02-12 20:04:23 +02:00
Jussi Pakkanen a32f31fdfa
Merge pull request #4826 from mensinda/confDefOpts
mconf: Use introspection to print the project default options (fixes #2543)
2019-02-12 20:00:34 +02:00
Dylan Baker 5b896ed70b allow setting directory locations in a native file
This allows the person running configure (either a developer, user, or
distro maintainer) to keep a configuration of where various kinds of
files should end up.
2019-02-11 12:50:32 -08:00
Daniel Mensinger 71d174bcbe
Fixed some code issues 2019-02-05 11:18:57 +01:00
John Ericson 19f81d3e33 Never access environment.properties downstream
Instead use coredata.compiler_options.<machine>. This brings the cross
and native code paths closer together, since both now use that.

Command line options are interpreted just as before, for backwards
compatibility. This does introduce some funny conditionals. In the
future, I'd like to change the interpretation of command line options so

 - The logic is cross-agnostic, i.e. there are no conditions affected by
   `is_cross_build()`.

 - Compiler args for both the build and host machines can always be
   controlled by the command line.

 - Compiler args for both machines can always be controlled separately.
2019-02-02 13:59:14 -05:00
Daniel Mensinger 90bc125d29
mconf: Use introspection to print the project default options (fixes #2543) 2019-01-25 12:21:32 +01:00
Jussi Pakkanen 3bf2ca483e
Merge pull request #4732 from mensinda/introMesonInfo2
mintro: Added `meson-info.json` introspection information about the latest meson run
2019-01-07 23:10:22 +02:00
Nicolas Schneider 3232f780d8 use same code for printing options in mconf and msetup
Also, options are now responsible for providing a suitable printable
representation of their value instead of handling this at the caller.
2019-01-06 19:41:24 -05:00
Daniel Mensinger ab32f1fe00 Added meson-info.json 2019-01-06 22:03:29 +01:00
Jussi Pakkanen a34ac74cf9
Merge pull request #4547 from mensinda/introIncDirs
mintro: Save introspection to disk and --targets modifications
2019-01-06 22:47:25 +02:00
Nicolas Schneider 735e138382 fix meson configure exception when install_umask is not an int 2019-01-06 22:35:04 +02:00
Daniel Mensinger d4ac832bf6
Split the monolithic introspection file into chunks 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 1759fc8f45
Sorted arrays alphabetically 2018-11-24 10:57:22 +01:00
Xavier Claessens 43101489cd Recover when coredata cannot be loaded
Write command line options into a separate file to be able to
reconfigure from scatch in the case coredata cannot be loaded. The most
common case is when we are reconfiguring with a newer meson version.

This means that we should try as much as possible to maintain backward
compatibility for the cmd_line.txt file format.

The main difference with a normal reconfigure is it will use new
default options values and will read again environment variables like
CFLAGS, etc.
2018-11-06 16:37:13 -05: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
Xavier Claessens 9350b9aa7b mconf: Take only one optional builddir arg that defaults to '.' 2018-06-06 20:02:37 +00:00
Xavier Claessens 75e501ceb8 coredata: Stop setting default option values as argparse attribute
All options are now the projectoptions list, regardless of how they got
defined in the command line.

This also delays setting builtin option values until the main project()
default options are parsed to simplify the code. This is possible
because we already delayed setting the backend after parsing main
project() in a previous commit.
2018-06-06 20:02:37 +00:00
Xavier Claessens 8afbfe227b mconf: Special case UserUmaskOption to print value in octal notation 2018-06-06 20:02:37 +00:00
Xavier Claessens 75cce9e157 mconf: Reduce code duplication and avoid missing builtin options
This ensure all option groups are printed the same way. Also ensure that
we cannot miss some builtin options by taking the list of all builtin
options and excluding only directories/testing options.
2018-06-06 20:02:37 +00:00
Xavier Claessens 04c5c53e3c mconf: Fix print when choices is a string instead of list 2018-06-06 20:02:37 +00:00
Xavier Claessens da29e48d13 mconf: Set prefix first because other options depends on it 2018-06-06 20:02:37 +00:00
Xavier Claessens 8fb72510c3 Move to coredata some methods handling options
Those methods only use coredata object, so better just move them as a
coredata method.
2018-06-06 20:02:37 +00:00
Xavier Claessens 3e6dc8fb71 mconf: Small tweaks when printing configuration 2018-06-06 20:02:37 +00:00
Xavier Claessens aa879b7f0c Fix issues found by flake8 2018-06-06 20:02:37 +00:00
Xavier Claessens b7d442150d Move <lang>_args to coredata.compiler_options 2018-06-06 20:02:37 +00:00
Xavier Claessens 24f1b96dde Fix setting c_args and friends from command line
When passing more than one -Dc_args it should override the value
instead of appending. This is how all other options works.

Value should be split on spaces using shlex just like it does with
CFLAGS environment variable.

Fixes #3473.
2018-05-01 12:09:45 +00:00
Xavier Claessens 570c108635 Fix --warnlevel being renamed to --warning-level in latest release 2018-04-27 11:09:14 -04:00
Xavier Claessens cb5ad2f211 Remove duplicated definition of -D cmdline arg 2018-04-26 22:46:40 -04:00
Filipe Brandenburger 170776d626 Add install_umask to list of options of `meson configure`
Tested:

  $ ./meson.py configure --help
  [...]
    --install-umask INSTALL_UMASK
                          Default umask to apply on permissions of installed
                          files (default: 022).
2018-04-25 14:11:06 -07:00
Dylan Baker 1c48cc08e0 mconf: accept -- options like `meson` does
I'm not really happy about this to be honest, I don't like having both
-- and -D options, I think it's stupid to have two ways to do exactly
the same thing, especially since we then have to validate that someone
hasn't passed the argument both ways.

However, other people want this, so here it is.

Fixes #969
2018-04-17 11:32:26 -07:00
Jussi Pakkanen 9b2e533d87 Always build parser objects anew to avoid leaking old data. 2018-03-27 00:39:45 +03:00
Jukka Laurila 52c50da6c7 Refactor: Add log.error and log.exception to reduce code duplication. 2018-03-10 18:04:52 +02:00
Sander Sweers 3a0ab6a2bc mconf: Make it pep8 compliant 2018-03-04 19:56:53 +01:00
Sander Sweers 9bafde953a mconf: make print_aligned static 2018-03-04 19:54:50 +01:00
Sander Sweers 9d31c751b6 mconf: Do not store dict keys for no reason
If a dict is empty it will evaluate to False
2018-03-04 19:54:50 +01:00
Sander Sweers 84d382f963 mconf: User newline instead of printing empty string 2018-03-04 19:54:50 +01:00
Sander Sweers f805f8e109 mconf: Replace usage of keys() on dicts with direct call by sorted
Calling sorted or list on a dictionary will return the keys.
2018-03-04 19:54:50 +01:00
Sander Sweers 41b5983823 Re-implement function print_aligned
It is now more readable, more pythonic and fixes #3149
2018-03-04 19:54:50 +01:00
Sander Sweers ae90b6586f mconf: Do not turn opt.choices into a string
It is inconsistent with other option groups. It also breaks
print_aligned as it handles lists.
2018-03-04 19:54:50 +01: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
Eric Engestrom da2343fb5e mconf: print choices of base options
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-11-27 20:54:03 +02:00
Josh Soref 4a572434a0 spelling: when 2017-11-26 17:28:33 +00: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
Jussi Pakkanen a800c96f99 Add option to limit maximum number of concurrent link processes. 2017-08-05 00:24:59 +03:00
Elliott Sales de Andrade ea636fcd51 Remove unused variables. 2017-05-17 04:41:54 -04:00
Elliott Sales de Andrade faf114299b Remove unnecessary __init__ methods. 2017-05-17 03:54:49 -04:00
Yasushi SHOJI abd12b69ea mesonconf: reorder output columns
mesonconf prints build dir information in the order of

  'Option' 'Description' 'Current Value' and, optionally, 'Possible Value'.

The Description tends to be longer and push the following values far
right, sometimes way far than fits in the full screen size of a
terminal on a FullHD monitor.

Experienced users know which options they want to change without
looking at the description string however they need to check the
current values for sure.

This patch moves the description to the last column.  Now mesonconf
prints options in the following order:

  'Option' 'Current Value' 'Possible Value' 'Description'

To implement this, mainly print_aligned() is modified.  The second
argument of the function is changed from

 - array of array of string to
 - array of dict with 'name', 'descr', 'value', and 'choices,

which maps to 'option', 'description', 'current value' and 'possible
values', respectively.

Since the position of the possible values are moved before its
description, the presence and the length of it affects header as well
as the following description.  Thus, we cal curate it before printing
the header.

To avoid re-calculation, we keep string version of the values and
flattened version of the possible values _in the given array_, which
means that now the print_aligned() function modify the the given
array.  The current callers do not use the passing array.  So there
should be no bad effects.
2017-05-15 22:02:06 +03:00