Commit Graph

9810 Commits

Author SHA1 Message Date
Dylan Baker 87248d9020 mdist: actually constrain the choices of the --formats option
Since we already have that list available.
2020-09-22 16:58:08 -07:00
Dylan Baker ecefe45f8e zsh: Add ability to complete depedency paths
using , separated syntax
2020-09-22 16:58:08 -07:00
Dylan Baker 670bc63fda zsh: add missing options for meson introspect 2020-09-22 16:08:45 -07:00
Dylan Baker f2572ea077 zsh: share common options between meson configure and meson setup 2020-09-22 16:07:09 -07:00
Dylan Baker 84d5233b5f zsh: Add missing options for meson setup 2020-09-22 16:01:50 -07:00
Dylan Baker 250c4463b4 zsh: remove binaries that are not longer installed 2020-09-22 16:01:34 -07:00
Nirbheek Chauhan 94ea9d97be docs: Clarify what literal strings mean [skip ci]
Someone on IRC was confused by this paragraph.
2020-09-21 15:36:24 +05:30
Jussi Pakkanen 13a8e1d26e Improve docs for creating new wraps. [skip ci] 2020-09-21 01:48:30 +03:00
Dylan Baker 007ece4659 pylint: Turn on a few more good warnings 2020-09-18 14:49:58 -07:00
Dylan Baker cb0265a6b2 pylint: Catch cases of `if len(container)` which should be replaced by `if container`
Unfortunately this doesn't catch other abuses of len(continauer) like,
`len(container) <comparator> 0`, see: https://github.com/PyCQA/pylint/issues/3751
2020-09-18 14:49:58 -07:00
Sebastian Meyer 35a5a69355 Some fixes for CompCert
1. Like with gcc's `ld`, also use the `group_start` code to create a
   `--start-group`/`--end-group`
2. xc16 tricked into believing the 'link_whole' was about `--*-group`,
   but it should use gcc's `--whole-archive` instead.
3. Not clear what the get_lib_prefix should really do, but for picolibc
   it seems I want just `''`.

The problem with picolibc was that the `-l` would be prefixed to a lib
like `picolib/libm/libm.a`. Though of course the `-l` would be necessary
for just a plain `m` (that's what I assumed this would be used for).
I think this might need some clarification from the meson devs ;-)
2020-09-18 08:59:39 -07:00
Martin Storsjö 9d8906363e Support identifying msvc dependency prefix with a path starting with a backslash 2020-09-18 05:30:49 +00:00
Xavier Claessens 17f07a53d0 msubprojects: Fix unit tests on Windows 2020-09-18 03:01:15 +00:00
Xavier Claessens da72e6284e msubprojects: Revert back to rev-parse instead of --show-current
It is undocumented in manpage, but --show-current is new in git 2.22
which is too recent for distros we want to support like Ubuntu 18.04.
2020-09-18 03:01:15 +00:00
Xavier Claessens e0cd54a322 msubprojects: Stop trying to guess subproject type
It was done to include them in `meson subprojects foreach` without
--types argument, but it's better to special case missing --types and
include wraps that have type=None too. It was a bad idea because that
was messing them in `meson subprojects update`, now they are ignored by
that command.
2020-09-18 03:01:15 +00:00
Xavier Claessens c203e2f92b msubprojects: Add basic unit tests 2020-09-18 03:01:15 +00:00
Xavier Claessens 6fbf368fde msubprojects: Avoid useless "no local changes to save" message 2020-09-18 03:01:15 +00:00
Xavier Claessens ce347f2f8c msubprojects: Fix checkout of new tag/branch
If revision is a tag that does not exist locally, `git fetch origin
<revision>` won't create it and checkout will fail. Using --refmap
ensures that references exists locally.
2020-09-18 03:01:15 +00:00
Xavier Claessens 49b61e476f msubprojects: Fix --types default value 2020-09-18 03:01:15 +00:00
Nirbheek Chauhan faba48d853 backends: Treat build target as generator only when it's the first arg
Otherwise it might be an argument to a script that just inspects the
binary itself.
2020-09-17 22:25:37 +00:00
Nirbheek Chauhan 9b8ac9db32 project tests: Verify that UWP cross binaries use the right arch
This is a test for https://github.com/mesonbuild/meson/pull/7021, to
verify that `link.exe` uses the correct architecture when targeting
ARM64. Can be extended to other cross targets later.
2020-09-17 22:25:37 +00:00
Nirbheek Chauhan 946aeb6947 project tests: Also check whether introspect works 2020-09-17 22:25:37 +00:00
Nirbheek Chauhan 85d036ebbb Rename [properties] to [built-in options]
This is the new syntax. Avoids loud deprecation warnings.
2020-09-17 22:25:37 +00:00
Nirbheek Chauhan 4c93da6531 project tests: Rename a variable for clarity 2020-09-17 22:25:37 +00:00
Nirbheek Chauhan ea46daa7bc Revert "windows: reduce chance of going over path limit in backend/vs"
This reverts commit 807f88739e.
2020-09-17 20:39:37 +00:00
Dylan Baker e9fea0fecf unittests: mock os.environ before mucking with it 2020-09-17 11:26:50 +00:00
Dylan Baker 80ec7ec681 tests: Make monkey patching smarter
There are two problems here. The first is that we're doing manual monkey
patching which is fragile and verbose, when unittest.mock is designed
specifically to solve this exact problem. The second is that we're
monkey patching os.environ at two different levels with the same
information. So let's only do it once.
2020-09-17 11:26:50 +00:00
Peter Harris 807f88739e windows: reduce chance of going over path limit in backend/vs
When building with vs2019 (not ninja), a path length error will be thrown
if the path to a resource file is even remotely deep within the tree.

This is largely because the target name includes the string "Windows
resource for file 'full path'", which is then expanded twice (once for
the .vcxproj itself, and once for IntDir) and added to the full path.
When combined with the tiny path limits on Windows, it is easy to exceed
path limits.

This error is largely avoided by the ninja back-end. Unlike the
vs back-end, the ninja back-end does not use target.get_id() as part of
the project file path, nor does it use target.get_id() as part of
get_target_private_dir().

Example error:

error MSB4184: The expression "[MSBuild]::NormalizePath(
C:\src\mesonbuild\Misc\FreeRDP-master\client\X11\xfreerdp\xfreerdp,
f3f7317@@Windows resource for file
'Misc_FreeRDP-master_client_X11_xfreerdp_xfreerdp_xfreerdp.rc'@cus\,
f3f7317@@Windows resource for file
'Misc_FreeRDP-master_client_X11_xfreerdp_xfreerdp_xfreerdp.rc'@cus.
vcxproj.CopyComplete)" cannot be evaluated. Path:
C:\src\mesonbuild\Misc\FreeRDP-master\client\X11\xfreerdp\xfreerdp\f3f7317
@@Windows resource for file
'Misc_FreeRDP-master_client_X11_xfreerdp_xfreerdp_xfreerdp.rc'@cus\f3f7317
@@Windows resource for file
'Misc_FreeRDP-master_client_X11_xfreerdp_xfreerdp_xfreerdp.rc'@cus.
vcxproj.CopyComplete exceeds the OS max path limit.
The fully qualified file name must be less than 260 characters.
2020-09-17 11:24:53 +00:00
Martin Storsjö deb1d7caba Canonicalize target architectures aarch64/armv* into arm64/arm for MSVC tools
If the architectures are taken from the output of "clang-cl --version",
we need to convert these names into names that the MSVC tools accept
as the -machine: parameter.
2020-09-17 11:23:36 +00:00
Marco Mastropaolo 93b1d31af9 Fixed MacOS dylib custom targets not marked as linkable 2020-09-17 11:22:41 +00:00
Dylan Baker 3526b36a77 linkers: fully type annotate and fix mypy issues
This makes GnuDynamicLinker not suitable for instantiation, so the tests
need to be changed to use the BFD class.
2020-09-16 20:28:56 -07:00
Dylan Baker 4401668c9a linkers/compilers: Move an emscripten method to the compiler
This needed an attribute the linker doesn't have.
2020-09-16 20:28:56 -07:00
Dylan Baker 67ab2880dd linkers: Make id a class variable for DynamicLinkers
Originally I had this idea that you'd be able to pass the id in to be
able to deduplicate some cases (like ld.gold and ld.bfd). That went away
because it ended up being really un-dry, but this id per instance
remained. Getting rid of it allows us to get rid of a bunch of otherwise
useless super calls, which makes adding type annotations easier.
2020-09-16 20:28:56 -07:00
Dylan Baker fc86df3d2c linkers: Fix argument error
The name of the argument passed was not the name of the argument used.
2020-09-16 20:28:56 -07:00
Dylan Baker a4a53237f1 envconfig: fix return type of get_env_var_pair
It doesn't return (None, None), it returns just None.
2020-09-16 01:32:19 +03:00
Sebastian Meyer a24fde6fde
Add support for the CompCert C Compiler
* Add preliminary support for the CompCert C Compiler

The intention is to use this with the picolibc, so some GCC flags are
automatically filtered. Since CompCert uses GCC is for linking, those
GCC-linker flags which are used by picolibc, are automatically prefixed
with '-WUl', so that they're passed to GCC.

Squashed commit of the following:

commit 4e0ad66dca9de301d2e41e74aea4142afbd1da7d
Author: Sebastian Meyer <meyer@absint.com>
Date:   Mon Aug 31 14:20:39 2020 +0200

    remove '-fall' from default arguments, also filter -ftls-model=.*

commit 41afa3ccc62ae72824eb319cb8b34b7e6693cb67
Author: Sebastian Meyer <meyer@absint.com>
Date:   Mon Aug 31 14:13:55 2020 +0200

    use regex for filtering ccomp args

commit d68d242d0ad22f8bf53923ce849da9b86b696a75
Author: Sebastian Meyer <meyer@absint.com>
Date:   Mon Aug 31 13:54:36 2020 +0200

    filter some gcc arguments

commit 982a01756266bddbbd211c54e8dbfa2f43dec38f
Author: Sebastian Meyer <meyer@absint.com>
Date:   Fri Aug 28 15:03:14 2020 +0200

    fix ccomp meson configuration

commit dce0bea00b1caa094b1ed0c6c77cf6c12f0f58d9
Author: Sebastian Meyer <meyer@absint.com>
Date:   Thu Aug 27 13:02:19 2020 +0200

    add CompCert to meson (does not fully work, yet)

* remove unused import and s/cls/self/

fixes the two obvious LGTM warnings

* CompCert: Do not ignore unsupported GCC flags

Some are safe to ignore, however, as per
https://github.com/mesonbuild/meson/pull/7674, they should not be
ignored by meson itself. Instead the meson.build should take care to
select only those which are actually supported by the compiler.

* remove unused variable

* Only add arguments once.

* Apply suggestions from code review

Co-authored-by: Dylan Baker <dylan@pnwbakers.com>

* Remove erroneous ' ' from '-o {}'.format()

As noticed by @dcbaker

* added release note snippet for compcert

* properly split parameters

As suggested by @dcbaker, these parameters should be properly split into multiple strings.

Co-authored-by: Dylan Baker <dylan@pnwbakers.com>

* Update add_compcert_compiler.md

Added a sentence about the state of the implementation (experimental); use proper markdown

* properly separate arguments

Co-authored-by: Dylan Baker <dylan@pnwbakers.com>
2020-09-15 21:51:21 +03:00
Xavier Claessens 67c0ec1640 InternalDependency: Add as_link_whole() method 2020-09-14 20:32:22 -04:00
Christoph Reiter b872eea27f
CI: don't update MSYS2 [skip ci]
This should use the package database from the installer,
from the release choco provides and result in fewer potential
changes overall.
2020-09-15 01:51:38 +03:00
Dylan Baker 60f78e7981
CODEOWNERS: add dcbaker for compilers and linkers [skip ci]
I probably know more about that code than anyone else, so I'm probably
the right person to be reviewing stuff in there.
2020-09-15 00:13:53 +03:00
Xavier Claessens 8972c71522 externalproject: Fix typing annotation 2020-09-13 17:33:00 -04:00
Xavier Claessens 6ec0b535ba external-project: Add typing annotation 2020-09-13 13:54:47 -04:00
Xavier Claessens 9d338200da external-project: New module to build configure/make projects
This adds an experimental meson module to build projects with other
build systems.

Closes: #4316
2020-09-13 13:54:47 -04:00
Xavier Claessens 19696c3dcd Allow installing dir from build dir 2020-09-13 13:54:47 -04:00
Nirbheek Chauhan 7fbdf38ce3 mcompile: Add some basic XCode support
I wrote this to convert run_tests.get_backend_commands() over to the
new meson wrappers, but that turned out to be harder than I expected,
so just splitting this out for now.
2020-09-13 20:44:30 +03:00
Tamás Bálint Misius 9d017a9c15 Improve regexp for MSVC target arch detection again 2020-09-13 06:27:57 +00:00
Vili Väinölä 416b47c915 Remove redudant checks in vs2010 backend
- Implicit include dirs was checked twice in a row
- Add define only if it does not yet exist rather than remove.
2020-09-13 06:27:00 +00:00
Vili Väinölä 25ad10e501 Add VS include directories to projects as well
- "Go To Document" action previously only worked
on c/cpp files which had the include directories
 set but it was not possible to move from header to another header.
2020-09-13 06:27:00 +00:00
Nirbheek Chauhan 1945f381b2 unit tests: Print total time taken for running tests 2020-09-11 23:27:15 +00:00
Nirbheek Chauhan c7adeac137 unit tests: Don't use pytest when running single tests
On my machine this spawns 24 processes and then runs like the single
test I asked it to run. With this change, running a single test goes
from 7 seconds to less than a second.
2020-09-11 23:27:15 +00:00
Jon Turney 6053da7a00 Add build machine compilers to project tests compiler report
When cross-compiling, also report build machine compilers in the
compiler report produced by run_project_tests.py
2020-09-11 20:45:09 +00:00