Commit Graph

502 Commits

Author SHA1 Message Date
Jussi Pakkanen 902aaf2ce6
Merge pull request #4626 from Ericson2314/consolidate-properties
Go through coreutils.compiler_options.{build.host.target}
2019-02-04 23:06:46 +01:00
Daniel Mensinger 69cb314718 Fix introspection test case for solaris (fixes #4866) 2019-02-04 20:25:03 +01: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 da7b9df16c Ensure that func dicts provide the same set of functions 2019-02-01 11:49:52 +00:00
Nirbheek Chauhan 50b863032e find_library: Check arch of libraries on Darwin
macOS provides the tool `lipo` to check the archs supported by an
object (executable, static library, dylib, etc). This is especially
useful for fat archives, but it also helps with thin archives.

Without this, the linker will fail to link to the library we mistakenly
'found' like so:

ld: warning: ignoring file /path/to/libfoo.a, missing required architecture armv7 in file /path/to/libfoo.a
2019-01-31 20:36:49 +00:00
Nirbheek Chauhan c0166355ce Rewrite appleframework and extraframework dependency classes
Instead of only doing a naive filesystem search, also run the linker
so that it can tell us whether the -F path specified actually contains
the framework we're looking for.

Unfortunately, `extraframework` searching is still not 100% correct in
the case when since we want to search in either /Library/Frameworks or
in /System/Library/Frameworks but not in both. The -Z flag disables
searching in those prefixes and would in theory allow this, but then
you cannot force the linker to look in those by manually adding -F
args, so that doesn't work.
2019-02-01 00:14:09 +05:30
Nirbheek Chauhan 00b59c9ad6 pkg-config: Fix another case where we were throwing a traceback
Also add a test for it. In the process, also remove an overly-zealous
try..except statement that was catching *all* exceptions, not just
expected ones, which was masking programming errors.
2019-01-31 20:12:21 +05:30
Nirbheek Chauhan 4268e156a3 unit tests: darwin tests must never require pkg-config 2019-01-31 20:12:21 +05:30
Nirbheek Chauhan 3997e8762e unit tests: Fix sdl2 failure test on macOS
Also ensure that the test's no-pkg-config codepath will always be run,
even on the CI where we always have pkg-config available.

This counts as a test case for #4728
2019-01-31 20:12:21 +05:30
Nirbheek Chauhan 58852e6290 unit tests: Simplify get_fake_env()
Almost every test already uses '' for the srcdir/builddir/etc.
Make it official.
2019-01-31 20:12:21 +05:30
Nirbheek Chauhan 36779c0500 unit tests: Run native file tests on the CI
The native file tests were never run on the CI since they were skipped
on Windows and also skipped on Linux and macOS since CC/CXX/etc are
always set by the CI.

Also fix test failure on macOS. The test was assuming that because
/usr/bin/gcc and /usr/bin/clang exist on macOS, they must be different
compilers. They're not. gcc is just a wrapper around clang, and we
correctly detect it as such.
2019-01-30 23:21:59 +02:00
Michael Hirsch, Ph.D da34bea893 pep8 py37 2019-01-29 22:06:11 +02:00
Michael Hirsch, Ph.D 8636f31d9c BUGFIX: broken/missing Fortran code/unit tests 2019-01-27 20:57:21 +02:00
Jussi Pakkanen 733f9a7765
Merge pull request #4814 from mensinda/astVisitor
rewriter: Rewrote the meson rewriter - now works with AST modification
2019-01-27 20:46:29 +02:00
Christoph Reiter 8df5afc98a configure_file: preserve newlines of the input file. Fixes #4817
In some cases (see #4817) it's helpful if the output file uses the
same newlines as the input file without translating them to the
platform defaults.

open() by default recognizes all newline styles and translates them
to "\n" and then to the platform default when writing.
Passing "" to "newline" disables the translation and lets us pass through
the original newline characters.
2019-01-24 21:02:34 +02:00
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
Daniel Mensinger 4b3e21b894
Fixed test case and setup.py 2019-01-22 17:47:51 +01:00
Daniel Mensinger 6fe2c2b209
Fixed flake8 issues 2019-01-22 17:31:15 +01:00
Daniel Mensinger 027c3c9ac7
Added subdir test 2019-01-22 17:04:43 +01:00
Daniel Mensinger b7c6f3ec72
Can now rewrite files 2019-01-22 16:41:25 +01:00
Daniel Mensinger 8dd9b44831
Added support for removing sources from a target 2019-01-22 16:41:25 +01:00
Daniel Mensinger 0ce6632393
Added suport for adding sources to a target 2019-01-22 16:41:25 +01:00
Daniel Mensinger 86d5799bc4
First rewriter test case 2019-01-22 16:41:06 +01:00
Daniel Mensinger 277dc10a5d
AST post processing 2019-01-22 16:09:34 +01:00
Simon McVittie 65192af2ff run_unittests: Use Python 3.5-compatible subprocess invocation
subprocess.run() didn't get the encoding parameter until 3.6.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-01-17 23:09:17 +02: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
Daniel Mensinger 2bb69ad50b Renamed unit test directories 2019-01-16 19:10:47 +02:00
Xavier Claessens 66ac6f6b3d find_external_dependency: Return NotFoundDependency()
The returned not-found object can be from any type because we were
returning the first of the failed attempts. It also can happen that we
don't have any dependency object in which case we should just return
NotFoundDependency() object as well instead of raising an exception.
That exception was happening before, but dependency_impl() was
calling find_external_dependency() in a try block so it was hidden.
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
Daniel Mensinger 609ecba37f mintro: Added `defined_in` key in the targets introspection 2019-01-15 20:28:12 +02:00
Daniel Mensinger 5c139032b8
Deprecated --target-files API 2019-01-07 22:35:56 +01:00
Daniel Mensinger 29dd57dcbf
Fixed flake8 2019-01-07 22:26:09 +01:00
Daniel Mensinger e67ba0fd64
Also made buildsystem files absolute 2019-01-07 22:26:09 +01:00
Daniel Mensinger a1d8c1d3e9
Changed introspection target format 2019-01-07 22:24:49 +01:00
Daniel Mensinger ab32f1fe00 Added meson-info.json 2019-01-06 22:03:29 +01:00
Daniel Mensinger bd8bad46c3
Code cleanup and renamed variables 2019-01-06 12:19:33 +01:00
Daniel Mensinger 8ac5b36c70
Fixed mac unit test 2019-01-06 12:19:32 +01:00
Daniel Mensinger 02734cc5c3
Better documentation 2019-01-06 12:19:31 +01:00
Daniel Mensinger 2e81631d0c
Keep 'filename' and 'install_filename' as strings 2019-01-06 12:19:31 +01:00
textshell 7eb8621ea6
Update run_unittests.py
Co-Authored-By: mensinda <daniel@mensinger-ka.de>
2019-01-06 12:19:30 +01:00
Daniel Mensinger 7691b0460c
Ninja backend target introspection 2019-01-06 12:19:30 +01:00
Daniel Mensinger d4ac832bf6
Split the monolithic introspection file into chunks 2019-01-06 12:19:29 +01:00
Daniel Mensinger e4e0e89ea8
Fixed mac build 2019-01-06 12:19:29 +01:00
Daniel Mensinger a9ade54707
Should fix azure 2019-01-06 12:19:29 +01:00
Daniel Mensinger c326ae2e75
Fixed flake8 2019-01-06 12:19:29 +01:00
Daniel Mensinger b11df88395
Documentation and unit test update 2019-01-06 12:19:29 +01:00
Daniel Mensinger b034f52656
Filenames are now lists 2019-01-06 12:19:29 +01:00
Daniel Mensinger b91c5aad85
Update intro dump on meson configure 2019-01-06 12:19:29 +01:00
Daniel Mensinger c4eb5c79fe
Added unit test 2019-01-06 12:19:28 +01:00
Daniel Mensinger 24d668bea0
Removed determine_installed_path since it is no longer needed 2019-01-06 12:19:28 +01:00