Commit Graph

698 Commits

Author SHA1 Message Date
Daniel Mensinger be6a9191e1
cmake: First working version 2019-06-06 18:27:02 +02:00
Daniel Mensinger e55236bde4
cmake: basic AST generation 2019-06-06 18:27:02 +02:00
Daniel Mensinger 8d3bd6eea8
cmake: Server handshake 2019-06-06 18:27:01 +02:00
Daniel Mensinger a9a3b3ffe6
Added method kwarg to subproject 2019-06-06 18:22:26 +02:00
John Ericson af2d7af998 Per machine do 'build.' and '' option prefixes
See the docs/ changes for details.
2019-06-05 23:05:34 -04:00
Mathieu Duponchelle 12a82e763d interpreter: add fallback argument to subproject.get_variable() 2019-05-28 20:26:54 +03:00
Jussi Pakkanen e9bd7d49bd
Merge pull request #5372 from dcbaker/get_variable
Dependency.get_variable method
2019-05-21 21:57:05 +03:00
Jussi Pakkanen 79d530e325 Generators can have extra target dependencies. Closes #4131. 2019-05-20 23:38:13 +03:00
Jussi Pakkanen ef024583df
Merge pull request #5276 from dcbaker/pkg-config-path-invalidate-cache
coredata: add pkg_config_path to depedency cache key
2019-05-20 22:50:12 +03:00
Jon Turney fb35e6faac Remove compiler data from build object
The actual data is in Coredata (which is serialized) and we just held a
reference in Build for (in)convenience.
2019-05-20 11:29:17 -07:00
Jon Turney 58870fda16 Remove compilers from ModuleState object
It doesn't make much sense to have this and not also have
cross-compilers (so any use of this is already pretty suspect as
probably wrong when cross-compiling).

This information is accessible anyhow via environment.coredata.
2019-05-20 11:29:17 -07:00
Dylan Baker 4f347ef14a fixup! interpreter: Add get_variable method to dependency holders 2019-05-20 10:59:18 -07:00
Dylan Baker 146e97e974 Use dependency cache 2019-05-20 10:05:36 -07:00
Jussi Pakkanen 67a5af99aa
Merge pull request #5395 from dcbaker/mtest-annotations
Mtest annotations and bug fixes
2019-05-16 00:31:01 +03:00
John Ericson 957d8e051c Make `PerMachine` and `MachineChoice` have just `build` and `host`
Meson itself *almost* only cares about the build and host platforms. The
exception is it takes a `target_machine` in the cross file and exposes
it to the user; but it doesn't do anything else with it. It's therefore
overkill to put target in `PerMachine` and `MachineChoice`. Instead, we
make a `PerThreeMachine` only for the machine infos.

Additionally fix a few other things that were bugging me in the process:

 - Get rid of `MachineInfos` class. Since `envconfig.py` was created, it
   has no methods that couldn't just got on `PerMachine`

 - Make `default_missing` and `miss_defaulting` work functionally. That
   means we can just locally bind rather than bind as class vars the
   "unfrozen" configuration. This helps prevent bugs where one forgets
   to freeze a configuration.
2019-05-16 00:27:57 +03:00
John Ericson 4030e7cb7a UserOption no longer has a name field.
This avoids the duplication where the option is stored in a dict at its
name, and also contains its own name. In general, the maxim in
programming is things shouldn't know their own name, so removed the name
field just leaving the option's position in the dictionary as its name.
2019-05-15 14:21:47 +03:00
Dylan Baker 502a684872 build: TestSetup doesn't take keyword arguments
This function is currently setup with keyword arguments defaulting to
None. However, it is never called without passing all of it's arguments
explicitly, and only one of it's arguments would actually be valid as
None. So just drop that, and make them all positional. And annotate
them.
2019-05-14 16:43:29 -07:00
Dylan Baker 285db6637d interpreter: annotate the Test class
This is needed for mtest, in a round about way through backends
2019-05-14 16:43:28 -07:00
Dylan Baker d770f1c815 interpreter: Add get_variable method to dependency holders 2019-05-10 10:55:58 -07:00
Daniel Eklöf c2ee82cc41 add support for "target_type: 'shared_module'" in build_target() 2019-05-09 22:43:10 +03:00
Jon Turney 261878f438 Fix an assertion exception when misusing install_data
* Failing test case for trying to install_data a custom_target

* Validate install_data() arguments are either string or file
2019-05-05 21:11:20 +03:00
Dylan Baker c0aa89e57f
Merge pull request #4952 from mensinda/cacheCompiles
Cache compilers.compile() in coredata
2019-05-02 14:54:02 -07:00
Jussi Pakkanen 1f4023fa47
Merge pull request #5311 from mensinda/flake8Plugins
Added flake8 plugins and some code fixes
2019-05-02 23:30:29 +03:00
Jussi Pakkanen 7ac03f6264 Non-required appleframework deps should not be an error. Closes #5295. 2019-05-02 21:37:57 +03:00
Daniel Mensinger 74b535fea7
Do not pass None to mlog.exception 2019-04-29 19:00:46 +02:00
Daniel Mensinger 236221061a
Fixed unnecessary .items() 2019-04-29 12:23:13 +02:00
Daniel Mensinger 3581839f4c
Fix unused variables warnings 2019-04-29 12:22:50 +02:00
Daniel Mensinger c9e2d22eef
Make flake8 happy 2019-04-28 14:33:21 +02:00
Daniel Mensinger 971dfd664b
Added some cahced values 2019-04-28 14:33:21 +02:00
Daniel Mensinger dfe3d56bfd
Print '(cached)' when compiler result was cached 2019-04-28 14:33:21 +02:00
Daniel Mensinger 75b7a856cd
ast: support elementary object methods 2019-04-23 09:10:47 +02:00
Dylan Baker add821db64 Don't use mutable types as default arguments
This isn't safe given the way python implements default arguments.
Basically python store a reference to the instance it was passed, and
then if that argument is not provided it uses the default. That means
that two calls to the same function get the same instance, if one of
them mutates that instance every subsequent call that gets the default
will receive the mutated instance. The idiom to this in python is to use
None and replace the None,

def in(value: str, container: Optional[List[str]]) -> boolean:
   return src in (container or [])

if there is no chance of mutation it's less code to use or and take
advantage of None being falsy. If you may want to mutate the value
passed in you need a ternary (this example is stupid):

def add(value: str, container: Optional[List[str]]) -> None:
    container = container if container is not None else []
    container.append(value)

I've used or everywhere I'm sure that the value will not be mutated by
the function and erred toward caution by using ternaries for the rest.
2019-04-23 02:03:19 +03:00
Jussi Pakkanen ce160e1eab
Merge pull request #5250 from jon-turney/test-compiler-report
Add a report of compilers used to run_project_tests.py
2019-04-20 14:36:16 +03:00
Nirbheek Chauhan 2795f942be interpreter: Check the meson version before parsing options
Also add a test for it so we don't regress this in the future.

Closes https://github.com/mesonbuild/meson/issues/5281
2019-04-18 19:18:21 +00:00
Nirbheek Chauhan 10468b3a28 interpreter: Warn when environment() ops are overriden
Warn when someone tries to use append() or prepend() on an env var
which already has an operation set on it. People seem to think that
multiple append/prepend operations stack, but they don't.

Closes https://github.com/mesonbuild/meson/issues/5087
2019-04-13 22:53:33 +03:00
Jon Turney 3fc3695624
Push formatting of compiler version string down into Compiler class 2019-04-12 11:47:28 +01:00
Dylan Baker 0a0b473e84 interpreter: use container explosion where it makes sense
we can avoid writing code like:
a = c[0]
b = c[1]
by using:
a, b = c

or
a = c[0]
b = c[1:]
by using:
a, *b = c

This saves just a bit of code and is a teeny bit faster. But mostly
for less code
2019-04-12 00:24:51 +03:00
Dylan Baker 00a3bb8d69 interpreter: use zip function
Currently this is implemented as range(min(len(a), len(b)), an then
indexing into a and b to get what we actually want. Fortunately python
provides a function called zip that just does this.
2019-04-12 00:24:51 +03:00
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