Commit Graph

8546 Commits

Author SHA1 Message Date
Michael Hirsch, Ph.D ccbb20e881
ci: improve robustness
* netcf
* hdf5
* scalapack
* coarray
2019-12-19 11:59:47 -05:00
Michael Hirsch, Ph.D f1d370247f
dependencies: refactor to use methods properly 2019-12-19 11:52:32 -05:00
Daniel Mensinger 06821755d2 CI: Skip NetCDF Fortran test on OSX 2019-12-19 11:13:30 -05:00
Daniel Mensinger ca34d01dcc CI: Skip git tests if g-ir-scanner does not exist 2019-12-19 11:13:30 -05:00
Daniel Mensinger 792a84199b CI: Fix C++11 related error on osx for protocol buffer 2019-12-19 11:13:30 -05:00
Michael Hirsch, Ph.D fb121f6254 fs: rename samefile => is_samepath
is_samepath better reflects the nature of this function--that files
and directories can be compared.

Also, instead of raising exceptions, simply return False when one
or both .is_samepath(path1, path1) don't exist. This is more
intuitive behavior and avoids having an extra if fs.exist() to go
with every fs.is_samepath()
2019-12-19 08:51:31 -05:00
Dylan Baker 9e21942780 linkers: Remove get_allow_undefined_args from link.exe
PE DLLs don't work like elf or mach-o, there's no way to define symbols
at run time, they must all be defined as import or export at link time.
As such there's no value in being able to have undefined symbols in
MSVC, nor does meson expose an option to change them

Fixes: #6342
2019-12-18 21:57:03 +02:00
Ting-Wei Lan 04e08f5a1f PkgConfigDependency: Sort -L flags according to PKG_CONFIG_PATH
When there is more than one path in PKG_CONFIG_PATH. It is almost always
preferred to find things in the order specified by PKG_CONFIG_PATH
instead of assuming pkg-config returns flags in a meaningful order.

For example:

/usr/local/lib/libgtk-3.so.0
/usr/local/lib/pkgconfig/gtk+-3.0.pc
/usr/local/lib/libcanberra-gtk3.so
/usr/local/lib/pkgconfig/libcanberra-gtk3.pc
/home/mesonuser/.local/lib/libgtk-3.so.0
/home/mesonuser/.local/lib/pkgconfig/gtk+-3.0.pc

PKG_CONFIG_PATH="/home/mesonuser/.local/lib/pkgconfig:/usr/local/lib/pkgconfig"

libcanberra-gtk3 is a library which depends on gtk+-3.0. The dependency
is mentioned in the .pc file with 'Requires', so flags from gtk+-3.0 are
used in both dynamic and static linking.

Assume the user wants to compile an application which needs both
libcanberra-gtk3 and gtk+-3.0. The application depends on features added
in the latest version of gtk+-3.0, which can be found in the home
directory of the user but not in /usr/local. When meson asks pkg-config
for linker flags of libcanberra-gtk3, pkg-config picks
/usr/local/lib/pkgconfig/libcanberra-gtk3.pc and
/home/mesonuser/.local/lib/pkgconfig/gtk+-3.0.pc. Since these two
libraries come from different prefixes, there will be two -L arguments
in the output of pkg-config. If -L/usr/local/lib is put before
-L/home/mesonuser/.local/lib, meson will find both libraries in
/usr/local/lib instead of picking libgtk-3.so.0 from the home directory.

This can result in linking failure such as undefined references error
when meson decides to put linker arguments of libcanberra-gtk3 before
linker arguments of gtk+-3.0. When both /usr/local/lib/libgtk-3.so.0 and
/home/mesonuser/.local/lib/libgtk-3.so.0 are present on the command
line, the linker chooses the first one and ignores the second one. If
the application needs new symbols that are only available in the second
one, the linker will throw an error because of missing symbols.

To resolve the issue, we should reorder -L flags according to
PKG_CONFIG_PATH ourselves before using it to find the full path of
library files. This makes sure that we always follow the preferences of
users, without depending on the unreliable part of pkg-config output.

Fixes https://github.com/mesonbuild/meson/issues/4271.
2019-12-18 11:34:24 -05:00
Daniel Mensinger c4649704c8 python: add embed to the python dependency function 2019-12-18 01:19:16 +02:00
Jussi Pakkanen 3122bac28a
Merge pull request #4649 from dcbaker/summary-function
Add a summary() function for configuration summarization
2019-12-18 01:17:27 +02:00
Jussi Pakkanen a2a9611e1d
Merge pull request #6065 from dcbaker/pass-options-to-linker-detection
Pass options to linker detection
2019-12-17 21:09:26 +02:00
Michael Hirsch, Ph.D 8a57b608ad ci cmake: Windows link.exe skip due to symbol issues 2019-12-17 16:59:27 +02:00
Jussi Pakkanen 39db7b1afc Fail gracefully detecting hdf5 if pkg-config is not available. 2019-12-17 15:10:13 +02:00
Jussi Pakkanen 58999cad91 Fix macOS library test when using system zlib. 2019-12-17 15:10:13 +02:00
Michael Brockus 585ccfc789 Clean MSI generator Try 2 [skip ci] 2019-12-16 18:33:54 +02:00
Daniel Mensinger eb67fb1d97 default inc dirs: Fix warning on MSYS (fixes #6336) 2019-12-15 13:25:16 +02:00
Michael Hirsch, Ph.D d8921f15a3 ci: type hint checking for compilers/mixins/intel.py 2019-12-14 23:35:07 +02:00
Michael Hirsch, Ph.D 0b7fe3f78a intel/intel-cl: handle arguments in intel-specific way
intel compiler's defaults are different enough from MSVC and GNU
that it's necessary to set specific defaults for Intel compilers.

This corrects/improves behaviors initially addressed in  b1c8f765fa
2019-12-14 23:35:07 +02:00
Dylan Baker 31bb6eae45 run_tests.py: use mlog.log_once to avoid spamming ninja < 1.9 warnings 2019-12-13 09:57:05 -05:00
Dylan Baker 7f0224fb88 compilers: make use of mlog.log_once
I'm sure there are other places that could use this, but I didn't see
any right off that bat.
2019-12-13 09:57:05 -05:00
Dylan Baker 614372aa55 mlog: Add a log_once function
There are a number of cases where we end up spamming users with the same
message over and over again, which is really annoying. This solves that.
2019-12-13 09:57:05 -05:00
Dylan Baker eb30c493f6 mlog: remove incorrect uses of global keyword
global is only needed to allow replacement of global values, they're
always in scope to read.
2019-12-13 09:57:05 -05:00
Xavier Claessens a4bb0928e3 summary: Add 'Subprojects' section to main project 2019-12-12 18:30:17 -05:00
Xavier Claessens 38953d8ee3 summary: Add bool_yn keyword argument 2019-12-12 18:30:17 -05:00
Xavier Claessens 49082f9669 summary: Allow section with no title, and passing key/value separately 2019-12-12 18:30:17 -05:00
Xavier Claessens 6e865a2330 Add a summary() function for configuration summarization
Based on patch from Dylan Baker.

Fixes #757
2019-12-12 18:30:17 -05:00
Paolo Bonzini 3778a34979 mintro: include test protocol in introspection data 2019-12-13 00:47:10 +02:00
Michael Hirsch, Ph.D 9371965132 ci fortran: add case where buildtype=release and warning_level=3
this can find issues with non-default build options
2019-12-13 00:45:49 +02:00
Dylan Baker 47dfe34c85 Consider compiler arguments in linker detection logic
If a user passes -fuse-ld=gold to gcc or clang, they expect that they'll
get ld.gold, not whatever the default is. Meson currently doesn't do
that, because it doesn't pass these arguments to the linker detection
logic. This patch fixes that. Another case that this is needed is with
clang's --target option

This is a bad solution, honestly, and it would be better to use $LD or a
cross/native file but this is needed for backwards compatability.

Fixes #6057
2019-12-12 10:57:27 -08:00
Dylan Baker 87766b3727 Allow setting <lang>_args before the compiler is detected
This is required to be able to pass compiler and linker arguments to the
methods that try to guess what linker to use.
2019-12-12 10:52:07 -08:00
Dylan Baker 7460e4ccda compilers: Make get_display_language a class or static method
Currently this is done at the instance level, but we need it at the
class level to allow compiler "lang" args to be gotten early enough.
This patch also removes a couple of instance of branch/leaf classes
providing their own implementation that is identical to the Compiler
version.
2019-12-12 09:35:32 -08:00
Dylan Baker ee6e249f65 compilers: move language attribute to the class level
We know that if a compiler class inherits CCompiler it's language will
be C, so doing this at the class level makes more sense.
2019-12-12 09:35:30 -08:00
ePirat 0bf8862beb docs: Fix wrong example for shaderc dependency [skip ci]
The example is meant for wxWidgets not Shaderc.
2019-12-12 10:44:12 -05:00
Jussi Pakkanen 17dd9e5bff
Merge pull request #6207 from dcbaker/linker-option
Add a way to select the dynamic linker meson uses
2019-12-11 23:29:33 +02:00
Jonathan Perkin c3d0b95a58 dependencies: Fix executable file test on Unix.
access(2) tests for X_OK that return true do not always guarantee that
the file is executable.  Instead check the stat(2) mode bits explicitly.

This fixes any builds or installs executed as root on Solaris and
illumos that contain non-executable scripts.
2019-12-11 22:39:29 +02:00
Xavier Claessens 5031f4981d dist: Fix --include-subprojects when .wrap file has directory value 2019-12-10 22:19:00 +02:00
Daniel Mensinger fc800a2cb8 mintro: Add version key to --scan-dependencies (fixes #6287) 2019-12-10 20:17:21 +02:00
Daniel Mensinger 38d3fbca94 dep: Try extraframework before cmake (fixes #6113) 2019-12-10 20:00:14 +02:00
Michael Hirsch, Ph.D 5da1a6e586 cmake: subprocess external .decode(errors='ignore') to avoid traceback
mesonlib.Popen_safe() doesn't work with the case where undecodeable
binary data comes back from CMake or compiler, so we use subprocess.run()
2019-12-10 19:57:51 +02:00
Marc Herbert f2ad800408 docs: explain cross-compilation names sooner [skip ci]
Meson's documentation about cross-compilation made me finally understand
why the typical confusion about machine names. Thanks, but let's make it
even better. Don't wait until the very end of the section to reveal the
most important information: that machine names are relative. For
suspense we already have TV shows; spill the beans much earlier.

Also fix the first, simplest cross-compilation example: target is
irrelevant.
2019-12-10 18:21:14 +02:00
Xavier Claessens 1dda7cde39 run_unittests: Disable pytest with python <= 3.5
It's causing issues in some CI runners, it looks like it could be that
bug: https://github.com/pytest-dev/pytest-xdist/issues/204.
2019-12-10 18:02:41 +02:00
Xavier Claessens 552e78da4d assert(): Make message argument optional 2019-12-10 18:02:41 +02:00
Daniel Mensinger 9c72d0fdb2 azure: Fix vs2015 2019-12-09 17:19:01 +01:00
Michael Hirsch, Ph.D 6eb67ee848 cmake test: skip case where Cmake backend not Fortran-compatible 2019-12-09 11:15:58 -05:00
Michael Hirsch, Ph.D 98fd4e5557 cmake: add project language to cmakelists.txt
cmake: get language from Meson project if not specified as depedency(..., langugage: ...)

deps: add threads method:cmake

dependency('threads', method: 'cmake') is useful for cmake unit tests
or those who just want to find threads using cmake.

cmake: project(... Fortran) generally also requires C language
2019-12-09 11:15:58 -05:00
Michael Hirsch, Ph.D 419a7a8f51 cmake: add fortran cache content 2019-12-09 11:15:58 -05:00
Xavier Claessens 162d2bcc71 run_command: Do not add dependency on /dev/stdout
Blacklist /dev paths, this fix infinite reconfigure when /dev/stdout is
redirected to a file.

Fixes: #6315.
2019-12-09 18:05:18 +02:00
Xavier Claessens 1298f71b1c dist: Add --include-subprojects option 2019-12-08 20:21:43 +02:00
Ken Gilmer f7d54c96c1 Add brief description of configuring Vala's preprocessor via the add_project_arguments() function. [skip ci] 2019-12-07 23:34:32 +02:00
Jussi Pakkanen a17746e2ab Fix typing import bug. 2019-12-07 22:36:07 +02:00