Commit Graph

5794 Commits

Author SHA1 Message Date
Xavier Claessens 2d3bfa0778 Interpreter: Fix subdir_done() to exit from inside if/foreach blocks
Closes: #3700.
2018-06-07 12:56:27 +00:00
Jussi Pakkanen e581a8937f Add test case for generated headers used through a dependency. 2018-06-07 00:22:50 +03:00
Philip Chimento d9efee01d0 gettext: Install .mo files atomically
Without this, building a module in a Flatpak app manifest that is a
newer version of a module already present in the Flatpak runtime will
fail. (The Flatpak file system is a bunch of hard links to readonly
files, which can be replaced but not written to.)

This instead creates a temporary file in the same directory as the
destination (to avoid cross-device renaming errors) and atomically
renames the temporary file to the destination, replacing it instead of
rewriting it as shutil.copyfile() would do.
2018-06-07 00:18:21 +03:00
Xavier Claessens 9b791881ed compilers: Use RUSTFLAGS from the env as default rust_args value 2018-06-06 20:02:37 +00:00
Xavier Claessens 7fbe10ac8d mesonmain: Take only 2 optional directories
If only 1 dir is provided, the 2nd defaults to '.' and if none is
provided they default to '.' and '..'. It should be builddir first,
followed by sourcedir, but validate_core_dirs() will still swap them if
builddir contains a meson.build file.
2018-06-06 20:02:37 +00:00
Xavier Claessens 9350b9aa7b mconf: Take only one optional builddir arg that defaults to '.' 2018-06-06 20:02:37 +00:00
Xavier Claessens 6ed7a31402 environment: copy self.cmd_line_options to not modify original options
That dict gets modified when adding default_options, but mesonmain will
need to keep the original values.
2018-06-06 20:02:37 +00:00
Xavier Claessens a2ebbc7ec4 wraptool: Convert to argparse 2018-06-06 20:02:37 +00:00
Xavier Claessens 3f66846b02 Add unit test for option precedence
Closes #3456.
2018-06-06 20:02:37 +00:00
Xavier Claessens 7c4736d27f Convert args.projectoptions into a dict
This simplifies a lot of code, and centralize "key=value" parsing in a
single place.

Unknown command line options becomes an hard error instead of
merely printing warning message. It has been warning it would become an
hard error for a while now. This has exceptions though, any
unknown option starting with "<lang>_" or "b_" are ignored because they
depend on which languages gets added and which compiler gets selected.
Also any option for unknown subproject are ignored because they depend
on which subproject actually gets built.

Also write more command line parsing tests. "19 bad command line
options" is removed because bad cmd line option became hard error and
it's covered with new tests in "30 command line".
2018-06-06 20:02:37 +00:00
Xavier Claessens b38452636c Fix command line unit test not actually testing failure message
self.init() raise an exception so anything else in the 'with' block is
not executed.
2018-06-06 20:02:37 +00:00
Xavier Claessens f4d60acaa9 Remove had_argument_for() it is not used anymore
This also means we don't need to keep original command line arguments
anymore.
2018-06-06 20:02:37 +00:00
Xavier Claessens 75e501ceb8 coredata: Stop setting default option values as argparse attribute
All options are now the projectoptions list, regardless of how they got
defined in the command line.

This also delays setting builtin option values until the main project()
default options are parsed to simplify the code. This is possible
because we already delayed setting the backend after parsing main
project() in a previous commit.
2018-06-06 20:02:37 +00:00
Xavier Claessens 8afbfe227b mconf: Special case UserUmaskOption to print value in octal notation 2018-06-06 20:02:37 +00:00
Xavier Claessens af66656117 UserUmaskOption: Add 'preserve' in choices and use octal notation 2018-06-06 20:02:37 +00:00
Xavier Claessens 531722229b UserUmaskOption: Implement validate_value instead of set_value
set_value() is implemented by the base class, subclasses only need to
override validate_value().
2018-06-06 20:02:37 +00:00
Xavier Claessens 75cce9e157 mconf: Reduce code duplication and avoid missing builtin options
This ensure all option groups are printed the same way. Also ensure that
we cannot miss some builtin options by taking the list of all builtin
options and excluding only directories/testing options.
2018-06-06 20:02:37 +00:00
Xavier Claessens 04c5c53e3c mconf: Fix print when choices is a string instead of list 2018-06-06 20:02:37 +00:00
Xavier Claessens da29e48d13 mconf: Set prefix first because other options depends on it 2018-06-06 20:02:37 +00:00
Xavier Claessens 00414a326a dependencies: Take options from coredata instead of cmd line
These are the last remaining places where attributes set by argparse for
"--builtin-option" are used.
2018-06-06 20:02:37 +00:00
Xavier Claessens d503b1423e mconf: Report all unknown cmd line options instead of aborting on first
This is also more consistent with the error message returned by
optinterpreter when it finds unknown command line options.
2018-06-06 20:02:37 +00:00
Xavier Claessens 8fb72510c3 Move to coredata some methods handling options
Those methods only use coredata object, so better just move them as a
coredata method.
2018-06-06 20:02:37 +00:00
Xavier Claessens 3e6dc8fb71 mconf: Small tweaks when printing configuration 2018-06-06 20:02:37 +00:00
Xavier Claessens 5af98d16b9 Delay backend creation until project() is parsed
The project() function could have a different value for the backend
option in its default_options kwargs.

Also set backend options, passing them in command line had no effect
previously.
2018-06-06 20:02:37 +00:00
Xavier Claessens 218ed2de89 optinterpreter: Remove duplicated list of languages
It is important to keep the list of languages up to date in
optinterpreter, otherwise we could have conflicting options when adding
new languages.
2018-06-06 20:02:37 +00:00
Xavier Claessens aa879b7f0c Fix issues found by flake8 2018-06-06 20:02:37 +00:00
Xavier Claessens b7d442150d Move <lang>_args to coredata.compiler_options 2018-06-06 20:02:37 +00:00
Xavier Claessens 58a9555ddf UserArrayOption: Small cleanup in value parsing
It is nicer to early raise exception if the value from meson_options.txt
is not a string in "[]" format than duplicating the parser code for both
cases.

Also it was checking for duplicated items only in the user_input case,
but we should also check for dups in the default value from
meson_options.txt.
2018-06-06 20:02:37 +00:00
Xavier Claessens 64bfc6cf7b UserArrayOption: Add support for splitting on space instead of coma 2018-06-06 20:02:37 +00:00
Xavier Claessens fa72cd7173 Move get_args_from_envvars() from environment to compilers 2018-06-06 20:02:37 +00:00
Xavier Claessens 6eeea9dd54 Compilers: Chain-up to parent class in get_options()
Parent class could have common options for all compilers, and we'll soon
add some.
2018-06-06 20:02:37 +00:00
Chun-wei Fan 3c4c8bf775 environment.py: Properly check platform on MSVC 2008
The 'Platform' envvar may not be set on Visual Studio 2008, at least
when using the SDK 7.0 compilers, so check the 'BUILD_PLAT' envvar so
that we do not mis-detect x64 build environments as x86.
2018-06-06 18:37:29 +00:00
Nirbheek Chauhan f9f3a51243 Revert "really switch to qmake automatically if pkg-config fails"
This reverts commit 0045d95a16.

<jeandet> nirbheek, it seems 0045d95a16 is
really wrong, I've tested on Ubuntu.  While writing this line I was
thinking that you can't have Qt without a working qmake in the path. On
Ubuntu you have that qtchooser stuff which is misleading.
2018-06-06 18:35:59 +00:00
Yudi Matsuzake 4ee07dd165 docs: Fix dictionary syntax [skip ci] 2018-06-06 18:18:23 +00:00
Nirbheek Chauhan 56a7d8b2b3 Warn when Apple bitcode support is enabled and in-use
We have to disable some options, so tell the user about them and point
to the documentation so they can read more about it.
2018-06-06 07:53:10 +00:00
Nirbheek Chauhan 0565262be3 Add documentation for Builtin options and bitcode
Also add a test that ensures that new base options and compiler options
are always documented.
2018-06-06 07:53:10 +00:00
Nirbheek Chauhan 3e1a610702 Add a new option for building with Apple bitcode support
Normally, people would just pass -fembed-bitcode in CFLAGS, but this
conflicts with -Wl,-dead_strip_dylibs and -bundle, so we need it as
an option so that those can be quietly disabled.
2018-06-06 07:53:10 +00:00
Nirbheek Chauhan 68001193d3 meson introspect: Fix --installed argument
Traceback (most recent call last):
  File "meson.py", line 29, in <module>
    sys.exit(mesonmain.main())
  File "mesonbuild/mesonmain.py", line 411, in main
    return run(sys.argv[1:], launcher)
  File "mesonbuild/mesonmain.py", line 320, in run
    return mintro.run(remaining_args)
  File "mesonbuild/mintro.py", line 234, in run
    list_installed(installdata)
  File "mesonbuild/mintro.py", line 72, in list_installed
    for path, installdir, aliases, unknown1, unknown2 in installdata.targets:
ValueError: too many values to unpack (expected 5)
2018-06-06 06:59:06 +00:00
Jon Turney f31679dedd Fix non-list used with FeatureNewKwargs
The type of this argument needs checking, or single strings need handling correctly.
2018-06-05 15:57:57 +00:00
Nirbheek Chauhan 48d49afe31 FeatureNew: Add decorators for new install_mode kwargs 2018-06-05 15:57:57 +00:00
Nirbheek Chauhan c3ffc1a249 docs: Add a release notes snippet about FeatureNew 2018-06-05 15:57:57 +00:00
Nirbheek Chauhan 9b314c9c24 FeatureNew: add two features that were just merged 2018-06-05 15:57:57 +00:00
Nirbheek Chauhan dff1d8eccf FeatureNew: Print WARNING instead of ERROR
ERROR is reserved for non-zero exit codes. People will probably get
confused.
2018-06-05 15:57:57 +00:00
Nirbheek Chauhan ad0121d259 Add prog/lib dirs from the mingw cross-compiler to PATH
These directories contain DLLs that the executable may need, such as
libstdc++-6.dll, libwinpthread, etc.
2018-06-05 10:50:22 +00:00
Nirbheek Chauhan bc4dd5e201 .travis.yml: Add CI for armhf and mingw
Also split them out to their own jobs. Travis gives us 5 parallel jobs
now, so we can parallelize it a bit more.
2018-06-05 10:50:22 +00:00
Nirbheek Chauhan eb383ef4a2 Automatically add cross-mingw root and sysroot bindir to WINEPATH
This ensures that all the system DLLs required by executables such as
libstdc++-6.dll can be found out of the box and tests can run
2018-06-05 10:50:22 +00:00
Nirbheek Chauhan 21dc45dbbb Add MinGW-w64 64-bit to the Travis CI
Includes new cross files for MinGW-w64
2018-06-05 10:50:22 +00:00
Nirbheek Chauhan efa9b75d5d Set WINEPATH when running serialized executables
When the exe runner is `wine` or `wine32` or `wine64`, etc.
This allows people to run tests with wine.

Note that you also have to set WINEPATH to point to your custom
prefix(es) if your tests use external dependencies.

Closes https://github.com/mesonbuild/meson/issues/3620
2018-06-05 10:50:22 +00:00
Niklas Claesson 7fbab2c6e9 Update environment.py
Fix typo in environment.py
2018-06-04 23:46:14 +03:00
Aleksey Filippov d1f9303787 Add 'common/202 subproject array version' test 2018-06-03 21:10:56 +00:00