Commit Graph

222 Commits

Author SHA1 Message Date
Dylan Baker 3edc7f343b coredata: store cross/native files in the same form they will be used (#5224)
* coredata: store cross/native files in the same form they will be used

Currently they're forced to absolute paths when they're stored in the
coredata datastructure, then when they're loaded we de-absolute path
them to check if they're in the system wide directories. This doesn't
work at all, since the ninja backend will generat a dependency on a
file that is in the source directory unless the path was already given
as absolute. This results in builds being retriggereed forever due to
a non-existant file.

The right way to do this is to figure out whether the file is in the
build directory, is absolute, or is in one of the system paths at
creation time, and store that path as absolute. Then the code that
reads the file and the code that generates the dependencies in the
ninja backend just takes the computed list and there is no mismatch
between them.

Fixes #5257

* run_unittests: Add a test for correct native file storage

This tests the bug in #5257
2019-04-21 23:10:02 +03:00
TheQwertiest bf65660509 Updated meson --help output 2019-04-20 14:17:13 +03:00
Jussi Pakkanen 04710b087a Add support for VS2019. Closes #4640. 2019-04-10 23:13:47 +03:00
Dylan Baker 377b652b93 coredata: Add ability to mark options as having separate cross values
Currently this only marks the pkg_config_path flag, but it could be
used to mark any of these values as having separate values for cross
and native builds, assuming that the necessary plumbing is done.
2019-04-05 15:08:17 -07:00
Dylan Baker 569e646e1e dependencies: Add command line option for pkg_config_path
This creates a new command line option to store pkg_config_path into,
and store the environment variable into that option. Currently this
works like the environment variable, for both cross and native targets.
2019-04-05 15:08:17 -07:00
Dylan Baker 5ce0d9fbbb coredata: Don't log warnings about reserved prefixes 2019-04-05 09:26:42 -07:00
Dylan Baker 863de72599 coredata: Fold add_builtin_argument into BuiltinOption
It really is a method of the BuiltinOption class, not a standalone
function.
2019-04-04 15:02:20 -07:00
Dylan Baker 1d7eda5fc8 coredata: Merge get_builtin_option_cmdline_name into BuiltinOption 2019-04-04 15:02:20 -07:00
Dylan Baker c3cb966631 coredata: merge get_builtin_option_default in to BuiltinOption 2019-04-04 15:02:20 -07:00
Dylan Baker 5aa2219f50 coredata: pull get_builtin_option_choices into BuiltinOption
We can remove some guards here since we know the object will have
certain attributes.
2019-04-04 15:02:20 -07:00
Dylan Baker 1e5496d1ba coredata: Remove get_builtin_option_description
Since the attribute is always accessible from a BuiltinOptions
instance we don't need a special function for this.
2019-04-04 15:02:20 -07:00
Dylan Baker 6940848f0b coredata: Move argparse action getterin into BuiltinOption class 2019-04-04 15:02:20 -07:00
Dylan Baker f8fcc7174d coredata: Remove is_builtin_option
This is a silly abstraction at this point.
2019-04-04 15:02:20 -07:00
Dylan Baker c6060d795c coredata: remove get_builtin_options
This returns a list out of th keys of a dict. In both cases of use
remaining though it's used for checking membership, checking for list
membership, lists are O(n) lookup, while dicts are O(1), so removing
the abstraction reduces typing and improves performance.
2019-04-04 15:02:20 -07:00
Dylan Baker d778a371ac coredata: Add an object to abstract builtins
Currently the builtins are stored as lists, then there are a mess of
functions which take said lists, check what the type of the first
thing is, and then extract data from various points in the list based
on that.

This is stupid. This is what structs/classes are for.
2019-04-04 15:02:17 -07:00
Jussi Pakkanen 1a79fdd7e7 Reuse build setup for host when native compiling. Closes #5047. 2019-04-01 19:20:08 +00:00
John Ericson e677704d21 Don't collect preprocssor flags separately from compiler flags
I recall that @jpakkane never wanted this, but @nirbheek did, but then
@nirbheek changed his mind.

I am fine either way except for the cross inconsistency that exists
today: There is no `c_preproc_args` or similar one can put in the cross
file, so no way to replicate the effect of CPPFLAGS during cross
compilation.
2019-03-27 14:45:42 +00:00
Ross Burton 65e59c84a1 mesonbuild: allow multiple --cross-file options
Just like --native-file, allow multiple --cross-file options.  This is mostly
unifying the logic between cross_files and config_files.
2019-03-20 10:06:17 +00:00
Ross Burton d57dd1092e load_configs: generalise the search path
Instead of hard-coding the fact that load_configs() searches for files under
meson/native, pass in the subdirectory allowing the cross-file code to use the
same logic.
2019-03-19 19:16:30 +00:00
Jussi Pakkanen 35c3cf2822 Bump version number for new development. 2019-03-10 20:40:31 +02:00
Jussi Pakkanen 9f48f5fe94 Update everything for new release. 2019-03-10 19:25:09 +02:00
John Ericson 2d6d242aec Feed compiler Properties to get its options defaulted
Before, the logic initialization compiler options from environment
variables vs config files was strewn about. Now, it is consolidated. We
leverage the new `envconfig.py` module to expose the configuration data
to `compilers.py` without creating an import cycle.
2019-02-27 13:10:16 -08:00
jml1795 a9e63568fe Add warning level zero 2019-02-19 00:06:27 +02:00
John Ericson 9d7f38eccd Fix cross file initialization of CPPFLAGS
'c_arg' entries should become *both* compiler options and external
peprocessor options for C. (And likewise for a few other languages.)
Seems inconsistent to me, but this is the status quo.
2019-02-15 09:17:24 -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
Nirbheek Chauhan a683fc30ab Use ConfigParser instead of deprecated SafeConfigParser
Fixes this annoying warning while running the tests:

mesonbuild/coredata.py:237: DeprecationWarning: The SafeConfigParser
class has been renamed to ConfigParser in Python 3.2. This alias will be
removed in future versions. Use ConfigParser directly instead.
2019-01-31 20:12:21 +05:30
Nirbheek Chauhan d02ec7111e coredata: Only reject a load if major version differs
Our builddir ABI is stable across minor (stable) releases, so there is
no need to force a wipe. We already release pretty often, no need to
force people to wipe twice as often.
2019-01-23 19:50:50 +05:30
Dylan Baker dbe2a29637 coredata: Serialize native files into the cmd_line.txt file
Because we need to store those as well.
2019-01-17 13:21:00 -05:00
Dylan Baker 8668a4e2ec coredata: Handle EOFError like UnpicklingError
If the coredata file has been truncated, that's pretty much the same as
being corrupt, handle that via the same path.
2019-01-17 13:21:00 -05:00
Dylan Baker ed0ad91f1c coredata: Handle AttributeError in unpickling coredata
Which can happen due to internal refactorings, such as the removal of
the ConfData class between 0.49 and 0.50
2019-01-17 13:21:00 -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
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
Nicolas Schneider 735e138382 fix meson configure exception when install_umask is not an int 2019-01-06 22:35:04 +02:00
John Ericson e147054d6f Get rid of `ConfigData` 2019-01-02 16:22:47 -05:00
Daniel Mensinger 10ce5deb71
Introspection refactoring 2018-12-29 23:55:45 +01:00
Jussi Pakkanen da5da5977a Default libdir is "lib" when cross compiling. Closes #2535. 2018-12-30 00:51:19 +02:00
John Ericson 9b13fb3672 Factor out more option iterating 2018-12-20 23:01:36 +02:00
John Ericson 4ffd009fe9 Factor out iterator over options dictionaries
Otherwise it's easy to forget one. In fact we did forget one:
`backend_options` in `validate_option_value`.
2018-12-18 20:40:24 +02:00
Jussi Pakkanen 6124a97722 Bump version number for new development. 2018-12-10 00:33:03 +02:00
Jussi Pakkanen 51aaa15bda Update everything for release 0.49.0 2018-12-09 21:58:12 +02:00
John Ericson 0fd548e16f Combine `run_tests` import lines in `run_unittests` 2018-12-03 22:33:20 +02:00
Dylan Baker 3af4407a16 Get basic native config file loading working 2018-11-14 15:57:37 -08:00
Xavier Claessens 8aeb967773 coredata: Do not use ':' as key delimited in cmd_line.txt 2018-11-09 20:32:52 -05: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
Jussi Pakkanen 4d986563dc Expose wrap_mode as an option. Closes #4266. 2018-10-07 22:52:54 +03:00
Jussi Pakkanen 3c4822e183 Updated version number for new development. 2018-09-22 23:36:09 +03:00
Jussi Pakkanen d1f3f1d023 Bump version number for release. 2018-09-22 20:21:49 +03:00
Zbigniew Jędrzejewski-Szmek 06646fe772 Drop unnecessary periods from help strings
The ones for "Compiler options" have no dots, so this was inconsistent.
Also dropping the dots makes the text fit better on narrow terminals.
2018-09-18 21:49:34 +03:00
Jussi Pakkanen 3f51745b41 New numbering scheme for pre-release versions. [skip ci] 2018-09-13 22:20:48 +03:00