Commit Graph

361 Commits

Author SHA1 Message Date
Daniel Mensinger 49c730ef05
cmake: Fix CMakeToolchain (fixes #8293)
Instead of guessing the internal compiler
variables, Meson now runns CMake once to
determine what they actually are.
2021-05-29 13:20:25 +02:00
Dylan Baker a5b43aa16c Add a helper to simplify the usage of PerMachineDefaultable 2021-05-28 09:26:38 -04:00
Dylan Baker 76b98459ac coredata: Use a PerMachineDefaultable for the deps cache 2021-05-28 09:26:38 -04:00
Jussi Pakkanen 8810583864 Bump version number for new development. 2021-05-02 13:34:58 +03:00
Jussi Pakkanen 753954be86 Release 0.58.0. 2021-05-02 12:42:42 +03:00
Jussi Pakkanen a493c950a7 Bump version number for rc1. 2021-04-26 23:39:15 +01:00
Dylan Baker d4e867809b store the list of initializes subprojects in the coredata structure
We need to konw on rconfigure which options have already bee set not
just for the super project, but also for the subproject. However, using
first_invocation is not sufficient, as a reconfigure could add a new
subpproject that wasn't present before, and we need to initialize that
project's builtins.
2021-04-26 17:05:44 +01:00
Dylan Baker aac67b502b coredata: Check for built-in options as host options
These options often don't exist for the build machine, as they're
generally invalid (ie, prefix, libdir, etc). So we should always check
for their existance as host optiuons, since all we want to know in this
case is if the option is yeilding (valid per-subproject), and build/vs
host doesn't matter in that cases:

Fixes #8613
2021-04-06 16:09:13 -07:00
Dylan Baker 2cd0723c42 Split environment variable and command line cflags
They are supposed to have different behavior. The environment variables
apply to both the compiler and linker when the compiler acts as a
linker, but the command line ones do not.

Fixes #8345
2021-03-30 18:52:17 +03:00
Dylan Baker 23c706add1 coredata: Fix dependency cache
The host cache had BUILD, which is wrong.
2021-03-28 22:44:21 +03:00
Xavier Claessens 20a90cf709 cmd_line_file.txt: Use cross/native file path resolved by coredata
This fix issue when using --wipe and the machine file was passed as a
pipe and written locally, or when the file was resolved in XDG_DATA_HOME
or XDG_DATA_DIRS.

Fixes: #8560
2021-03-22 14:45:10 -04:00
Paolo Bonzini 32e49b5ff2 coredata: be more robust on unpickling errors
When reverting from 0.57 to 0.56, one can see an error like this:

  File /Users/pm215/src/qemu-for-merges/meson/mesonbuild/coredata.py,
line 1016, in load
    obj = pickle.load(f)
ModuleNotFoundError: No module named 'mesonbuild.mesonlib.universal';
'mesonbuild.mesonlib' is not a package
FAILED: build.ninja

The reason is that the old version fails to resolve mesonbuild.mesonlib,
which is a similar situation to the existing AttributeError check.  Raise
a MesonException for ModuleNotFoundError as well, so that reconfiguration
proceeds using cmd_line.txt.
2021-03-16 09:32:57 -04:00
Eli Schwartz 6a0fabc647
mass rewrite of string formatting to use f-strings everywhere
performed by running "pyupgrade --py36-plus" and committing the results
2021-03-04 17:16:11 -05:00
Eli Schwartz 4340bf34fa
various python neatness cleanups
All changes were created by running

"pyupgrade --py3-only --keep-percent-format"

and committing the results. I have not touched string formatting for
now.

- use set literals
- simplify .format() parameter naming
- remove __future__
- remove default "r" mode for open()
- use OSError rather than compatibility aliases
- remove stray parentheses in function(generator) scopes
2021-03-04 17:11:26 -05:00
Jussi Pakkanen ba99181ba7 Bump version for new development. 2021-02-14 21:57:29 +02:00
Jussi Pakkanen 5d651e76b5 Set up release 0.57. 2021-02-14 21:28:44 +02:00
Jussi Pakkanen ba770d1877 Bump version numbers for rc1. 2021-02-09 01:20:19 +02:00
Volker-Weissmann f31ffaaf17
bugfix concerning octal umasks (#8282)
* bugfix concerning octal umasks

* minor fix

* spelling mistake
2021-02-01 09:48:48 -08:00
Jussi Pakkanen 8133a7b9a4 Keep buildtype the same even if user changes debug and/or optimization. 2021-01-19 20:25:55 +00:00
Xavier Claessens 5db77fd103 coredata: Add missing nopromote wrap_mode choice 2021-01-14 18:29:28 +00:00
Dylan Baker 4b0b44afac move handling of CFLAGS and friends to environment
This has a bunch of nice features. It obviously centralizes everything,
which is nice. It also means that env is only re-read at `meson --wipe`,
not `meson --reconfigure`. And it's going to allow more cleanups.
2021-01-11 11:15:06 -08:00
Dylan Baker a539fda0cf fix LGTM warnings 2021-01-04 12:20:59 -08:00
Dylan Baker e81acbd606 Use a single coredata dictionary for options
This patches takes the options work to it's logical conclusion: A single
flat dictionary of OptionKey: UserOptions. This allows us to simplify a
large number of cases, as we don't need to check if an option is in this
dict or that one (or any of 5 or 6, actually).
2021-01-04 12:20:58 -08:00
Dylan Baker 71db6b04a3 use OptionKey for builtin and base options
I would have prefered to do these seperatately, but they are combined in
some cases, so it was much easier to convert them together.

this eliminates the builtins_per_machine dict, as it's duplicated with
the OptionKey's machine parameter.
2021-01-04 12:20:40 -08:00
Dylan Baker f9b19e73a5 move OptionKey to mesonlib
There's starting to be a lot of things including coredata that coredata
needs to itself include. putting it in mesonlib makes more sense
2021-01-04 12:20:40 -08:00
Dylan Baker fe973d9fc4 use OptionKey for compiler_options 2021-01-04 12:20:39 -08:00
Dylan Baker 615686fd6d use new optionkey.is_* methods 2021-01-04 12:15:41 -08:00
Dylan Baker 30ec7612c8 coredata: Add a type to the OptionKey
This is useful for figuring out what kind of option this is. My hope is
that in the longterm this is less useful, but we'll still want it for
the configuration summary printing.
2021-01-04 12:15:41 -08:00
Dylan Baker 7142c92285 use OptionKey for backend_options 2021-01-04 12:15:41 -08:00
Dylan Baker e2ef6930ff use OptionKey for coredata.user_options 2021-01-04 12:15:41 -08:00
Dylan Baker b37f0cce2c movve insert_build_prefix to mconf
that's the only place it's used anyway.
2021-01-04 12:15:41 -08:00
Dylan Baker b25a423a64 use the OptionKey type for command line and machine files 2021-01-04 12:15:41 -08:00
Dylan Baker 983380d5ce coredata: Add OptionKey type
This is a complex key that can store multiple bits of data in a single
place. It can be generated from a command line formatted string, and
it's str method returns it to that form.

It's intentionally immutable, use the evolve() method to create
variations of an existing key.
2021-01-04 12:15:41 -08:00
Dylan Baker f6672c7a19 use real pathlib module
We added the _pathlib module to work around defeciencies in python 3.5's
implementation, since we now rely on 3.6 lets drop this
2020-11-20 15:08:40 -08:00
Elliot ff50f724bb
Fix #5492 (#7919)
* fix 5492 with cleaner code

* remove argparse import

* replace list(map( with list comprehension

* pass str rather than Path to get_cmd_line_file
2020-11-01 10:50:15 -08:00
Jussi Pakkanen 8fbf10c4bc Bump version number for new development. 2020-10-30 11:17:02 +02:00
Jussi Pakkanen f16d31607e Bump version number for release. This is the 10 000th commit! 2020-10-30 10:25:24 +02:00
Jussi Pakkanen 42d6b37423 Update version number to rc2. 2020-10-26 20:17:56 +02:00
Jussi Pakkanen 55d370e565 Bump version number for rc1. 2020-10-19 00:34:49 +03:00
Xavier Claessens 7271b1e942 Machine file pkg_config_path overrides environment
This is consistent with c_args in machine file overriding CFLAGS from
env. This also spotted an issue where in a native build this resulted
in pkg_config_path being /bar instead of /foo:
`-Dpkg_config_path=/foo -Dbuild.pkg_config_path=/bar`

Fixes: #7573
2020-10-16 17:42:24 -04:00
Xavier Claessens 7902d2032d Refactor handling of machine file options
It is much easier to not try to parse options into complicated
structures until we actually collected all options: machine files,
command line, project()'s default_options, environment.
2020-10-16 17:42:24 -04:00
Dylan Baker 94ac51fdda options: Handle updates to choices in options
Currently if you change the `choices` field in the meson_options.txt
file, no update will be done until `meson setup --wipe` is called. Now
if the choices change then the options will be properly merged.

If the currently select value is still valid it is guaranteed to be
kept, if it is now invalid the new default value will be used and a
warning will be printed.

Fixes #7386
2020-10-05 23:10:35 +03:00
Dylan Baker 4b1c1d83c8 machinefiles: Allow keys to be stored case insensitive
This is required to make the various keys in the [user options] section
work the same as they do in the meson_options.txt file, where we don't
have any rules about case sensitivity.

There is some risk here. Someone may be relying on this lower by default
behavior, and this could break their machine files.

Fixes #7731
2020-10-05 08:59:45 -04:00
Daniel Mensinger 1dfaccfd91 pathlib: Fix resolve() by overriding it in Python 3.5 2020-10-04 10:45:48 +02:00
Dylan Baker 6d173f9678 mesonlib: make OptionOverrideProxy a true MutableMapping
So that we can actually use it anyplace that an OptionDictType could be
used. I've also done a bit optimizing/simplifying of the implementation.
This is needed for cuda, as it returns an OptionOverrideProxy where we
ask for an OptionDicType
2020-10-01 15:05:00 -07:00
Dylan Baker 54329eeed7 dependencies/hdf5: Use the correct compilers for the machine
Instead of the default ones, this is especially important when cross
compiling or when using compilers that aren't compatible with the
default ones.
squash! dependencies/hdf5: Use the actual system compilers
2020-09-25 11:11:46 -07:00
Dylan Baker 79d1ecd5bc compilers/compilers: Fully type annotate 2020-09-24 12:14:13 -07:00
Dylan Baker d326c87fe2 compilers: Use a distinct type for compile/link results
Currently we do some crazy hackery where we add extra properties to a
Popen object and return that. That's crazy. Especially since some of our
hackery is to delete attributes off of the Popen we don't want. Instead,
let's just have a discrete type that has exactly the properties we want.
2020-09-24 12:14:13 -07:00
Dylan Baker f342efd080 pylint: turn on bad-indentation error
and fix all of the bad indentation
2020-09-22 17:57:03 -07:00
Nirbheek Chauhan fb7099c6cf mtest: Check version in the test data after loading
Same as coredata.dat and build.dat loading. Also, do not assert if
things change. Raise the appropriate exception.

Fixes https://github.com/mesonbuild/meson/issues/7613
2020-09-10 08:18:16 +00:00