Commit Graph

660 Commits

Author SHA1 Message Date
TheQwertiest 38273ac668 Added deduplication for configurration time file dependencies (fixes #5190) 2019-04-02 22:46:03 +03:00
Rico Tzschichholz 201ef0778e Add 'is_default' to permitted_kwargs for add_test_setup()
This missing in 0821462ce3

See #4430
2019-04-01 20:48:59 +03:00
Jakub Adam 0ad5670895 Fix run_command() with command on a different drive
On Windows, program on a different drive than srcdir won't have
an expressible relative path; cmd_path will be absolute instead and
shouldn't get added into build_def_files.
2019-03-28 23:20:21 +02:00
Jussi Pakkanen 68567482f5 Maintain backwards compatibility for one release. Closes #5051.
Also, specify what the replacement is.
2019-03-27 20:44:17 +02:00
Jussi Pakkanen e2f4e926b2 Reduce absolute paths to a deprecation. Closes #5050. 2019-03-26 01:48:00 +02:00
John Ericson 3037ade41d Inline check_compilers
This function is used just once. It also seems all policy and no
mechanism (it raises, it calls the same function to do all the work
twice in a simple way). This makes it seem to be as a good candidate for
inlining.

`environment` and `coredata` are woefully intertwined and while this
change doesn't fix that, but at least it makes it easier to follow.
2019-03-24 13:33:27 +02:00
Jon Turney 8a9e1b1166 Disallow add_languages('vala') without 'c'
v2:
Exercise add_lanagues('vala') after 'c' in a test case
2019-03-22 20:04:50 +02:00
Jussi Pakkanen ed5992a10d
Merge pull request #5031 from bonzini/kconfig
Kconfig Module
2019-03-20 22:03:47 +02:00
Dylan Baker ac627bcea7 replace library type strings with an enum
This patch creates an enum for selecting libtype as static, shared,
prefer-static, or prefer-shared. This also renames 'static-shared'
with 'prefer_static' and 'shared-static' with 'prefer_shared'. This is
just a refactor with no behavioral changes or user facing changes.
2019-03-20 18:45:56 +02:00
Paolo Bonzini 66db1af4dd interpreter: allow passing dictionaries to holderify
This in turn allows modules to return dictionaries, since their return values
is automatically passed through holderify.
2019-03-15 11:41:49 +01:00
Niklas Claesson dd2c44cdf6 Add static as keyword to find_library 2019-03-11 20:56:52 +02:00
Jussi Pakkanen 65487f1599 Install header\'s subdir must not be absolute. 2019-03-04 01:49:28 +02:00
Paolo Bonzini 91f847d308 mtest: implement TAP parsing
This provides an initial support for parsing TAP output.  It detects failures
and skipped tests without relying on exit code, as well as early termination
of the test due to an error or a crash.

For now, subtests are not recorded in the TestRun object.  However, because the
TAP output goes on stdout, it is printed by --print-errorlogs when a test does
not behave as expected.  Handling subtests as TestRuns, and serializing them
to JSON, can be added later.

The parser was written specifically for Meson, and comes with its own
test suite.

Fixes #2923.
2019-03-02 09:07:54 +01:00
Paolo Bonzini 4b5cf3f7c5 interpreter: add "protocol" kwarg to test
This is the first step towards adding support for TAP.
2019-03-02 09:07:54 +01:00
John Ericson 2622e9ec32 Move some configuration classes out of environment.py
First of all, I'd like compilers and other modules that environment.py
currently imports to be able to take these without creating
hard-to-follow module cycles.

Second of all, environment.py's exact purpose seems a bit obscured.
Splitting the data types (and basic pure functions) from the more
complex logic that infers that data seems like a good way to separate
concerns.
2019-02-27 13:10:16 -08:00
Jussi Pakkanen 067ff7eeae Fall back to current interpreter when python3 not found. 2019-02-26 01:26:54 +02:00
John Ericson 3e9396f259 Fix cross static linker lookup
Need to search based off of `cross_comp`, not `comp`.

Fixes #4822
2019-02-14 11:18:55 -08: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
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 e1a83793ae CMake: Added support for CMAKE_MODULE_PATH and extra CMake args (closes #4779) 2019-02-01 00:25:21 +02:00
Nirbheek Chauhan 1575bd988a configure_file: Allow setting install_dir: false with deprecation
Also add location node for two more deprecations

See: https://github.com/mesonbuild/meson/pull/4489#issuecomment-459246879
2019-01-31 13:48:59 -05:00
Michael Hirsch, Ph.D da34bea893 pep8 py37 2019-01-29 22:06:11 +02:00
Nicolas Schneider 3fc8a0dc41 fix non-default option printing
Previously, the default option string was compared to the actual project
option that has been converted to the proper type. This lead to messages
like 'Option x is: true [default: true]'.

Fixes #4806.
2019-01-27 20:52:46 +02:00
Jan Tojnar 33d82201bd run_command: add env kwarg 2019-01-27 19:24:15 +02:00
Xavier Claessens 15cea55f5b Interpreter: Add a location to all mlog.warning() calls
Now that the current node is always available as self.current_node in
both function and method calls, it's easy to pass it to warning
messages.
2019-01-22 16:12:15 -05:00
Xavier Claessens 0d195cefa6 Interpreter: Add current_node to 'state' passed to module methods
The current node is useful to pass as location to mlog.warning().
2019-01-22 15:59:36 -05:00
Daniel Mensinger af38722f89 mintro: Introspection interpreter refactoring (#4733)
* Fixed spelling

* Merged the Buildoptions and Projectinfo interpreter

* Moved detect_compilers to Environment

* Added removed test case

* Split detect_compilers and moved even more code into Environment

* Moved set_default_options to coredata

* Small code simplification in mintro.run

* Move cmd_line_options back to `environment`

We don't actually wish to persist something this unstructured, so we
shouldn't make it a field on `coredata`. It would also be data
denormalization since the information we already store in coredata
depends on the CLI args.
2019-01-16 23:42:54 +02:00
Xavier Claessens 83766b3687 Fix flake8 errors 2019-01-16 11:16:46 -05:00
Xavier Claessens 815f1205a8 do_subproject: Improve log messages and formatting 2019-01-16 11:16:46 -05:00
Xavier Claessens af643d6409 extract_required_kwarg: Fix typo 2019-01-16 11:16:46 -05:00
Xavier Claessens 35f0f7090d dependency: Cleanup code by avoiding nested if blocks 2019-01-16 11:16:46 -05:00
Xavier Claessens 5dac8e51f4 dependency: Not all DependencyException means not-found dep 2019-01-16 11:16:46 -05:00
Xavier Claessens 335b87fcaa dependency: Add has_fallback variable 2019-01-16 11:16:46 -05:00
Xavier Claessens 1cd393c6e2 dependency_fallback: Set 'required' in subproject's kwargs
This makes error clearer because it stops exactly where the error occurs
during the subproject configuration.
2019-01-16 11:16:46 -05:00
Xavier Claessens 2867371f1a dependency_fallback: Pass display_name in arguments 2019-01-16 11:16:46 -05:00
Xavier Claessens bdf301d05b do_subproject: InvalidCode is always an error
Not need to catch exceptions in dependency_fallback(), it's already
handled in do_subproject(). This ensure subproject errors are handled
the same way when doing dependency() fallback and when doing
subproject().
2019-01-16 11:16:46 -05:00
Xavier Claessens f6a34c8aaf dependency_fallback: Simplify useless try block 2019-01-16 11:16:46 -05:00
Xavier Claessens b209a3cd8f dependencies: Avoid duplicated code
The dependency version from a subproject was checked in two different
places. Do it in get_subproject_dep().
2019-01-16 11:16:46 -05:00
Xavier Claessens a92b41fdcd dependencies: Remove version from cache key
We cannot have 2 different versions with all other kwargs being
identical. This simplifies a lot that code.
2019-01-16 11:16:46 -05:00
John Ericson b53c982b58 Build class should not duplicate compiler state
Compilers should be held by coredata, so this is just here for
convenience.
2019-01-14 00:16:36 +02:00
Marco Trevisan (Treviño) 95c1cdf776 interpreter: obey to the install argument in configure_file
If a configure_file has an install_dir set, the supported install
argument is ignored, while this should have actually higher priority
than the install_dir itself.
Also check that correct types are used for `install` and `install_dir`.

Add test to verify this.

Fixes #3983
2019-01-13 19:51:31 +02:00
Jon Turney 680d266591 Fix a typo in an error message 2019-01-11 20:58:43 +02:00
John Ericson 17a602a4ec Remove spurious case in interpreter
`need_cross_compiler = is_cross_build()`, so the condition is always
false.
2019-01-10 22:59:01 +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
Xavier Claessens aa840afb3a Always flatten include_directories lists 2019-01-06 19:24:05 +02:00
John Ericson 2b22576fb6 Remove cross_info; cross file is parsed up front and discarded 2019-01-02 16:22:47 -05:00
John Ericson dbf080afe9 Get rid of `need_cross_compiler`
Building a cross compiler (`build == host != target`) is not cross
compiling. As such, it doesn't make sense to handle it under
`is_cross_build`.

(N.B. Building a standard library for a cross compiler would require
cross compiling, but Meson has support to do such a thing as part of a
compiler build currently.)
2019-01-02 16:11:02 -05:00
Jussi Pakkanen 3a6e2aeed9 Can use plain strings for include_directories. 2019-01-02 22:29:08 +02:00
Daniel Mensinger 10ce5deb71
Introspection refactoring 2018-12-29 23:55:45 +01:00
Jussi Pakkanen ab3aeeffe9 Print warning if using "default_options" without a "fallback". 2018-12-30 00:50:45 +02:00