aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
AgeCommit message (Collapse)AuthorFilesLines
2019-12-18linkers: Remove get_allow_undefined_args from link.exeDylan Baker1-2/+1
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-18PkgConfigDependency: Sort -L flags according to PKG_CONFIG_PATHTing-Wei Lan1-0/+40
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-18python: add embed to the python dependency functionDaniel Mensinger2-9/+16
2019-12-18Merge pull request #4649 from dcbaker/summary-functionJussi Pakkanen2-6/+108
Add a summary() function for configuration summarization
2019-12-17Merge pull request #6065 from dcbaker/pass-options-to-linker-detectionJussi Pakkanen17-135/+156
Pass options to linker detection
2019-12-17Fail gracefully detecting hdf5 if pkg-config is not available.Jussi Pakkanen1-8/+11
2019-12-15default inc dirs: Fix warning on MSYS (fixes #6336)Daniel Mensinger1-5/+8
2019-12-14intel/intel-cl: handle arguments in intel-specific wayMichael Hirsch, Ph.D1-20/+38
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 b1c8f765fa6e2a
2019-12-13compilers: make use of mlog.log_onceDylan Baker2-6/+2
I'm sure there are other places that could use this, but I didn't see any right off that bat.
2019-12-13mlog: Add a log_once functionDylan Baker1-10/+38
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-13mlog: remove incorrect uses of global keywordDylan Baker1-2/+0
global is only needed to allow replacement of global values, they're always in scope to read.
2019-12-12summary: Add 'Subprojects' section to main projectXavier Claessens1-4/+20
2019-12-12summary: Add bool_yn keyword argumentXavier Claessens1-6/+13
2019-12-12summary: Allow section with no title, and passing key/value separatelyXavier Claessens1-8/+24
2019-12-12Add a summary() function for configuration summarizationXavier Claessens2-2/+65
Based on patch from Dylan Baker. Fixes #757
2019-12-13mintro: include test protocol in introspection dataPaolo Bonzini1-0/+1
2019-12-12Consider compiler arguments in linker detection logicDylan Baker5-17/+23
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-12Allow setting <lang>_args before the compiler is detectedDylan Baker3-99/+102
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-12compilers: Make get_display_language a class or static methodDylan Baker7-12/+11
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-12compilers: move language attribute to the class levelDylan Baker12-13/+26
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-11Merge pull request #6207 from dcbaker/linker-optionJussi Pakkanen8-142/+215
Add a way to select the dynamic linker meson uses
2019-12-11dependencies: Fix executable file test on Unix.Jonathan Perkin1-1/+3
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-10dist: Fix --include-subprojects when .wrap file has directory valueXavier Claessens2-15/+23
2019-12-10mintro: Add version key to --scan-dependencies (fixes #6287)Daniel Mensinger2-2/+14
2019-12-10dep: Try extraframework before cmake (fixes #6113)Daniel Mensinger1-1/+3
2019-12-10cmake: subprocess external .decode(errors='ignore') to avoid tracebackMichael Hirsch, Ph.D1-9/+14
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-10assert(): Make message argument optionalXavier Claessens2-7/+20
2019-12-09cmake: add project language to cmakelists.txtMichael Hirsch, Ph.D4-14/+87
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-09cmake: add fortran cache contentMichael Hirsch, Ph.D1-15/+37
2019-12-09run_command: Do not add dependency on /dev/stdoutXavier Claessens1-1/+1
Blacklist /dev paths, this fix infinite reconfigure when /dev/stdout is redirected to a file. Fixes: #6315.
2019-12-08dist: Add --include-subprojects optionXavier Claessens1-8/+36
2019-12-07Fix typing import bug.Jussi Pakkanen1-1/+1
2019-12-07types: Add type annotations to mintro.pyDaniel Mensinger1-120/+93
2019-12-07Merge pull request #6228 from scivision/scalapackJussi Pakkanen3-4/+131
deps: add Scalapack
2019-12-07catch malformed command line array option with helpful errorMichael Hirsch, Ph.D1-1/+4
fixes #6291
2019-12-07type annoMichael Hirsch, Ph.D1-2/+2
2019-12-06Update Python2 syntax to Python3 syntax in WrapMichael Brockus2-10/+10
2019-12-05wrap: check whitelist subdomainMichael Hirsch, Ph.D1-18/+26
wrap: add imposter URL test this test shows that meson wrap subsystem historically allows imposter URLs like https://wrapdb.mesonwrap.com.evil/v1/foo.zip while the new code does no.
2019-12-05rpm: update for host machine compiler API changeMichael Hirsch, Ph.D1-1/+1
2019-12-05wrap: raise WrapException instead of Python exception when program not availableMichael Hirsch, Ph.D1-23/+36
2019-12-05use WrapDB domain whitelist, don't fallback to non-SSL when SSL availableMichael Hirsch, Ph.D1-12/+19
In my opinion, we should not fall back to http:// from the SSL HSTS WrapDB URL, **for systems that have Python SSL** as that is controverting the point of HSTS + SSL. For systems that do not have Python SSL, they continue to work with a colored mlog.warning instead of only a stderr console print. attempt to stop masquerade URLS containing wrapdb.mesonbuild.com.evil.stuff.com
2019-12-05doc: py35 deprecation commentsMichael Hirsch, Ph.D1-1/+2
2019-12-05find_program(): Add 'dirs' keyword argumentXavier Claessens2-17/+35
Fixes: #1576
2019-12-05interpreter: Remove useless checkXavier Claessens1-2/+0
extract_required_kwarg() above already ensure that required is always boolean at that point.
2019-12-05Partially revert "lgtm: fix Missing call to __init__ during object ↵Dylan Baker1-19/+16
initialization" This partially reverts commit fe853ee516e1e7b392753a6e8f1f0b9cad6fb54f. In particular this reverts the changes to the DynamicLinker __init__ methods. Frankly this is *bad* because it allows a mixin class (which should not be directly instantiated) to be directly instantiated, and complicates the init process. It also increases the amount of code for zero gain, and makes the code less resilient to refactors.
2019-12-05compilers: Rework the CompilerArgs to be less awfulDylan Baker1-71/+73
There are two awful things about CompilerArgs, one is that it directly inherits from list, and there are a lot of subtle gotcahs with inheriting from builtin types. The second is that the class allows arguments to be passed in whatever order. That's bad. This also fully annotates the CompilerArgs class, so mypy can type check it for us.
2019-12-05compilers: use import typing instead of from typing importDylan Baker1-44/+47
`from foo import` should be used sparingly because of namespace pollution, especially since those names will be exported unconditionally. For typing this is extra annoying because anytime someone wants to use another symbol from the typing module they have to add it to the import line. Use `import typing` to avoid all of this.
2019-12-05build: Fix type signature of rich comparison dundersDylan Baker1-4/+12
There are three problems: 1) Dunders like `__lt__` and `__gt__` don't return bool, they return either a bool or the NotImplemented singleton to signal that they don't know how to be compared. 2) The don't take type object, the take `typing.Any` 3) They need to return NotImplemented if the comparison is not implemented, this allows python to try the inverse dunder from the other object. If that object returns NotImplemented as well a TypeError is raised.
2019-12-05Fix 'meson subprojects foreach' when command returns non-zero exit codeAntonio Ospite1-4/+10
The 'output' field of the subprocess.CalledProcessError exception is valid only when subprocess.check_output() is called, trying to access it after calling subprocess.check_call() results in an unwanted exception when commands return non-zero exit code, e.g.: ----------------------------------------------------------------------- $ meson subprojects foreach false Executing command in ./subprojects/sqlite-amalgamation-3250100 -> Not downloaded yet Executing command in ./subprojects/gstreamer Traceback (most recent call last): File "/home/ao2/meson/meson/mesonbuild/msubprojects.py", line 177, in foreach subprocess.check_call([options.command] + options.args, cwd=repo_dir) File "/usr/lib/python3.7/subprocess.py", line 363, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['false']' returned non-zero exit status 1. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ao2/meson/meson/mesonbuild/mesonmain.py", line 129, in run return options.run_func(options) File "/home/ao2/meson/meson/mesonbuild/msubprojects.py", line 248, in run options.subprojects_func(wrap, repo_dir, options) File "/home/ao2/meson/meson/mesonbuild/msubprojects.py", line 180, in foreach out = e.output.decode().strip() AttributeError: 'NoneType' object has no attribute 'decode' ----------------------------------------------------------------------- Use subprocess.check_output() instead and behave more like git commands in handling stderr. This makes it possible to actually run commands on all subprojects allowing them to fail on some subprojects and succeed on others. Also catch the case of missing commands and print an error message in this case as well.
2019-12-05Clean stray .o file that LDC creates during tests.Jussi Pakkanen1-0/+8