Commit Graph

108 Commits

Author SHA1 Message Date
Nirbheek Chauhan a6c9f98c57 depfixer: We no longer run this as a script 2018-05-24 14:38:28 +00:00
Jussi Pakkanen e3be7f7021 Write coredata transactionally. Closes #3511. 2018-05-21 00:48:25 +03:00
Jussi Pakkanen d52f892de9
Merge pull request #3485 from xclaesse/warnlevel
--warnlevel got renamed to --warning-level
2018-04-29 20:27:43 +03:00
Nirbheek Chauhan 900c23f98a New argument: --profile-self for profiling performance
Outputs two profile logs: one for the interpreter run and another for
the backend-specific build file generation. Both are stored in
meson-private in the build directory.
2018-04-27 23:14:16 +03: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
Dylan Baker 8120ff9cf7 Move builtin_argument_registration to coredata
We're going to want to use these functions in meson configure as well to
make the command line options the same between `meson` and `meson
configure`.
2018-04-17 11:32:26 -07:00
Dylan Baker 78e37c4953 Accept builtin options with -D when making initial meson call
Currently meson only accepts `-Dopt=value` for builtin options when
calling `meson configure` and `--opt=value` for builtin options when
calling `meson` initially. This is a confusing behavior, and users only
get a small warning at the top of a potentially long configuration
summary to catch this.

This has confused end users and developers alike, there are at least 5
duplicates of the bug this fixes, and I have personally been asked about
this more times than I can count. The help documentation doesn't make
it clear that -D cannot be used to set options like prefix and bindir.

This adds support for -D options to the initial meson call, but not --
options to the meson configure call. I think it's better to have one way
to do things, and -- options are kinda one off while -D is used
everywhere else, so lets stick with that.

Related #969
2018-04-17 11:32:26 -07:00
Dylan Baker cdefc15285 mesonmain: be DRY
We have all the information needed to calculate the builtin arguments in
the coredata module already, don't duplicate that in the mesonmain
module as well.
2018-04-17 11:32:26 -07:00
Dylan Baker 1452eb73c1 coredata: encapsulate destination name
This means that there are no special args passed ot builtin args
anymore.
2018-04-17 11:32:26 -07:00
Dylan Baker bbf71d9aa3 coredata: Add helper for setting action
Currently we manually pass the argparse action, this isn't very DRY,
since the builtin_types already has all the data necessary to find that.
This adds a new function to determine the action based on the default
type.
2018-04-17 11:32:26 -07:00
Jussi Pakkanen bdb57cf62a Convert Gnome module to use find_program from interpreter. 2018-04-15 13:32:38 +05:30
Jussi Pakkanen 58156ef7cf Grab a file lock on the build dir during modifications. 2018-03-20 22:28:37 +02:00
Jukka Laurila 52c50da6c7 Refactor: Add log.error and log.exception to reduce code duplication. 2018-03-10 18:04:52 +02:00
Jukka Laurila 048508c989 Make "meson help" and "meson help <subcommand>" do the expected thing. 2018-03-06 14:02:55 +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
Jon Turney 2a64ed855e Verify that failing tests are failing with an error, not a python exception
PR #2527 suggests "making failing tests more strict about failing
gracefully".

To achive this, make meson exit with distinct exit statuses for meson errors
and python exceptions, and check the exit status is as expected for failing
tests.

I can't see how to write a test for this, within the current framework.

You can test this change by reverting the fix (but not the test) from commit
1a159db8 and verifying that 'test cases/failing/66 string as link target'
fails.
2018-02-15 12:51:24 +00:00
Jon Turney c027bb2c42 Ensure any generation error appears in the logfile and thus in CI output
Since c2a5ac39, MesonApp.generate() closes the logfile before returning,
which means that when invoked by mesonmain.run(), any MesonException is not
logged there.

MesonApp.generate() does not appear to have any other users I can find.

This somewhat reduces the diagnostic value of the logfile.

This also interacts badly with running project tests in CI, as _run_tests
chooses to report the logfile contents, rather than stdout, for the
configure step, and it thus doesn't report any configure error which caused
a test failure.
2018-02-14 19:15:30 +02:00
Jon Turney 6a1a56ab57 Report warning/error locations in a format IDEs may already know how to parse
Examples:

meson.build:2:0: ERROR: Dependency is both required and not-found
meson.build:4: WARNING: Keyword argument "link_with" defined multiple times.

These are already matched by the default compilation-error-regexp-alist in
emacs.

Also:
Don't start 'red' markup until after the \n before an error
Unabsorb full-stop at end of warning with location from mlog.warning()
Update warning_location test
2018-01-30 06:48:22 +11:00
Jussi Pakkanen 3bea6eeae8 Removed duplicate if branch. 2018-01-18 19:39:22 +02:00
Jussi Pakkanen 0538009d30 Bump minimum supported Python from 3.4 to 3.5. 2018-01-04 21:29:02 +02:00
Jussi Pakkanen d2b68d31dd Added init command that creates a sample exe project. 2017-12-31 23:18:08 +02:00
Gabríel Arthúr Pétursson 2fc3fc8d67 Remember which Visual Studio backend was auto-detected
This fixes the REGEN build target since VSINSTALLDIR does not get set by
Visual Studio when building targets.

Fixes #2848.
2017-12-30 14:03:59 +00:00
Dylan Baker e1c9d2f53a mesonmain: Remove useless ternary
This ternary checks the value of a bool, and returns the same value.
2017-12-19 10:10:40 -08:00
Dylan Baker 8a1a866c68 Don't print traceback when options are invalid
Currently passing a bad combo or array option, providing a non-boolean
to a bool arg, or a host of other things can cause an traceback from a
MesonException, don't do that.

Fixes #2683
2017-11-28 21:41:06 +02:00
Jussi Pakkanen 105ea1e597 Make the full test suite runnable with an external command. 2017-11-20 23:14:45 +02:00
Jussi Pakkanen 5d51bc79c7 Replaced sys.executable use with the mesonlib equivalent. 2017-11-20 23:08:17 +02:00
Jussi Pakkanen a437cd1955 Add command to run Python scripts with the current interpreter. 2017-11-20 23:08:17 +02:00
Jussi Pakkanen 69bd87a716
Merge pull request #2511 from jon-turney/prefix-dependent-defaults
Make sysconfdir, localstatedir and sharedstatedir defaults depend on prefix
2017-11-13 21:14:59 +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
Elliott Sales de Andrade 6715087598 Dump coredata earlier.
Unfortunately, `time.time` and file timestamps are not guaranteed to be
in sync and due to various kernel caches may be different enough to
cause rebuilds to fail [1]. This was masked by older ninja versions that
could not read sub-second timestamps.

[1] https://travis-ci.org/mesonbuild/meson/jobs/296797872
2017-11-06 20:56:53 +02:00
Jon Turney 24549dbed5 Make sysconfdir, localstatedir and sharedstatedir defaults depend on prefix
Rather than requiring a bit of boilerplate in every meson.build, which is
only documented in a comment in mesoncore.py, use sensible defaults for
sysconfdir, localstatedir and sharedstatedir depending on the prefix.

Fixes #1637

v2:
For clarity, give get_builtin_option_default() a noneIfSuppress argument,
rather than overloading prefix '' and None with special meanings.
2017-10-28 23:27:36 +01:00
Luke Shumaker bb25260f00 flake8: Perform suggested whitespace/formatting changes
This only touches newlines, spaces, and (occaisionally) commas.  Anything
else is left for another commit.
2017-09-21 11:59:03 -04:00
Nirbheek Chauhan f04d141088 logging: Print location of log file on error
Similar to configure

Closes https://github.com/mesonbuild/meson/issues/2316
2017-09-14 18:29:30 +03:00
Chet Gurevitch e5e060a6b7 Update message for already configured builddir 2017-09-12 20:30:26 +03:00
Nirbheek Chauhan 6cf5cb5842 wrap-mode: Make the error output more useful
Now it errors out while displaying the possible options

See: https://bugs.python.org/issue25061 for native support
2017-09-07 19:05:38 +03:00
Jussi Pakkanen 511a370856 Merge pull request #2163 from chetgurevitch/master
Don't error if build directory is already configured and update instructions
2017-08-20 23:18:39 +03:00
Jussi Pakkanen c2a5ac3981 Ensure log file gets closed. 2017-08-18 12:08:50 +03:00
Chet Gurevitch 2da2c92698 Tell users about ninja rebuild and meson configure 2017-08-18 01:30:11 -07:00
Chet Gurevitch 0ec2e530e1 Don't error if build directory is already configured 2017-08-18 01:22:39 -07:00
Jussi Pakkanen 59a35c4c53 Print deprecation warnings on old style commands. 2017-08-02 22:01:13 +03:00
Jussi Pakkanen fa278f351f Add command multiplexer to main Meson invoker. 2017-08-02 22:00:09 +03:00
Elliott Sales de Andrade b52955ff3d Run postconf scripts after dumping coredata.
MESONINTROSPECT is set when running postconf scripts, which implies that
introspection is possible. But it isn't really possible because coredata
hasn't been written yet. We also still need to make sure to delete
coredata if any postconf scripts fail.
2017-07-15 13:47:17 +02:00
Nirbheek Chauhan 627190faf3 Add an env var to force meson to print a backtrace
This is really useful when debugging test failures. Without a stack
trace, you have to grep the source code for the error message.

Also set this in run_tests.py.
2017-06-09 20:21:01 +05:30
Alistair Thomas a195b78c8d Whitespace tweaks to reduce Flake8 warnings 2017-05-29 19:32:47 +03:00
Jussi Pakkanen 8d2fbf8084 Clarify multiple uses of -D. Closes #1836. 2017-05-26 23:22:56 +03:00
Jussi Pakkanen 111e3df45d Moved coverage commands to a standalone script. 2017-05-13 22:54:08 +03:00
Jussi Pakkanen 255be79e22 Created a dist target. Closes #877. 2017-05-11 19:34:16 +03:00
Jussi Pakkanen 0e3aa5a348 Merge pull request #1587 from mesonbuild/tingping/msgfmt-datadir
i18n: Improve data_dirs support
2017-05-03 18:51:55 +03:00
Jussi Pakkanen 9d69c934d6 Expand input paths so they do not contain symlinks. 2017-05-02 22:05:31 +03:00