diff -Nru meson-0.53.2/cross/armclang-linux.txt meson-0.52.1/cross/armclang-linux.txt --- meson-0.53.2/cross/armclang-linux.txt 2020-01-07 19:29:59.000000000 +0000 +++ meson-0.52.1/cross/armclang-linux.txt 2019-08-28 17:15:38.000000000 +0000 @@ -26,7 +26,7 @@ [properties] -c_args = ['--target=aarch64-arm-none-eabi'] +#c_args = ['--target=aarch64-arm-none-eabi'] [host_machine] system = 'baremetal' diff -Nru meson-0.53.2/cross/ccrx.txt meson-0.52.1/cross/ccrx.txt --- meson-0.53.2/cross/ccrx.txt 2020-02-25 18:00:46.000000000 +0000 +++ meson-0.52.1/cross/ccrx.txt 2018-12-09 14:27:16.000000000 +0000 @@ -10,13 +10,11 @@ [properties] # The '--cpu' option with the appropriate target type should be mentioned # to cross compile c/c++ code with ccrx,. -c_args = ['-cpu=rx600'] -cpp_args = ['-cpu=rx600'] -c_link_args = [] -cpp_link_args = [] +c_args = ['--cpu=rx600'] +cpp_args = ['--cpu=rx600'] [host_machine] -system = 'bare metal' +system = 'bare metal' # Update with your system name - bare metal/OS. cpu_family = 'rx' cpu = 'rx600' endian = 'little' diff -Nru meson-0.53.2/cross/linux-mingw-w64-32bit.txt meson-0.52.1/cross/linux-mingw-w64-32bit.txt --- meson-0.53.2/cross/linux-mingw-w64-32bit.txt 2020-01-23 22:34:28.000000000 +0000 +++ meson-0.52.1/cross/linux-mingw-w64-32bit.txt 2018-08-25 08:05:43.000000000 +0000 @@ -6,7 +6,6 @@ pkgconfig = '/usr/bin/i686-w64-mingw32-pkg-config' windres = '/usr/bin/i686-w64-mingw32-windres' exe_wrapper = 'wine' -ld = '/usr/bin/i686-w64-mingw32-ld' [properties] # Directory that contains 'bin', 'lib', etc diff -Nru meson-0.53.2/cross/ubuntu-armhf.txt meson-0.52.1/cross/ubuntu-armhf.txt --- meson-0.53.2/cross/ubuntu-armhf.txt 2020-01-23 22:34:28.000000000 +0000 +++ meson-0.52.1/cross/ubuntu-armhf.txt 2019-08-25 22:36:06.000000000 +0000 @@ -7,7 +7,6 @@ ar = '/usr/arm-linux-gnueabihf/bin/ar' strip = '/usr/arm-linux-gnueabihf/bin/strip' pkgconfig = '/usr/bin/arm-linux-gnueabihf-pkg-config' -ld = '/usr/bin/arm-linux/gnueabihf-ld' [properties] root = '/usr/arm-linux-gnueabihf' diff -Nru meson-0.53.2/data/syntax-highlighting/vim/ftplugin/meson.vim meson-0.52.1/data/syntax-highlighting/vim/ftplugin/meson.vim --- meson-0.53.2/data/syntax-highlighting/vim/ftplugin/meson.vim 2019-12-04 18:45:50.000000000 +0000 +++ meson-0.52.1/data/syntax-highlighting/vim/ftplugin/meson.vim 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,5 @@ " Vim filetype plugin file " Language: meson -" License: VIM License " Original Author: Laurent Pinchart " Last Change: 2018 Nov 27 @@ -9,9 +8,6 @@ let s:keepcpo= &cpo set cpo&vim -setlocal commentstring=#\ %s -setlocal comments=:# - setlocal shiftwidth=2 setlocal softtabstop=2 diff -Nru meson-0.53.2/data/syntax-highlighting/vim/indent/meson.vim meson-0.52.1/data/syntax-highlighting/vim/indent/meson.vim --- meson-0.53.2/data/syntax-highlighting/vim/indent/meson.vim 2019-12-04 18:45:50.000000000 +0000 +++ meson-0.52.1/data/syntax-highlighting/vim/indent/meson.vim 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,5 @@ " Vim indent file " Language: Meson -" License: VIM License " Maintainer: Nirbheek Chauhan " Original Authors: David Bustos " Bram Moolenaar diff -Nru meson-0.53.2/data/syntax-highlighting/vim/syntax/meson.vim meson-0.52.1/data/syntax-highlighting/vim/syntax/meson.vim --- meson-0.53.2/data/syntax-highlighting/vim/syntax/meson.vim 2019-12-29 22:47:27.000000000 +0000 +++ meson-0.52.1/data/syntax-highlighting/vim/syntax/meson.vim 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,5 @@ " Vim syntax file " Language: Meson -" License: VIM License " Maintainer: Nirbheek Chauhan " Last Change: 2016 Dec 7 " Credits: Zvezdan Petkovic @@ -28,7 +27,7 @@ " We need nocompatible mode in order to continue lines with backslashes. " Original setting will be restored. let s:cpo_save = &cpo -set cpo&vim +setlocal cpo&vim " http://mesonbuild.com/Syntax.html syn keyword mesonConditional elif else if endif @@ -117,7 +116,6 @@ \ subdir \ subdir_done \ subproject - \ summary \ target_machine \ test \ vcs_tag diff -Nru meson-0.53.2/debian/changelog meson-0.52.1/debian/changelog --- meson-0.53.2/debian/changelog 2020-06-09 13:52:24.000000000 +0000 +++ meson-0.52.1/debian/changelog 2020-06-11 00:14:52.000000000 +0000 @@ -1,77 +1,8 @@ -meson (0.53.2-2ubuntu2~bionic2) bionic; urgency=medium +meson (0.52.1-1~bionic1) bionic; urgency=medium - * Build for Bionic + * build for bionic - -- Dan Streetman Tue, 09 Jun 2020 09:52:24 -0400 - -meson (0.53.2-2ubuntu2) focal; urgency=medium - - * Skip test cross on s390x, because arm toolchain is not available there. - - -- Gianfranco Costamagna Tue, 03 Mar 2020 08:59:51 +0100 - -meson (0.53.2-2ubuntu1) focal; urgency=medium - - * Merge from Debian unstable. Remaining changes: - - add debian/patches/6703.patch - - Allow stderr for new test - - depend on rustc and valac, so autopkgtests can pick them up - - -- Gianfranco Costamagna Mon, 02 Mar 2020 12:05:06 +0100 - -meson (0.53.2-2) unstable; urgency=medium - - * Fix autopkgtest dependencies. Closes: #952610 - - -- Jussi Pakkanen Sat, 29 Feb 2020 00:20:11 +0200 - -meson (0.53.2-1ubuntu4) focal; urgency=medium - - * Also allow stderr - - -- Gianfranco Costamagna Mon, 02 Mar 2020 11:58:04 +0100 - -meson (0.53.2-1ubuntu3) focal; urgency=medium - - * debian/patches/6703.patch - - use upstream proposed approach instead of use_python3_tests.patch - * Tweak debian tests/control to fix another test failure (Closes: #952610) - - patch taken from bug report - - -- Gianfranco Costamagna Mon, 02 Mar 2020 07:24:25 +0100 - -meson (0.53.2-1ubuntu1) focal; urgency=medium - - [ Stefano Rivera ] - * debian/patches/use_python3_tests.patch: - - Update use_python3_tests.patch to catch one more python binary use. - - [ Rico Tzschichholz ] - * debian/tests/control: - - Explicit depends on rustc and valac, so autopkgtests can pick it up - - -- Rico Tzschichholz Wed, 26 Feb 2020 12:42:13 +0100 - -meson (0.53.2-1) unstable; urgency=medium - - * New upstream release. Closes: #950020, #951487 - - -- Jussi Pakkanen Tue, 25 Feb 2020 18:02:37 +0200 - -meson (0.53.1-1) unstable; urgency=medium - - * New upstream release. Closes: #948611. - * Add cross build autopkgtest from Helmut Grohne. Closes: #948608 - - -- Jussi Pakkanen Fri, 24 Jan 2020 00:35:16 +0200 - -meson (0.53.0-1) unstable; urgency=medium - - * New upstream release. - * Disable tests that check home directory because it does - not seem to work under pbuilder. - - -- Jussi Pakkanen Tue, 07 Jan 2020 22:13:25 +0200 + -- Dan Streetman Wed, 10 Jun 2020 20:14:52 -0400 meson (0.52.1-1) unstable; urgency=medium diff -Nru meson-0.53.2/debian/control meson-0.52.1/debian/control --- meson-0.53.2/debian/control 2020-06-09 13:52:24.000000000 +0000 +++ meson-0.52.1/debian/control 2020-06-11 00:13:35.000000000 +0000 @@ -2,9 +2,9 @@ Maintainer: Jussi Pakkanen Section: devel Priority: optional -Standards-Version: 4.5.0 +Standards-Version: 4.4.1 Homepage: https://mesonbuild.com -X-Python3-Version: >= 3.7 +X-Python3-Version: >= 3.6 Rules-Requires-Root: no Build-Depends: debhelper (>= 11), python3:any (>= 3.5), @@ -48,7 +48,7 @@ # suite. Rust tests will be skipped if rustc is not available. This # stanza makes dep dep solver install rustc whenever it is available # and when not it installs a harmless filler package. - rustc [i386 amd64 arm64 armhf] | bash-doc , + rustc [i386 amd64] | bash-doc , python3-dev , cython3 , # GDC is available on all platforms but it only @@ -92,7 +92,6 @@ Depends: ${misc:Depends}, ${python3:Depends}, - python3.7, ninja-build(>=1.6), # python3-pkg-resources, Description: high-productivity build system diff -Nru meson-0.53.2/debian/patches/1-disable-openmpi.patch meson-0.52.1/debian/patches/1-disable-openmpi.patch --- meson-0.53.2/debian/patches/1-disable-openmpi.patch 2020-06-09 13:50:13.000000000 +0000 +++ meson-0.52.1/debian/patches/1-disable-openmpi.patch 2020-06-10 20:27:14.000000000 +0000 @@ -8,5 +8,5 @@ +error('MESON_SKIP_TEST openmpi binaries do not work when run in pbuilder for some reason.') + cc = meson.get_compiler('c') - mpic = dependency('mpi', language : 'c', required : false) - if not mpic.found() + + if build_machine.system() == 'windows' and cc.get_id() != 'msvc' diff -Nru meson-0.53.2/debian/patches/2-disable-rootdir-test.patch meson-0.52.1/debian/patches/2-disable-rootdir-test.patch --- meson-0.53.2/debian/patches/2-disable-rootdir-test.patch 2020-06-09 13:50:13.000000000 +0000 +++ meson-0.52.1/debian/patches/2-disable-rootdir-test.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -diff --git a/test cases/common/227 fs module/meson.build b/test cases/common/227 fs module/meson.build -index 8795ee00..e34572ef 100644 ---- a/test cases/common/227 fs module/meson.build -+++ b/test cases/common/227 fs module/meson.build -@@ -30,8 +30,11 @@ assert(fs.is_dir('subprojects'), 'Dir not detected correctly.') - assert(not fs.is_dir('meson.build'), 'File detected as a dir.') - assert(not fs.is_dir('nonexisting'), 'Bad path detected as a dir.') - --assert(fs.is_dir('~'), 'expanduser not working') --assert(not fs.is_file('~'), 'expanduser not working') -+# These don't work under pbuilder for some reason. -+# I have not been able to replicate this manually, -+# even with 'pbuilder login' -+#assert(fs.is_dir('~'), 'expanduser not working') -+#assert(not fs.is_file('~'), 'expanduser not working') - - original = 'foo.txt' - new = fs.replace_suffix(original, '.ini') diff -Nru meson-0.53.2/debian/patches/6703.patch meson-0.52.1/debian/patches/6703.patch --- meson-0.53.2/debian/patches/6703.patch 2020-06-09 13:50:13.000000000 +0000 +++ meson-0.52.1/debian/patches/6703.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -Origin: https://github.com/mesonbuild/meson/pull/6703 ---- meson-0.53.2.orig/run_unittests.py -+++ meson-0.53.2/run_unittests.py -@@ -6650,9 +6650,9 @@ class NativeFileTests(BasePlatformTests) - '--native-file', config, '--native-file', config2, - '-Dcase=find_program']) - -- def _simple_test(self, case, binary): -+ def _simple_test(self, case, binary, entry=None): - wrapper = self.helper_create_binary_wrapper(binary, version='12345') -- config = self.helper_create_native_file({'binaries': {binary: wrapper}}) -+ config = self.helper_create_native_file({'binaries': {entry or binary: wrapper}}) - self.init(self.testcase, extra_args=['--native-file', config, '-Dcase={}'.format(case)]) - - def test_find_program(self): -@@ -6675,16 +6675,21 @@ class NativeFileTests(BasePlatformTests) - # python module breaks. This is fine on other OSes because they - # don't need the extra indirection. - raise unittest.SkipTest('bat indirection breaks internal sanity checks.') -- if os.path.exists('/etc/debian_version'): -- rc = subprocess.call(['pkg-config', '--cflags', 'python2'], -- stdout=subprocess.DEVNULL, -- stderr=subprocess.DEVNULL) -- if rc != 0: -- # Python 2 will be removed in Debian Bullseye, thus we must -- # remove the build dependency on python2-dev. Keep the tests -- # but only run them if dev packages are available. -+ elif is_osx(): -+ binary = 'python' -+ else: -+ binary = 'python2' -+ -+ # We not have python2, check for it -+ for v in ['2', '2.7', '-2.7']: -+ rc = subprocess.call(['pkg-config', '--cflags', 'python{}'.format(v)], -+ stdout=subprocess.DEVNULL, -+ stderr=subprocess.DEVNULL) -+ if rc == 0: -+ break -+ else: - raise unittest.SkipTest('Not running Python 2 tests because dev packages not installed.') -- self._simple_test('python', 'python') -+ self._simple_test('python', binary, entry='python') - - @unittest.skipIf(is_windows(), 'Setting up multiple compilers on windows is hard') - @skip_if_env_set('CC') diff -Nru meson-0.53.2/debian/patches/series meson-0.52.1/debian/patches/series --- meson-0.53.2/debian/patches/series 2020-06-09 13:50:13.000000000 +0000 +++ meson-0.52.1/debian/patches/series 2020-06-10 20:27:14.000000000 +0000 @@ -1,3 +1 @@ 1-disable-openmpi.patch -2-disable-rootdir-test.patch -6703.patch diff -Nru meson-0.53.2/debian/tests/control meson-0.52.1/debian/tests/control --- meson-0.53.2/debian/tests/control 2020-06-09 13:50:13.000000000 +0000 +++ meson-0.52.1/debian/tests/control 2020-06-10 20:27:14.000000000 +0000 @@ -1,12 +1,8 @@ Tests: basicmeson -Depends: meson, g++ +Depends: meson, ninja-build, g++ Tests: clangmeson -Depends: meson, clang +Depends: meson, ninja-build, clang Tests: exhaustive -Depends: meson, @builddeps@, rustc, valac - -Tests: crossbuild -Depends: meson, g++, g++-arm-linux-gnueabihf -Restrictions: allow-stderr, skip-not-installable +Depends: meson, @builddeps@ diff -Nru meson-0.53.2/debian/tests/crossbuild meson-0.52.1/debian/tests/crossbuild --- meson-0.53.2/debian/tests/crossbuild 2020-06-09 13:50:13.000000000 +0000 +++ meson-0.52.1/debian/tests/crossbuild 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -#!/bin/sh - -set -e - -cd "${AUTOPKGTEST_TMP:-/tmp}" -mkdir testproject -cd testproject -cat >meson.build <main.c < -int main(int argc, char **argv) { - printf("Hello there.\n"); - return 0; -} -EOF -mkdir build -cd build -/usr/share/meson/debcrossgen --arch armhf -o cross-file.txt -meson --cross-file cross-file.txt .. -ninja diff -Nru meson-0.53.2/ghwt.py meson-0.52.1/ghwt.py --- meson-0.53.2/ghwt.py 2019-12-29 22:47:27.000000000 +0000 +++ meson-0.52.1/ghwt.py 2018-10-31 09:31:20.000000000 +0000 @@ -40,7 +40,7 @@ return 0 def unpack(sproj, branch, outdir): - subprocess.check_call(['git', 'clone', '-b', branch, 'https://github.com/mesonbuild/{}.git'.format(sproj), outdir]) + subprocess.check_call(['git', 'clone', '-b', branch, 'https://github.com/mesonbuild/%s.git' % sproj, outdir]) usfile = os.path.join(outdir, 'upstream.wrap') assert(os.path.isfile(usfile)) config = configparser.ConfigParser() @@ -82,7 +82,7 @@ if os.path.isdir(sproj_dir): print('Subproject is already there. To update, nuke the dir and reinstall.') return 1 - blist = gh_get('https://api.github.com/repos/mesonbuild/{}/branches'.format(sproj)) + blist = gh_get('https://api.github.com/repos/mesonbuild/%s/branches' % sproj) blist = [b['name'] for b in blist] blist = [b for b in blist if b != 'master'] blist.sort() diff -Nru meson-0.53.2/man/meson.1 meson-0.52.1/man/meson.1 --- meson-0.53.2/man/meson.1 2020-02-25 18:00:46.000000000 +0000 +++ meson-0.52.1/man/meson.1 2019-11-28 17:37:44.000000000 +0000 @@ -1,4 +1,4 @@ -.TH MESON "1" "February 2020" "meson 0.53.2" "User Commands" +.TH MESON "1" "November 2019" "meson 0.52.1" "User Commands" .SH NAME meson - a high productivity build system .SH DESCRIPTION diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/manual tests/10 svn wrap/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/manual tests/10 svn wrap/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/manual tests/10 svn wrap/prog.c" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/manual tests/10 svn wrap/prog.c" 2018-08-25 08:05:43.000000000 +0000 @@ -1,6 +1,6 @@ #include"subproj.h" -int main(void) { +int main(int argc, char **argv) { subproj_function(); return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/manual tests/11 wrap imposter/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/manual tests/11 wrap imposter/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/manual tests/11 wrap imposter/meson.build" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/manual tests/11 wrap imposter/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -project('evil URL') -# showing that new Meson wrap.py code tries to stop imposter WrapDB URLs -# a WrapException is raised. -# -# ERROR: https://wrapdb.mesonbuild.com.invalid/v1/projects/zlib/1.2.11/4/get_zip may be a WrapDB-impersonating URL -# - -subproject('zlib') \ No newline at end of file diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/manual tests/11 wrap imposter/subprojects/zlib.wrap" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/manual tests/11 wrap imposter/subprojects/zlib.wrap" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/manual tests/11 wrap imposter/subprojects/zlib.wrap" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/manual tests/11 wrap imposter/subprojects/zlib.wrap" 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -[wrap-file] -directory = zlib-1.2.8 - -source_url = https://zlib.net/zlib-1.2.11.tar.gz -source_filename = zlib-1.2.11.tar.gz -source_hash = c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1 - -patch_url = https://wrapdb.mesonbuild.com.invalid/v1/projects/zlib/1.2.11/4/get_zip -patch_filename = zlib-1.2.11-4-wrap.zip -patch_hash = 886b67480dbe73b406ad83a1dd6d9596f93089d90c220ccfc91944c95f1c68c4 \ No newline at end of file diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/manual tests/12 wrap mirror/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/manual tests/12 wrap mirror/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/manual tests/12 wrap mirror/meson.build" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/manual tests/12 wrap mirror/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -project('downloader') -# this test will timeout, showing that a subdomain isn't caught as masquarading url - -subproject('zlib') diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/manual tests/12 wrap mirror/subprojects/zlib.wrap" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/manual tests/12 wrap mirror/subprojects/zlib.wrap" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/manual tests/12 wrap mirror/subprojects/zlib.wrap" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/manual tests/12 wrap mirror/subprojects/zlib.wrap" 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -[wrap-file] -directory = zlib-1.2.8 - -source_url = https://zlib.net/zlib-1.2.11.tar.gz -source_filename = zlib-1.2.11.tar.gz -source_hash = c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1 - -patch_url = https://mirror1.wrapdb.mesonbuild.com/v1/projects/zlib/1.2.11/4/get_zip -patch_filename = zlib-1.2.11-4-wrap.zip -patch_hash = 886b67480dbe73b406ad83a1dd6d9596f93089d90c220ccfc91944c95f1c68c4 \ No newline at end of file diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/manual tests/1 wrap/main.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/manual tests/1 wrap/main.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/manual tests/1 wrap/main.c" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/manual tests/1 wrap/main.c" 2016-01-23 18:52:39.000000000 +0000 @@ -1,7 +1,7 @@ #include #include -int main(void) { +int main(int argc, char **argv) { sqlite3 *db; if(sqlite3_open(":memory:", &db) != SQLITE_OK) { printf("Sqlite failed.\n"); diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/manual tests/3 git wrap/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/manual tests/3 git wrap/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/manual tests/3 git wrap/prog.c" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/manual tests/3 git wrap/prog.c" 2016-01-23 18:52:39.000000000 +0000 @@ -1,6 +1,6 @@ #include"subproj.h" -int main(void) { +int main(int argc, char **argv) { subproj_function(); return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/manual tests/4 standalone binaries/myapp.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/manual tests/4 standalone binaries/myapp.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/manual tests/4 standalone binaries/myapp.cpp" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/manual tests/4 standalone binaries/myapp.cpp" 2016-01-23 18:52:39.000000000 +0000 @@ -3,7 +3,7 @@ #include #include -int main(void) { +int main(int argc, char *argv[]) { SDL_Surface *screenSurface; SDL_Event e; int keepGoing = 1; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/manual tests/5 rpm/main.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/manual tests/5 rpm/main.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/manual tests/5 rpm/main.c" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/manual tests/5 rpm/main.c" 2016-01-23 18:52:39.000000000 +0000 @@ -1,6 +1,6 @@ #include #include -int main(void) +int main(int argc, char **argv) { char *t = meson_print(); printf("%s", t); diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/manual tests/6 hg wrap/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/manual tests/6 hg wrap/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/manual tests/6 hg wrap/prog.c" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/manual tests/6 hg wrap/prog.c" 2016-11-27 18:42:05.000000000 +0000 @@ -1,6 +1,6 @@ #include"subproj.h" -int main(void) { +int main(int argc, char **argv) { subproj_function(); return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/manual tests/8 timeout/sleepprog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/manual tests/8 timeout/sleepprog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/manual tests/8 timeout/sleepprog.c" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/manual tests/8 timeout/sleepprog.c" 2016-01-23 18:52:39.000000000 +0000 @@ -1,6 +1,6 @@ #include -int main(void) { +int main(int argc, char **argv) { sleep(1000); return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/manual tests/9 nostdlib/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/manual tests/9 nostdlib/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/manual tests/9 nostdlib/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/manual tests/9 nostdlib/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,7 +1,7 @@ #include -int main(void) { +int main() { const char *message = "Hello without stdlib.\n"; return simple_print(message, simple_strlen(message)); } diff -Nru meson-0.53.2/mesonbuild/ast/interpreter.py meson-0.52.1/mesonbuild/ast/interpreter.py --- meson-0.53.2/mesonbuild/ast/interpreter.py 2020-01-23 12:51:19.000000000 +0000 +++ meson-0.52.1/mesonbuild/ast/interpreter.py 2019-11-28 17:37:44.000000000 +0000 @@ -35,7 +35,7 @@ ) import os, sys -import typing as T +from typing import List, Any, Optional class DontCareObject(interpreterbase.InterpreterObject): pass @@ -59,7 +59,7 @@ REMOVE_SOURCE = 1 class AstInterpreter(interpreterbase.InterpreterBase): - def __init__(self, source_root: str, subdir: str, visitors: T.Optional[T.List[AstVisitor]] = None): + def __init__(self, source_root: str, subdir: str, visitors: Optional[List[AstVisitor]] = None): super().__init__(source_root, subdir) self.visitors = visitors if visitors is not None else [] self.visited_subdirs = {} @@ -119,7 +119,6 @@ 'find_library': self.func_do_nothing, 'subdir_done': self.func_do_nothing, 'alias_target': self.func_do_nothing, - 'summary': self.func_do_nothing, }) def func_do_nothing(self, node, args, kwargs): @@ -246,8 +245,8 @@ self.reverse_assignment[node.value.ast_id] = node self.assign_vals[node.var_name] = [self.evaluate_statement(node.value)] # Evaluate the value just in case - def resolve_node(self, node: BaseNode, include_unknown_args: bool = False, id_loop_detect: T.Optional[T.List[str]] = None) -> T.Optional[T.Any]: - def quick_resolve(n: BaseNode, loop_detect: T.Optional[T.List[str]] = None) -> T.Any: + def resolve_node(self, node: BaseNode, include_unknown_args: bool = False, id_loop_detect: Optional[List[str]] = None) -> Optional[Any]: + def quick_resolve(n: BaseNode, loop_detect: Optional[List[str]] = None) -> Any: if loop_detect is None: loop_detect = [] if isinstance(n, IdNode): @@ -290,7 +289,7 @@ l = quick_resolve(node.left) r = quick_resolve(node.right) if isinstance(l, str) and isinstance(r, str): - result = l + r # String concatenation detected + result = l + r # String concatination detected else: result = self.flatten_args(l, include_unknown_args, id_loop_detect) + self.flatten_args(r, include_unknown_args, id_loop_detect) @@ -327,7 +326,7 @@ return result - def flatten_args(self, args: T.Any, include_unknown_args: bool = False, id_loop_detect: T.Optional[T.List[str]] = None) -> T.List[T.Any]: + def flatten_args(self, args: Any, include_unknown_args: bool = False, id_loop_detect: Optional[List[str]] = None) -> List[Any]: # Make sure we are always dealing with lists if not isinstance(args, list): args = [args] diff -Nru meson-0.53.2/mesonbuild/ast/introspection.py meson-0.52.1/mesonbuild/ast/introspection.py --- meson-0.53.2/mesonbuild/ast/introspection.py 2019-12-29 22:47:27.000000000 +0000 +++ meson-0.52.1/mesonbuild/ast/introspection.py 2019-11-28 17:37:44.000000000 +0000 @@ -35,7 +35,7 @@ class IntrospectionInterpreter(AstInterpreter): # Interpreter to detect the options without a build directory - # Most of the code is stolen from interpreter.Interpreter + # Most of the code is stolen from interperter.Interpreter def __init__(self, source_root, subdir, backend, visitors=None, cross_file=None, subproject='', subproject_dir='subprojects', env=None): visitors = visitors if visitors is not None else [] super().__init__(source_root, subdir, visitors=visitors) @@ -136,15 +136,11 @@ def func_dependency(self, node, args, kwargs): args = self.flatten_args(args) - kwargs = self.flatten_kwargs(kwargs) if not args: return name = args[0] has_fallback = 'fallback' in kwargs required = kwargs.get('required', True) - version = kwargs.get('version', []) - if not isinstance(version, list): - version = [version] condition_level = node.condition_level if hasattr(node, 'condition_level') else 0 if isinstance(required, ElementaryNode): required = required.value @@ -153,10 +149,9 @@ self.dependencies += [{ 'name': name, 'required': required, - 'version': version, 'has_fallback': has_fallback, 'conditional': condition_level > 0, - 'node': node, + 'node': node }] def build_target(self, node, args, kwargs, targetclass): @@ -166,7 +161,7 @@ name = args[0] srcqueue = [node] - # Process the sources BEFORE flattening the kwargs, to preserve the original nodes + # Process the soruces BEFORE flattening the kwargs, to preserve the original nodes if 'sources' in kwargs: srcqueue += mesonlib.listify(kwargs['sources']) diff -Nru meson-0.53.2/mesonbuild/ast/printer.py meson-0.52.1/mesonbuild/ast/printer.py --- meson-0.53.2/mesonbuild/ast/printer.py 2019-12-29 22:47:27.000000000 +0000 +++ meson-0.52.1/mesonbuild/ast/printer.py 2019-08-28 17:15:39.000000000 +0000 @@ -100,7 +100,7 @@ def visit_ComparisonNode(self, node: mparser.ComparisonNode): node.left.accept(self) - self.append_padded(node.ctype, node) + self.append_padded(mparser.comparison_map[node.ctype], node) node.right.accept(self) def visit_ArithmeticNode(self, node: mparser.ArithmeticNode): @@ -192,10 +192,7 @@ if break_args: self.newline() for key, val in node.kwargs.items(): - if isinstance(key, str): - self.append(key, node) - else: - key.accept(self) + self.append(key, node) self.append_padded(':', node) val.accept(self) self.append(', ', node) diff -Nru meson-0.53.2/mesonbuild/backend/backends.py meson-0.52.1/mesonbuild/backend/backends.py --- meson-0.53.2/mesonbuild/backend/backends.py 2020-01-23 12:51:19.000000000 +0000 +++ meson-0.52.1/mesonbuild/backend/backends.py 2019-11-28 17:37:44.000000000 +0000 @@ -27,7 +27,7 @@ from collections import OrderedDict import shlex from functools import lru_cache -import typing as T +import typing class CleanTrees: @@ -81,12 +81,12 @@ self.capture = capture class TestSerialisation: - def __init__(self, name: str, project: str, suite: str, fname: T.List[str], - is_cross_built: bool, exe_wrapper: T.Optional[build.Executable], - needs_exe_wrapper: bool, is_parallel: bool, cmd_args: T.List[str], + def __init__(self, name: str, project: str, suite: str, fname: typing.List[str], + is_cross_built: bool, exe_wrapper: typing.Optional[build.Executable], + needs_exe_wrapper: bool, is_parallel: bool, cmd_args: typing.List[str], env: build.EnvironmentVariables, should_fail: bool, - timeout: T.Optional[int], workdir: T.Optional[str], - extra_paths: T.List[str], protocol: str, priority: int): + timeout: typing.Optional[int], workdir: typing.Optional[str], + extra_paths: typing.List[str], protocol: str, priority: int): self.name = name self.project_name = project self.suite = suite @@ -676,7 +676,7 @@ paths.update(cc.get_library_dirs(self.environment)) return list(paths) - def determine_windows_extra_paths(self, target: T.Union[build.BuildTarget, str], extra_bdeps): + def determine_windows_extra_paths(self, target: typing.Union[build.BuildTarget, str], extra_bdeps): '''On Windows there is no such thing as an rpath. We must determine all locations of DLLs that this exe links to and return them so they can be used in unit @@ -1092,31 +1092,22 @@ t.get_aliases(), should_strip, mappings, t.install_rpath, install_mode) d.targets.append(i) - - if isinstance(t, (build.SharedLibrary, build.SharedModule, build.Executable)): - # On toolchains/platforms that use an import library for - # linking (separate from the shared library with all the - # code), we need to install that too (dll.a/.lib). - if t.get_import_filename(): - if custom_install_dir: - # If the DLL is installed into a custom directory, - # install the import library into the same place so - # it doesn't go into a surprising place - implib_install_dir = outdirs[0] - else: - implib_install_dir = self.environment.get_import_lib_dir() - # Install the import library; may not exist for shared modules - i = TargetInstallData(self.get_target_filename_for_linking(t), - implib_install_dir, {}, False, {}, '', install_mode, - optional=isinstance(t, build.SharedModule)) - d.targets.append(i) - - if not should_strip and t.get_debug_filename(): - debug_file = os.path.join(self.get_target_dir(t), t.get_debug_filename()) - i = TargetInstallData(debug_file, outdirs[0], - {}, False, {}, '', - install_mode, optional=True) - d.targets.append(i) + # On toolchains/platforms that use an import library for + # linking (separate from the shared library with all the + # code), we need to install that too (dll.a/.lib). + if isinstance(t, (build.SharedLibrary, build.SharedModule, build.Executable)) and t.get_import_filename(): + if custom_install_dir: + # If the DLL is installed into a custom directory, + # install the import library into the same place so + # it doesn't go into a surprising place + implib_install_dir = outdirs[0] + else: + implib_install_dir = self.environment.get_import_lib_dir() + # Install the import library; may not exist for shared modules + i = TargetInstallData(self.get_target_filename_for_linking(t), + implib_install_dir, {}, False, {}, '', install_mode, + optional=isinstance(t, build.SharedModule)) + d.targets.append(i) # Install secondary outputs. Only used for Vala right now. if num_outdirs > 1: for output, outdir in zip(t.get_outputs()[1:], outdirs[1:]): diff -Nru meson-0.53.2/mesonbuild/backend/ninjabackend.py meson-0.52.1/mesonbuild/backend/ninjabackend.py --- meson-0.53.2/mesonbuild/backend/ninjabackend.py 2020-01-23 12:51:19.000000000 +0000 +++ meson-0.52.1/mesonbuild/backend/ninjabackend.py 2019-11-28 17:37:44.000000000 +0000 @@ -11,7 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -import typing as T +from typing import List import os import re import pickle @@ -165,7 +165,7 @@ # This is the only way I could find to make this work on all # platforms including Windows command shell. Slash is a dir separator # on Windows, too, so all characters are unambiguous and, more importantly, - # do not require quoting, unless explicitly specified, which is necessary for + # do not require quoting, unless explicitely specified, which is necessary for # the csc compiler. line = line.replace('\\', '/') outfile.write(line) @@ -285,10 +285,9 @@ def generate(self, interp): self.interpreter = interp - ninja = environment.detect_ninja_command_and_version(log=True) - if ninja is None: + self.ninja_command = environment.detect_ninja(log=True) + if self.ninja_command is None: raise MesonException('Could not detect Ninja v1.5 or newer') - (self.ninja_command, self.ninja_version) = ninja outfilename = os.path.join(self.environment.get_build_dir(), self.ninja_filename) tempfilename = outfilename + '~' with open(tempfilename, 'w', encoding='utf-8') as outfile: @@ -334,7 +333,6 @@ # Only overwrite the old build file after the new one has been # fully created. os.replace(tempfilename, outfilename) - mlog.cmd_ci_include(outfilename) # For CI debugging self.generate_compdb() # http://clang.llvm.org/docs/JSONCompilationDatabase.html @@ -344,8 +342,7 @@ for lang in self.environment.coredata.compilers[for_machine]: rules += [self.get_compiler_rule_name(lang, for_machine)] rules += [self.get_pch_rule_name(lang, for_machine)] - compdb_options = ['-x'] if mesonlib.version_compare(self.ninja_version, '>=1.9') else [] - ninja_compdb = [self.ninja_command, '-t', 'compdb'] + compdb_options + rules + ninja_compdb = [self.ninja_command, '-t', 'compdb'] + rules builddir = self.environment.get_build_dir() try: jsondb = subprocess.check_output(ninja_compdb, cwd=builddir) @@ -769,6 +766,7 @@ elem = NinjaBuildElement(self.all_outputs, target_name, 'phony', []) elem.add_dep(deps) + cmd = self.replace_paths(target, cmd) self.add_build(elem) self.processed_targets[target.get_id()] = True @@ -1017,6 +1015,7 @@ generated_sources = self.get_target_generated_sources(target) generated_rel_srcs = [] for rel_src in generated_sources.keys(): + dirpart, fnamepart = os.path.split(rel_src) if rel_src.lower().endswith('.cs'): generated_rel_srcs.append(os.path.normpath(rel_src)) deps.append(os.path.normpath(rel_src)) @@ -1291,15 +1290,6 @@ else: raise InvalidArguments('Unknown target type for rustc.') args.append(cratetype) - - # If we're dynamically linking, add those arguments - # - # Rust is super annoying, calling -C link-arg foo does not work, it has - # to be -C link-arg=foo - if cratetype in {'bin', 'dylib'}: - for a in rustc.linker.get_always_args(): - args += ['-C', 'link-arg={}'.format(a)] - args += ['--crate-name', target.name] args += rustc.get_buildtype_args(self.get_option_for_target('buildtype', target)) args += rustc.get_debug_args(self.get_option_for_target('debug', target)) @@ -1872,7 +1862,7 @@ self.fortran_deps[target.get_basename()] = {**module_files, **submodule_files} - def get_fortran_deps(self, compiler: FortranCompiler, src: Path, target) -> T.List[str]: + def get_fortran_deps(self, compiler: FortranCompiler, src: Path, target) -> List[str]: """ Find all module and submodule needed by a Fortran target """ @@ -2656,8 +2646,6 @@ def generate_scanbuild(self): if not environment.detect_scanbuild(): return - if ('', 'scan-build') in self.build.run_target_names: - return cmd = self.environment.get_build_command() + \ ['--internal', 'scanbuild', self.environment.source_dir, self.environment.build_dir] + \ self.environment.get_build_command() + self.get_user_option_args() @@ -2675,8 +2663,6 @@ return if target_name in self.all_outputs: return - if ('', target_name) in self.build.run_target_names: - return cmd = self.environment.get_build_command() + \ ['--internal', 'clang' + name, self.environment.source_dir, self.environment.build_dir] elem = NinjaBuildElement(self.all_outputs, 'meson-' + target_name, 'CUSTOM_COMMAND', 'PHONY') @@ -2696,31 +2682,11 @@ return self.generate_clangtool('tidy') - def generate_tags(self, tool, target_name): - import shutil - if not shutil.which(tool): - return - if ('', target_name) in self.build.run_target_names: - return - if target_name in self.all_outputs: - return - cmd = self.environment.get_build_command() + \ - ['--internal', 'tags', tool, self.environment.source_dir] - elem = NinjaBuildElement(self.all_outputs, 'meson-' + target_name, 'CUSTOM_COMMAND', 'PHONY') - elem.add_item('COMMAND', cmd) - elem.add_item('pool', 'console') - self.add_build(elem) - # Alias that runs the target defined above - self.create_target_alias('meson-' + target_name) - # For things like scan-build and other helper tools we might have. def generate_utils(self): self.generate_scanbuild() self.generate_clangformat() self.generate_clangtidy() - self.generate_tags('etags', 'TAGS') - self.generate_tags('ctags', 'ctags') - self.generate_tags('cscope', 'cscope') cmd = self.environment.get_build_command() + ['--internal', 'uninstall'] elem = NinjaBuildElement(self.all_outputs, 'meson-uninstall', 'CUSTOM_COMMAND', 'PHONY') elem.add_item('COMMAND', cmd) @@ -2795,7 +2761,7 @@ return obj -def _scan_fortran_file_deps(src: Path, srcdir: Path, dirname: Path, tdeps, compiler) -> T.List[str]: +def _scan_fortran_file_deps(src: Path, srcdir: Path, dirname: Path, tdeps, compiler) -> List[str]: """ scan a Fortran file for dependencies. Needs to be distinct from target to allow for recursion induced by `include` statements.er diff -Nru meson-0.53.2/mesonbuild/backend/vs2010backend.py meson-0.52.1/mesonbuild/backend/vs2010backend.py --- meson-0.53.2/mesonbuild/backend/vs2010backend.py 2020-01-23 12:51:19.000000000 +0000 +++ meson-0.52.1/mesonbuild/backend/vs2010backend.py 2019-08-28 17:15:39.000000000 +0000 @@ -1191,68 +1191,46 @@ targetmachine.text = 'MachineARM' else: raise MesonException('Unsupported Visual Studio target machine: ' + targetplatform) - # /nologo - ET.SubElement(link, 'SuppressStartupBanner').text = 'true' - # /release - ET.SubElement(link, 'SetChecksum').text = 'true' meson_file_group = ET.SubElement(root, 'ItemGroup') ET.SubElement(meson_file_group, 'None', Include=os.path.join(proj_to_src_dir, build_filename)) - # Visual Studio can't load projects that present duplicated items. Filter them out - # by keeping track of already added paths. - def path_normalize_add(path, lis): - normalized = os.path.normcase(os.path.normpath(path)) - if normalized not in lis: - lis.append(normalized) - return True - else: - return False - - previous_includes = [] - if len(headers) + len(gen_hdrs) + len(target.extra_files) + len(pch_sources) > 0: + extra_files = target.extra_files + if len(headers) + len(gen_hdrs) + len(extra_files) + len(pch_sources) > 0: inc_hdrs = ET.SubElement(root, 'ItemGroup') for h in headers: relpath = os.path.join(down, h.rel_to_builddir(self.build_to_src)) - if path_normalize_add(relpath, previous_includes): - ET.SubElement(inc_hdrs, 'CLInclude', Include=relpath) + ET.SubElement(inc_hdrs, 'CLInclude', Include=relpath) for h in gen_hdrs: - if path_normalize_add(h, previous_includes): - ET.SubElement(inc_hdrs, 'CLInclude', Include=h) + ET.SubElement(inc_hdrs, 'CLInclude', Include=h) for h in target.extra_files: relpath = os.path.join(down, h.rel_to_builddir(self.build_to_src)) - if path_normalize_add(relpath, previous_includes): - ET.SubElement(inc_hdrs, 'CLInclude', Include=relpath) + ET.SubElement(inc_hdrs, 'CLInclude', Include=relpath) for lang in pch_sources: h = pch_sources[lang][0] - path = os.path.join(proj_to_src_dir, h) - if path_normalize_add(path, previous_includes): - ET.SubElement(inc_hdrs, 'CLInclude', Include=path) + ET.SubElement(inc_hdrs, 'CLInclude', Include=os.path.join(proj_to_src_dir, h)) - previous_sources = [] if len(sources) + len(gen_src) + len(pch_sources) > 0: inc_src = ET.SubElement(root, 'ItemGroup') for s in sources: relpath = os.path.join(down, s.rel_to_builddir(self.build_to_src)) - if path_normalize_add(relpath, previous_sources): - inc_cl = ET.SubElement(inc_src, 'CLCompile', Include=relpath) - lang = Vs2010Backend.lang_from_source_file(s) - self.add_pch(pch_sources, lang, inc_cl) - self.add_additional_options(lang, inc_cl, file_args) - self.add_preprocessor_defines(lang, inc_cl, file_defines) - self.add_include_dirs(lang, inc_cl, file_inc_dirs) - ET.SubElement(inc_cl, 'ObjectFileName').text = "$(IntDir)" + self.object_filename_from_source(target, s) + inc_cl = ET.SubElement(inc_src, 'CLCompile', Include=relpath) + lang = Vs2010Backend.lang_from_source_file(s) + self.add_pch(pch_sources, lang, inc_cl) + self.add_additional_options(lang, inc_cl, file_args) + self.add_preprocessor_defines(lang, inc_cl, file_defines) + self.add_include_dirs(lang, inc_cl, file_inc_dirs) + ET.SubElement(inc_cl, 'ObjectFileName').text = "$(IntDir)" + self.object_filename_from_source(target, s) for s in gen_src: - if path_normalize_add(s, previous_sources): - inc_cl = ET.SubElement(inc_src, 'CLCompile', Include=s) - lang = Vs2010Backend.lang_from_source_file(s) - self.add_pch(pch_sources, lang, inc_cl) - self.add_additional_options(lang, inc_cl, file_args) - self.add_preprocessor_defines(lang, inc_cl, file_defines) - self.add_include_dirs(lang, inc_cl, file_inc_dirs) + inc_cl = ET.SubElement(inc_src, 'CLCompile', Include=s) + lang = Vs2010Backend.lang_from_source_file(s) + self.add_pch(pch_sources, lang, inc_cl) + self.add_additional_options(lang, inc_cl, file_args) + self.add_preprocessor_defines(lang, inc_cl, file_defines) + self.add_include_dirs(lang, inc_cl, file_inc_dirs) for lang in pch_sources: impl = pch_sources[lang][1] - if impl and path_normalize_add(impl, previous_sources): + if impl: inc_cl = ET.SubElement(inc_src, 'CLCompile', Include=impl) self.create_pch(pch_sources, lang, inc_cl) self.add_additional_options(lang, inc_cl, file_args) @@ -1265,16 +1243,13 @@ inc_dirs = file_inc_dirs self.add_include_dirs(lang, inc_cl, inc_dirs) - previous_objects = [] if self.has_objects(objects, additional_objects, gen_objs): inc_objs = ET.SubElement(root, 'ItemGroup') for s in objects: relpath = os.path.join(down, s.rel_to_builddir(self.build_to_src)) - if path_normalize_add(relpath, previous_objects): - ET.SubElement(inc_objs, 'Object', Include=relpath) + ET.SubElement(inc_objs, 'Object', Include=relpath) for s in additional_objects: - if path_normalize_add(s, previous_objects): - ET.SubElement(inc_objs, 'Object', Include=s) + ET.SubElement(inc_objs, 'Object', Include=s) self.add_generated_objects(inc_objs, gen_objs) ET.SubElement(root, 'Import', Project=r'$(VCTargetsPath)\Microsoft.Cpp.targets') diff -Nru meson-0.53.2/mesonbuild/backend/xcodebackend.py meson-0.52.1/mesonbuild/backend/xcodebackend.py --- meson-0.53.2/mesonbuild/backend/xcodebackend.py 2019-12-04 18:45:50.000000000 +0000 +++ meson-0.52.1/mesonbuild/backend/xcodebackend.py 2019-11-28 17:37:44.000000000 +0000 @@ -634,7 +634,7 @@ self.write_line('isa = XCBuildConfiguration;') self.write_line('buildSettings = {') self.indent_level += 1 - self.write_line('ARCHS = "$(ARCHS_STANDARD_64_BIT)";') + self.write_line('ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";') self.write_line('ONLY_ACTIVE_ARCH = YES;') self.write_line('SDKROOT = "macosx";') self.write_line('SYMROOT = "%s/build";' % self.environment.get_build_dir()) diff -Nru meson-0.53.2/mesonbuild/build.py meson-0.52.1/mesonbuild/build.py --- meson-0.53.2/mesonbuild/build.py 2020-01-23 21:41:11.000000000 +0000 +++ meson-0.52.1/mesonbuild/build.py 2019-11-28 17:37:44.000000000 +0000 @@ -18,7 +18,7 @@ import hashlib import pickle from functools import lru_cache -import typing as T +import typing from . import environment from . import dependencies @@ -117,11 +117,10 @@ self.environment = environment self.projects = {} self.targets = OrderedDict() - self.run_target_names = set() # type: T.Set[T.Tuple[str, str]] - self.global_args = PerMachine({}, {}) # type: PerMachine[T.Dict[str, T.List[str]]] - self.projects_args = PerMachine({}, {}) # type: PerMachine[T.Dict[str, T.List[str]]] - self.global_link_args = PerMachine({}, {}) # type: PerMachine[T.Dict[str, T.List[str]]] - self.projects_link_args = PerMachine({}, {}) # type: PerMachine[T.Dict[str, T.List[str]]] + self.global_args = PerMachine({}, {}) # type: PerMachine[typing.Dict[str, typing.List[str]]] + self.projects_args = PerMachine({}, {}) # type: PerMachine[typing.Dict[str, typing.List[str]]] + self.global_link_args = PerMachine({}, {}) # type: PerMachine[typing.Dict[str, typing.List[str]]] + self.projects_link_args = PerMachine({}, {}) # type: PerMachine[typing.Dict[str, typing.List[str]]] self.tests = [] self.benchmarks = [] self.headers = [] @@ -137,7 +136,7 @@ self.dep_manifest_name = None self.dep_manifest = {} self.stdlibs = PerMachine({}, {}) - self.test_setups = {} # type: T.Dict[str, TestSetup] + self.test_setups = {} # type: typing.Dict[str, TestSetup] self.test_setup_default_name = None self.find_overrides = {} self.searched_programs = set() # The list of all programs that have been searched for. @@ -331,7 +330,7 @@ return value - def get_env(self, full_env: T.Dict[str, str]) -> T.Dict[str, str]: + def get_env(self, full_env: typing.Dict[str, str]) -> typing.Dict[str, str]: env = full_env.copy() for method, name, values, kwargs in self.envvars: env[name] = method(full_env, name, values, kwargs) @@ -355,26 +354,6 @@ if not hasattr(self, 'typename'): raise RuntimeError('Target type is not set for target class "{}". This is a bug'.format(type(self).__name__)) - def __lt__(self, other: T.Any) -> T.Union[bool, type(NotImplemented)]: - if not hasattr(other, 'get_id') and not callable(other.get_id): - return NotImplemented - return self.get_id() < other.get_id() - - def __le__(self, other: T.Any) -> T.Union[bool, type(NotImplemented)]: - if not hasattr(other, 'get_id') and not callable(other.get_id): - return NotImplemented - return self.get_id() <= other.get_id() - - def __gt__(self, other: T.Any) -> T.Union[bool, type(NotImplemented)]: - if not hasattr(other, 'get_id') and not callable(other.get_id): - return NotImplemented - return self.get_id() > other.get_id() - - def __ge__(self, other: T.Any) -> T.Union[bool, type(NotImplemented)]: - if not hasattr(other, 'get_id') and not callable(other.get_id): - return NotImplemented - return self.get_id() >= other.get_id() - def get_install_dir(self, environment): # Find the installation directory. default_install_dir = self.get_default_install_dir(environment) @@ -431,7 +410,7 @@ return self.construct_id_from_path( self.subdir, self.name, self.type_suffix()) - def process_kwargs_base(self, kwargs): + def process_kwargs(self, kwargs): if 'build_by_default' in kwargs: self.build_by_default = kwargs['build_by_default'] if not isinstance(self.build_by_default, bool): @@ -508,6 +487,9 @@ self.validate_install(environment) self.check_module_linking() + def __lt__(self, other): + return self.get_id() < other.get_id() + def __repr__(self): repr_str = "<{0} {1}: {2}>" return repr_str.format(self.__class__.__name__, self.get_id(), self.filename) @@ -806,7 +788,7 @@ return self.install_mode def process_kwargs(self, kwargs, environment): - self.process_kwargs_base(kwargs) + super().process_kwargs(kwargs) self.copy_kwargs(kwargs) kwargs.get('modules', []) self.need_install = kwargs.get('install', self.need_install) @@ -1113,17 +1095,14 @@ raise InvalidArguments('Custom target {!r} is not linkable.'.format(t)) if not t.get_filename().endswith('.a'): raise InvalidArguments('Can only link_whole custom targets that are .a archives.') - if isinstance(self, StaticLibrary): - # FIXME: We could extract the .a archive to get object files - raise InvalidArguments('Cannot link_whole a custom target into a static library') elif not isinstance(t, StaticLibrary): raise InvalidArguments('{!r} is not a static library.'.format(t)) - elif isinstance(self, SharedLibrary) and not t.pic: + if isinstance(self, SharedLibrary) and not t.pic: msg = "Can't link non-PIC static library {!r} into shared library {!r}. ".format(t.name, self.name) msg += "Use the 'pic' option to static_library to build with PIC." raise InvalidArguments(msg) if self.for_machine is not t.for_machine: - msg = 'Tried to mix libraries for machines {1} and {2} in target {0!r}'.format(self.name, self.for_machine, t.for_machine) + msg = 'Tried to mix libraries for machines {1} and {2} in target {!r}'.format(self.name, self.for_machine, t.for_machine) if self.environment.is_cross_build(): raise InvalidArguments(msg + ' This is not possible in a cross build.') else: @@ -1171,7 +1150,7 @@ raise MesonException('File %s does not exist.' % f) self.pch[language] = pchlist - def add_include_dirs(self, args, set_is_system: T.Optional[str] = None): + def add_include_dirs(self, args, set_is_system: typing.Optional[str] = None): ids = [] for a in args: # FIXME same hack, forcibly unpack from holder. @@ -1200,7 +1179,7 @@ def get_aliases(self): return {} - def get_langs_used_by_deps(self) -> T.List[str]: + def get_langs_used_by_deps(self) -> typing.List[str]: ''' Sometimes you want to link to a C++ library that exports C API, which means the linker must link in the C++ stdlib, and we must use a C++ @@ -1509,8 +1488,6 @@ self.vs_import_filename = None # The import library that GCC would generate (and prefer) self.gcc_import_filename = None - # The debugging information file this target will generate - self.debug_filename = None # Check for export_dynamic self.export_dynamic = False @@ -1523,13 +1500,12 @@ if self.export_dynamic and kwargs.get('implib') is False: raise InvalidArguments('"implib" keyword argument must not be false for if "export_dynamic" is true') - m = environment.machines[for_machine] - # If using export_dynamic, set the import library name if self.export_dynamic: implib_basename = self.name + '.exe' if not isinstance(kwargs.get('implib', False), bool): implib_basename = kwargs['implib'] + m = environment.machines[for_machine] if m.is_windows() or m.is_cygwin(): self.vs_import_filename = '{0}.lib'.format(implib_basename) self.gcc_import_filename = 'lib{0}.a'.format(implib_basename) @@ -1538,11 +1514,6 @@ else: self.import_filename = self.gcc_import_filename - if m.is_windows() and ('cs' in self.compilers or - self.get_using_rustc() or - self.get_using_msvc()): - self.debug_filename = self.name + '.pdb' - # Only linkwithable if using export_dynamic self.is_linkwithable = self.export_dynamic @@ -1569,14 +1540,6 @@ return [self.vs_import_filename, self.gcc_import_filename] return [] - def get_debug_filename(self): - """ - The name of debuginfo file that will be created by the compiler - - Returns None if the build won't create any debuginfo file - """ - return self.debug_filename - def is_linkable_target(self): return self.is_linkwithable @@ -1656,8 +1619,6 @@ self.vs_import_filename = None # The import library that GCC would generate (and prefer) self.gcc_import_filename = None - # The debugging information file this target will generate - self.debug_filename = None super().__init__(name, subdir, subproject, for_machine, sources, objects, environment, kwargs) if 'rust' in self.compilers: # If no crate type is specified, or it's the generic lib type, use dylib @@ -1712,7 +1673,6 @@ """ prefix = '' suffix = '' - create_debug_file = False self.filename_tpl = self.basic_filename_tpl # NOTE: manual prefix/suffix override is currently only tested for C/C++ # C# and Mono @@ -1720,7 +1680,6 @@ prefix = '' suffix = 'dll' self.filename_tpl = '{0.prefix}{0.name}.{0.suffix}' - create_debug_file = True # C, C++, Swift, Vala # Only Windows uses a separate import library for linking # For all other targets/platforms import_filename stays None @@ -1733,13 +1692,11 @@ prefix = '' # Import library is called foo.dll.lib self.import_filename = '{0}.dll.lib'.format(self.name) - create_debug_file = True elif self.get_using_msvc(): # Shared library is of the form foo.dll prefix = '' # Import library is called foo.lib self.import_filename = self.vs_import_filename - create_debug_file = True # Assume GCC-compatible naming else: # Shared library is of the form libfoo.dll @@ -1796,8 +1753,6 @@ self.suffix = suffix self.filename = self.filename_tpl.format(self) self.outputs = [self.filename] - if create_debug_file: - self.debug_filename = os.path.splitext(self.filename)[0] + '.pdb' @staticmethod def _validate_darwin_versions(darwin_versions): @@ -1911,14 +1866,6 @@ """ return self.import_filename - def get_debug_filename(self): - """ - The name of debuginfo file that will be created by the compiler - - Returns None if the build won't create any debuginfo file - """ - return self.debug_filename - def get_import_filenameslist(self): if self.import_filename: return [self.vs_import_filename, self.gcc_import_filename] @@ -2022,6 +1969,9 @@ def get_default_install_dir(self, environment): return None + def __lt__(self, other): + return self.get_id() < other.get_id() + def __repr__(self): repr_str = "<{0} {1}: {2}>" return repr_str.format(self.__class__.__name__, self.get_id(), self.command) @@ -2082,7 +2032,7 @@ return final_cmd def process_kwargs(self, kwargs, backend): - self.process_kwargs_base(kwargs) + super().process_kwargs(kwargs) self.sources = extract_as_list(kwargs, 'input', unholder=True) if 'output' not in kwargs: raise InvalidArguments('Missing keyword argument "output".') @@ -2259,13 +2209,13 @@ self.args = args self.dependencies = dependencies + def __lt__(self, other): + return self.get_id() < other.get_id() + def __repr__(self): repr_str = "<{0} {1}: {2}>" return repr_str.format(self.__class__.__name__, self.get_id(), self.command) - def process_kwargs(self, kwargs): - return self.process_kwargs_base(kwargs) - def get_dependencies(self): return self.dependencies @@ -2448,7 +2398,7 @@ self['args'] = args class TestSetup: - def __init__(self, exe_wrapper: T.Optional[T.List[str]], gdb: bool, + def __init__(self, exe_wrapper: typing.Optional[typing.List[str]], gdb: bool, timeout_multiplier: int, env: EnvironmentVariables): self.exe_wrapper = exe_wrapper self.gdb = gdb @@ -2491,8 +2441,7 @@ raise MesonException( "Build data file {!r} references functions or classes that don't " "exist. This probably means that it was generated with an old " - "version of meson. Try running from the source directory " - "meson {} --wipe".format(filename, build_dir)) + "version of meson. Try running meson {} --wipe".format(filename, build_dir)) if not isinstance(obj, Build): raise MesonException(load_fail_msg) return obj diff -Nru meson-0.53.2/mesonbuild/cmake/client.py meson-0.52.1/mesonbuild/cmake/client.py --- meson-0.53.2/mesonbuild/cmake/client.py 2020-01-23 12:51:19.000000000 +0000 +++ meson-0.52.1/mesonbuild/cmake/client.py 2019-11-28 17:37:44.000000000 +0000 @@ -15,14 +15,14 @@ # This class contains the basic functionality needed to run any interpreter # or an interpreter-based tool. -from .common import CMakeException, CMakeConfiguration, CMakeBuildFile +from .common import CMakeException from .executor import CMakeExecutor from ..environment import Environment from ..mesonlib import MachineChoice from .. import mlog from contextlib import contextmanager from subprocess import Popen, PIPE, TimeoutExpired -import typing as T +from typing import List, Optional import json import os @@ -110,11 +110,11 @@ pass class MessageHello(MessageBase): - def __init__(self, supported_protocol_versions: T.List[dict]): + def __init__(self, supported_protocol_versions: List[dict]): super().__init__('hello', '') self.supported_protocol_versions = supported_protocol_versions - def supports(self, major: int, minor: T.Optional[int] = None) -> bool: + def supports(self, major: int, minor: Optional[int] = None) -> bool: for i in self.supported_protocol_versions: if major == i['major']: if minor is None or minor == i['minor']: @@ -124,7 +124,7 @@ # Request classes class RequestHandShake(RequestBase): - def __init__(self, src_dir: str, build_dir: str, generator: str, vers_major: int, vers_minor: T.Optional[int] = None): + def __init__(self, src_dir: str, build_dir: str, generator: str, vers_major: int, vers_minor: Optional[int] = None): super().__init__('handshake') self.src_dir = src_dir self.build_dir = build_dir @@ -150,7 +150,7 @@ } class RequestConfigure(RequestBase): - def __init__(self, args: T.Optional[T.List[str]] = None): + def __init__(self, args: Optional[List[str]] = None): super().__init__('configure') self.args = args @@ -186,8 +186,17 @@ def __init__(self, cookie: str): super().__init__(cookie, 'compute') +class CMakeBuildFile: + def __init__(self, file: str, is_cmake: bool, is_temp: bool): + self.file = file + self.is_cmake = is_cmake + self.is_temp = is_temp + + def __repr__(self): + return '<{}: {}; cmake={}; temp={}>'.format(self.__class__.__name__, self.file, self.is_cmake, self.is_temp) + class ReplyCMakeInputs(ReplyBase): - def __init__(self, cookie: str, cmake_root: str, src_dir: str, build_files: T.List[CMakeBuildFile]): + def __init__(self, cookie: str, cmake_root: str, src_dir: str, build_files: List[CMakeBuildFile]): super().__init__(cookie, 'cmakeInputs') self.cmake_root = cmake_root self.src_dir = src_dir @@ -201,6 +210,138 @@ for i in self.build_files: mlog.log(str(i)) +def _flags_to_list(raw: str) -> List[str]: + # Convert a raw commandline string into a list of strings + res = [] + curr = '' + escape = False + in_string = False + for i in raw: + if escape: + # If the current char is not a quote, the '\' is probably important + if i not in ['"', "'"]: + curr += '\\' + curr += i + escape = False + elif i == '\\': + escape = True + elif i in ['"', "'"]: + in_string = not in_string + elif i in [' ', '\n']: + if in_string: + curr += i + else: + res += [curr] + curr = '' + else: + curr += i + res += [curr] + res = list(filter(lambda x: len(x) > 0, res)) + return res + +class CMakeFileGroup: + def __init__(self, data: dict): + self.defines = data.get('defines', '') + self.flags = _flags_to_list(data.get('compileFlags', '')) + self.includes = data.get('includePath', []) + self.is_generated = data.get('isGenerated', False) + self.language = data.get('language', 'C') + self.sources = data.get('sources', []) + + # Fix the include directories + tmp = [] + for i in self.includes: + if isinstance(i, dict) and 'path' in i: + tmp += [i['path']] + elif isinstance(i, str): + tmp += [i] + self.includes = tmp + + def log(self) -> None: + mlog.log('flags =', mlog.bold(', '.join(self.flags))) + mlog.log('defines =', mlog.bold(', '.join(self.defines))) + mlog.log('includes =', mlog.bold(', '.join(self.includes))) + mlog.log('is_generated =', mlog.bold('true' if self.is_generated else 'false')) + mlog.log('language =', mlog.bold(self.language)) + mlog.log('sources:') + for i in self.sources: + with mlog.nested(): + mlog.log(i) + +class CMakeTarget: + def __init__(self, data: dict): + self.artifacts = data.get('artifacts', []) + self.src_dir = data.get('sourceDirectory', '') + self.build_dir = data.get('buildDirectory', '') + self.name = data.get('name', '') + self.full_name = data.get('fullName', '') + self.install = data.get('hasInstallRule', False) + self.install_paths = list(set(data.get('installPaths', []))) + self.link_lang = data.get('linkerLanguage', '') + self.link_libraries = _flags_to_list(data.get('linkLibraries', '')) + self.link_flags = _flags_to_list(data.get('linkFlags', '')) + self.link_lang_flags = _flags_to_list(data.get('linkLanguageFlags', '')) + self.link_path = data.get('linkPath', '') + self.type = data.get('type', 'EXECUTABLE') + self.is_generator_provided = data.get('isGeneratorProvided', False) + self.files = [] + + for i in data.get('fileGroups', []): + self.files += [CMakeFileGroup(i)] + + def log(self) -> None: + mlog.log('artifacts =', mlog.bold(', '.join(self.artifacts))) + mlog.log('src_dir =', mlog.bold(self.src_dir)) + mlog.log('build_dir =', mlog.bold(self.build_dir)) + mlog.log('name =', mlog.bold(self.name)) + mlog.log('full_name =', mlog.bold(self.full_name)) + mlog.log('install =', mlog.bold('true' if self.install else 'false')) + mlog.log('install_paths =', mlog.bold(', '.join(self.install_paths))) + mlog.log('link_lang =', mlog.bold(self.link_lang)) + mlog.log('link_libraries =', mlog.bold(', '.join(self.link_libraries))) + mlog.log('link_flags =', mlog.bold(', '.join(self.link_flags))) + mlog.log('link_lang_flags =', mlog.bold(', '.join(self.link_lang_flags))) + mlog.log('link_path =', mlog.bold(self.link_path)) + mlog.log('type =', mlog.bold(self.type)) + mlog.log('is_generator_provided =', mlog.bold('true' if self.is_generator_provided else 'false')) + for idx, i in enumerate(self.files): + mlog.log('Files {}:'.format(idx)) + with mlog.nested(): + i.log() + +class CMakeProject: + def __init__(self, data: dict): + self.src_dir = data.get('sourceDirectory', '') + self.build_dir = data.get('buildDirectory', '') + self.name = data.get('name', '') + self.targets = [] + + for i in data.get('targets', []): + self.targets += [CMakeTarget(i)] + + def log(self) -> None: + mlog.log('src_dir =', mlog.bold(self.src_dir)) + mlog.log('build_dir =', mlog.bold(self.build_dir)) + mlog.log('name =', mlog.bold(self.name)) + for idx, i in enumerate(self.targets): + mlog.log('Target {}:'.format(idx)) + with mlog.nested(): + i.log() + +class CMakeConfiguration: + def __init__(self, data: dict): + self.name = data.get('name', '') + self.projects = [] + for i in data.get('projects', []): + self.projects += [CMakeProject(i)] + + def log(self) -> None: + mlog.log('name =', mlog.bold(self.name)) + for idx, i in enumerate(self.projects): + mlog.log('Project {}:'.format(idx)) + with mlog.nested(): + i.log() + class ReplyCodeModel(ReplyBase): def __init__(self, data: dict): super().__init__(data['cookie'], 'codemodel') @@ -296,7 +437,7 @@ raise CMakeException('CMake server query failed') return reply - def do_handshake(self, src_dir: str, build_dir: str, generator: str, vers_major: int, vers_minor: T.Optional[int] = None) -> None: + def do_handshake(self, src_dir: str, build_dir: str, generator: str, vers_major: int, vers_minor: Optional[int] = None) -> None: # CMake prints the hello message on startup msg = self.readMessage() if not isinstance(msg, MessageHello): diff -Nru meson-0.53.2/mesonbuild/cmake/common.py meson-0.52.1/mesonbuild/cmake/common.py --- meson-0.53.2/mesonbuild/cmake/common.py 2020-01-23 12:51:19.000000000 +0000 +++ meson-0.52.1/mesonbuild/cmake/common.py 2019-11-28 17:37:44.000000000 +0000 @@ -16,150 +16,6 @@ # or an interpreter-based tool. from ..mesonlib import MesonException -from .. import mlog -import typing as T class CMakeException(MesonException): pass - -class CMakeBuildFile: - def __init__(self, file: str, is_cmake: bool, is_temp: bool): - self.file = file - self.is_cmake = is_cmake - self.is_temp = is_temp - - def __repr__(self): - return '<{}: {}; cmake={}; temp={}>'.format(self.__class__.__name__, self.file, self.is_cmake, self.is_temp) - -def _flags_to_list(raw: str) -> T.List[str]: - # Convert a raw commandline string into a list of strings - res = [] - curr = '' - escape = False - in_string = False - for i in raw: - if escape: - # If the current char is not a quote, the '\' is probably important - if i not in ['"', "'"]: - curr += '\\' - curr += i - escape = False - elif i == '\\': - escape = True - elif i in ['"', "'"]: - in_string = not in_string - elif i in [' ', '\n']: - if in_string: - curr += i - else: - res += [curr] - curr = '' - else: - curr += i - res += [curr] - res = list(filter(lambda x: len(x) > 0, res)) - return res - -class CMakeFileGroup: - def __init__(self, data: dict): - self.defines = data.get('defines', '') - self.flags = _flags_to_list(data.get('compileFlags', '')) - self.includes = data.get('includePath', []) - self.is_generated = data.get('isGenerated', False) - self.language = data.get('language', 'C') - self.sources = data.get('sources', []) - - # Fix the include directories - tmp = [] - for i in self.includes: - if isinstance(i, dict) and 'path' in i: - i['isSystem'] = i.get('isSystem', False) - tmp += [i] - elif isinstance(i, str): - tmp += [{'path': i, 'isSystem': False}] - self.includes = tmp - - def log(self) -> None: - mlog.log('flags =', mlog.bold(', '.join(self.flags))) - mlog.log('defines =', mlog.bold(', '.join(self.defines))) - mlog.log('includes =', mlog.bold(', '.join(self.includes))) - mlog.log('is_generated =', mlog.bold('true' if self.is_generated else 'false')) - mlog.log('language =', mlog.bold(self.language)) - mlog.log('sources:') - for i in self.sources: - with mlog.nested(): - mlog.log(i) - -class CMakeTarget: - def __init__(self, data: dict): - self.artifacts = data.get('artifacts', []) - self.src_dir = data.get('sourceDirectory', '') - self.build_dir = data.get('buildDirectory', '') - self.name = data.get('name', '') - self.full_name = data.get('fullName', '') - self.install = data.get('hasInstallRule', False) - self.install_paths = list(set(data.get('installPaths', []))) - self.link_lang = data.get('linkerLanguage', '') - self.link_libraries = _flags_to_list(data.get('linkLibraries', '')) - self.link_flags = _flags_to_list(data.get('linkFlags', '')) - self.link_lang_flags = _flags_to_list(data.get('linkLanguageFlags', '')) - # self.link_path = data.get('linkPath', '') - self.type = data.get('type', 'EXECUTABLE') - # self.is_generator_provided = data.get('isGeneratorProvided', False) - self.files = [] - - for i in data.get('fileGroups', []): - self.files += [CMakeFileGroup(i)] - - def log(self) -> None: - mlog.log('artifacts =', mlog.bold(', '.join(self.artifacts))) - mlog.log('src_dir =', mlog.bold(self.src_dir)) - mlog.log('build_dir =', mlog.bold(self.build_dir)) - mlog.log('name =', mlog.bold(self.name)) - mlog.log('full_name =', mlog.bold(self.full_name)) - mlog.log('install =', mlog.bold('true' if self.install else 'false')) - mlog.log('install_paths =', mlog.bold(', '.join(self.install_paths))) - mlog.log('link_lang =', mlog.bold(self.link_lang)) - mlog.log('link_libraries =', mlog.bold(', '.join(self.link_libraries))) - mlog.log('link_flags =', mlog.bold(', '.join(self.link_flags))) - mlog.log('link_lang_flags =', mlog.bold(', '.join(self.link_lang_flags))) - # mlog.log('link_path =', mlog.bold(self.link_path)) - mlog.log('type =', mlog.bold(self.type)) - # mlog.log('is_generator_provided =', mlog.bold('true' if self.is_generator_provided else 'false')) - for idx, i in enumerate(self.files): - mlog.log('Files {}:'.format(idx)) - with mlog.nested(): - i.log() - -class CMakeProject: - def __init__(self, data: dict): - self.src_dir = data.get('sourceDirectory', '') - self.build_dir = data.get('buildDirectory', '') - self.name = data.get('name', '') - self.targets = [] - - for i in data.get('targets', []): - self.targets += [CMakeTarget(i)] - - def log(self) -> None: - mlog.log('src_dir =', mlog.bold(self.src_dir)) - mlog.log('build_dir =', mlog.bold(self.build_dir)) - mlog.log('name =', mlog.bold(self.name)) - for idx, i in enumerate(self.targets): - mlog.log('Target {}:'.format(idx)) - with mlog.nested(): - i.log() - -class CMakeConfiguration: - def __init__(self, data: dict): - self.name = data.get('name', '') - self.projects = [] - for i in data.get('projects', []): - self.projects += [CMakeProject(i)] - - def log(self) -> None: - mlog.log('name =', mlog.bold(self.name)) - for idx, i in enumerate(self.projects): - mlog.log('Project {}:'.format(idx)) - with mlog.nested(): - i.log() diff -Nru meson-0.53.2/mesonbuild/cmake/data/preload.cmake meson-0.52.1/mesonbuild/cmake/data/preload.cmake --- meson-0.53.2/mesonbuild/cmake/data/preload.cmake 2020-02-25 18:00:46.000000000 +0000 +++ meson-0.52.1/mesonbuild/cmake/data/preload.cmake 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -if(MESON_PS_LOADED) - return() -endif() - -set(MESON_PS_LOADED ON) - -# Dummy macros that have a special meaning in the meson code -macro(meson_ps_execute_delayed_calls) -endmacro() - -macro(meson_ps_reload_vars) -endmacro() - -# Helper macro to inspect the current CMake state -macro(meson_ps_inspect_vars) - set(MESON_PS_CMAKE_CURRENT_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}") - set(MESON_PS_CMAKE_CURRENT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}") - meson_ps_execute_delayed_calls() -endmacro() - - -# Override some system functions with custom code and forward the args -# to the original function -macro(add_custom_command) - meson_ps_inspect_vars() - _add_custom_command(${ARGV}) -endmacro() - -macro(add_custom_target) - meson_ps_inspect_vars() - _add_custom_target(${ARGV}) -endmacro() - -set(MESON_PS_DELAYED_CALLS add_custom_command;add_custom_target) -meson_ps_reload_vars() diff -Nru meson-0.53.2/mesonbuild/cmake/data/run_ctgt.py meson-0.52.1/mesonbuild/cmake/data/run_ctgt.py --- meson-0.53.2/mesonbuild/cmake/data/run_ctgt.py 2019-12-04 18:45:59.000000000 +0000 +++ meson-0.52.1/mesonbuild/cmake/data/run_ctgt.py 2019-11-28 17:37:44.000000000 +0000 @@ -7,31 +7,27 @@ import sys commands = [[]] -SEPARATOR = ';;;' +SEPERATOR = ';;;' # Generate CMD parameters parser = argparse.ArgumentParser(description='Wrapper for add_custom_command') parser.add_argument('-d', '--directory', type=str, metavar='D', required=True, help='Working directory to cwd to') parser.add_argument('-o', '--outputs', nargs='+', metavar='O', required=True, help='Expected output files') -parser.add_argument('-O', '--original-outputs', nargs='*', metavar='O', default=[], help='Output files expected by CMake') -parser.add_argument('commands', nargs=argparse.REMAINDER, help='A "{}" seperated list of commands'.format(SEPARATOR)) +parser.add_argument('-O', '--original-outputs', nargs='+', metavar='O', required=True, help='Output files expected by CMake') +parser.add_argument('commands', nargs=argparse.REMAINDER, help='A "{}" seperated list of commands'.format(SEPERATOR)) # Parse args = parser.parse_args() -dummy_target = None -if len(args.outputs) == 1 and len(args.original_outputs) == 0: - dummy_target = args.outputs[0] -elif len(args.outputs) != len(args.original_outputs): +if len(args.outputs) != len(args.original_outputs): print('Length of output list and original output list differ') sys.exit(1) for i in args.commands: - if i == SEPARATOR: + if i == SEPERATOR: commands += [[]] continue - i = i.replace('"', '') # Remove lefover quotes commands[-1] += [i] # Execute @@ -40,16 +36,7 @@ if not i: continue - try: - os.makedirs(args.directory, exist_ok=True) - subprocess.run(i, cwd=args.directory, check=True) - except subprocess.CalledProcessError: - exit(1) - -if dummy_target: - with open(dummy_target, 'a'): - os.utime(dummy_target, None) - exit(0) + subprocess.run(i, cwd=args.directory) # Copy outputs zipped_outputs = zip(args.outputs, args.original_outputs) diff -Nru meson-0.53.2/mesonbuild/cmake/executor.py meson-0.52.1/mesonbuild/cmake/executor.py --- meson-0.53.2/mesonbuild/cmake/executor.py 2020-02-25 18:00:46.000000000 +0000 +++ meson-0.52.1/mesonbuild/cmake/executor.py 2019-08-28 17:15:39.000000000 +0000 @@ -15,22 +15,16 @@ # This class contains the basic functionality needed to run any interpreter # or an interpreter-based tool. -import subprocess -from pathlib import Path -import typing as T -import re -import os -import shutil -import ctypes -import textwrap - from .. import mlog, mesonlib from ..mesonlib import PerMachine, Popen_safe, version_compare, MachineChoice from ..environment import Environment -if T.TYPE_CHECKING: +from typing import List, Tuple, Optional, TYPE_CHECKING + +if TYPE_CHECKING: from ..dependencies.base import ExternalProgram +import re, os, shutil, ctypes class CMakeExecutor: # The class's copy of the CMake path. Avoids having to search for it @@ -56,7 +50,7 @@ self.cmakebin = None return - def find_cmake_binary(self, environment: Environment, silent: bool = False) -> T.Tuple['ExternalProgram', str]: + def find_cmake_binary(self, environment: Environment, silent: bool = False) -> Tuple['ExternalProgram', str]: from ..dependencies.base import ExternalProgram # Create an iterator of options @@ -108,7 +102,7 @@ return CMakeExecutor.class_cmakebin[self.for_machine], CMakeExecutor.class_cmakevers[self.for_machine] - def check_cmake(self, cmakebin: 'ExternalProgram') -> T.Optional[str]: + def check_cmake(self, cmakebin: 'ExternalProgram') -> Optional[str]: if not cmakebin.found(): mlog.log('Did not find CMake {!r}'.format(cmakebin.name)) return None @@ -131,25 +125,21 @@ cmvers = re.sub(r'\s*cmake version\s*', '', out.split('\n')[0]).strip() return cmvers - def _cache_key(self, args: T.List[str], build_dir: str, env): + def _cache_key(self, args: List[str], build_dir: str, env): fenv = frozenset(env.items()) if env is not None else None targs = tuple(args) return (self.cmakebin, targs, build_dir, fenv) - def _call_real(self, args: T.List[str], build_dir: str, env) -> T.Tuple[int, str, str]: + def _call_real(self, args: List[str], build_dir: str, env) -> Tuple[int, str, str]: os.makedirs(build_dir, exist_ok=True) cmd = self.cmakebin.get_command() + args - ret = subprocess.run(cmd, env=env, cwd=build_dir, close_fds=False, - stdout=subprocess.PIPE, stderr=subprocess.PIPE, - universal_newlines=False) - rc = ret.returncode - out = ret.stdout.decode(errors='ignore') - err = ret.stderr.decode(errors='ignore') + p, out, err = Popen_safe(cmd, env=env, cwd=build_dir) + rc = p.returncode call = ' '.join(cmd) mlog.debug("Called `{}` in {} -> {}".format(call, build_dir, rc)) return rc, out, err - def call(self, args: T.List[str], build_dir: str, env=None, disable_cache: bool = False): + def call(self, args: List[str], build_dir: str, env=None, disable_cache: bool = False): if env is None: env = os.environ @@ -163,7 +153,7 @@ cache[key] = self._call_real(args, build_dir, env) return cache[key] - def call_with_fake_build(self, args: T.List[str], build_dir: str, env=None): + def call_with_fake_build(self, args: List[str], build_dir: str, env=None): # First check the cache cache = CMakeExecutor.class_cmake_cache key = self._cache_key(args, build_dir, env) @@ -177,7 +167,7 @@ fallback = os.path.realpath(__file__) # A file used as a fallback wehen everything else fails compilers = self.environment.coredata.compilers[MachineChoice.BUILD] - def make_abs(exe: str, lang: str) -> str: + def make_abs(exe: str, lang: str): if os.path.isabs(exe): return exe @@ -187,17 +177,14 @@ p = fallback return p - def choose_compiler(lang: str) -> T.Tuple[str, str]: + def choose_compiler(lang: str): exe_list = [] if lang in compilers: exe_list = compilers[lang].get_exelist() else: - try: - comp_obj = self.environment.compiler_from_language(lang, MachineChoice.BUILD) - if comp_obj is not None: - exe_list = comp_obj.get_exelist() - except Exception: - pass + comp_obj = self.environment.compiler_from_language(lang, MachineChoice.BUILD) + if comp_obj is not None: + exe_list = comp_obj.get_exelist() if len(exe_list) == 1: return make_abs(exe_list[0], lang), '' @@ -209,71 +196,53 @@ c_comp, c_launcher = choose_compiler('c') cxx_comp, cxx_launcher = choose_compiler('cpp') - fortran_comp, fortran_launcher = choose_compiler('fortran') # on Windows, choose_compiler returns path with \ as separator - replace by / before writing to CMAKE file c_comp = c_comp.replace('\\', '/') c_launcher = c_launcher.replace('\\', '/') cxx_comp = cxx_comp.replace('\\', '/') cxx_launcher = cxx_launcher.replace('\\', '/') - fortran_comp = fortran_comp.replace('\\', '/') - fortran_launcher = fortran_launcher.replace('\\', '/') # Reset the CMake cache - (Path(build_dir) / 'CMakeCache.txt').write_text('CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1\n') + with open('{}/CMakeCache.txt'.format(build_dir), 'w') as fp: + fp.write('CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1\n') # Fake the compiler files - comp_dir = Path(build_dir) / 'CMakeFiles' / self.cmakevers - comp_dir.mkdir(parents=True, exist_ok=True) + comp_dir = '{}/CMakeFiles/{}'.format(build_dir, self.cmakevers) + os.makedirs(comp_dir, exist_ok=True) + + c_comp_file = '{}/CMakeCCompiler.cmake'.format(comp_dir) + cxx_comp_file = '{}/CMakeCXXCompiler.cmake'.format(comp_dir) - c_comp_file = comp_dir / 'CMakeCCompiler.cmake' - cxx_comp_file = comp_dir / 'CMakeCXXCompiler.cmake' - fortran_comp_file = comp_dir / 'CMakeFortranCompiler.cmake' - - if c_comp and not c_comp_file.is_file(): - c_comp_file.write_text(textwrap.dedent('''\ - # Fake CMake file to skip the boring and slow stuff - set(CMAKE_C_COMPILER "{}") # Should be a valid compiler for try_compile, etc. - set(CMAKE_C_COMPILER_LAUNCHER "{}") # The compiler launcher (if presentt) - set(CMAKE_C_COMPILER_ID "GNU") # Pretend we have found GCC - set(CMAKE_COMPILER_IS_GNUCC 1) - set(CMAKE_C_COMPILER_LOADED 1) - set(CMAKE_C_COMPILER_WORKS TRUE) - set(CMAKE_C_ABI_COMPILED TRUE) - set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) - set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) - set(CMAKE_SIZEOF_VOID_P "{}") - '''.format(c_comp, c_launcher, ctypes.sizeof(ctypes.c_voidp)))) - - if cxx_comp and not cxx_comp_file.is_file(): - cxx_comp_file.write_text(textwrap.dedent('''\ - # Fake CMake file to skip the boring and slow stuff - set(CMAKE_CXX_COMPILER "{}") # Should be a valid compiler for try_compile, etc. - set(CMAKE_CXX_COMPILER_LAUNCHER "{}") # The compiler launcher (if presentt) - set(CMAKE_CXX_COMPILER_ID "GNU") # Pretend we have found GCC - set(CMAKE_COMPILER_IS_GNUCXX 1) - set(CMAKE_CXX_COMPILER_LOADED 1) - set(CMAKE_CXX_COMPILER_WORKS TRUE) - set(CMAKE_CXX_ABI_COMPILED TRUE) - set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) - set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;mm;CPP) - set(CMAKE_SIZEOF_VOID_P "{}") - '''.format(cxx_comp, cxx_launcher, ctypes.sizeof(ctypes.c_voidp)))) - - if fortran_comp and not fortran_comp_file.is_file(): - fortran_comp_file.write_text(textwrap.dedent('''\ - # Fake CMake file to skip the boring and slow stuff - set(CMAKE_Fortran_COMPILER "{}") # Should be a valid compiler for try_compile, etc. - set(CMAKE_Fortran_COMPILER_LAUNCHER "{}") # The compiler launcher (if presentt) - set(CMAKE_Fortran_COMPILER_ID "GNU") # Pretend we have found GCC - set(CMAKE_COMPILER_IS_GNUG77 1) - set(CMAKE_Fortran_COMPILER_LOADED 1) - set(CMAKE_Fortran_COMPILER_WORKS TRUE) - set(CMAKE_Fortran_ABI_COMPILED TRUE) - set(CMAKE_Fortran_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) - set(CMAKE_Fortran_SOURCE_FILE_EXTENSIONS f;F;fpp;FPP;f77;F77;f90;F90;for;For;FOR;f95;F95) - set(CMAKE_SIZEOF_VOID_P "{}") - '''.format(fortran_comp, fortran_launcher, ctypes.sizeof(ctypes.c_voidp)))) + if not os.path.exists(c_comp_file): + with open(c_comp_file, 'w') as fp: + fp.write('''# Fake CMake file to skip the boring and slow stuff +set(CMAKE_C_COMPILER "{}") # Should be a valid compiler for try_compile, etc. +set(CMAKE_C_COMPILER_LAUNCHER "{}") # The compiler launcher (if presentt) +set(CMAKE_C_COMPILER_ID "GNU") # Pretend we have found GCC +set(CMAKE_COMPILER_IS_GNUCC 1) +set(CMAKE_C_COMPILER_LOADED 1) +set(CMAKE_C_COMPILER_WORKS TRUE) +set(CMAKE_C_ABI_COMPILED TRUE) +set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) +set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) +set(CMAKE_SIZEOF_VOID_P "{}") +'''.format(c_comp, c_launcher, ctypes.sizeof(ctypes.c_voidp))) + + if not os.path.exists(cxx_comp_file): + with open(cxx_comp_file, 'w') as fp: + fp.write('''# Fake CMake file to skip the boring and slow stuff +set(CMAKE_CXX_COMPILER "{}") # Should be a valid compiler for try_compile, etc. +set(CMAKE_CXX_COMPILER_LAUNCHER "{}") # The compiler launcher (if presentt) +set(CMAKE_CXX_COMPILER_ID "GNU") # Pretend we have found GCC +set(CMAKE_COMPILER_IS_GNUCXX 1) +set(CMAKE_CXX_COMPILER_LOADED 1) +set(CMAKE_CXX_COMPILER_WORKS TRUE) +set(CMAKE_CXX_ABI_COMPILED TRUE) +set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) +set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;mm;CPP) +set(CMAKE_SIZEOF_VOID_P "{}") +'''.format(cxx_comp, cxx_launcher, ctypes.sizeof(ctypes.c_voidp))) return self.call(args, build_dir, env) diff -Nru meson-0.53.2/mesonbuild/cmake/fileapi.py meson-0.52.1/mesonbuild/cmake/fileapi.py --- meson-0.53.2/mesonbuild/cmake/fileapi.py 2020-01-23 12:51:19.000000000 +0000 +++ meson-0.52.1/mesonbuild/cmake/fileapi.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,318 +0,0 @@ -# Copyright 2019 The Meson development team - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from .common import CMakeException, CMakeBuildFile, CMakeConfiguration -import typing as T -from .. import mlog -import os -import json -import re - -STRIP_KEYS = ['cmake', 'reply', 'backtrace', 'backtraceGraph', 'version'] - -class CMakeFileAPI: - def __init__(self, build_dir: str): - self.build_dir = build_dir - self.api_base_dir = os.path.join(self.build_dir, '.cmake', 'api', 'v1') - self.request_dir = os.path.join(self.api_base_dir, 'query', 'client-meson') - self.reply_dir = os.path.join(self.api_base_dir, 'reply') - self.cmake_sources = [] - self.cmake_configurations = [] - self.kind_resolver_map = { - 'codemodel': self._parse_codemodel, - 'cmakeFiles': self._parse_cmakeFiles, - } - - def get_cmake_sources(self) -> T.List[CMakeBuildFile]: - return self.cmake_sources - - def get_cmake_configurations(self) -> T.List[CMakeConfiguration]: - return self.cmake_configurations - - def setup_request(self) -> None: - os.makedirs(self.request_dir, exist_ok=True) - - query = { - 'requests': [ - {'kind': 'codemodel', 'version': {'major': 2, 'minor': 0}}, - {'kind': 'cmakeFiles', 'version': {'major': 1, 'minor': 0}}, - ] - } - - with open(os.path.join(self.request_dir, 'query.json'), 'w') as fp: - json.dump(query, fp, indent=2) - - def load_reply(self) -> None: - if not os.path.isdir(self.reply_dir): - raise CMakeException('No response from the CMake file API') - - files = os.listdir(self.reply_dir) - root = None - reg_index = re.compile(r'^index-.*\.json$') - for i in files: - if reg_index.match(i): - root = i - break - - if not root: - raise CMakeException('Failed to find the CMake file API index') - - index = self._reply_file_content(root) # Load the root index - index = self._strip_data(index) # Avoid loading duplicate files - index = self._resolve_references(index) # Load everything - index = self._strip_data(index) # Strip unused data (again for loaded files) - - # Debug output - debug_json = os.path.normpath(os.path.join(self.build_dir, '..', 'fileAPI.json')) - with open(debug_json, 'w') as fp: - json.dump(index, fp, indent=2) - mlog.cmd_ci_include(debug_json) - - # parse the JSON - for i in index['objects']: - assert(isinstance(i, dict)) - assert('kind' in i) - assert(i['kind'] in self.kind_resolver_map) - - self.kind_resolver_map[i['kind']](i) - - def _parse_codemodel(self, data: dict) -> None: - assert('configurations' in data) - assert('paths' in data) - - source_dir = data['paths']['source'] - build_dir = data['paths']['build'] - - # The file API output differs quite a bit from the server - # output. It is more flat than the server output and makes - # heavy use of references. Here these references are - # resolved and the resulting data structure is identical - # to the CMake serve output. - - def helper_parse_dir(dir_entry: dict) -> T.Tuple[str, str]: - src_dir = dir_entry.get('source', '.') - bld_dir = dir_entry.get('build', '.') - src_dir = src_dir if os.path.isabs(src_dir) else os.path.join(source_dir, src_dir) - bld_dir = bld_dir if os.path.isabs(bld_dir) else os.path.join(source_dir, bld_dir) - src_dir = os.path.normpath(src_dir) - bld_dir = os.path.normpath(bld_dir) - - return src_dir, bld_dir - - def parse_sources(comp_group: dict, tgt: dict) -> T.Tuple[T.List[str], T.List[str], T.List[int]]: - gen = [] - src = [] - idx = [] - - src_list_raw = tgt.get('sources', []) - for i in comp_group.get('sourceIndexes', []): - if i >= len(src_list_raw) or 'path' not in src_list_raw[i]: - continue - if src_list_raw[i].get('isGenerated', False): - gen += [src_list_raw[i]['path']] - else: - src += [src_list_raw[i]['path']] - idx += [i] - - return src, gen, idx - - def parse_target(tgt: dict) -> dict: - src_dir, bld_dir = helper_parse_dir(cnf.get('paths', {})) - - # Parse install paths (if present) - install_paths = [] - if 'install' in tgt: - prefix = tgt['install']['prefix']['path'] - install_paths = [os.path.join(prefix, x['path']) for x in tgt['install']['destinations']] - install_paths = list(set(install_paths)) - - # On the first look, it looks really nice that the CMake devs have - # decided to use arrays for the linker flags. However, this feeling - # soon turns into despair when you realize that there only one entry - # per type in most cases, and we still have to do manual string splitting. - link_flags = [] - link_libs = [] - for i in tgt.get('link', {}).get('commandFragments', []): - if i['role'] == 'flags': - link_flags += [i['fragment']] - elif i['role'] == 'libraries': - link_libs += [i['fragment']] - elif i['role'] == 'libraryPath': - link_flags += ['-L{}'.format(i['fragment'])] - elif i['role'] == 'frameworkPath': - link_flags += ['-F{}'.format(i['fragment'])] - for i in tgt.get('archive', {}).get('commandFragments', []): - if i['role'] == 'flags': - link_flags += [i['fragment']] - - # TODO The `dependencies` entry is new in the file API. - # maybe we can make use of that in addition to the - # implicit dependency detection - tgt_data = { - 'artifacts': [x.get('path', '') for x in tgt.get('artifacts', [])], - 'sourceDirectory': src_dir, - 'buildDirectory': bld_dir, - 'name': tgt.get('name', ''), - 'fullName': tgt.get('nameOnDisk', ''), - 'hasInstallRule': 'install' in tgt, - 'installPaths': install_paths, - 'linkerLanguage': tgt.get('link', {}).get('language', 'CXX'), - 'linkLibraries': ' '.join(link_libs), # See previous comment block why we join the array - 'linkFlags': ' '.join(link_flags), # See previous comment block why we join the array - 'type': tgt.get('type', 'EXECUTABLE'), - 'fileGroups': [], - } - - processed_src_idx = [] - for cg in tgt.get('compileGroups', []): - # Again, why an array, when there is usually only one element - # and arguments are separated with spaces... - flags = [] - for i in cg.get('compileCommandFragments', []): - flags += [i['fragment']] - - cg_data = { - 'defines': [x.get('define', '') for x in cg.get('defines', [])], - 'compileFlags': ' '.join(flags), - 'language': cg.get('language', 'C'), - 'isGenerated': None, # Set later, flag is stored per source file - 'sources': [], - 'includePath': cg.get('includes', []), - } - - normal_src, generated_src, src_idx = parse_sources(cg, tgt) - if normal_src: - cg_data = dict(cg_data) - cg_data['isGenerated'] = False - cg_data['sources'] = normal_src - tgt_data['fileGroups'] += [cg_data] - if generated_src: - cg_data = dict(cg_data) - cg_data['isGenerated'] = True - cg_data['sources'] = generated_src - tgt_data['fileGroups'] += [cg_data] - processed_src_idx += src_idx - - # Object libraries have no compile groups, only source groups. - # So we add all the source files to a dummy source group that were - # not found in the previous loop - normal_src = [] - generated_src = [] - for idx, src in enumerate(tgt.get('sources', [])): - if idx in processed_src_idx: - continue - - if src.get('isGenerated', False): - generated_src += [src['path']] - else: - normal_src += [src['path']] - - if normal_src: - tgt_data['fileGroups'] += [{ - 'isGenerated': False, - 'sources': normal_src, - }] - if generated_src: - tgt_data['fileGroups'] += [{ - 'isGenerated': True, - 'sources': generated_src, - }] - return tgt_data - - def parse_project(pro: dict) -> dict: - # Only look at the first directory specified in directoryIndexes - # TODO Figure out what the other indexes are there for - p_src_dir = source_dir - p_bld_dir = build_dir - try: - p_src_dir, p_bld_dir = helper_parse_dir(cnf['directories'][pro['directoryIndexes'][0]]) - except (IndexError, KeyError): - pass - - pro_data = { - 'name': pro.get('name', ''), - 'sourceDirectory': p_src_dir, - 'buildDirectory': p_bld_dir, - 'targets': [], - } - - for ref in pro.get('targetIndexes', []): - tgt = {} - try: - tgt = cnf['targets'][ref] - except (IndexError, KeyError): - pass - pro_data['targets'] += [parse_target(tgt)] - - return pro_data - - for cnf in data.get('configurations', []): - cnf_data = { - 'name': cnf.get('name', ''), - 'projects': [], - } - - for pro in cnf.get('projects', []): - cnf_data['projects'] += [parse_project(pro)] - - self.cmake_configurations += [CMakeConfiguration(cnf_data)] - - def _parse_cmakeFiles(self, data: dict) -> None: - assert('inputs' in data) - assert('paths' in data) - - src_dir = data['paths']['source'] - - for i in data['inputs']: - path = i['path'] - path = path if os.path.isabs(path) else os.path.join(src_dir, path) - self.cmake_sources += [CMakeBuildFile(path, i.get('isCMake', False), i.get('isGenerated', False))] - - def _strip_data(self, data: T.Any) -> T.Any: - if isinstance(data, list): - for idx, i in enumerate(data): - data[idx] = self._strip_data(i) - - elif isinstance(data, dict): - new = {} - for key, val in data.items(): - if key not in STRIP_KEYS: - new[key] = self._strip_data(val) - data = new - - return data - - def _resolve_references(self, data: T.Any) -> T.Any: - if isinstance(data, list): - for idx, i in enumerate(data): - data[idx] = self._resolve_references(i) - - elif isinstance(data, dict): - # Check for the "magic" reference entry and insert - # it into the root data dict - if 'jsonFile' in data: - data.update(self._reply_file_content(data['jsonFile'])) - - for key, val in data.items(): - data[key] = self._resolve_references(val) - - return data - - def _reply_file_content(self, filename: str) -> dict: - real_path = os.path.join(self.reply_dir, filename) - if not os.path.exists(real_path): - raise CMakeException('File "{}" does not exist'.format(real_path)) - - with open(real_path, 'r') as fp: - return json.load(fp) diff -Nru meson-0.53.2/mesonbuild/cmake/__init__.py meson-0.52.1/mesonbuild/cmake/__init__.py --- meson-0.53.2/mesonbuild/cmake/__init__.py 2020-01-23 21:41:11.000000000 +0000 +++ meson-0.52.1/mesonbuild/cmake/__init__.py 2019-11-28 17:37:44.000000000 +0000 @@ -19,19 +19,16 @@ 'CMakeClient', 'CMakeExecutor', 'CMakeException', - 'CMakeFileAPI', 'CMakeInterpreter', 'CMakeTarget', 'CMakeTraceLine', 'CMakeTraceParser', 'parse_generator_expressions', - 'language_map', ] from .common import CMakeException from .client import CMakeClient from .executor import CMakeExecutor -from .fileapi import CMakeFileAPI from .generator import parse_generator_expressions -from .interpreter import CMakeInterpreter, language_map +from .interpreter import CMakeInterpreter from .traceparser import CMakeTarget, CMakeTraceLine, CMakeTraceParser diff -Nru meson-0.53.2/mesonbuild/cmake/interpreter.py meson-0.52.1/mesonbuild/cmake/interpreter.py --- meson-0.53.2/mesonbuild/cmake/interpreter.py 2020-02-25 18:00:46.000000000 +0000 +++ meson-0.52.1/mesonbuild/cmake/interpreter.py 2019-11-28 17:37:44.000000000 +0000 @@ -15,21 +15,17 @@ # This class contains the basic functionality needed to run any interpreter # or an interpreter-based tool. -from .common import CMakeException, CMakeTarget -from .client import CMakeClient, RequestCMakeInputs, RequestConfigure, RequestCompute, RequestCodeModel -from .fileapi import CMakeFileAPI +from .common import CMakeException +from .client import CMakeClient, RequestCMakeInputs, RequestConfigure, RequestCompute, RequestCodeModel, CMakeTarget from .executor import CMakeExecutor from .traceparser import CMakeTraceParser, CMakeGeneratorTarget from .. import mlog from ..environment import Environment -from ..mesonlib import MachineChoice, version_compare +from ..mesonlib import MachineChoice from ..compilers.compilers import lang_suffixes, header_suffixes, obj_suffixes, lib_suffixes, is_header from subprocess import Popen, PIPE +from typing import Any, List, Dict, Optional, TYPE_CHECKING from threading import Thread -from enum import Enum -from functools import lru_cache -from pathlib import Path -import typing as T import os, re from ..mparser import ( @@ -49,7 +45,7 @@ ) -if T.TYPE_CHECKING: +if TYPE_CHECKING: from ..build import Build from ..backend.backends import Backend @@ -80,8 +76,6 @@ 'c': 'C', 'cpp': 'CXX', 'cuda': 'CUDA', - 'objc': 'OBJC', - 'objcpp': 'OBJCXX', 'cs': 'CSharp', 'java': 'Java', 'fortran': 'Fortran', @@ -97,6 +91,8 @@ 'INTERFACE_LIBRARY': 'header_only' } +target_type_requires_trace = ['INTERFACE_LIBRARY'] + skip_targets = ['UTILITY'] blacklist_compiler_flags = [ @@ -128,99 +124,29 @@ 'advapi32.lib' ] -transfer_dependencies_from = ['header_only'] +# Utility functions to generate local keys +def _target_key(tgt_name: str) -> str: + return '__tgt_{}__'.format(tgt_name) -_cmake_name_regex = re.compile(r'[^_a-zA-Z0-9]') -def _sanitize_cmake_name(name: str) -> str: - name = _cmake_name_regex.sub('_', name) - return 'cm_' + name +def _generated_file_key(fname: str) -> str: + return '__gen_{}__'.format(os.path.basename(fname)) -class OutputTargetMap: +class ConverterTarget: + lang_cmake_to_meson = {val.lower(): key for key, val in language_map.items()} rm_so_version = re.compile(r'(\.[0-9]+)+$') - def __init__(self, build_dir: str): - self.tgt_map = {} - self.build_dir = build_dir - - def add(self, tgt: T.Union['ConverterTarget', 'ConverterCustomTarget']) -> None: - def assign_keys(keys: T.List[str]) -> None: - for i in [x for x in keys if x]: - self.tgt_map[i] = tgt - keys = [self._target_key(tgt.cmake_name)] - if isinstance(tgt, ConverterTarget): - keys += [tgt.full_name] - keys += [self._rel_artifact_key(x) for x in tgt.artifacts] - keys += [self._base_artifact_key(x) for x in tgt.artifacts] - if isinstance(tgt, ConverterCustomTarget): - keys += [self._rel_generated_file_key(x) for x in tgt.original_outputs] - keys += [self._base_generated_file_key(x) for x in tgt.original_outputs] - assign_keys(keys) - - def _return_first_valid_key(self, keys: T.List[str]) -> T.Optional[T.Union['ConverterTarget', 'ConverterCustomTarget']]: - for i in keys: - if i and i in self.tgt_map: - return self.tgt_map[i] - return None - - def target(self, name: str) -> T.Optional[T.Union['ConverterTarget', 'ConverterCustomTarget']]: - return self._return_first_valid_key([self._target_key(name)]) - - def artifact(self, name: str) -> T.Optional[T.Union['ConverterTarget', 'ConverterCustomTarget']]: - keys = [] - candidates = [name, OutputTargetMap.rm_so_version.sub('', name)] - for i in lib_suffixes: - if not name.endswith('.' + i): - continue - new_name = name[:-len(i) - 1] - new_name = OutputTargetMap.rm_so_version.sub('', new_name) - candidates += ['{}.{}'.format(new_name, i)] - for i in candidates: - keys += [self._rel_artifact_key(i), os.path.basename(i), self._base_artifact_key(i)] - return self._return_first_valid_key(keys) - - def generated(self, name: str) -> T.Optional[T.Union['ConverterTarget', 'ConverterCustomTarget']]: - return self._return_first_valid_key([self._rel_generated_file_key(name), self._base_generated_file_key(name)]) - - # Utility functions to generate local keys - def _rel_path(self, fname: str) -> T.Optional[str]: - fname = os.path.normpath(os.path.join(self.build_dir, fname)) - if os.path.commonpath([self.build_dir, fname]) != self.build_dir: - return None - return os.path.relpath(fname, self.build_dir) - - def _target_key(self, tgt_name: str) -> str: - return '__tgt_{}__'.format(tgt_name) - - def _rel_generated_file_key(self, fname: str) -> T.Optional[str]: - path = self._rel_path(fname) - return '__relgen_{}__'.format(path) if path else None - - def _base_generated_file_key(self, fname: str) -> str: - return '__gen_{}__'.format(os.path.basename(fname)) - - def _rel_artifact_key(self, fname: str) -> T.Optional[str]: - path = self._rel_path(fname) - return '__relart_{}__'.format(path) if path else None - - def _base_artifact_key(self, fname: str) -> str: - return '__art_{}__'.format(os.path.basename(fname)) - -class ConverterTarget: def __init__(self, target: CMakeTarget, env: Environment): self.env = env self.artifacts = target.artifacts self.src_dir = target.src_dir self.build_dir = target.build_dir self.name = target.name - self.cmake_name = target.name self.full_name = target.full_name self.type = target.type self.install = target.install self.install_dir = '' self.link_libraries = target.link_libraries self.link_flags = target.link_flags + target.link_lang_flags - self.depends_raw = [] - self.depends = [] if target.install_paths: self.install_dir = target.install_paths[0] @@ -229,7 +155,6 @@ self.sources = [] self.generated = [] self.includes = [] - self.sys_includes = [] self.link_with = [] self.object_libs = [] self.compile_opts = {} @@ -239,13 +164,9 @@ # Project default override options (c_std, cpp_std, etc.) self.override_options = [] - # Convert the target name to a valid meson target name - self.name = _sanitize_cmake_name(self.name) - for i in target.files: # Determine the meson language - lang_cmake_to_meson = {val.lower(): key for key, val in language_map.items()} - lang = lang_cmake_to_meson.get(i.language.lower(), 'c') + lang = ConverterTarget.lang_cmake_to_meson.get(i.language.lower(), 'c') if lang not in self.languages: self.languages += [lang] if lang not in self.compile_opts: @@ -257,8 +178,7 @@ self.compile_opts[lang] += [x for x in args if x not in self.compile_opts[lang]] # Handle include directories - self.includes += [x['path'] for x in i.includes if x not in self.includes and not x['isSystem']] - self.sys_includes += [x['path'] for x in i.includes if x not in self.sys_includes and x['isSystem']] + self.includes += [x for x in i.includes if x not in self.includes] # Add sources to the right array if i.is_generated: @@ -271,7 +191,7 @@ std_regex = re.compile(r'([-]{1,2}std=|/std:v?|[-]{1,2}std:)(.*)') - def postprocess(self, output_target_map: OutputTargetMap, root_src_dir: str, subdir: str, install_prefix: str, trace: CMakeTraceParser) -> None: + def postprocess(self, output_target_map: dict, root_src_dir: str, subdir: str, install_prefix: str, trace: CMakeTraceParser) -> None: # Detect setting the C and C++ standard for i in ['c', 'cpp']: if i not in self.compile_opts: @@ -296,84 +216,32 @@ self.pie = True # Use the CMake trace, if required - tgt = trace.targets.get(self.cmake_name) - if tgt: - self.depends_raw = trace.targets[self.cmake_name].depends - if self.type.upper() == 'INTERFACE_LIBRARY': - props = tgt.properties + if self.type.upper() in target_type_requires_trace: + if self.name in trace.targets: + props = trace.targets[self.name].properties self.includes += props.get('INTERFACE_INCLUDE_DIRECTORIES', []) self.public_compile_opts += props.get('INTERFACE_COMPILE_DEFINITIONS', []) self.public_compile_opts += props.get('INTERFACE_COMPILE_OPTIONS', []) self.link_flags += props.get('INTERFACE_LINK_OPTIONS', []) + else: + mlog.warning('CMake: Target', mlog.bold(self.name), 'not found in CMake trace. This can lead to build errors') - # TODO refactor this copy paste from CMakeDependency for future releases - reg_is_lib = re.compile(r'^(-l[a-zA-Z0-9_]+|-l?pthread)$') - to_process = [self.cmake_name] - processed = [] - while len(to_process) > 0: - curr = to_process.pop(0) - - if curr in processed or curr not in trace.targets: + # Fix link libraries + def try_resolve_link_with(path: str) -> Optional[str]: + basename = os.path.basename(path) + candidates = [basename, ConverterTarget.rm_so_version.sub('', basename)] + for i in lib_suffixes: + if not basename.endswith('.' + i): continue - - tgt = trace.targets[curr] - cfgs = [] - cfg = '' - otherDeps = [] - libraries = [] - mlog.debug(tgt) - - if 'INTERFACE_COMPILE_DEFINITIONS' in tgt.properties: - self.public_compile_opts += ['-D' + re.sub('^-D', '', x) for x in tgt.properties['INTERFACE_COMPILE_DEFINITIONS'] if x] - - if 'INTERFACE_COMPILE_OPTIONS' in tgt.properties: - self.public_compile_opts += [x for x in tgt.properties['INTERFACE_COMPILE_OPTIONS'] if x] - - if 'IMPORTED_CONFIGURATIONS' in tgt.properties: - cfgs += [x for x in tgt.properties['IMPORTED_CONFIGURATIONS'] if x] - cfg = cfgs[0] - - if 'CONFIGURATIONS' in tgt.properties: - cfgs += [x for x in tgt.properties['CONFIGURATIONS'] if x] - cfg = cfgs[0] - - if 'RELEASE' in cfgs: - cfg = 'RELEASE' - - if 'IMPORTED_IMPLIB_{}'.format(cfg) in tgt.properties: - libraries += [x for x in tgt.properties['IMPORTED_IMPLIB_{}'.format(cfg)] if x] - elif 'IMPORTED_IMPLIB' in tgt.properties: - libraries += [x for x in tgt.properties['IMPORTED_IMPLIB'] if x] - elif 'IMPORTED_LOCATION_{}'.format(cfg) in tgt.properties: - libraries += [x for x in tgt.properties['IMPORTED_LOCATION_{}'.format(cfg)] if x] - elif 'IMPORTED_LOCATION' in tgt.properties: - libraries += [x for x in tgt.properties['IMPORTED_LOCATION'] if x] - - if 'LINK_LIBRARIES' in tgt.properties: - otherDeps += [x for x in tgt.properties['LINK_LIBRARIES'] if x] - - if 'INTERFACE_LINK_LIBRARIES' in tgt.properties: - otherDeps += [x for x in tgt.properties['INTERFACE_LINK_LIBRARIES'] if x] - - if 'IMPORTED_LINK_DEPENDENT_LIBRARIES_{}'.format(cfg) in tgt.properties: - otherDeps += [x for x in tgt.properties['IMPORTED_LINK_DEPENDENT_LIBRARIES_{}'.format(cfg)] if x] - elif 'IMPORTED_LINK_DEPENDENT_LIBRARIES' in tgt.properties: - otherDeps += [x for x in tgt.properties['IMPORTED_LINK_DEPENDENT_LIBRARIES'] if x] - - for j in otherDeps: - if j in trace.targets: - to_process += [j] - elif reg_is_lib.match(j) or os.path.exists(j): - libraries += [j] - - for j in libraries: - if j not in self.link_libraries: - self.link_libraries += [j] - - processed += [curr] - elif self.type.upper() not in ['EXECUTABLE', 'OBJECT_LIBRARY']: - mlog.warning('CMake: Target', mlog.bold(self.cmake_name), 'not found in CMake trace. This can lead to build errors') + new_basename = basename[:-len(i) - 1] + new_basename = ConverterTarget.rm_so_version.sub('', new_basename) + new_basename = '{}.{}'.format(new_basename, i) + candidates += [new_basename] + for i in candidates: + if i in output_target_map: + return output_target_map[i] + return None temp = [] for i in self.link_libraries: @@ -381,7 +249,7 @@ if ',-rpath,' in i: continue if not os.path.isabs(i): - link_with = output_target_map.artifact(i) + link_with = try_resolve_link_with(i) if link_with: self.link_with += [link_with] continue @@ -398,23 +266,11 @@ self.generated = [x for x in self.generated if any([x.endswith(y) for y in supported])] # Make paths relative - def rel_path(x: str, is_header: bool, is_generated: bool) -> T.Optional[str]: + def rel_path(x: str, is_header: bool, is_generated: bool) -> Optional[str]: if not os.path.isabs(x): x = os.path.normpath(os.path.join(self.src_dir, x)) if not os.path.exists(x) and not any([x.endswith(y) for y in obj_suffixes]) and not is_generated: - mlog.warning('CMake: path', mlog.bold(x), 'does not exist.') - mlog.warning(' --> Ignoring. This can lead to build errors.') - return None - if ( - os.path.isabs(x) - and os.path.commonpath([x, self.env.get_source_dir()]) == self.env.get_source_dir() - and not ( - os.path.commonpath([x, root_src_dir]) == root_src_dir or - os.path.commonpath([x, self.env.get_build_dir()]) == self.env.get_build_dir() - ) - ): - mlog.warning('CMake: path', mlog.bold(x), 'is inside the root project but', mlog.bold('not'), 'inside the subproject.') - mlog.warning(' --> Ignoring. This can lead to build errors.') + mlog.warning('CMake: path', mlog.bold(x), 'does not exist. Ignoring. This can lead to build errors') return None if os.path.isabs(x) and os.path.commonpath([x, self.env.get_build_dir()]) == self.env.get_build_dir(): if is_header: @@ -426,8 +282,9 @@ return x def custom_target(x: str): - ctgt = output_target_map.generated(x) - if ctgt: + key = _generated_file_key(x) + if key in output_target_map: + ctgt = output_target_map[key] assert(isinstance(ctgt, ConverterCustomTarget)) ref = ctgt.get_ref(x) assert(isinstance(ref, CustomTargetReference) and ref.valid()) @@ -436,7 +293,6 @@ build_dir_rel = os.path.relpath(self.build_dir, os.path.join(self.env.get_build_dir(), subdir)) self.includes = list(set([rel_path(x, True, False) for x in set(self.includes)] + [build_dir_rel])) - self.sys_includes = list(set([rel_path(x, True, False) for x in set(self.sys_includes)])) self.sources = [rel_path(x, False, False) for x in self.sources] self.generated = [rel_path(x, False, True) for x in self.generated] @@ -445,7 +301,6 @@ # Remove delete entries self.includes = [x for x in self.includes if x is not None] - self.sys_includes = [x for x in self.sys_includes if x is not None] self.sources = [x for x in self.sources if x is not None] self.generated = [x for x in self.generated if x is not None] @@ -469,89 +324,28 @@ self.link_libraries = [x for x in self.link_libraries if x.lower() not in blacklist_link_libs] self.link_flags = [x for x in self.link_flags if check_flag(x)] - # Handle explicit CMake add_dependency() calls - for i in self.depends_raw: - tgt = output_target_map.target(i) - if tgt: - self.depends.append(tgt) - - def process_object_libs(self, obj_target_list: T.List['ConverterTarget'], linker_workaround: bool): + def process_object_libs(self, obj_target_list: List['ConverterTarget']): # Try to detect the object library(s) from the generated input sources temp = [x for x in self.generated if isinstance(x, str)] temp = [os.path.basename(x) for x in temp] temp = [x for x in temp if any([x.endswith('.' + y) for y in obj_suffixes])] temp = [os.path.splitext(x)[0] for x in temp] - exts = self._all_source_suffixes() # Temp now stores the source filenames of the object files for i in obj_target_list: - source_files = [x for x in i.sources + i.generated if isinstance(x, str)] - source_files = [os.path.basename(x) for x in source_files] - for j in temp: - # On some platforms (specifically looking at you Windows with vs20xy backend) CMake does - # not produce object files with the format `foo.cpp.obj`, instead it skipps the language - # suffix and just produces object files like `foo.obj`. Thus we have to do our best to - # undo this step and guess the correct language suffix of the object file. This is done - # by trying all language suffixes meson knows and checking if one of them fits. - candidates = [j] # type: T.List[str] - if not any([j.endswith('.' + x) for x in exts]): - mlog.warning('Object files do not contain source file extensions, thus falling back to guessing them.', once=True) - candidates += ['{}.{}'.format(j, x) for x in exts] - if any([x in source_files for x in candidates]): - if linker_workaround: - self._append_objlib_sources(i) - else: - self.includes += i.includes - self.includes = list(set(self.includes)) - self.object_libs += [i] + source_files = [os.path.basename(x) for x in i.sources + i.generated] + for j in source_files: + if j in temp: + self.object_libs += [i] break # Filter out object files from the sources self.generated = [x for x in self.generated if not isinstance(x, str) or not any([x.endswith('.' + y) for y in obj_suffixes])] - def _append_objlib_sources(self, tgt: 'ConverterTarget') -> None: - self.includes += tgt.includes - self.sources += tgt.sources - self.generated += tgt.generated - self.sources = list(set(self.sources)) - self.generated = list(set(self.generated)) - self.includes = list(set(self.includes)) - - # Inherit compiler arguments since they may be required for building - for lang, opts in tgt.compile_opts.items(): - if lang not in self.compile_opts: - self.compile_opts[lang] = [] - self.compile_opts[lang] += [x for x in opts if x not in self.compile_opts[lang]] - - @lru_cache(maxsize=None) - def _all_source_suffixes(self) -> T.List[str]: - suffixes = [] # type: T.List[str] - for exts in lang_suffixes.values(): - suffixes += [x for x in exts] - return suffixes - - def process_inter_target_dependencies(self): - # Move the dependencies from all transfer_dependencies_from to the target - to_process = list(self.depends) - processed = [] - new_deps = [] - for i in to_process: - processed += [i] - if isinstance(i, ConverterTarget) and i.meson_func() in transfer_dependencies_from: - to_process += [x for x in i.depends if x not in processed] - else: - new_deps += [i] - self.depends = list(set(new_deps)) - - def cleanup_dependencies(self): - # Clear the dependencies from targets that where moved from - if self.meson_func() in transfer_dependencies_from: - self.depends = [] - def meson_func(self) -> str: return target_type_map.get(self.type.upper()) def log(self) -> None: - mlog.log('Target', mlog.bold(self.name), '({})'.format(self.cmake_name)) + mlog.log('Target', mlog.bold(self.name)) mlog.log(' -- artifacts: ', mlog.bold(str(self.artifacts))) mlog.log(' -- full_name: ', mlog.bold(self.full_name)) mlog.log(' -- type: ', mlog.bold(self.type)) @@ -563,12 +357,10 @@ mlog.log(' -- link_flags: ', mlog.bold(str(self.link_flags))) mlog.log(' -- languages: ', mlog.bold(str(self.languages))) mlog.log(' -- includes: ', mlog.bold(str(self.includes))) - mlog.log(' -- sys_includes: ', mlog.bold(str(self.sys_includes))) mlog.log(' -- sources: ', mlog.bold(str(self.sources))) mlog.log(' -- generated: ', mlog.bold(str(self.generated))) mlog.log(' -- pie: ', mlog.bold('true' if self.pie else 'false')) mlog.log(' -- override_opts: ', mlog.bold(str(self.override_options))) - mlog.log(' -- depends: ', mlog.bold(str(self.depends))) mlog.log(' -- options:') for key, val in self.compile_opts.items(): mlog.log(' -', key, '=', mlog.bold(str(val))) @@ -592,65 +384,45 @@ class ConverterCustomTarget: tgt_counter = 0 # type: int - out_counter = 0 # type: int def __init__(self, target: CMakeGeneratorTarget): - assert(target.current_bin_dir is not None) - assert(target.current_src_dir is not None) - self.name = target.name - if not self.name: - self.name = 'custom_tgt_{}'.format(ConverterCustomTarget.tgt_counter) - ConverterCustomTarget.tgt_counter += 1 - self.cmake_name = str(self.name) + self.name = 'custom_tgt_{}'.format(ConverterCustomTarget.tgt_counter) self.original_outputs = list(target.outputs) self.outputs = [os.path.basename(x) for x in self.original_outputs] - self.conflict_map = {} self.command = target.command self.working_dir = target.working_dir self.depends_raw = target.depends self.inputs = [] self.depends = [] - self.current_bin_dir = Path(target.current_bin_dir) - self.current_src_dir = Path(target.current_src_dir) - # Convert the target name to a valid meson target name - self.name = _sanitize_cmake_name(self.name) + ConverterCustomTarget.tgt_counter += 1 def __repr__(self) -> str: - return '<{}: {} {}>'.format(self.__class__.__name__, self.name, self.outputs) + return '<{}: {}>'.format(self.__class__.__name__, self.outputs) - def postprocess(self, output_target_map: OutputTargetMap, root_src_dir: str, subdir: str, all_outputs: T.List[str]) -> None: - # Default the working directory to ${CMAKE_CURRENT_BINARY_DIR} + def postprocess(self, output_target_map: dict, root_src_dir: str, subdir: str, build_dir: str) -> None: + # Default the working directory to the CMake build dir. This + # is not 100% correct, since it should be the value of + # ${CMAKE_CURRENT_BINARY_DIR} when add_custom_command is + # called. However, keeping track of this variable is not + # trivial and the current solution should work in most cases. if not self.working_dir: - self.working_dir = self.current_bin_dir.as_posix() + self.working_dir = build_dir # relative paths in the working directory are always relative - # to ${CMAKE_CURRENT_BINARY_DIR} + # to ${CMAKE_CURRENT_BINARY_DIR} (see note above) if not os.path.isabs(self.working_dir): - self.working_dir = (self.current_bin_dir / self.working_dir).as_posix() + self.working_dir = os.path.normpath(os.path.join(build_dir, self.working_dir)) # Modify the original outputs if they are relative. Again, # relative paths are relative to ${CMAKE_CURRENT_BINARY_DIR} - def ensure_absolute(x: Path) -> Path: - if x.is_absolute(): + # and the first disclaimer is stil in effect + def ensure_absolute(x: str): + if os.path.isabs(x): return x else: - return self.current_bin_dir / x - self.original_outputs = [ensure_absolute(Path(x)).as_posix() for x in self.original_outputs] - - # Ensure that there is no duplicate output in the project so - # that meson can handle cases where the same filename is - # generated in multiple directories - temp_outputs = [] # type: T.List[str] - for i in self.outputs: - if i in all_outputs: - old = str(i) - i = 'c{}_{}'.format(ConverterCustomTarget.out_counter, i) - ConverterCustomTarget.out_counter += 1 - self.conflict_map[old] = i - all_outputs += [i] - temp_outputs += [i] - self.outputs = temp_outputs + return os.path.normpath(os.path.join(build_dir, x)) + self.original_outputs = [ensure_absolute(x) for x in self.original_outputs] # Check if the command is a build target commands = [] @@ -659,86 +431,46 @@ cmd = [] for j in i: - if not j: - continue - target = output_target_map.target(j) - cmd += [target] if target else [j] + target_key = _target_key(j) + if target_key in output_target_map: + cmd += [output_target_map[target_key]] + else: + cmd += [j] commands += [cmd] self.command = commands - # If the custom target does not declare any output, create a dummy - # one that can be used as dependency. - if not self.outputs: - self.outputs = [self.name + '.h'] - # Check dependencies and input files - root = Path(root_src_dir) for i in self.depends_raw: - if not i: - continue - raw = Path(i) - art = output_target_map.artifact(i) - tgt = output_target_map.target(i) - gen = output_target_map.generated(i) - - rel_to_root = None - try: - rel_to_root = raw.relative_to(root) - except ValueError: - rel_to_root = None - - # First check for existing files. Only then check for existing - # targets, etc. This reduces the chance of misdetecting input files - # as outputs from other targets. - # See https://github.com/mesonbuild/meson/issues/6632 - if not raw.is_absolute() and (self.current_src_dir / raw).exists(): - self.inputs += [(self.current_src_dir / raw).relative_to(root).as_posix()] - elif raw.is_absolute() and raw.exists() and rel_to_root is not None: - self.inputs += [rel_to_root.as_posix()] - elif art: - self.depends += [art] - elif tgt: - self.depends += [tgt] - elif gen: - self.inputs += [gen.get_ref(i)] - - def process_inter_target_dependencies(self): - # Move the dependencies from all transfer_dependencies_from to the target - to_process = list(self.depends) - processed = [] - new_deps = [] - for i in to_process: - processed += [i] - if isinstance(i, ConverterTarget) and i.meson_func() in transfer_dependencies_from: - to_process += [x for x in i.depends if x not in processed] - else: - new_deps += [i] - self.depends = list(set(new_deps)) + tgt_key = _target_key(i) + gen_key = _generated_file_key(i) + + if os.path.basename(i) in output_target_map: + self.depends += [output_target_map[os.path.basename(i)]] + elif tgt_key in output_target_map: + self.depends += [output_target_map[tgt_key]] + elif gen_key in output_target_map: + self.inputs += [output_target_map[gen_key].get_ref(i)] + elif not os.path.isabs(i) and os.path.exists(os.path.join(root_src_dir, i)): + self.inputs += [i] + elif os.path.isabs(i) and os.path.exists(i) and os.path.commonpath([i, root_src_dir]) == root_src_dir: + self.inputs += [os.path.relpath(i, root_src_dir)] - def get_ref(self, fname: str) -> T.Optional[CustomTargetReference]: - fname = os.path.basename(fname) + def get_ref(self, fname: str) -> Optional[CustomTargetReference]: try: - if fname in self.conflict_map: - fname = self.conflict_map[fname] - idx = self.outputs.index(fname) + idx = self.outputs.index(os.path.basename(fname)) return CustomTargetReference(self, idx) except ValueError: return None def log(self) -> None: mlog.log('Custom Target', mlog.bold(self.name)) - mlog.log(' -- command: ', mlog.bold(str(self.command))) - mlog.log(' -- outputs: ', mlog.bold(str(self.outputs))) - mlog.log(' -- conflict_map: ', mlog.bold(str(self.conflict_map))) - mlog.log(' -- working_dir: ', mlog.bold(str(self.working_dir))) - mlog.log(' -- depends_raw: ', mlog.bold(str(self.depends_raw))) - mlog.log(' -- inputs: ', mlog.bold(str(self.inputs))) - mlog.log(' -- depends: ', mlog.bold(str(self.depends))) - -class CMakeAPI(Enum): - SERVER = 1 - FILE = 2 + mlog.log(' -- command: ', mlog.bold(str(self.command))) + mlog.log(' -- outputs: ', mlog.bold(str(self.outputs))) + mlog.log(' -- working_dir: ', mlog.bold(str(self.working_dir))) + mlog.log(' -- depends_raw: ', mlog.bold(str(self.depends_raw))) + mlog.log(' -- inputs: ', mlog.bold(str(self.inputs))) + mlog.log(' -- depends: ', mlog.bold(str(self.depends))) class CMakeInterpreter: def __init__(self, build: 'Build', subdir: str, src_dir: str, install_prefix: str, env: Environment, backend: 'Backend'): @@ -751,58 +483,39 @@ self.install_prefix = install_prefix self.env = env self.backend_name = backend.name - self.linkers = set() # type: T.Set[str] - self.cmake_api = CMakeAPI.SERVER self.client = CMakeClient(self.env) - self.fileapi = CMakeFileAPI(self.build_dir) # Raw CMake results self.bs_files = [] - self.codemodel_configs = None + self.codemodel = None self.raw_trace = None # Analysed data self.project_name = '' self.languages = [] self.targets = [] - self.custom_targets = [] # type: T.List[ConverterCustomTarget] + self.custom_targets = [] # type: List[ConverterCustomTarget] self.trace = CMakeTraceParser() - self.output_target_map = OutputTargetMap(self.build_dir) # Generated meson data self.generated_targets = {} - self.internal_name_map = {} - def configure(self, extra_cmake_options: T.List[str]) -> None: + def configure(self, extra_cmake_options: List[str]) -> None: for_machine = MachineChoice.HOST # TODO make parameter # Find CMake cmake_exe = CMakeExecutor(self.env, '>=3.7', for_machine) if not cmake_exe.found(): raise CMakeException('Unable to find CMake') - preload_file = Path(__file__).resolve().parent / 'data' / 'preload.cmake' - - # Prefere CMAKE_PROJECT_INCLUDE over CMAKE_TOOLCHAIN_FILE if possible, - # since CMAKE_PROJECT_INCLUDE was actually designed for code injection. - preload_var = 'CMAKE_PROJECT_INCLUDE' - if version_compare(cmake_exe.version(), '<3.15'): - preload_var = 'CMAKE_TOOLCHAIN_FILE' - generator = backend_generator_map[self.backend_name] cmake_args = cmake_exe.get_command() trace_args = ['--trace', '--trace-expand', '--no-warn-unused-cli'] cmcmp_args = ['-DCMAKE_POLICY_WARNING_{}=OFF'.format(x) for x in disable_policy_warnings] - pload_args = ['-D{}={}'.format(preload_var, str(preload_file))] - - if version_compare(cmake_exe.version(), '>=3.14'): - self.cmake_api = CMakeAPI.FILE - self.fileapi.setup_request() # Map meson compiler to CMake variables for lang, comp in self.env.coredata.compilers[for_machine].items(): if lang not in language_map: continue - self.linkers.add(comp.get_linker_id()) cmake_lang = language_map[lang] exelist = comp.get_exelist() if len(exelist) == 1: @@ -824,13 +537,12 @@ mlog.log(mlog.bold(' - build directory: '), self.build_dir) mlog.log(mlog.bold(' - source directory: '), self.src_dir) mlog.log(mlog.bold(' - trace args: '), ' '.join(trace_args)) - mlog.log(mlog.bold(' - preload file: '), str(preload_file)) mlog.log(mlog.bold(' - disabled policy warnings:'), '[{}]'.format(', '.join(disable_policy_warnings))) mlog.log() os.makedirs(self.build_dir, exist_ok=True) os_env = os.environ.copy() os_env['LC_ALL'] = 'C' - final_command = cmake_args + trace_args + cmcmp_args + pload_args + [self.src_dir] + final_command = cmake_args + trace_args + cmcmp_args + [self.src_dir] proc = Popen(final_command, stdout=PIPE, stderr=PIPE, cwd=self.build_dir, env=os_env) def print_stdout(): @@ -872,27 +584,11 @@ if proc.returncode != 0: raise CMakeException('Failed to configure the CMake subproject') - def initialise(self, extra_cmake_options: T.List[str]) -> None: - # Run configure the old way because doing it + def initialise(self, extra_cmake_options: List[str]) -> None: + # Run configure the old way becuse doing it # with the server doesn't work for some reason - # Additionally, the File API requires a configure anyway self.configure(extra_cmake_options) - # Continue with the file API If supported - if self.cmake_api is CMakeAPI.FILE: - # Parse the result - self.fileapi.load_reply() - - # Load the buildsystem file list - cmake_files = self.fileapi.get_cmake_sources() - self.bs_files = [x.file for x in cmake_files if not x.is_cmake and not x.is_temp] - self.bs_files = [os.path.relpath(x, self.env.get_source_dir()) for x in self.bs_files] - self.bs_files = list(set(self.bs_files)) - - # Load the codemodel configurations - self.codemodel_configs = self.fileapi.get_cmake_configurations() - return - with self.client.connect(): generator = backend_generator_map[self.backend_name] self.client.do_handshake(self.src_dir, self.build_dir, generator, 1) @@ -913,10 +609,10 @@ self.bs_files = [x.file for x in bs_reply.build_files if not x.is_cmake and not x.is_temp] self.bs_files = [os.path.relpath(os.path.join(src_dir, x), self.env.get_source_dir()) for x in self.bs_files] self.bs_files = list(set(self.bs_files)) - self.codemodel_configs = cm_reply.configs + self.codemodel = cm_reply def analyse(self) -> None: - if self.codemodel_configs is None: + if self.codemodel is None: raise CMakeException('CMakeInterpreter was not initialized') # Clear analyser data @@ -930,64 +626,41 @@ self.trace.parse(self.raw_trace) # Find all targets - added_target_names = [] # type: T.List[str] - for i in self.codemodel_configs: + for i in self.codemodel.configs: for j in i.projects: if not self.project_name: self.project_name = j.name for k in j.targets: - # Avoid duplicate targets from different configurations and known - # dummy CMake internal target types - if k.type not in skip_targets and k.name not in added_target_names: - added_target_names += [k.name] + if k.type not in skip_targets: self.targets += [ConverterTarget(k, self.env)] - # Add interface targets from trace, if not already present. - # This step is required because interface targets were removed from - # the CMake file API output. - api_target_name_list = [x.name for x in self.targets] - for i in self.trace.targets.values(): - if i.type != 'INTERFACE' or i.name in api_target_name_list or i.imported: - continue - dummy = CMakeTarget({ - 'name': i.name, - 'type': 'INTERFACE_LIBRARY', - 'sourceDirectory': self.src_dir, - 'buildDirectory': self.build_dir, - }) - self.targets += [ConverterTarget(dummy, self.env)] - for i in self.trace.custom_targets: self.custom_targets += [ConverterCustomTarget(i)] # generate the output_target_map - for i in [*self.targets, *self.custom_targets]: - self.output_target_map.add(i) + output_target_map = {} + output_target_map.update({x.full_name: x for x in self.targets}) + output_target_map.update({_target_key(x.name): x for x in self.targets}) + for i in self.targets: + for j in i.artifacts: + output_target_map[os.path.basename(j)] = i + for i in self.custom_targets: + for j in i.original_outputs: + output_target_map[_generated_file_key(j)] = i + object_libs = [] # First pass: Basic target cleanup - object_libs = [] - custom_target_outputs = [] # type: T.List[str] for i in self.custom_targets: - i.postprocess(self.output_target_map, self.src_dir, self.subdir, custom_target_outputs) + i.postprocess(output_target_map, self.src_dir, self.subdir, self.build_dir) for i in self.targets: - i.postprocess(self.output_target_map, self.src_dir, self.subdir, self.install_prefix, self.trace) + i.postprocess(output_target_map, self.src_dir, self.subdir, self.install_prefix, self.trace) if i.type == 'OBJECT_LIBRARY': object_libs += [i] self.languages += [x for x in i.languages if x not in self.languages] # Second pass: Detect object library dependencies for i in self.targets: - i.process_object_libs(object_libs, self._object_lib_workaround()) - - # Third pass: Reassign dependencies to avoid some loops - for i in self.targets: - i.process_inter_target_dependencies() - for i in self.custom_targets: - i.process_inter_target_dependencies() - - # Fourth pass: Remove rassigned dependencies - for i in self.targets: - i.cleanup_dependencies() + i.process_object_libs(object_libs) mlog.log('CMake project', mlog.bold(self.project_name), 'has', mlog.bold(str(len(self.targets) + len(self.custom_targets))), 'build targets.') @@ -1025,28 +698,32 @@ args = ArgumentNode(token()) if not isinstance(elements, list): elements = [args] - args.arguments += [nodeify(x) for x in elements if x is not None] + args.arguments += [nodeify(x) for x in elements] return ArrayNode(args, 0, 0, 0, 0) def function(name: str, args=None, kwargs=None) -> FunctionNode: - args = [] if args is None else args - kwargs = {} if kwargs is None else kwargs + if args is None: + args = [] + if kwargs is None: + kwargs = {} args_n = ArgumentNode(token()) if not isinstance(args, list): args = [args] - args_n.arguments = [nodeify(x) for x in args if x is not None] - args_n.kwargs = {k: nodeify(v) for k, v in kwargs.items() if v is not None} + args_n.arguments = [nodeify(x) for x in args] + args_n.kwargs = {k: nodeify(v) for k, v in kwargs.items()} func_n = FunctionNode(self.subdir, 0, 0, 0, 0, name, args_n) return func_n def method(obj: BaseNode, name: str, args=None, kwargs=None) -> MethodNode: - args = [] if args is None else args - kwargs = {} if kwargs is None else kwargs + if args is None: + args = [] + if kwargs is None: + kwargs = {} args_n = ArgumentNode(token()) if not isinstance(args, list): args = [args] - args_n.arguments = [nodeify(x) for x in args if x is not None] - args_n.kwargs = {k: nodeify(v) for k, v in kwargs.items() if v is not None} + args_n.arguments = [nodeify(x) for x in args] + args_n.kwargs = {k: nodeify(v) for k, v in kwargs.items()} return MethodNode(self.subdir, 0, 0, obj, name, args_n) def assign(var_name: str, value: BaseNode) -> AssignmentNode: @@ -1062,59 +739,33 @@ root_cb.lines += [assign(run_script_var, function('find_program', [[run_script]], {'required': True}))] # Add the targets - processing = [] processed = {} - name_map = {} - - def extract_tgt(tgt: T.Union[ConverterTarget, ConverterCustomTarget, CustomTargetReference]) -> IdNode: - tgt_name = None - if isinstance(tgt, (ConverterTarget, ConverterCustomTarget)): - tgt_name = tgt.name - elif isinstance(tgt, CustomTargetReference): - tgt_name = tgt.ctgt.name - assert(tgt_name is not None and tgt_name in processed) - res_var = processed[tgt_name]['tgt'] - return id_node(res_var) if res_var else None - - def detect_cycle(tgt: T.Union[ConverterTarget, ConverterCustomTarget]) -> None: - if tgt.name in processing: - raise CMakeException('Cycle in CMake inputs/dependencies detected') - processing.append(tgt.name) def resolve_ctgt_ref(ref: CustomTargetReference) -> BaseNode: - tgt_var = extract_tgt(ref) + tgt_var = processed[ref.ctgt.name]['tgt'] if len(ref.ctgt.outputs) == 1: - return tgt_var + return id_node(tgt_var) else: - return indexed(tgt_var, ref.index) + return indexed(id_node(tgt_var), ref.index) def process_target(tgt: ConverterTarget): - detect_cycle(tgt) - # First handle inter target dependencies link_with = [] - objec_libs = [] # type: T.List[IdNode] + objec_libs = [] sources = [] generated = [] generated_filenames = [] custom_targets = [] - dependencies = [] for i in tgt.link_with: assert(isinstance(i, ConverterTarget)) if i.name not in processed: process_target(i) - link_with += [extract_tgt(i)] + link_with += [id_node(processed[i.name]['tgt'])] for i in tgt.object_libs: assert(isinstance(i, ConverterTarget)) if i.name not in processed: process_target(i) - objec_libs += [extract_tgt(i)] - for i in tgt.depends: - if not isinstance(i, ConverterCustomTarget): - continue - if i.name not in processed: - process_custom_target(i) - dependencies += [extract_tgt(i)] + objec_libs += [processed[i.name]['tgt']] # Generate the source list and handle generated sources for i in tgt.sources + tgt.generated: @@ -1148,23 +799,22 @@ raise CMakeException('Unknown target type "{}"'.format(tgt.type)) # Determine the variable names - inc_var = '{}_inc'.format(tgt.name) - dir_var = '{}_dir'.format(tgt.name) - sys_var = '{}_sys'.format(tgt.name) - src_var = '{}_src'.format(tgt.name) - dep_var = '{}_dep'.format(tgt.name) - tgt_var = tgt.name + base_name = str(tgt.name) + base_name = base_name.replace('-', '_') + inc_var = '{}_inc'.format(base_name) + src_var = '{}_src'.format(base_name) + dep_var = '{}_dep'.format(base_name) + tgt_var = base_name # Generate target kwargs tgt_kwargs = { - 'build_by_default': False, 'link_args': tgt.link_flags + tgt.link_libraries, 'link_with': link_with, 'include_directories': id_node(inc_var), 'install': tgt.install, 'install_dir': tgt.install_dir, 'override_options': tgt.override_options, - 'objects': [method(x, 'extract_all_objects') for x in objec_libs], + 'objects': [method(id_node(x), 'extract_all_objects') for x in objec_libs], } # Handle compiler args @@ -1185,53 +835,42 @@ 'include_directories': id_node(inc_var), } - if dependencies: - generated += dependencies - # Generate the function nodes - dir_node = assign(dir_var, function('include_directories', tgt.includes)) - sys_node = assign(sys_var, function('include_directories', tgt.sys_includes, {'is_system': True})) - inc_node = assign(inc_var, array([id_node(dir_var), id_node(sys_var)])) - node_list = [dir_node, sys_node, inc_node] + inc_node = assign(inc_var, function('include_directories', tgt.includes)) + node_list = [inc_node] if tgt_func == 'header_only': del dep_kwargs['link_with'] dep_node = assign(dep_var, function('declare_dependency', kwargs=dep_kwargs)) node_list += [dep_node] - src_var = None - tgt_var = None + src_var = '' + tgt_var = '' else: src_node = assign(src_var, function('files', sources)) - tgt_node = assign(tgt_var, function(tgt_func, [tgt_var, [id_node(src_var)] + generated], tgt_kwargs)) + tgt_node = assign(tgt_var, function(tgt_func, [base_name, [id_node(src_var)] + generated], tgt_kwargs)) node_list += [src_node, tgt_node] if tgt_func in ['static_library', 'shared_library']: dep_node = assign(dep_var, function('declare_dependency', kwargs=dep_kwargs)) node_list += [dep_node] else: - dep_var = None + dep_var = '' # Add the nodes to the ast root_cb.lines += node_list processed[tgt.name] = {'inc': inc_var, 'src': src_var, 'dep': dep_var, 'tgt': tgt_var, 'func': tgt_func} - name_map[tgt.cmake_name] = tgt.name def process_custom_target(tgt: ConverterCustomTarget) -> None: # CMake allows to specify multiple commands in a custom target. # To map this to meson, a helper script is used to execute all - # commands in order. This additionally allows setting the working + # commands in order. This addtionally allows setting the working # directory. - detect_cycle(tgt) tgt_var = tgt.name # type: str - def resolve_source(x: T.Any) -> T.Any: + def resolve_source(x: Any) -> Any: if isinstance(x, ConverterTarget): if x.name not in processed: process_target(x) - return extract_tgt(x) - if isinstance(x, ConverterCustomTarget): - if x.name not in processed: - process_custom_target(x) - return extract_tgt(x) + return id_node(x.name) elif isinstance(x, CustomTargetReference): if x.ctgt.name not in processed: process_custom_target(x.ctgt) @@ -1243,11 +882,10 @@ command = [] command += [id_node(run_script_var)] command += ['-o', '@OUTPUT@'] - if tgt.original_outputs: - command += ['-O'] + tgt.original_outputs + command += ['-O'] + tgt.original_outputs command += ['-d', tgt.working_dir] - # Generate the commands. Subcommands are separated by ';;;' + # Generate the commands. Subcommands are seperated by ';;;' for cmd in tgt.command: command += [resolve_source(x) for x in cmd] + [';;;'] @@ -1260,7 +898,6 @@ root_cb.lines += [assign(tgt_var, function('custom_target', [tgt.name], tgt_kwargs))] processed[tgt.name] = {'inc': None, 'src': None, 'dep': None, 'tgt': tgt_var, 'func': 'custom_target'} - name_map[tgt.cmake_name] = tgt.name # Now generate the target function calls for i in self.custom_targets: @@ -1271,24 +908,12 @@ process_target(i) self.generated_targets = processed - self.internal_name_map = name_map return root_cb - def target_info(self, target: str) -> T.Optional[T.Dict[str, str]]: - # Try resolving the target name - # start by checking if there is a 100% match (excluding the name prefix) - prx_tgt = _sanitize_cmake_name(target) - if prx_tgt in self.generated_targets: - return self.generated_targets[prx_tgt] - # check if there exists a name mapping - if target in self.internal_name_map: - target = self.internal_name_map[target] - assert(target in self.generated_targets) + def target_info(self, target: str) -> Optional[Dict[str, str]]: + if target in self.generated_targets: return self.generated_targets[target] return None - def target_list(self) -> T.List[str]: - return list(self.internal_name_map.keys()) - - def _object_lib_workaround(self) -> bool: - return 'link' in self.linkers and self.backend_name.startswith('vs') + def target_list(self) -> List[str]: + return list(self.generated_targets.keys()) diff -Nru meson-0.53.2/mesonbuild/cmake/traceparser.py meson-0.52.1/mesonbuild/cmake/traceparser.py --- meson-0.53.2/mesonbuild/cmake/traceparser.py 2020-02-25 18:00:46.000000000 +0000 +++ meson-0.52.1/mesonbuild/cmake/traceparser.py 2019-11-28 17:37:44.000000000 +0000 @@ -19,7 +19,7 @@ from .generator import parse_generator_expressions from .. import mlog -import typing as T +from typing import List, Tuple, Optional import re import os @@ -35,57 +35,46 @@ return s.format(self.file, self.line, self.func, self.args) class CMakeTarget: - def __init__(self, name, target_type, properties=None, imported: bool = False, tline: T.Optional[CMakeTraceLine] = None): + def __init__(self, name, target_type, properties=None): if properties is None: properties = {} self.name = name self.type = target_type self.properties = properties - self.imported = imported - self.tline = tline - self.depends = [] - self.current_bin_dir = None - self.current_src_dir = None def __repr__(self): - s = 'CMake TARGET:\n -- name: {}\n -- type: {}\n -- imported: {}\n -- properties: {{\n{} }}\n -- tline: {}' + s = 'CMake TARGET:\n -- name: {}\n -- type: {}\n -- properties: {{\n{} }}' propSTR = '' for i in self.properties: propSTR += " '{}': {}\n".format(i, self.properties[i]) - return s.format(self.name, self.type, self.imported, propSTR, self.tline) + return s.format(self.name, self.type, propSTR) - def strip_properties(self) -> None: - # Strip the strings in the properties - if not self.properties: - return - for key, val in self.properties.items(): - self.properties[key] = [x.strip() for x in val] - -class CMakeGeneratorTarget(CMakeTarget): - def __init__(self, name): - super().__init__(name, 'CUSTOM', {}) - self.outputs = [] # type: T.List[str] - self.command = [] # type: T.List[T.List[str]] - self.working_dir = None # type: T.Optional[str] +class CMakeGeneratorTarget: + def __init__(self): + self.outputs = [] # type: List[str] + self.command = [] # type: List[List[str]] + self.working_dir = None # type: Optional[str] + self.depends = [] # type: List[str] class CMakeTraceParser: def __init__(self, permissive: bool = False): - self.vars = {} # type: T.Dict[str, T.List[str]] - self.targets = {} # type: T.Dict[str, CMakeTarget] + # Dict of CMake variables: '': ['list', 'of', 'values'] + self.vars = {} - # T.List of targes that were added with add_custom_command to generate files - self.custom_targets = [] # type: T.List[CMakeGeneratorTarget] + # Dict of CMakeTarget + self.targets = {} + + # List of targes that were added with add_custom_command to generate files + self.custom_targets = [] # type: List[CMakeGeneratorTarget] self.permissive = permissive # type: bool - # State for delayed command execution. Delayed command execution is realised - # with a custom CMake file that overrides some functions and adds some - # introspection information to the trace. - self.delayed_commands = [] # type: T.List[str] - self.stored_commands = [] # type: T.List[CMakeTraceLine] + def parse(self, trace: str) -> None: + # First parse the trace + lexer1 = self._lex_trace(trace) # All supported functions - self.functions = { + functions = { 'set': self._cmake_set, 'unset': self._cmake_unset, 'add_executable': self._cmake_add_executable, @@ -97,39 +86,17 @@ 'target_compile_definitions': self._cmake_target_compile_definitions, 'target_compile_options': self._cmake_target_compile_options, 'target_include_directories': self._cmake_target_include_directories, - 'target_link_libraries': self._cmake_target_link_libraries, 'target_link_options': self._cmake_target_link_options, - 'add_dependencies': self._cmake_add_dependencies, - - # Special functions defined in the preload script. - # These functions do nothing in the CMake code, but have special - # meaning here in the trace parser. - 'meson_ps_execute_delayed_calls': self._meson_ps_execute_delayed_calls, - 'meson_ps_reload_vars': self._meson_ps_reload_vars, } - - def parse(self, trace: str) -> None: - # First parse the trace - lexer1 = self._lex_trace(trace) - # Primary pass -- parse everything for l in lexer1: - # store the function if its execution should be delayed - if l.func in self.delayed_commands: - self.stored_commands += [l] - continue - # "Execute" the CMake function if supported - fn = self.functions.get(l.func, None) + fn = functions.get(l.func, None) if(fn): fn(l) - # Postprocess - for tgt in self.targets.values(): - tgt.strip_properties() - - def get_first_cmake_var_of(self, var_list: T.List[str]) -> T.List[str]: + def get_first_cmake_var_of(self, var_list: List[str]) -> List[str]: # Return the first found CMake variable in list var_list for i in var_list: if i in self.vars: @@ -137,19 +104,13 @@ return [] - def get_cmake_var(self, var: str) -> T.List[str]: + def get_cmake_var(self, var: str) -> List[str]: # Return the value of the CMake variable var or an empty list if var does not exist if var in self.vars: return self.vars[var] return [] - def var_to_str(self, var: str) -> T.Optional[str]: - if var in self.vars and self.vars[var]: - return self.vars[var][0] - - return None - def var_to_bool(self, var): if var not in self.vars: return False @@ -249,7 +210,7 @@ if len(args) < 1: return self._gen_exception('add_library', 'interface library name not specified', tline) - self.targets[args[0]] = CMakeTarget(args[0], 'INTERFACE', {}, tline=tline, imported='IMPORTED' in args) + self.targets[args[0]] = CMakeTarget(args[0], 'INTERFACE', {}) elif 'IMPORTED' in args: args.remove('IMPORTED') @@ -257,7 +218,7 @@ if len(args) < 2: return self._gen_exception('add_library', 'requires at least 2 arguments', tline) - self.targets[args[0]] = CMakeTarget(args[0], args[1], {}, tline=tline, imported=True) + self.targets[args[0]] = CMakeTarget(args[0], args[1], {}) elif 'ALIAS' in args: args.remove('ALIAS') @@ -266,13 +227,13 @@ return self._gen_exception('add_library', 'requires at least 2 arguments', tline) # Simulate the ALIAS with INTERFACE_LINK_LIBRARIES - self.targets[args[0]] = CMakeTarget(args[0], 'ALIAS', {'INTERFACE_LINK_LIBRARIES': [args[1]]}, tline=tline) + self.targets[args[0]] = CMakeTarget(args[0], 'ALIAS', {'INTERFACE_LINK_LIBRARIES': [args[1]]}) elif 'OBJECT' in args: return self._gen_exception('add_library', 'OBJECT libraries are not supported', tline) else: - self.targets[args[0]] = CMakeTarget(args[0], 'NORMAL', {}, tline=tline) + self.targets[args[0]] = CMakeTarget(args[0], 'NORMAL', {}) - def _cmake_add_custom_command(self, tline: CMakeTraceLine, name=None): + def _cmake_add_custom_command(self, tline: CMakeTraceLine): # DOC: https://cmake.org/cmake/help/latest/command/add_custom_command.html args = list(tline.args) # Make a working copy @@ -287,10 +248,10 @@ 'IMPLICIT_DEPENDS', 'WORKING_DIRECTORY', 'COMMENT', 'DEPFILE', 'JOB_POOL', 'VERBATIM', 'APPEND', 'USES_TERMINAL', 'COMMAND_EXPAND_LISTS'] - target = CMakeGeneratorTarget(name) + target = CMakeGeneratorTarget() def handle_output(key: str, target: CMakeGeneratorTarget) -> None: - target.outputs += key.split(';') + target.outputs += [key] def handle_command(key: str, target: CMakeGeneratorTarget) -> None: if key == 'ARGS': @@ -298,7 +259,7 @@ target.command[-1] += key.split(';') def handle_depends(key: str, target: CMakeGeneratorTarget) -> None: - target.depends += key.split(';') + target.depends += [key] def handle_working_dir(key: str, target: CMakeGeneratorTarget) -> None: if target.working_dir is None: @@ -327,15 +288,11 @@ if fn is not None: fn(i, target) - target.current_bin_dir = self.var_to_str('MESON_PS_CMAKE_CURRENT_BINARY_DIR') - target.current_src_dir = self.var_to_str('MESON_PS_CMAKE_CURRENT_SOURCE_DIR') target.outputs = self._guess_files(target.outputs) target.depends = self._guess_files(target.depends) target.command = [self._guess_files(x) for x in target.command] self.custom_targets += [target] - if name: - self.targets[name] = target def _cmake_add_custom_target(self, tline: CMakeTraceLine): # DOC: https://cmake.org/cmake/help/latest/command/add_custom_target.html @@ -343,8 +300,7 @@ if len(tline.args) < 1: return self._gen_exception('add_custom_target', 'requires at least one argument', tline) - # It's pretty much the same as a custom command - self._cmake_add_custom_command(tline, tline.args[0]) + self.targets[tline.args[0]] = CMakeTarget(tline.args[0], 'CUSTOM', {}) def _cmake_set_property(self, tline: CMakeTraceLine) -> None: # DOC: https://cmake.org/cmake/help/latest/command/set_property.html @@ -418,7 +374,7 @@ # option 1 first and fall back to 2, as 1 requires less code and less # synchroniztion for cmake changes. - arglist = [] # type: T.List[T.Tuple[str, T.List[str]]] + arglist = [] # type: List[Tuple[str, List[str]]] name = args.pop(0) values = [] prop_regex = re.compile(r'^[A-Z_]+$') @@ -440,20 +396,6 @@ self.targets[i].properties[name] = value - def _cmake_add_dependencies(self, tline: CMakeTraceLine) -> None: - # DOC: https://cmake.org/cmake/help/latest/command/add_dependencies.html - args = list(tline.args) - - if len(args) < 2: - return self._gen_exception('add_dependencies', 'takes at least 2 arguments', tline) - - target = self.targets.get(args[0]) - if not target: - return self._gen_exception('add_dependencies', 'target not found', tline) - - for i in args[1:]: - target.depends += i.split(';') - def _cmake_target_compile_definitions(self, tline: CMakeTraceLine) -> None: # DOC: https://cmake.org/cmake/help/latest/command/target_compile_definitions.html self._parse_common_target_options('target_compile_definitions', 'COMPILE_DEFINITIONS', 'INTERFACE_COMPILE_DEFINITIONS', tline) @@ -470,11 +412,7 @@ # DOC: https://cmake.org/cmake/help/latest/command/target_link_options.html self._parse_common_target_options('target_link_options', 'LINK_OPTIONS', 'INTERFACE_LINK_OPTIONS', tline) - def _cmake_target_link_libraries(self, tline: CMakeTraceLine) -> None: - # DOC: https://cmake.org/cmake/help/latest/command/target_link_libraries.html - self._parse_common_target_options('target_link_options', 'LINK_LIBRARIES', 'INTERFACE_LINK_LIBRARIES', tline) - - def _parse_common_target_options(self, func: str, private_prop: str, interface_prop: str, tline: CMakeTraceLine, ignore: T.Optional[T.List[str]] = None, paths: bool = False): + def _parse_common_target_options(self, func: str, private_prop: str, interface_prop: str, tline: CMakeTraceLine, ignore: Optional[List[str]] = None, paths: bool = False): if ignore is None: ignore = ['BEFORE'] @@ -495,14 +433,14 @@ if i in ignore: continue - if i in ['INTERFACE', 'LINK_INTERFACE_LIBRARIES', 'PUBLIC', 'PRIVATE', 'LINK_PUBLIC', 'LINK_PRIVATE']: + if i in ['INTERFACE', 'PUBLIC', 'PRIVATE']: mode = i continue - if mode in ['INTERFACE', 'LINK_INTERFACE_LIBRARIES', 'PUBLIC', 'LINK_PUBLIC']: + if mode in ['INTERFACE', 'PUBLIC']: interface += [i] - if mode in ['PUBLIC', 'PRIVATE', 'LINK_PRIVATE']: + if mode in ['PUBLIC', 'PRIVATE']: private += [i] if paths: @@ -518,18 +456,6 @@ self.targets[target].properties[i[0]] += i[1] - def _meson_ps_execute_delayed_calls(self, tline: CMakeTraceLine) -> None: - for l in self.stored_commands: - fn = self.functions.get(l.func, None) - if(fn): - fn(l) - - # clear the stored commands - self.stored_commands = [] - - def _meson_ps_reload_vars(self, tline: CMakeTraceLine) -> None: - self.delayed_commands = self.get_cmake_var('MESON_PS_DELAYED_CALLS') - def _lex_trace(self, trace): # The trace format is: '(): ( )\n' reg_tline = re.compile(r'\s*(.*\.(cmake|txt))\(([0-9]+)\):\s*(\w+)\(([\s\S]*?) ?\)\s*\n', re.MULTILINE) @@ -558,24 +484,24 @@ yield CMakeTraceLine(file, line, func, args) - def _guess_files(self, broken_list: T.List[str]) -> T.List[str]: + def _guess_files(self, broken_list: List[str]) -> List[str]: #Try joining file paths that contain spaces reg_start = re.compile(r'^([A-Za-z]:)?/.*/[^./]+$') reg_end = re.compile(r'^.*\.[a-zA-Z]+$') - fixed_list = [] # type: T.List[str] - curr_str = None # type: T.Optional[str] + fixed_list = [] # type: List[str] + curr_str = None # type: Optional[str] for i in broken_list: if curr_str is None: curr_str = i elif os.path.isfile(curr_str): - # Abort concatenation if curr_str is an existing file + # Abort concatination if curr_str is an existing file fixed_list += [curr_str] curr_str = i elif not reg_start.match(curr_str): - # Abort concatenation if curr_str no longer matches the regex + # Abort concatination if curr_str no longer matches the regex fixed_list += [curr_str] curr_str = i elif reg_end.match(i) or os.path.exists('{} {}'.format(curr_str, i)): diff -Nru meson-0.53.2/mesonbuild/compilers/compilers.py meson-0.52.1/mesonbuild/compilers/compilers.py --- meson-0.53.2/mesonbuild/compilers/compilers.py 2020-02-25 18:00:46.000000000 +0000 +++ meson-0.52.1/mesonbuild/compilers/compilers.py 2019-11-28 17:37:44.000000000 +0000 @@ -12,25 +12,24 @@ # See the License for the specific language governing permissions and # limitations under the License. -import contextlib, os.path, re, tempfile -import collections.abc -import typing as T +import contextlib, enum, os.path, re, tempfile +import typing +from typing import Optional, Tuple, List from ..linkers import StaticLinker, GnuLikeDynamicLinkerMixin, SolarisDynamicLinker from .. import coredata from .. import mlog from .. import mesonlib from ..mesonlib import ( - EnvironmentException, MachineChoice, MesonException, + EnvironmentException, MachineChoice, MesonException, OrderedSet, Popen_safe, split_args ) from ..envconfig import ( Properties, ) -if T.TYPE_CHECKING: +if typing.TYPE_CHECKING: from ..coredata import OptionDictType - from ..envconfig import MachineInfo from ..environment import Environment from ..linkers import DynamicLinker # noqa: F401 @@ -88,10 +87,8 @@ 'vala': 'VALAFLAGS', 'rust': 'RUSTFLAGS'} -unixy_compiler_internal_libs = ('m', 'c', 'pthread', 'dl', 'rt') -# execinfo is a compiler lib on FreeBSD and NetBSD -if mesonlib.is_freebsd() or mesonlib.is_netbsd(): - unixy_compiler_internal_libs += ('execinfo',) +# execinfo is a compiler lib on BSD +unixy_compiler_internal_libs = ('m', 'c', 'pthread', 'dl', 'rt', 'execinfo') # All these are only for C-linkable languages; see `clink_langs` above. @@ -386,12 +383,11 @@ self.stdout = stdout self.stderr = stderr -class CompilerArgs(collections.abc.MutableSequence): +class CompilerArgs(list): ''' - List-like class that manages a list of compiler arguments. Should be used - while constructing compiler arguments from various sources. Can be - operated with ordinary lists, so this does not need to be used - everywhere. + Class derived from list() that manages a list of compiler arguments. Should + be used while constructing compiler arguments from various sources. Can be + operated with ordinary lists, so this does not need to be used everywhere. All arguments must be inserted and stored in GCC-style (-lfoo, -Idir, etc) and can converted to the native type of each compiler by using the @@ -440,45 +436,37 @@ # In generate_link() we add external libs without de-dup, but we must # *always* de-dup these because they're special arguments to the linker always_dedup_args = tuple('-l' + lib for lib in unixy_compiler_internal_libs) + compiler = None - def __init__(self, compiler: T.Union['Compiler', StaticLinker], - iterable: T.Optional[T.Iterable[str]] = None): - self.compiler = compiler - self.__container = list(iterable) if iterable is not None else [] # type: T.List[str] - - @T.overload # noqa: F811 - def __getitem__(self, index: int) -> str: # noqa: F811 - pass - - @T.overload # noqa: F811 - def __getitem__(self, index: slice) -> T.List[str]: # noqa: F811 - pass - - def __getitem__(self, index): # noqa: F811 - return self.__container[index] - - @T.overload # noqa: F811 - def __setitem__(self, index: int, value: str) -> None: # noqa: F811 - pass - - @T.overload # noqa: F811 - def __setitem__(self, index: slice, value: T.List[str]) -> None: # noqa: F811 - pass - - def __setitem__(self, index, value) -> None: # noqa: F811 - self.__container[index] = value - - def __delitem__(self, index: T.Union[int, slice]) -> None: - del self.__container[index] - - def __len__(self) -> int: - return len(self.__container) - - def insert(self, index: int, value: str) -> None: - self.__container.insert(index, value) + def _check_args(self, args): + cargs = [] + if len(args) > 2: + raise TypeError("CompilerArgs() only accepts at most 2 arguments: " + "The compiler, and optionally an initial list") + elif not args: + return cargs + elif len(args) == 1: + if isinstance(args[0], (Compiler, StaticLinker)): + self.compiler = args[0] + else: + raise TypeError("you must pass a Compiler instance as one of " + "the arguments") + elif len(args) == 2: + if isinstance(args[0], (Compiler, StaticLinker)): + self.compiler = args[0] + cargs = args[1] + elif isinstance(args[1], (Compiler, StaticLinker)): + cargs = args[0] + self.compiler = args[1] + else: + raise TypeError("you must pass a Compiler instance as one of " + "the two arguments") + else: + raise AssertionError('Not reached') + return cargs - def copy(self) -> 'CompilerArgs': - return CompilerArgs(self.compiler, self.__container.copy()) + def __init__(self, *args): + super().__init__(self._check_args(args)) @classmethod def _can_dedup(cls, arg): @@ -531,7 +519,7 @@ return True return False - def to_native(self, copy: bool = False) -> T.List[str]: + def to_native(self, copy: bool = False) -> typing.List[str]: # Check if we need to add --start/end-group for circular dependencies # between static libraries, and for recursively searching for symbols # needed by static libraries that are provided by object files or @@ -543,7 +531,7 @@ # This covers all ld.bfd, ld.gold, ld.gold, and xild on Linux, which # all act like (or are) gnu ld # TODO: this could probably be added to the DynamicLinker instead - if (isinstance(self.compiler, Compiler) and + if (hasattr(self.compiler, 'linker') and self.compiler.linker is not None and isinstance(self.compiler.linker, (GnuLikeDynamicLinkerMixin, SolarisDynamicLinker))): group_start = -1 @@ -563,9 +551,9 @@ # Remove system/default include paths added with -isystem if hasattr(self.compiler, 'get_default_include_dirs'): default_dirs = self.compiler.get_default_include_dirs() - bad_idx_list = [] # type: T.List[int] + bad_idx_list = [] for i, each in enumerate(new): - # Remove the -isystem and the path if the path is a default path + # Remove the -isystem and the path if the path is a dafault path if (each == '-isystem' and i < (len(new) - 1) and new[i + 1] in default_dirs): @@ -576,9 +564,9 @@ bad_idx_list += [i] for i in reversed(bad_idx_list): new.pop(i) - return self.compiler.unix_args_to_native(new.__container) + return self.compiler.unix_args_to_native(new) - def append_direct(self, arg: str) -> None: + def append_direct(self, arg): ''' Append the specified argument without any reordering or de-dup except for absolute paths to libraries, etc, which can always be de-duped @@ -587,9 +575,9 @@ if os.path.isabs(arg): self.append(arg) else: - self.__container.append(arg) + super().append(arg) - def extend_direct(self, iterable: T.Iterable[str]) -> None: + def extend_direct(self, iterable): ''' Extend using the elements in the specified iterable without any reordering or de-dup except for absolute paths where the order of @@ -598,7 +586,7 @@ for elem in iterable: self.append_direct(elem) - def extend_preserving_lflags(self, iterable: T.Iterable[str]) -> None: + def extend_preserving_lflags(self, iterable): normal_flags = [] lflags = [] for i in iterable: @@ -609,20 +597,20 @@ self.extend(normal_flags) self.extend_direct(lflags) - def __add__(self, args: T.Iterable[str]) -> 'CompilerArgs': - new = self.copy() + def __add__(self, args): + new = CompilerArgs(self, self.compiler) new += args return new - def __iadd__(self, args: T.Iterable[str]) -> 'CompilerArgs': + def __iadd__(self, args): ''' Add two CompilerArgs while taking into account overriding of arguments and while preserving the order of arguments as much as possible ''' - pre = [] # type: T.List[str] - post = [] # type: T.List[str] - if not isinstance(args, collections.abc.Iterable): - raise TypeError('can only concatenate Iterable[str] (not "{}") to CompilerArgs'.format(args)) + pre = [] + post = [] + if not isinstance(args, list): + raise TypeError('can only concatenate list (not "{}") to list'.format(args)) for arg in args: # If the argument can be de-duped, do it either by removing the # previous occurrence of it and adding a new one, or not adding the @@ -647,31 +635,29 @@ # Insert at the beginning self[:0] = pre # Append to the end - self.__container += post + super().__iadd__(post) return self - def __radd__(self, args: T.Iterable[str]): - new = CompilerArgs(self.compiler, args) + def __radd__(self, args): + new = CompilerArgs(args, self.compiler) new += self return new - def __eq__(self, other: T.Any) -> T.Union[bool, type(NotImplemented)]: - # Only allow equality checks against other CompilerArgs and lists instances - if isinstance(other, CompilerArgs): - return self.compiler == other.compiler and self.__container == other.__container - elif isinstance(other, list): - return self.__container == other - return NotImplemented + def __mul__(self, args): + raise TypeError("can't multiply compiler arguments") + + def __imul__(self, args): + raise TypeError("can't multiply compiler arguments") + + def __rmul__(self, args): + raise TypeError("can't multiply compiler arguments") - def append(self, arg: str) -> None: + def append(self, arg): self.__iadd__([arg]) - def extend(self, args: T.Iterable[str]) -> None: + def extend(self, args): self.__iadd__(args) - def __repr__(self) -> str: - return 'CompilerArgs({!r}, {!r})'.format(self.compiler, self.__container) - class Compiler: # Libraries to ignore in find_library() since they are provided by the # compiler or the C library. Currently only used for MSVC. @@ -680,11 +666,10 @@ # manually searched. internal_libs = () - LINKER_PREFIX = None # type: T.Union[None, str, T.List[str]] - INVOKES_LINKER = True + LINKER_PREFIX = None # type: typing.Union[None, str, typing.List[str]] - def __init__(self, exelist, version, for_machine: MachineChoice, info: 'MachineInfo', - linker: T.Optional['DynamicLinker'] = None, **kwargs): + def __init__(self, exelist, version, for_machine: MachineChoice, + linker: typing.Optional['DynamicLinker'] = None, **kwargs): if isinstance(exelist, str): self.exelist = [exelist] elif isinstance(exelist, list): @@ -705,7 +690,6 @@ self.for_machine = for_machine self.base_options = [] self.linker = linker - self.info = info def __repr__(self): repr_str = "<{0}: v{1} `{2}`>" @@ -723,15 +707,6 @@ def get_id(self) -> str: return self.id - def get_linker_id(self) -> str: - # There is not guarantee that we have a dynamic linker instance, as - # some languages don't have separate linkers and compilers. In those - # cases return the compiler id - try: - return self.linker.id - except AttributeError: - return self.id - def get_version_string(self) -> str: details = [self.id, self.version] if self.full_version: @@ -741,14 +716,13 @@ def get_language(self) -> str: return self.language - @classmethod - def get_display_language(cls) -> str: - return cls.language.capitalize() + def get_display_language(self) -> str: + return self.language.capitalize() def get_default_suffix(self) -> str: return self.default_suffix - def get_define(self, dname, prefix, env, extra_args, dependencies) -> T.Tuple[str, bool]: + def get_define(self, dname, prefix, env, extra_args, dependencies) -> Tuple[str, bool]: raise EnvironmentException('%s does not support get_define ' % self.get_id()) def compute_int(self, expression, low, high, guess, prefix, env, extra_args, dependencies) -> int: @@ -757,12 +731,10 @@ def compute_parameters_with_absolute_paths(self, parameter_list, build_dir): raise EnvironmentException('%s does not support compute_parameters_with_absolute_paths ' % self.get_id()) - def has_members(self, typename, membernames, prefix, env, *, - extra_args=None, dependencies=None) -> T.Tuple[bool, bool]: + def has_members(self, typename, membernames, prefix, env, *, extra_args=None, dependencies=None) -> Tuple[bool, bool]: raise EnvironmentException('%s does not support has_member(s) ' % self.get_id()) - def has_type(self, typename, prefix, env, extra_args, *, - dependencies=None) -> T.Tuple[bool, bool]: + def has_type(self, typename, prefix, env, extra_args, *, dependencies=None) -> Tuple[bool, bool]: raise EnvironmentException('%s does not support has_type ' % self.get_id()) def symbols_have_underscore_prefix(self, env) -> bool: @@ -771,10 +743,10 @@ def get_exelist(self): return self.exelist[:] - def get_linker_exelist(self) -> T.List[str]: + def get_linker_exelist(self) -> typing.List[str]: return self.linker.get_exelist() - def get_linker_output_args(self, outputname: str) -> T.List[str]: + def get_linker_output_args(self, outputname: str) -> typing.List[str]: return self.linker.get_output_args(outputname) def get_builtin_define(self, *args, **kwargs): @@ -805,31 +777,126 @@ """ return [] - def get_linker_args_from_envvars(self) -> T.List[str]: + def use_preproc_flags(self) -> bool: + """ + Whether the compiler (or processes it spawns) cares about CPPFLAGS + """ + return self.get_language() in {'c', 'cpp', 'objc', 'objcpp'} + + def use_ldflags(self) -> bool: + """ + Whether the compiler (or processes it spawns) cares about LDFLAGS + """ + return self.get_language() in languages_using_ldflags + + def get_linker_args_from_envvars(self) -> typing.List[str]: return self.linker.get_args_from_envvars() - def get_options(self) -> T.Dict[str, coredata.UserOption]: - return {} + def get_args_from_envvars(self) -> typing.Tuple[typing.List[str], typing.List[str]]: + """ + Returns a tuple of (compile_flags, link_flags) for the specified language + from the inherited environment + """ + def log_var(var, val: Optional[str]): + if val: + mlog.log('Appending {} from environment: {!r}'.format(var, val)) + else: + mlog.debug('No {} in the environment, not changing global flags.'.format(var)) + + lang = self.get_language() + compiler_is_linker = self.linker is not None and self.linker.invoked_by_compiler() + + if lang not in cflags_mapping: + return [], [] + + compile_flags = [] # type: typing.List[str] + link_flags = [] # type: typing.List[str] + + env_compile_flags = os.environ.get(cflags_mapping[lang]) + log_var(cflags_mapping[lang], env_compile_flags) + if env_compile_flags is not None: + compile_flags += split_args(env_compile_flags) + + # Link flags (same for all languages) + if self.use_ldflags(): + env_link_flags = self.get_linker_args_from_envvars() + else: + env_link_flags = [] + log_var('LDFLAGS', env_link_flags) + link_flags += env_link_flags + if compiler_is_linker: + # When the compiler is used as a wrapper around the linker (such as + # with GCC and Clang), the compile flags can be needed while linking + # too. This is also what Autotools does. However, we don't want to do + # this when the linker is stand-alone such as with MSVC C/C++, etc. + link_flags = compile_flags + link_flags + + # Pre-processor flags for certain languages + if self.use_preproc_flags(): + env_preproc_flags = os.environ.get('CPPFLAGS') + log_var('CPPFLAGS', env_preproc_flags) + if env_preproc_flags is not None: + compile_flags += split_args(env_preproc_flags) + + return compile_flags, link_flags + + def get_options(self): + opts = {} # build afresh every time + description = 'Extra arguments passed to the {}'.format(self.get_display_language()) + opts.update({ + self.language + '_args': coredata.UserArrayOption( + description + ' compiler', + [], split_args=True, user_input=True, allow_dups=True), + self.language + '_link_args': coredata.UserArrayOption( + description + ' linker', + [], split_args=True, user_input=True, allow_dups=True), + }) + + return opts + + def get_and_default_options(self, properties: Properties): + """ + Take default values from env variables and/or config files. + """ + opts = self.get_options() + + if properties.fallback: + # Get from env vars. + compile_args, link_args = self.get_args_from_envvars() + else: + compile_args = [] + link_args = [] + + for k, o in opts.items(): + if k in properties: + # Get from configuration files. + o.set_value(properties[k]) + elif k == self.language + '_args': + o.set_value(compile_args) + elif k == self.language + '_link_args': + o.set_value(link_args) + + return opts def get_option_compile_args(self, options): return [] - def get_option_link_args(self, options: 'OptionDictType') -> T.List[str]: + def get_option_link_args(self, options: 'OptionDictType') -> typing.List[str]: return self.linker.get_option_args(options) - def check_header(self, *args, **kwargs) -> T.Tuple[bool, bool]: + def check_header(self, *args, **kwargs) -> Tuple[bool, bool]: raise EnvironmentException('Language %s does not support header checks.' % self.get_display_language()) - def has_header(self, *args, **kwargs) -> T.Tuple[bool, bool]: + def has_header(self, *args, **kwargs) -> Tuple[bool, bool]: raise EnvironmentException('Language %s does not support header checks.' % self.get_display_language()) - def has_header_symbol(self, *args, **kwargs) -> T.Tuple[bool, bool]: + def has_header_symbol(self, *args, **kwargs) -> Tuple[bool, bool]: raise EnvironmentException('Language %s does not support header symbol checks.' % self.get_display_language()) - def compiles(self, *args, **kwargs) -> T.Tuple[bool, bool]: + def compiles(self, *args, **kwargs) -> Tuple[bool, bool]: raise EnvironmentException('Language %s does not support compile checks.' % self.get_display_language()) - def links(self, *args, **kwargs) -> T.Tuple[bool, bool]: + def links(self, *args, **kwargs) -> Tuple[bool, bool]: raise EnvironmentException('Language %s does not support link checks.' % self.get_display_language()) def run(self, *args, **kwargs) -> RunResult: @@ -841,7 +908,7 @@ def alignment(self, *args, **kwargs) -> int: raise EnvironmentException('Language %s does not support alignment checks.' % self.get_display_language()) - def has_function(self, *args, **kwargs) -> T.Tuple[bool, bool]: + def has_function(self, *args, **kwargs) -> Tuple[bool, bool]: raise EnvironmentException('Language %s does not support function checks.' % self.get_display_language()) @classmethod @@ -850,7 +917,7 @@ return args[:] @classmethod - def native_args_to_unix(cls, args: T.List[str]) -> T.List[str]: + def native_args_to_unix(cls, args: typing.List[str]) -> typing.List[str]: "Always returns a copy that can be independently mutated" return args[:] @@ -863,12 +930,12 @@ def get_program_dirs(self, *args, **kwargs): return [] - def has_multi_arguments(self, args, env) -> T.Tuple[bool, bool]: + def has_multi_arguments(self, args, env) -> Tuple[bool, bool]: raise EnvironmentException( 'Language {} does not support has_multi_arguments.'.format( self.get_display_language())) - def has_multi_link_arguments(self, args: T.List[str], env: 'Environment') -> T.Tuple[bool, bool]: + def has_multi_link_arguments(self, args: typing.List[str], env: 'Environment') -> Tuple[bool, bool]: return self.linker.has_multi_arguments(args, env) def _get_compile_output(self, dirname, mode): @@ -935,7 +1002,7 @@ p.output_name = output p.cached = False # Make sure that the cached attribute always exists yield p - except OSError: + except (PermissionError, OSError): # On Windows antivirus programs and the like hold on to files so # they can't be deleted. There's not much to do in this case. Also, # catch OSError because the directory is then no longer empty. @@ -982,22 +1049,22 @@ def get_compile_debugfile_args(self, rel_obj, **kwargs): return [] - def get_link_debugfile_args(self, targetfile: str) -> T.List[str]: + def get_link_debugfile_args(self, targetfile: str) -> typing.List[str]: return self.linker.get_debugfile_args(targetfile) - def get_std_shared_lib_link_args(self) -> T.List[str]: + def get_std_shared_lib_link_args(self) -> typing.List[str]: return self.linker.get_std_shared_lib_args() - def get_std_shared_module_link_args(self, options: 'OptionDictType') -> T.List[str]: + def get_std_shared_module_link_args(self, options: 'OptionDictType') -> typing.List[str]: return self.linker.get_std_shared_module_args(options) - def get_link_whole_for(self, args: T.List[str]) -> T.List[str]: + def get_link_whole_for(self, args: typing.List[str]) -> typing.List[str]: return self.linker.get_link_whole_for(args) - def get_allow_undefined_link_args(self) -> T.List[str]: + def get_allow_undefined_link_args(self) -> typing.List[str]: return self.linker.get_allow_undefined_args() - def no_undefined_link_args(self) -> T.List[str]: + def no_undefined_link_args(self) -> typing.List[str]: return self.linker.no_undefined_args() # Compiler arguments needed to enable the given instruction set. @@ -1008,7 +1075,7 @@ def build_rpath_args(self, env: 'Environment', build_dir: str, from_dir: str, rpath_paths: str, build_rpath: str, - install_rpath: str) -> T.List[str]: + install_rpath: str) -> typing.List[str]: return self.linker.build_rpath_args( env, build_dir, from_dir, rpath_paths, build_rpath, install_rpath) @@ -1039,7 +1106,7 @@ m = 'Language {} does not support position-independent executable' raise EnvironmentException(m.format(self.get_display_language())) - def get_pie_link_args(self) -> T.List[str]: + def get_pie_link_args(self) -> typing.List[str]: return self.linker.get_pie_args() def get_argument_syntax(self): @@ -1061,58 +1128,39 @@ raise EnvironmentException( '%s does not support get_profile_use_args ' % self.get_id()) - def get_undefined_link_args(self) -> T.List[str]: + def get_undefined_link_args(self) -> typing.List[str]: return self.linker.get_undefined_link_args() def remove_linkerlike_args(self, args): - rm_exact = ('-headerpad_max_install_names',) - rm_prefixes = ('-Wl,', '-L',) - rm_next = ('-L',) - ret = [] - iargs = iter(args) - for arg in iargs: - # Remove this argument - if arg in rm_exact: - continue - # If the argument starts with this, but is not *exactly* this - # f.ex., '-L' should match ['-Lfoo'] but not ['-L', 'foo'] - if arg.startswith(rm_prefixes) and arg not in rm_prefixes: - continue - # Ignore this argument and the one after it - if arg in rm_next: - next(iargs) - continue - ret.append(arg) - return ret + return [x for x in args if not x.startswith('-Wl')] - def get_lto_compile_args(self) -> T.List[str]: + def get_lto_compile_args(self) -> List[str]: return [] - def get_lto_link_args(self) -> T.List[str]: + def get_lto_link_args(self) -> List[str]: return self.linker.get_lto_args() - def sanitizer_compile_args(self, value: str) -> T.List[str]: + def sanitizer_compile_args(self, value: str) -> List[str]: return [] - def sanitizer_link_args(self, value: str) -> T.List[str]: + def sanitizer_link_args(self, value: str) -> List[str]: return self.linker.sanitizer_args(value) - def get_asneeded_args(self) -> T.List[str]: + def get_asneeded_args(self) -> typing.List[str]: return self.linker.get_asneeded_args() - def bitcode_args(self) -> T.List[str]: + def bitcode_args(self) -> typing.List[str]: return self.linker.bitcode_args() - def get_linker_debug_crt_args(self) -> T.List[str]: + def get_linker_debug_crt_args(self) -> typing.List[str]: return self.linker.get_debug_crt_args() - def get_buildtype_linker_args(self, buildtype: str) -> T.List[str]: + def get_buildtype_linker_args(self, buildtype: str) -> typing.List[str]: return self.linker.get_buildtype_args(buildtype) def get_soname_args(self, env: 'Environment', prefix: str, shlib_name: str, - suffix: str, soversion: str, - darwin_versions: T.Tuple[str, str], - is_shared_module: bool) -> T.List[str]: + suffix: str, soversion: str, darwin_versions: typing.Tuple[str, str], + is_shared_module: bool) -> typing.List[str]: return self.linker.get_soname_args( env, prefix, shlib_name, suffix, soversion, darwin_versions, is_shared_module) @@ -1126,18 +1174,53 @@ def get_dependency_link_args(self, dep): return dep.get_link_args() - @classmethod - def use_linker_args(cls, linker: str) -> T.List[str]: - """Get a list of arguments to pass to the compiler to set the linker. - """ - return [] +@enum.unique +class CompilerType(enum.Enum): + GCC_STANDARD = 0 + GCC_OSX = 1 + GCC_MINGW = 2 + GCC_CYGWIN = 3 + + CLANG_STANDARD = 10 + CLANG_OSX = 11 + CLANG_MINGW = 12 + CLANG_EMSCRIPTEN = 13 + # Possibly clang-cl? + + ICC_STANDARD = 20 + ICC_OSX = 21 + ICC_WIN = 22 + + ARM_WIN = 30 + + CCRX_WIN = 40 + + PGI_STANDARD = 50 + PGI_OSX = 51 + PGI_WIN = 52 + + @property + def is_standard_compiler(self): + return self.name in ('GCC_STANDARD', 'CLANG_STANDARD', 'ICC_STANDARD', 'PGI_STANDARD') + + @property + def is_osx_compiler(self): + return self.name in ('GCC_OSX', 'CLANG_OSX', 'ICC_OSX', 'PGI_OSX') + + @property + def is_windows_compiler(self): + return self.name in ('GCC_MINGW', 'GCC_CYGWIN', 'CLANG_MINGW', 'ICC_WIN', 'ARM_WIN', 'CCRX_WIN', 'PGI_WIN') + +def get_compiler_is_linuxlike(compiler): + compiler_type = getattr(compiler, 'compiler_type', None) + return compiler_type and compiler_type.is_standard_compiler def get_largefile_args(compiler): ''' Enable transparent large-file-support for 32-bit UNIX systems ''' - if not (compiler.info.is_windows() or compiler.info.is_darwin()): + if get_compiler_is_linuxlike(compiler): # Enable large-file support unconditionally on all platforms other # than macOS and Windows. macOS is now 64-bit-only so it doesn't # need anything special, and Windows doesn't have automatic LFS. @@ -1153,84 +1236,3 @@ # transitionary features and must be enabled by programs that use # those features explicitly. return [] - - -def get_args_from_envvars(lang: str, use_linker_args: bool) -> T.Tuple[T.List[str], T.List[str]]: - """ - Returns a tuple of (compile_flags, link_flags) for the specified language - from the inherited environment - """ - def log_var(var, val: T.Optional[str]): - if val: - mlog.log('Appending {} from environment: {!r}'.format(var, val)) - else: - mlog.debug('No {} in the environment, not changing global flags.'.format(var)) - - if lang not in cflags_mapping: - return [], [] - - compile_flags = [] # type: T.List[str] - link_flags = [] # type: T.List[str] - - env_compile_flags = os.environ.get(cflags_mapping[lang]) - log_var(cflags_mapping[lang], env_compile_flags) - if env_compile_flags is not None: - compile_flags += split_args(env_compile_flags) - - # Link flags (same for all languages) - if lang in languages_using_ldflags: - # This is duplicated between the linkers, but I'm not sure how else - # to handle this - env_link_flags = split_args(os.environ.get('LDFLAGS', '')) - else: - env_link_flags = [] - log_var('LDFLAGS', env_link_flags) - link_flags += env_link_flags - if use_linker_args: - # When the compiler is used as a wrapper around the linker (such as - # with GCC and Clang), the compile flags can be needed while linking - # too. This is also what Autotools does. However, we don't want to do - # this when the linker is stand-alone such as with MSVC C/C++, etc. - link_flags = compile_flags + link_flags - - # Pre-processor flags for certain languages - if lang in {'c', 'cpp', 'objc', 'objcpp'}: - env_preproc_flags = os.environ.get('CPPFLAGS') - log_var('CPPFLAGS', env_preproc_flags) - if env_preproc_flags is not None: - compile_flags += split_args(env_preproc_flags) - - return compile_flags, link_flags - - -def get_global_options(lang: str, comp: T.Type[Compiler], - properties: Properties) -> T.Dict[str, coredata.UserOption]: - """Retreive options that apply to all compilers for a given language.""" - description = 'Extra arguments passed to the {}'.format(lang) - opts = { - lang + '_args': coredata.UserArrayOption( - description + ' compiler', - [], split_args=True, user_input=True, allow_dups=True), - lang + '_link_args': coredata.UserArrayOption( - description + ' linker', - [], split_args=True, user_input=True, allow_dups=True), - } - - if properties.fallback: - # Get from env vars. - # XXX: True here is a hack - compile_args, link_args = get_args_from_envvars(lang, comp.INVOKES_LINKER) - else: - compile_args = [] - link_args = [] - - for k, o in opts.items(): - if k in properties: - # Get from configuration files. - o.set_value(properties[k]) - elif k == lang + '_args': - o.set_value(compile_args) - elif k == lang + '_link_args': - o.set_value(link_args) - - return opts diff -Nru meson-0.53.2/mesonbuild/compilers/cpp.py meson-0.52.1/mesonbuild/compilers/cpp.py --- meson-0.53.2/mesonbuild/compilers/cpp.py 2020-02-25 18:00:46.000000000 +0000 +++ meson-0.52.1/mesonbuild/compilers/cpp.py 2019-11-28 17:37:44.000000000 +0000 @@ -15,7 +15,7 @@ import copy import functools import os.path -import typing as T +import typing from .. import coredata from .. import mlog @@ -37,10 +37,6 @@ from .mixins.elbrus import ElbrusCompiler from .mixins.pgi import PGICompiler from .mixins.islinker import BasicLinkerIsCompilerMixin, LinkerEnvVarsMixin -from .mixins.emscripten import EmscriptenMixin - -if T.TYPE_CHECKING: - from ..envconfig import MachineInfo def non_msvc_eh_options(eh, args): @@ -59,23 +55,21 @@ except KeyError: raise MesonException('Unknown function attribute "{}"'.format(name)) - language = 'cpp' - def __init__(self, exelist, version, for_machine: MachineChoice, is_cross: bool, - info: 'MachineInfo', exe_wrap: T.Optional[str] = None, **kwargs): + exe_wrap: typing.Optional[str] = None, **kwargs): # If a child ObjCPP class has already set it, don't set it ourselves - Compiler.__init__(self, exelist, version, for_machine, info, **kwargs) + self.language = 'cpp' + Compiler.__init__(self, exelist, version, for_machine, **kwargs) CLikeCompiler.__init__(self, is_cross, exe_wrap) - @staticmethod - def get_display_language(): + def get_display_language(self): return 'C++' def get_no_stdinc_args(self): return ['-nostdinc++'] def sanity_check(self, work_dir, environment): - code = 'class breakCCompiler;int main(void) { return 0; }\n' + code = 'class breakCCompiler;int main() { return 0; }\n' return self.sanity_check_impl(work_dir, environment, 'sanitycheckcpp.cc', code) def get_compiler_check_args(self): @@ -98,7 +92,7 @@ t = '''{prefix} #include <{header}> using {symbol}; - int main(void) {{ return 0; }}''' + int main () {{ return 0; }}''' return self.compiles(t.format(**fargs), env, extra_args=extra_args, dependencies=dependencies) @@ -153,11 +147,9 @@ class ClangCPPCompiler(ClangCompiler, CPPCompiler): - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross, info: 'MachineInfo', exe_wrapper=None, **kwargs): - CPPCompiler.__init__(self, exelist, version, for_machine, is_cross, - info, exe_wrapper, **kwargs) - ClangCompiler.__init__(self) + def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwargs): + CPPCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwargs) + ClangCompiler.__init__(self, compiler_type) default_warn_args = ['-Wall', '-Winvalid-pch', '-Wnon-virtual-dtor'] self.warn_args = {'0': [], '1': default_warn_args, @@ -169,7 +161,6 @@ opts.update({'cpp_eh': coredata.UserComboOption('C++ exception handling type.', ['none', 'default', 'a', 's', 'sc'], 'default'), - 'cpp_rtti': coredata.UserBooleanOption('Enable RTTI', True), 'cpp_std': coredata.UserComboOption('C++ language standard to use', ['none', 'c++98', 'c++03', 'c++11', 'c++14', 'c++17', 'c++1z', 'c++2a', 'gnu++11', 'gnu++14', 'gnu++17', 'gnu++1z', 'gnu++2a'], @@ -184,9 +175,6 @@ non_msvc_eh_options(options['cpp_eh'].value, args) - if not options['cpp_rtti'].value: - args.append('-fno-rtti') - return args def get_option_link_args(self, options): @@ -196,19 +184,11 @@ return ['-lstdc++'] -class AppleClangCPPCompiler(ClangCPPCompiler): - - pass - - -class EmscriptenCPPCompiler(LinkerEnvVarsMixin, EmscriptenMixin, BasicLinkerIsCompilerMixin, ClangCPPCompiler): - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross: bool, info: 'MachineInfo', exe_wrapper=None, **kwargs): +class EmscriptenCPPCompiler(LinkerEnvVarsMixin, BasicLinkerIsCompilerMixin, ClangCPPCompiler): + def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwargs): if not is_cross: raise MesonException('Emscripten compiler can only be used for cross compilation.') - ClangCPPCompiler.__init__(self, exelist=exelist, version=version, - for_machine=for_machine, is_cross=is_cross, - info=info, exe_wrapper=exe_wrapper, **kwargs) + ClangCPPCompiler.__init__(self, exelist, version, compiler_type, for_machine, is_cross, exe_wrapper, **kwargs) self.id = 'emscripten' def get_option_compile_args(self, options): @@ -218,12 +198,23 @@ args.append(self._find_best_cpp_std(std.value)) return args + def get_option_link_args(self, options): + return [] + + def get_soname_args(self, *args, **kwargs): + raise MesonException('Emscripten does not support shared libraries.') + + def get_allow_undefined_link_args(self) -> typing.List[str]: + return ['-s', 'ERROR_ON_UNDEFINED_SYMBOLS=0'] + + def get_linker_output_args(self, output: str) -> typing.List[str]: + return ['-o', output] + class ArmclangCPPCompiler(ArmclangCompiler, CPPCompiler): - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross, info: 'MachineInfo', exe_wrapper=None, **kwargs): + def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwargs): CPPCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwargs) - ArmclangCompiler.__init__(self) + ArmclangCompiler.__init__(self, compiler_type) default_warn_args = ['-Wall', '-Winvalid-pch', '-Wnon-virtual-dtor'] self.warn_args = {'0': [], '1': default_warn_args, @@ -256,10 +247,9 @@ class GnuCPPCompiler(GnuCompiler, CPPCompiler): - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross, info: 'MachineInfo', exe_wrap, defines, **kwargs): - CPPCompiler.__init__(self, exelist, version, for_machine, is_cross, info, exe_wrap, **kwargs) - GnuCompiler.__init__(self, defines) + def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrap, defines, **kwargs): + CPPCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrap, **kwargs) + GnuCompiler.__init__(self, compiler_type, defines) default_warn_args = ['-Wall', '-Winvalid-pch', '-Wnon-virtual-dtor'] self.warn_args = {'0': [], '1': default_warn_args, @@ -271,14 +261,13 @@ opts.update({'cpp_eh': coredata.UserComboOption('C++ exception handling type.', ['none', 'default', 'a', 's', 'sc'], 'default'), - 'cpp_rtti': coredata.UserBooleanOption('Enable RTTI', True), 'cpp_std': coredata.UserComboOption('C++ language standard to use', ['none', 'c++98', 'c++03', 'c++11', 'c++14', 'c++17', 'c++1z', 'c++2a', 'gnu++03', 'gnu++11', 'gnu++14', 'gnu++17', 'gnu++1z', 'gnu++2a'], 'none'), 'cpp_debugstl': coredata.UserBooleanOption('STL debug mode', False)}) - if self.info.is_windows() or self.info.is_cygwin(): + if self.compiler_type.is_windows_compiler: opts.update({ 'cpp_winlibs': coredata.UserArrayOption('Standard Win libraries to link against', gnu_winlibs), }) @@ -292,15 +281,12 @@ non_msvc_eh_options(options['cpp_eh'].value, args) - if not options['cpp_rtti'].value: - args.append('-fno-rtti') - if options['cpp_debugstl'].value: args.append('-D_GLIBCXX_DEBUG=1') return args def get_option_link_args(self, options): - if self.info.is_windows() or self.info.is_cygwin(): + if self.compiler_type.is_windows_compiler: return options['cpp_winlibs'].value[:] return [] @@ -312,20 +298,14 @@ class PGICPPCompiler(PGICompiler, CPPCompiler): - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross, info: 'MachineInfo', exe_wrapper=None, **kwargs): - CPPCompiler.__init__(self, exelist, version, for_machine, is_cross, info, exe_wrapper, **kwargs) - PGICompiler.__init__(self) - + def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwargs): + CPPCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwargs) + PGICompiler.__init__(self, compiler_type) class ElbrusCPPCompiler(GnuCPPCompiler, ElbrusCompiler): - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross, info: 'MachineInfo', exe_wrapper=None, - defines=None, **kwargs): - GnuCPPCompiler.__init__(self, exelist, version, for_machine, - is_cross, info, exe_wrapper, defines, - **kwargs) - ElbrusCompiler.__init__(self) + def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, defines=None, **kwargs): + GnuCPPCompiler.__init__(self, exelist, version, compiler_type, for_machine, is_cross, exe_wrapper, defines, **kwargs) + ElbrusCompiler.__init__(self, compiler_type, defines) # It does not support c++/gnu++ 17 and 1z, but still does support 0x, 1y, and gnu++98. def get_options(self): @@ -351,26 +331,11 @@ extra_args=extra_args, dependencies=dependencies) - # Elbrus C++ compiler does not support RTTI, so don't check for it. - def get_option_compile_args(self, options): - args = [] - std = options['cpp_std'] - if std.value != 'none': - args.append(self._find_best_cpp_std(std.value)) - - non_msvc_eh_options(options['cpp_eh'].value, args) - - if options['cpp_debugstl'].value: - args.append('-D_GLIBCXX_DEBUG=1') - return args - class IntelCPPCompiler(IntelGnuLikeCompiler, CPPCompiler): - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross, info: 'MachineInfo', exe_wrap, **kwargs): - CPPCompiler.__init__(self, exelist, version, for_machine, is_cross, - info, exe_wrap, **kwargs) - IntelGnuLikeCompiler.__init__(self) + def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrap, **kwargs): + CPPCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrap, **kwargs) + IntelGnuLikeCompiler.__init__(self, compiler_type) self.lang_header = 'c++-header' default_warn_args = ['-Wall', '-w3', '-diag-disable:remark', '-Wpch-messages', '-Wnon-virtual-dtor'] @@ -396,7 +361,6 @@ opts.update({'cpp_eh': coredata.UserComboOption('C++ exception handling type.', ['none', 'default', 'a', 's', 'sc'], 'default'), - 'cpp_rtti': coredata.UserBooleanOption('Enable RTTI', True), 'cpp_std': coredata.UserComboOption('C++ language standard to use', ['none'] + c_stds + g_stds, 'none'), @@ -415,8 +379,6 @@ args.append('-std=' + remap_cpp03.get(std.value, std.value)) if options['cpp_eh'].value == 'none': args.append('-fno-exceptions') - if not options['cpp_rtti'].value: - args.append('-fno-rtti') if options['cpp_debugstl'].value: args.append('-D_GLIBCXX_DEBUG=1') return args @@ -444,11 +406,10 @@ def get_option_link_args(self, options): return options['cpp_winlibs'].value[:] - def _get_options_impl(self, opts, cpp_stds: T.List[str]): + def _get_options_impl(self, opts, cpp_stds: typing.List[str]): opts.update({'cpp_eh': coredata.UserComboOption('C++ exception handling type.', ['none', 'default', 'a', 's', 'sc'], 'default'), - 'cpp_rtti': coredata.UserBooleanOption('Enable RTTI', True), 'cpp_std': coredata.UserComboOption('C++ language standard to use', cpp_stds, 'none'), @@ -462,14 +423,9 @@ eh = options['cpp_eh'] if eh.value == 'default': args.append('/EHsc') - elif eh.value == 'none': - args.append('/EHs-c-') - else: + elif eh.value != 'none': args.append('/EH' + eh.value) - if not options['cpp_rtti'].value: - args.append('/GR-') - permissive, ver = self.VC_VERSION_MAP[options['cpp_std'].value] if ver is not None: @@ -499,7 +455,7 @@ # if one is using anything before that point, one cannot set the standard. if options['cpp_std'].value in {'vc++11', 'c++11'}: mlog.warning(self.id, 'does not support C++11;', - 'attempting best effort; setting the standard to C++14', once=True) + 'attempting best effort; setting the standard to C++14') # Don't mutate anything we're going to change, we need to use # deepcopy since we're messing with members, and we can't simply # copy the members because the option proxy doesn't support it. @@ -512,9 +468,8 @@ class VisualStudioCPPCompiler(CPP11AsCPP14Mixin, VisualStudioLikeCPPCompilerMixin, VisualStudioLikeCompiler, CPPCompiler): - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross: bool, info: 'MachineInfo', exe_wrap, target, **kwargs): - CPPCompiler.__init__(self, exelist, version, for_machine, is_cross, info, exe_wrap, **kwargs) + def __init__(self, exelist, version, for_machine: MachineChoice, is_cross: bool, exe_wrap, target, **kwargs): + CPPCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrap, **kwargs) VisualStudioLikeCompiler.__init__(self, target) self.base_options = ['b_pch', 'b_vscrt'] # FIXME add lto, pgo and the like self.id = 'msvc' @@ -546,10 +501,8 @@ return args class ClangClCPPCompiler(CPP11AsCPP14Mixin, VisualStudioLikeCPPCompilerMixin, VisualStudioLikeCompiler, CPPCompiler): - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross, info: 'MachineInfo', exe_wrap, target, **kwargs): - CPPCompiler.__init__(self, exelist, version, for_machine, is_cross, - info, exe_wrap, **kwargs) + def __init__(self, exelist, version, for_machine: MachineChoice, is_cross, exe_wrap, target, **kwargs): + CPPCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrap, **kwargs) VisualStudioLikeCompiler.__init__(self, target) self.id = 'clang-cl' @@ -560,24 +513,20 @@ class IntelClCPPCompiler(VisualStudioLikeCPPCompilerMixin, IntelVisualStudioLikeCompiler, CPPCompiler): - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross, info: 'MachineInfo', exe_wrap, target, **kwargs): - CPPCompiler.__init__(self, exelist, version, for_machine, is_cross, - info, exe_wrap, **kwargs) + def __init__(self, exelist, version, for_machine: MachineChoice, is_cross, exe_wrap, target, **kwargs): + CPPCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrap, **kwargs) IntelVisualStudioLikeCompiler.__init__(self, target) def get_options(self): - # This has only been tested with version 19.0, + # This has only been tested with verison 19.0, cpp_stds = ['none', 'c++11', 'vc++11', 'c++14', 'vc++14', 'c++17', 'vc++17', 'c++latest'] return self._get_options_impl(super().get_options(), cpp_stds) class ArmCPPCompiler(ArmCompiler, CPPCompiler): - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross, info: 'MachineInfo', exe_wrap=None, **kwargs): - CPPCompiler.__init__(self, exelist, version, for_machine, is_cross, - info, exe_wrap, **kwargs) - ArmCompiler.__init__(self) + def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrap=None, **kwargs): + CPPCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrap, **kwargs) + ArmCompiler.__init__(self, compiler_type) def get_options(self): opts = CPPCompiler.get_options(self) @@ -603,11 +552,9 @@ class CcrxCPPCompiler(CcrxCompiler, CPPCompiler): - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross, info: 'MachineInfo', exe_wrap=None, **kwargs): - CPPCompiler.__init__(self, exelist, version, for_machine, is_cross, - info, exe_wrap, **kwargs) - CcrxCompiler.__init__(self) + def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrap=None, **kwargs): + CPPCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrap, **kwargs) + CcrxCompiler.__init__(self, compiler_type) # Override CCompiler.get_always_args def get_always_args(self): diff -Nru meson-0.53.2/mesonbuild/compilers/c.py meson-0.52.1/mesonbuild/compilers/c.py --- meson-0.53.2/mesonbuild/compilers/c.py 2020-02-25 18:00:46.000000000 +0000 +++ meson-0.52.1/mesonbuild/compilers/c.py 2019-11-28 17:37:44.000000000 +0000 @@ -13,7 +13,7 @@ # limitations under the License. import os.path -import typing as T +import typing from .. import coredata from ..mesonlib import MachineChoice, MesonException, mlog, version_compare @@ -28,16 +28,13 @@ from .mixins.elbrus import ElbrusCompiler from .mixins.pgi import PGICompiler from .mixins.islinker import BasicLinkerIsCompilerMixin, LinkerEnvVarsMixin -from .mixins.emscripten import EmscriptenMixin from .compilers import ( gnu_winlibs, msvc_winlibs, Compiler, + CompilerType, ) -if T.TYPE_CHECKING: - from ..envconfig import MachineInfo - class CCompiler(CLikeCompiler, Compiler): @@ -48,26 +45,25 @@ except KeyError: raise MesonException('Unknown function attribute "{}"'.format(name)) - language = 'c' - def __init__(self, exelist, version, for_machine: MachineChoice, is_cross: bool, - info: 'MachineInfo', exe_wrapper: T.Optional[str] = None, **kwargs): + exe_wrapper: typing.Optional[str] = None, **kwargs): # If a child ObjC or CPP class has already set it, don't set it ourselves - Compiler.__init__(self, exelist, version, for_machine, info, **kwargs) + self.language = 'c' + Compiler.__init__(self, exelist, version, for_machine, **kwargs) CLikeCompiler.__init__(self, is_cross, exe_wrapper) def get_no_stdinc_args(self): return ['-nostdinc'] def sanity_check(self, work_dir, environment): - code = 'int main(void) { int class=0; return class; }\n' + code = 'int main() { int class=0; return class; }\n' return self.sanity_check_impl(work_dir, environment, 'sanitycheckc.c', code) def has_header_symbol(self, hname, symbol, prefix, env, *, extra_args=None, dependencies=None): fargs = {'prefix': prefix, 'header': hname, 'symbol': symbol} t = '''{prefix} #include <{header}> - int main(void) {{ + int main () {{ /* If it's not defined as a macro, try to use as a symbol */ #ifndef {symbol} {symbol}; @@ -79,14 +75,9 @@ class ClangCCompiler(ClangCompiler, CCompiler): - - _C17_VERSION = '>=6.0.0' - _C18_VERSION = '>=8.0.0' - - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross, info: 'MachineInfo', exe_wrapper=None, **kwargs): - CCompiler.__init__(self, exelist, version, for_machine, is_cross, info, exe_wrapper, **kwargs) - ClangCompiler.__init__(self) + def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwargs): + CCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwargs) + ClangCompiler.__init__(self, compiler_type) default_warn_args = ['-Wall', '-Winvalid-pch'] self.warn_args = {'0': [], '1': default_warn_args, @@ -99,10 +90,12 @@ g_stds = ['gnu89', 'gnu99', 'gnu11'] # https://releases.llvm.org/6.0.0/tools/clang/docs/ReleaseNotes.html # https://en.wikipedia.org/wiki/Xcode#Latest_versions - if version_compare(self.version, self._C17_VERSION): + v = '>=10.0.0' if self.compiler_type is CompilerType.CLANG_OSX else '>=6.0.0' + if version_compare(self.version, v): c_stds += ['c17'] g_stds += ['gnu17'] - if version_compare(self.version, self._C18_VERSION): + v = '>=11.0.0' if self.compiler_type is CompilerType.CLANG_OSX else '>=8.0.0' + if version_compare(self.version, v): c_stds += ['c18'] g_stds += ['gnu18'] opts.update({'c_std': coredata.UserComboOption('C language standard to use', @@ -121,35 +114,30 @@ return [] -class AppleClangCCompiler(ClangCCompiler): - - """Handle the differences between Apple Clang and Vanilla Clang. +class EmscriptenCCompiler(LinkerEnvVarsMixin, BasicLinkerIsCompilerMixin, ClangCCompiler): + def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwargs): + if not is_cross: + raise MesonException('Emscripten compiler can only be used for cross compilation.') + ClangCCompiler.__init__(self, exelist, version, compiler_type, for_machine, is_cross, exe_wrapper, **kwargs) + self.id = 'emscripten' - Right now this just handles the differences between the versions that new - C standards were added. - """ + def get_option_link_args(self, options): + return [] - _C17_VERSION = '>=10.0.0' - _C18_VERSION = '>=11.0.0' + def get_soname_args(self, *args, **kwargs): + raise MesonException('Emscripten does not support shared libraries.') + def get_allow_undefined_link_args(self) -> typing.List[str]: + return ['-s', 'ERROR_ON_UNDEFINED_SYMBOLS=0'] -class EmscriptenCCompiler(LinkerEnvVarsMixin, EmscriptenMixin, BasicLinkerIsCompilerMixin, ClangCCompiler): - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross: bool, info: 'MachineInfo', exe_wrapper=None, **kwargs): - if not is_cross: - raise MesonException('Emscripten compiler can only be used for cross compilation.') - ClangCCompiler.__init__(self, exelist=exelist, version=version, - for_machine=for_machine, is_cross=is_cross, - info=info, exe_wrapper=exe_wrapper, **kwargs) - self.id = 'emscripten' + def get_linker_output_args(self, output: str) -> typing.List[str]: + return ['-o', output] class ArmclangCCompiler(ArmclangCompiler, CCompiler): - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross, info: 'MachineInfo', exe_wrapper=None, **kwargs): - CCompiler.__init__(self, exelist, version, for_machine, is_cross, - info, exe_wrapper, **kwargs) - ArmclangCompiler.__init__(self) + def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwargs): + CCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwargs) + ArmclangCompiler.__init__(self, compiler_type) default_warn_args = ['-Wall', '-Winvalid-pch'] self.warn_args = {'0': [], '1': default_warn_args, @@ -176,12 +164,9 @@ class GnuCCompiler(GnuCompiler, CCompiler): - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross, info: 'MachineInfo', exe_wrapper=None, - defines=None, **kwargs): - CCompiler.__init__(self, exelist, version, for_machine, is_cross, - info, exe_wrapper, **kwargs) - GnuCompiler.__init__(self, defines) + def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, defines=None, **kwargs): + CCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwargs) + GnuCompiler.__init__(self, compiler_type, defines) default_warn_args = ['-Wall', '-Winvalid-pch'] self.warn_args = {'0': [], '1': default_warn_args, @@ -199,7 +184,7 @@ opts.update({'c_std': coredata.UserComboOption('C language standard to use', ['none'] + c_stds + g_stds, 'none')}) - if self.info.is_windows() or self.info.is_cygwin(): + if self.compiler_type.is_windows_compiler: opts.update({ 'c_winlibs': coredata.UserArrayOption('Standard Win libraries to link against', gnu_winlibs), }) @@ -213,7 +198,7 @@ return args def get_option_link_args(self, options): - if self.info.is_windows() or self.info.is_cygwin(): + if self.compiler_type.is_windows_compiler: return options['c_winlibs'].value[:] return [] @@ -222,20 +207,15 @@ class PGICCompiler(PGICompiler, CCompiler): - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross, info: 'MachineInfo', exe_wrapper=None, **kwargs): - CCompiler.__init__(self, exelist, version, for_machine, is_cross, - info, exe_wrapper, **kwargs) - PGICompiler.__init__(self) + def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwargs): + CCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwargs) + PGICompiler.__init__(self, compiler_type) class ElbrusCCompiler(GnuCCompiler, ElbrusCompiler): - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross, info: 'MachineInfo', exe_wrapper=None, - defines=None, **kwargs): - GnuCCompiler.__init__(self, exelist, version, for_machine, is_cross, - info, exe_wrapper, defines, **kwargs) - ElbrusCompiler.__init__(self) + def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, defines=None, **kwargs): + GnuCCompiler.__init__(self, exelist, version, compiler_type, for_machine, is_cross, exe_wrapper, defines, **kwargs) + ElbrusCompiler.__init__(self, compiler_type, defines) # It does support some various ISO standards and c/gnu 90, 9x, 1x in addition to those which GNU CC supports. def get_options(self): @@ -259,11 +239,9 @@ class IntelCCompiler(IntelGnuLikeCompiler, CCompiler): - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross, info: 'MachineInfo', exe_wrapper=None, **kwargs): - CCompiler.__init__(self, exelist, version, for_machine, is_cross, - info, exe_wrapper, **kwargs) - IntelGnuLikeCompiler.__init__(self) + def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwargs): + CCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwargs) + IntelGnuLikeCompiler.__init__(self, compiler_type) self.lang_header = 'c-header' default_warn_args = ['-Wall', '-w3', '-diag-disable:remark'] self.warn_args = {'0': [], @@ -303,23 +281,16 @@ def get_option_link_args(self, options): return options['c_winlibs'].value[:] - class VisualStudioCCompiler(VisualStudioLikeCompiler, VisualStudioLikeCCompilerMixin, CCompiler): - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross, info: 'MachineInfo', exe_wrap, target: str, - **kwargs): - CCompiler.__init__(self, exelist, version, for_machine, is_cross, - info, exe_wrap, **kwargs) + def __init__(self, exelist, version, for_machine: MachineChoice, is_cross, exe_wrap, target: str, **kwargs): + CCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrap, **kwargs) VisualStudioLikeCompiler.__init__(self, target) self.id = 'msvc' - class ClangClCCompiler(VisualStudioLikeCompiler, VisualStudioLikeCCompilerMixin, CCompiler): - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross, info: 'MachineInfo', exe_wrap, target, **kwargs): - CCompiler.__init__(self, exelist, version, for_machine, is_cross, - info, exe_wrap, **kwargs) + def __init__(self, exelist, version, for_machine: MachineChoice, is_cross, exe_wrap, target, **kwargs): + CCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrap, **kwargs) VisualStudioLikeCompiler.__init__(self, target) self.id = 'clang-cl' @@ -328,10 +299,10 @@ """Intel "ICL" compiler abstraction.""" - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross, info: 'MachineInfo', exe_wrap, target, **kwargs): - CCompiler.__init__(self, exelist, version, for_machine, is_cross, - info, exe_wrap, **kwargs) + __have_warned = False + + def __init__(self, exelist, version, for_machine: MachineChoice, is_cross, exe_wrap, target, **kwargs): + CCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrap, **kwargs) IntelVisualStudioLikeCompiler.__init__(self, target) def get_options(self): @@ -346,18 +317,18 @@ args = [] std = options['c_std'] if std.value == 'c89': - mlog.warning("ICL doesn't explicitly implement c89, setting the standard to 'none', which is close.", once=True) + if not self.__have_warned: + self.__have_warned = True + mlog.warning("ICL doesn't explicitly implement c89, setting the standard to 'none', which is close.") elif std.value != 'none': args.append('/Qstd:' + std.value) return args class ArmCCompiler(ArmCompiler, CCompiler): - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross, info: 'MachineInfo', exe_wrapper=None, **kwargs): - CCompiler.__init__(self, exelist, version, for_machine, is_cross, - info, exe_wrapper, **kwargs) - ArmCompiler.__init__(self) + def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwargs): + CCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwargs) + ArmCompiler.__init__(self, compiler_type) def get_options(self): opts = CCompiler.get_options(self) @@ -373,13 +344,10 @@ args.append('--' + std.value) return args - class CcrxCCompiler(CcrxCompiler, CCompiler): - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross, info: 'MachineInfo', exe_wrapper=None, **kwargs): - CCompiler.__init__(self, exelist, version, for_machine, is_cross, - info, exe_wrapper, **kwargs) - CcrxCompiler.__init__(self) + def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwargs): + CCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwargs) + CcrxCompiler.__init__(self, compiler_type) # Override CCompiler.get_always_args def get_always_args(self): @@ -392,9 +360,6 @@ 'none')}) return opts - def get_no_stdinc_args(self): - return [] - def get_option_compile_args(self, options): args = [] std = options['c_std'] diff -Nru meson-0.53.2/mesonbuild/compilers/cs.py meson-0.52.1/mesonbuild/compilers/cs.py --- meson-0.53.2/mesonbuild/compilers/cs.py 2020-01-23 12:51:19.000000000 +0000 +++ meson-0.52.1/mesonbuild/compilers/cs.py 2019-11-28 17:37:44.000000000 +0000 @@ -13,16 +13,13 @@ # limitations under the License. import os.path, subprocess -import typing as T from ..mesonlib import EnvironmentException +from ..mesonlib import is_windows from .compilers import Compiler, MachineChoice, mono_buildtype_args from .mixins.islinker import BasicLinkerIsCompilerMixin -if T.TYPE_CHECKING: - from ..envconfig import MachineInfo - cs_optimization_args = {'0': [], 'g': [], '1': ['-optimize+'], @@ -31,20 +28,15 @@ 's': ['-optimize+'], } - class CsCompiler(BasicLinkerIsCompilerMixin, Compiler): - - language = 'cs' - - def __init__(self, exelist, version, for_machine: MachineChoice, - info: 'MachineInfo', comp_id, runner=None): - super().__init__(exelist, version, for_machine, info) + def __init__(self, exelist, version, for_machine: MachineChoice, comp_id, runner=None): + self.language = 'cs' + super().__init__(exelist, version, for_machine) self.id = comp_id self.is_cross = False self.runner = runner - @classmethod - def get_display_language(cls): + def get_display_language(self): return 'C sharp' def get_always_args(self): @@ -141,20 +133,18 @@ class MonoCompiler(CsCompiler): - def __init__(self, exelist, version, for_machine: MachineChoice, - info: 'MachineInfo'): - super().__init__(exelist, version, for_machine, info, 'mono', - runner='mono') + def __init__(self, exelist, version, for_machine: MachineChoice): + super().__init__(exelist, version, for_machine, 'mono', + 'mono') class VisualStudioCsCompiler(CsCompiler): - def __init__(self, exelist, version, for_machine: MachineChoice, - info: 'MachineInfo'): - super().__init__(exelist, version, for_machine, info, 'csc') + def __init__(self, exelist, version, for_machine: MachineChoice): + super().__init__(exelist, version, for_machine, 'csc') def get_buildtype_args(self, buildtype): res = mono_buildtype_args[buildtype] - if not self.info.is_windows(): + if not is_windows(): tmp = [] for flag in res: if flag == '-debug': diff -Nru meson-0.53.2/mesonbuild/compilers/cuda.py meson-0.52.1/mesonbuild/compilers/cuda.py --- meson-0.53.2/mesonbuild/compilers/cuda.py 2020-01-23 12:51:19.000000000 +0000 +++ meson-0.52.1/mesonbuild/compilers/cuda.py 2019-11-28 17:37:44.000000000 +0000 @@ -13,30 +13,29 @@ # limitations under the License. import os.path -import typing as T +import typing from functools import partial from .. import coredata from .. import mlog -from ..mesonlib import EnvironmentException, MachineChoice, Popen_safe, OptionOverrideProxy, is_windows, LibType +from ..mesonlib import EnvironmentException, MachineChoice, Popen_safe, OptionOverrideProxy, is_windows from .compilers import (Compiler, cuda_buildtype_args, cuda_optimization_args, cuda_debug_args) -if T.TYPE_CHECKING: +if typing.TYPE_CHECKING: from ..environment import Environment # noqa: F401 - from ..envconfig import MachineInfo class CudaCompiler(Compiler): LINKER_PREFIX = '-Xlinker=' - language = 'cuda' _universal_flags = {'compiler': ['-I', '-D', '-U', '-E'], 'linker': ['-l', '-L']} - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross, exe_wrapper, host_compiler, info: 'MachineInfo', **kwargs): - super().__init__(exelist, version, for_machine, info, **kwargs) + def __init__(self, exelist, version, for_machine: MachineChoice, is_cross, exe_wrapper, host_compiler, **kwargs): + if not hasattr(self, 'language'): + self.language = 'cuda' + super().__init__(exelist, version, for_machine, **kwargs) self.is_cross = is_cross self.exe_wrapper = exe_wrapper self.host_compiler = host_compiler @@ -61,6 +60,9 @@ def get_always_args(self): return [] + def get_display_language(self): + return 'Cuda' + def get_no_stdinc_args(self): return [] @@ -153,7 +155,7 @@ raise EnvironmentException('Executables created by {0} compiler {1} are not runnable.'.format(self.language, self.name_string())) # Interpret the result of the sanity test. - # As mentioned above, it is not only a sanity test but also a GPU + # As mentionned above, it is not only a sanity test but also a GPU # architecture detection test. if stde == '': self.detected_cc = stdo @@ -170,7 +172,7 @@ t = '''{prefix} #include <{header}> using {symbol}; - int main(void) {{ return 0; }}''' + int main () {{ return 0; }}''' return self.compiles(t.format(**fargs), env, extra_args, dependencies) def get_options(self): @@ -187,7 +189,7 @@ def get_option_compile_args(self, options): args = [] # On Windows, the version of the C++ standard used by nvcc is dictated by - # the combination of CUDA version and MSVC version; the --std= is thus ignored + # the combination of CUDA version and MSVC verion; the --std= is thus ignored # and attempting to use it will result in a warning: https://stackoverflow.com/a/51272091/741027 if not is_windows(): std = options['cuda_std'] @@ -197,9 +199,9 @@ return args + self._to_host_flags(self.host_compiler.get_option_compile_args(self._to_host_compiler_options(options))) @classmethod - def _cook_link_args(cls, args: T.List[str]) -> T.List[str]: + def _cook_link_args(cls, args: typing.List[str]) -> typing.List[str]: # Prepare link args for nvcc - cooked = [] # type: T.List[str] + cooked = [] # type: typing.List[str] for arg in args: if arg.startswith('-Wl,'): # strip GNU-style -Wl prefix arg = arg.replace('-Wl,', '', 1) @@ -263,7 +265,7 @@ def get_depfile_suffix(self): return 'd' - def get_linker_debug_crt_args(self) -> T.List[str]: + def get_linker_debug_crt_args(self) -> typing.List[str]: return self._cook_link_args(self.host_compiler.get_linker_debug_crt_args()) def get_buildtype_linker_args(self, buildtype): @@ -271,7 +273,7 @@ def build_rpath_args(self, env: 'Environment', build_dir: str, from_dir: str, rpath_paths: str, build_rpath: str, - install_rpath: str) -> T.List[str]: + install_rpath: str) -> typing.List[str]: return self._cook_link_args(self.host_compiler.build_rpath_args( env, build_dir, from_dir, rpath_paths, build_rpath, install_rpath)) @@ -284,15 +286,12 @@ def compute_parameters_with_absolute_paths(self, parameter_list, build_dir): return [] - def get_output_args(self, target: str) -> T.List[str]: + def get_output_args(self, target: str) -> typing.List[str]: return ['-o', target] - def get_std_exe_link_args(self) -> T.List[str]: + def get_std_exe_link_args(self) -> typing.List[str]: return self._cook_link_args(self.host_compiler.get_std_exe_link_args()) - def find_library(self, libname, env, extra_dirs, libtype: LibType = LibType.PREFER_SHARED): - return ['-l' + libname] # FIXME - def get_crt_compile_args(self, crt_val, buildtype): return self._to_host_flags(self.host_compiler.get_crt_compile_args(crt_val, buildtype)) diff -Nru meson-0.53.2/mesonbuild/compilers/d.py meson-0.52.1/mesonbuild/compilers/d.py --- meson-0.53.2/mesonbuild/compilers/d.py 2020-01-23 12:51:19.000000000 +0000 +++ meson-0.52.1/mesonbuild/compilers/d.py 2019-11-28 17:37:44.000000000 +0000 @@ -13,13 +13,14 @@ # limitations under the License. import os.path, subprocess -import typing as T +import typing from ..mesonlib import ( - EnvironmentException, MachineChoice, version_compare, + EnvironmentException, MachineChoice, version_compare, is_windows, is_osx ) from .compilers import ( + CompilerType, d_dmd_buildtype_args, d_gdc_buildtype_args, d_ldc_buildtype_args, @@ -30,9 +31,6 @@ from .mixins.gnu import GnuCompiler from .mixins.islinker import LinkerEnvVarsMixin, BasicLinkerIsCompilerMixin -if T.TYPE_CHECKING: - from ..envconfig import MachineInfo - d_feature_args = {'gcc': {'unittest': '-funittest', 'debug': '-fdebug', 'version': '-fversion', @@ -119,7 +117,7 @@ return 'deps' def get_pic_args(self): - if self.info.is_windows(): + if is_windows(): return [] return ['-fPIC'] @@ -217,7 +215,7 @@ return ['-Wl,--out-implib=' + implibname] def build_rpath_args(self, env, build_dir, from_dir, rpath_paths, build_rpath, install_rpath): - if self.info.is_windows(): + if is_windows(): return [] # This method is to be used by LDC and DMD. @@ -235,7 +233,8 @@ paths = paths + ':' + padding return ['-Wl,-rpath,{}'.format(paths)] - def translate_args_to_nongnu(self, args): + @classmethod + def translate_args_to_nongnu(cls, args): dcargs = [] # Translate common arguments to flags the LDC/DMD compilers # can understand. @@ -244,10 +243,10 @@ for arg in args: # Translate OS specific arguments first. osargs = [] - if self.info.is_windows(): - osargs = self.translate_arg_to_windows(arg) - elif self.info.is_darwin(): - osargs = self.translate_arg_to_osx(arg) + if is_windows(): + osargs = cls.translate_arg_to_windows(arg) + elif is_osx(): + osargs = cls.translate_arg_to_osx(arg) if osargs: dcargs.extend(osargs) continue @@ -366,7 +365,7 @@ return clike_debug_args[is_debug] + ddebug_args def get_crt_args(self, crt_val, buildtype): - if not self.info.is_windows(): + if not is_windows(): return [] if crt_val in self.mscrt_args: @@ -388,7 +387,7 @@ assert(buildtype == 'custom') raise EnvironmentException('Requested C runtime based on buildtype, but buildtype is "custom".') - def get_soname_args(self, *args, **kwargs) -> T.List[str]: + def get_soname_args(self, *args, **kwargs) -> typing.List[str]: # LDC and DMD actually do use a linker, but they proxy all of that with # their own arguments soargs = [] @@ -396,7 +395,7 @@ soargs.append('-L=' + arg) return soargs - def get_allow_undefined_link_args(self) -> T.List[str]: + def get_allow_undefined_link_args(self) -> typing.List[str]: args = [] for arg in self.linker.get_allow_undefined_args(): args.append('-L=' + arg) @@ -412,15 +411,11 @@ 'mtd': ['-mscrtlib=libcmtd'], } - language = 'd' - - def __init__(self, exelist, version, for_machine: MachineChoice, - info: 'MachineInfo', arch, is_cross, exe_wrapper, **kwargs): - super().__init__(exelist, version, for_machine, info, **kwargs) + def __init__(self, exelist, version, for_machine: MachineChoice, arch, **kwargs): + self.language = 'd' + super().__init__(exelist, version, for_machine, **kwargs) self.id = 'unknown' self.arch = arch - self.exe_wrapper = exe_wrapper - self.is_cross = is_cross def sanity_check(self, work_dir, environment): source_name = os.path.join(work_dir, 'sanity.d') @@ -431,14 +426,7 @@ pc.wait() if pc.returncode != 0: raise EnvironmentException('D compiler %s can not compile programs.' % self.name_string()) - if self.is_cross: - if self.exe_wrapper is None: - # Can't check if the binaries run so we have to assume they do - return - cmdlist = self.exe_wrapper.get_command() + [output_name] - else: - cmdlist = [output_name] - if subprocess.call(cmdlist) != 0: + if subprocess.call(output_name) != 0: raise EnvironmentException('Executables created by D compiler %s are not runnable.' % self.name_string()) def needs_static_linker(self): @@ -451,7 +439,7 @@ return 'deps' def get_pic_args(self): - if self.info.is_windows(): + if is_windows(): return [] return ['-fPIC'] @@ -587,7 +575,7 @@ def get_target_arch_args(self): # LDC2 on Windows targets to current OS architecture, but # it should follow the target specified by the MSVC toolchain. - if self.info.is_windows(): + if is_windows(): if self.arch == 'x86_64': return ['-m64'] return ['-m32'] @@ -611,10 +599,8 @@ # we mostly want DCompiler, but that gives us the Compiler.LINKER_PREFIX instead LINKER_PREFIX = GnuCompiler.LINKER_PREFIX - def __init__(self, exelist, version, for_machine: MachineChoice, - info: 'MachineInfo', is_cross, exe_wrapper, arch, **kwargs): - DCompiler.__init__(self, exelist, version, for_machine, info, is_cross, exe_wrapper, arch, **kwargs) - GnuCompiler.__init__(self, {}) + def __init__(self, exelist, version, for_machine: MachineChoice, arch, **kwargs): + DCompiler.__init__(self, exelist, version, for_machine, arch, **kwargs) self.id = 'gcc' default_warn_args = ['-Wall', '-Wdeprecated'] self.warn_args = {'0': [], @@ -654,15 +640,13 @@ return parameter_list - def get_allow_undefined_link_args(self) -> T.List[str]: + def get_allow_undefined_link_args(self) -> typing.List[str]: return self.linker.get_allow_undefined_args() class LLVMDCompiler(DmdLikeCompilerMixin, LinkerEnvVarsMixin, BasicLinkerIsCompilerMixin, DCompiler): - - def __init__(self, exelist, version, for_machine: MachineChoice, - info: 'MachineInfo', arch, **kwargs): - DCompiler.__init__(self, exelist, version, for_machine, info, arch, False, None, **kwargs) + def __init__(self, exelist, version, for_machine: MachineChoice, arch, **kwargs): + DCompiler.__init__(self, exelist, version, for_machine, arch, **kwargs) self.id = 'llvm' self.base_options = ['b_coverage', 'b_colorout', 'b_vscrt'] @@ -693,18 +677,17 @@ def get_crt_link_args(self, crt_val, buildtype): return self.get_crt_args(crt_val, buildtype) - def unix_args_to_native(self, args): - return self.translate_args_to_nongnu(args) + @classmethod + def unix_args_to_native(cls, args): + return cls.translate_args_to_nongnu(args) def get_optimization_args(self, optimization_level): return ldc_optimization_args[optimization_level] class DmdDCompiler(DmdLikeCompilerMixin, LinkerEnvVarsMixin, BasicLinkerIsCompilerMixin, DCompiler): - - def __init__(self, exelist, version, for_machine: MachineChoice, - info: 'MachineInfo', arch, **kwargs): - DCompiler.__init__(self, exelist, version, for_machine, info, arch, False, None, **kwargs) + def __init__(self, exelist, version, for_machine: MachineChoice, arch, **kwargs): + DCompiler.__init__(self, exelist, version, for_machine, arch, **kwargs) self.id = 'dmd' self.base_options = ['b_coverage', 'b_colorout', 'b_vscrt'] @@ -719,7 +702,7 @@ return d_dmd_buildtype_args[buildtype] def get_std_exe_link_args(self): - if self.info.is_windows(): + if is_windows(): # DMD links against D runtime only when main symbol is found, # so these needs to be inserted when linking static D libraries. if self.arch == 'x86_64': @@ -731,7 +714,7 @@ def get_std_shared_lib_link_args(self): libname = 'libphobos2.so' - if self.info.is_windows(): + if is_windows(): if self.arch == 'x86_64': libname = 'phobos64.lib' elif self.arch == 'x86_mscoff': @@ -744,7 +727,7 @@ # DMD32 and DMD64 on 64-bit Windows defaults to 32-bit (OMF). # Force the target to 64-bit in order to stay consistent # across the different platforms. - if self.info.is_windows(): + if is_windows(): if self.arch == 'x86_64': return ['-m64'] elif self.arch == 'x86_mscoff': @@ -755,8 +738,9 @@ def get_crt_compile_args(self, crt_val, buildtype): return self.get_crt_args(crt_val, buildtype) - def unix_args_to_native(self, args): - return self.translate_args_to_nongnu(args) + @classmethod + def unix_args_to_native(cls, args): + return cls.translate_args_to_nongnu(args) def get_optimization_args(self, optimization_level): return dmd_optimization_args[optimization_level] diff -Nru meson-0.53.2/mesonbuild/compilers/fortran.py meson-0.52.1/mesonbuild/compilers/fortran.py --- meson-0.53.2/mesonbuild/compilers/fortran.py 2020-02-25 18:00:46.000000000 +0000 +++ meson-0.52.1/mesonbuild/compilers/fortran.py 2019-11-28 17:37:44.000000000 +0000 @@ -13,11 +13,12 @@ # limitations under the License. from pathlib import Path -import typing as T +from typing import List import subprocess, os +import typing -from .. import coredata from .compilers import ( + CompilerType, clike_debug_args, Compiler, ) @@ -32,28 +33,20 @@ from .. import mlog from mesonbuild.mesonlib import ( - version_compare, EnvironmentException, MesonException, MachineChoice, LibType + EnvironmentException, MachineChoice, is_osx, LibType ) -if T.TYPE_CHECKING: - from ..envconfig import MachineInfo - class FortranCompiler(CLikeCompiler, Compiler): - language = 'fortran' - - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross, info: 'MachineInfo', exe_wrapper=None, **kwargs): - Compiler.__init__(self, exelist, version, for_machine, info, **kwargs) + def __init__(self, exelist, version, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwargs): + self.language = 'fortran' + Compiler.__init__(self, exelist, version, for_machine, **kwargs) CLikeCompiler.__init__(self, is_cross, exe_wrapper) self.id = 'unknown' - def has_function(self, funcname, prefix, env, *, extra_args=None, dependencies=None): - raise MesonException('Fortran does not have "has_function" capability.\n' - 'It is better to test if a Fortran capability is working like:\n\n' - "meson.get_compiler('fortran').links('block; end block; end program')\n\n" - 'that example is to see if the compiler has Fortran 2008 Block element.') + def get_display_language(self): + return 'Fortran' def sanity_check(self, work_dir: Path, environment): """ @@ -129,7 +122,7 @@ def module_name_to_filename(self, module_name: str) -> str: if '_' in module_name: # submodule s = module_name.lower() - if self.id in ('gcc', 'intel', 'intel-cl'): + if self.id in ('gcc', 'intel'): filename = s.replace('_', '@') + '.smod' elif self.id in ('pgi', 'flang'): filename = s.replace('_', '-') + '.mod' @@ -165,36 +158,14 @@ class GnuFortranCompiler(GnuCompiler, FortranCompiler): - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross, info: 'MachineInfo', exe_wrapper=None, - defines=None, **kwargs): - FortranCompiler.__init__(self, exelist, version, for_machine, - is_cross, info, exe_wrapper, **kwargs) - GnuCompiler.__init__(self, defines) + def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, defines=None, **kwargs): + FortranCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwargs) + GnuCompiler.__init__(self, compiler_type, defines) default_warn_args = ['-Wall'] self.warn_args = {'0': [], '1': default_warn_args, '2': default_warn_args + ['-Wextra'], - '3': default_warn_args + ['-Wextra', '-Wpedantic', '-fimplicit-none']} - - def get_options(self): - opts = FortranCompiler.get_options(self) - fortran_stds = ['legacy', 'f95', 'f2003'] - if version_compare(self.version, '>=4.4.0'): - fortran_stds += ['f2008'] - if version_compare(self.version, '>=8.0.0'): - fortran_stds += ['f2018'] - opts.update({'fortran_std': coredata.UserComboOption('Fortran language standard to use', - ['none'] + fortran_stds, - 'none')}) - return opts - - def get_option_compile_args(self, options) -> T.List[str]: - args = [] - std = options['fortran_std'] - if std.value != 'none': - args.append('-std=' + std.value) - return args + '3': default_warn_args + ['-Wextra', '-Wpedantic']} def get_dependency_gen_args(self, outtarget, outfile): # Disabled until this is fixed: @@ -209,22 +180,16 @@ return ['-lgfortran', '-lm'] class ElbrusFortranCompiler(GnuFortranCompiler, ElbrusCompiler): - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross, info: 'MachineInfo', exe_wrapper=None, - defines=None, **kwargs): - GnuFortranCompiler.__init__(self, exelist, version, for_machine, - is_cross, info, exe_wrapper, defines, - **kwargs) - ElbrusCompiler.__init__(self) + def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, defines=None, **kwargs): + GnuFortranCompiler.__init__(self, exelist, version, compiler_type, for_machine, is_cross, exe_wrapper, defines, **kwargs) + ElbrusCompiler.__init__(self, compiler_type, defines) class G95FortranCompiler(FortranCompiler): LINKER_PREFIX = '-Wl,' - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross, info: 'MachineInfo', exe_wrapper=None, **kwargs): - FortranCompiler.__init__(self, exelist, version, for_machine, - is_cross, info, exe_wrapper, **kwargs) + def __init__(self, exelist, version, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwags): + FortranCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwags) self.id = 'g95' default_warn_args = ['-Wall'] self.warn_args = {'0': [], @@ -244,10 +209,8 @@ LINKER_PREFIX = '-Wl,' - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross, info: 'MachineInfo', exe_wrapper=None, - **kwargs): - FortranCompiler.__init__(self, exelist, version, for_machine, is_cross, info, exe_wrapper, **kwargs) + def __init__(self, exelist, version, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwags): + FortranCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwags) self.id = 'sun' def get_dependency_gen_args(self, outtarget, outfile): @@ -270,16 +233,12 @@ class IntelFortranCompiler(IntelGnuLikeCompiler, FortranCompiler): - - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross, info: 'MachineInfo', exe_wrapper=None, - **kwargs): + def __init__(self, exelist, version, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwags): self.file_suffixes = ('f90', 'f', 'for', 'ftn', 'fpp') - FortranCompiler.__init__(self, exelist, version, for_machine, - is_cross, info, exe_wrapper, **kwargs) + FortranCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwags) # FIXME: Add support for OS X and Windows in detect_fortran_compiler so # we are sent the type of compiler - IntelGnuLikeCompiler.__init__(self) + IntelGnuLikeCompiler.__init__(self, CompilerType.ICC_STANDARD) self.id = 'intel' default_warn_args = ['-warn', 'general', '-warn', 'truncated_source'] self.warn_args = {'0': [], @@ -287,22 +246,6 @@ '2': default_warn_args + ['-warn', 'unused'], '3': ['-warn', 'all']} - def get_options(self): - opts = FortranCompiler.get_options(self) - fortran_stds = ['legacy', 'f95', 'f2003', 'f2008', 'f2018'] - opts.update({'fortran_std': coredata.UserComboOption('Fortran language standard to use', - ['none'] + fortran_stds, - 'none')}) - return opts - - def get_option_compile_args(self, options) -> T.List[str]: - args = [] - std = options['fortran_std'] - stds = {'legacy': 'none', 'f95': 'f95', 'f2003': 'f03', 'f2008': 'f08', 'f2018': 'f18'} - if std.value != 'none': - args.append('-stand=' + stds[std.value]) - return args - def get_preprocess_only_args(self): return ['-cpp', '-EP'] @@ -315,7 +258,7 @@ def language_stdlib_only_link_flags(self): return ['-lifcore', '-limf'] - def get_dependency_gen_args(self, outtarget: str, outfile: str) -> T.List[str]: + def get_dependency_gen_args(self, outtarget: str, outfile: str) -> typing.List[str]: return ['-gen-dep=' + outtarget, '-gen-depformat=make'] @@ -324,11 +267,17 @@ file_suffixes = ['f90', 'f', 'for', 'ftn', 'fpp'] always_args = ['/nologo'] - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross, target: str, info: 'MachineInfo', exe_wrapper=None, - **kwargs): - FortranCompiler.__init__(self, exelist, version, for_machine, - is_cross, info, exe_wrapper, **kwargs) + BUILD_ARGS = { + 'plain': [], + 'debug': ["/Zi", "/Od"], + 'debugoptimized': ["/Zi", "/O1"], + 'release': ["/O2"], + 'minsize': ["/Os"], + 'custom': [], + } + + def __init__(self, exelist, for_machine: MachineChoice, version, is_cross, target: str, exe_wrapper=None, **kwargs): + FortranCompiler.__init__(self, exelist, for_machine, version, is_cross, exe_wrapper, **kwargs) IntelVisualStudioLikeCompiler.__init__(self, target) default_warn_args = ['/warn:general', '/warn:truncated_source'] @@ -337,32 +286,16 @@ '2': default_warn_args + ['/warn:unused'], '3': ['/warn:all']} - def get_options(self): - opts = FortranCompiler.get_options(self) - fortran_stds = ['legacy', 'f95', 'f2003', 'f2008', 'f2018'] - opts.update({'fortran_std': coredata.UserComboOption('Fortran language standard to use', - ['none'] + fortran_stds, - 'none')}) - return opts - - def get_option_compile_args(self, options) -> T.List[str]: - args = [] - std = options['fortran_std'] - stds = {'legacy': 'none', 'f95': 'f95', 'f2003': 'f03', 'f2008': 'f08', 'f2018': 'f18'} - if std.value != 'none': - args.append('/stand:' + stds[std.value]) - return args - - def get_module_outdir_args(self, path) -> T.List[str]: + def get_module_outdir_args(self, path) -> List[str]: return ['/module:' + path] + def get_buildtype_args(self, buildtype: str) -> List[str]: + return self.BUILD_ARGS[buildtype] + class PathScaleFortranCompiler(FortranCompiler): - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross, info: 'MachineInfo', exe_wrapper=None, - **kwargs): - FortranCompiler.__init__(self, exelist, version, for_machine, - is_cross, info, exe_wrapper, **kwargs) + def __init__(self, exelist, version, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwags): + FortranCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwags) self.id = 'pathscale' default_warn_args = ['-fullwarn'] self.warn_args = {'0': [], @@ -375,30 +308,18 @@ class PGIFortranCompiler(PGICompiler, FortranCompiler): - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross, info: 'MachineInfo', exe_wrapper=None, - **kwargs): - FortranCompiler.__init__(self, exelist, version, for_machine, - is_cross, info, exe_wrapper, **kwargs) - PGICompiler.__init__(self) - - default_warn_args = ['-Minform=inform'] - self.warn_args = {'0': [], - '1': default_warn_args, - '2': default_warn_args, - '3': default_warn_args + ['-Mdclchk']} + def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwags): + FortranCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwags) + PGICompiler.__init__(self, compiler_type) - def language_stdlib_only_link_flags(self) -> T.List[str]: + def language_stdlib_only_link_flags(self) -> List[str]: return ['-lpgf90rtl', '-lpgf90', '-lpgf90_rpm1', '-lpgf902', '-lpgf90rtl', '-lpgftnrtl', '-lrt'] class FlangFortranCompiler(ClangCompiler, FortranCompiler): - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross, info: 'MachineInfo', exe_wrapper=None, - **kwargs): - FortranCompiler.__init__(self, exelist, version, for_machine, - is_cross, info, exe_wrapper, **kwargs) - ClangCompiler.__init__(self) + def __init__(self, exelist, version, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwags): + FortranCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwags) + ClangCompiler.__init__(self, CompilerType.CLANG_STANDARD) self.id = 'flang' default_warn_args = ['-Minform=inform'] self.warn_args = {'0': [], @@ -406,15 +327,12 @@ '2': default_warn_args, '3': default_warn_args} - def language_stdlib_only_link_flags(self) -> T.List[str]: + def language_stdlib_only_link_flags(self) -> List[str]: return ['-lflang', '-lpgmath'] class Open64FortranCompiler(FortranCompiler): - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross, info: 'MachineInfo', exe_wrapper=None, - **kwargs): - FortranCompiler.__init__(self, exelist, version, for_machine, - is_cross, info, exe_wrapper, **kwargs) + def __init__(self, exelist, version, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwags): + FortranCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwags) self.id = 'open64' default_warn_args = ['-fullwarn'] self.warn_args = {'0': [], @@ -427,11 +345,8 @@ class NAGFortranCompiler(FortranCompiler): - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross, info: 'MachineInfo', exe_wrapper=None, - **kwargs): - FortranCompiler.__init__(self, exelist, version, for_machine, - is_cross, info, exe_wrapper, **kwargs) + def __init__(self, exelist, version, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwags): + FortranCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwags) self.id = 'nagfor' def get_warn_args(self, level): diff -Nru meson-0.53.2/mesonbuild/compilers/__init__.py meson-0.52.1/mesonbuild/compilers/__init__.py --- meson-0.53.2/mesonbuild/compilers/__init__.py 2019-12-04 18:45:50.000000000 +0000 +++ meson-0.52.1/mesonbuild/compilers/__init__.py 2019-11-28 17:37:44.000000000 +0000 @@ -14,6 +14,7 @@ # Public symbols for compilers sub-package when using 'from . import compilers' __all__ = [ + 'CompilerType', 'Compiler', 'all_languages', @@ -33,8 +34,6 @@ 'lang_suffixes', 'sort_clink', - 'AppleClangCCompiler', - 'AppleClangCPPCompiler', 'ArmCCompiler', 'ArmCPPCompiler', 'ArmclangCCompiler', @@ -55,11 +54,9 @@ 'G95FortranCompiler', 'GnuCCompiler', 'ElbrusCCompiler', - 'EmscriptenCCompiler', 'GnuCompiler', 'GnuCPPCompiler', 'ElbrusCPPCompiler', - 'EmscriptenCPPCompiler', 'GnuDCompiler', 'GnuFortranCompiler', 'ElbrusFortranCompiler', @@ -100,6 +97,7 @@ # Bring symbols from each module into compilers sub-package namespace from .compilers import ( + CompilerType, Compiler, all_languages, base_options, @@ -121,7 +119,6 @@ ) from .c import ( CCompiler, - AppleClangCCompiler, ArmCCompiler, ArmclangCCompiler, ClangCCompiler, @@ -137,7 +134,6 @@ ) from .cpp import ( CPPCompiler, - AppleClangCPPCompiler, ArmCPPCompiler, ArmclangCPPCompiler, ClangCPPCompiler, diff -Nru meson-0.53.2/mesonbuild/compilers/java.py meson-0.52.1/mesonbuild/compilers/java.py --- meson-0.53.2/mesonbuild/compilers/java.py 2020-01-23 12:51:19.000000000 +0000 +++ meson-0.52.1/mesonbuild/compilers/java.py 2019-11-28 17:37:44.000000000 +0000 @@ -12,25 +12,17 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os.path -import shutil -import subprocess -import typing as T +import os.path, shutil, subprocess from ..mesonlib import EnvironmentException, MachineChoice + from .compilers import Compiler, java_buildtype_args from .mixins.islinker import BasicLinkerIsCompilerMixin -if T.TYPE_CHECKING: - from ..envconfig import MachineInfo - class JavaCompiler(BasicLinkerIsCompilerMixin, Compiler): - - language = 'java' - - def __init__(self, exelist, version, for_machine: MachineChoice, - info: 'MachineInfo'): - super().__init__(exelist, version, for_machine, info) + def __init__(self, exelist, version, for_machine: MachineChoice): + self.language = 'java' + super().__init__(exelist, version, for_machine) self.id = 'unknown' self.is_cross = False self.javarunner = 'java' diff -Nru meson-0.53.2/mesonbuild/compilers/mixins/arm.py meson-0.52.1/mesonbuild/compilers/mixins/arm.py --- meson-0.53.2/mesonbuild/compilers/mixins/arm.py 2020-02-25 18:00:46.000000000 +0000 +++ meson-0.52.1/mesonbuild/compilers/mixins/arm.py 2019-11-28 17:37:44.000000000 +0000 @@ -16,13 +16,14 @@ import os import re -import typing as T +import typing from ... import mesonlib from ..compilers import clike_debug_args from .clang import clang_color_args -if T.TYPE_CHECKING: +if typing.TYPE_CHECKING: + from ..compilers import CompilerType from ...environment import Environment arm_buildtype_args = { @@ -32,7 +33,7 @@ 'release': ['-O3', '-Otime'], 'minsize': ['-O3', '-Ospace'], 'custom': [], -} # type: T.Dict[str, T.List[str]] +} # type: typing.Dict[str, typing.List[str]] arm_optimization_args = { '0': ['-O0'], @@ -41,7 +42,7 @@ '2': ['-O2'], '3': ['-O3'], 's': [], -} # type: T.Dict[str, T.List[str]] +} # type: typing.Dict[str, typing.List[str]] armclang_buildtype_args = { 'plain': [], @@ -50,7 +51,7 @@ 'release': ['-Os'], 'minsize': ['-Oz'], 'custom': [], -} # type: T.Dict[str, T.List[str]] +} # type: typing.Dict[str, typing.List[str]] armclang_optimization_args = { '0': ['-O0'], @@ -59,16 +60,17 @@ '2': ['-O2'], '3': ['-O3'], 's': ['-Os'] -} # type: T.Dict[str, T.List[str]] +} # type: typing.Dict[str, typing.List[str]] class ArmCompiler: # Functionality that is common to all ARM family compilers. - def __init__(self): + def __init__(self, compiler_type: 'CompilerType'): if not self.is_cross: raise mesonlib.EnvironmentException('armcc supports only cross-compilation.') self.id = 'arm' - default_warn_args = [] # type: T.List[str] + self.compiler_type = compiler_type + default_warn_args = [] # type: typing.List[str] self.warn_args = {'0': [], '1': default_warn_args, '2': default_warn_args + [], @@ -76,22 +78,23 @@ # Assembly self.can_compile_suffixes.add('s') - def get_pic_args(self) -> T.List[str]: + + def get_pic_args(self) -> typing.List[str]: # FIXME: Add /ropi, /rwpi, /fpic etc. qualifiers to --apcs return [] - def get_buildtype_args(self, buildtype: str) -> T.List[str]: + def get_buildtype_args(self, buildtype: str) -> typing.List[str]: return arm_buildtype_args[buildtype] # Override CCompiler.get_always_args - def get_always_args(self) -> T.List[str]: + def get_always_args(self) -> typing.List[str]: return [] # Override CCompiler.get_dependency_gen_args - def get_dependency_gen_args(self, outtarget: str, outfile: str) -> T.List[str]: + def get_dependency_gen_args(self, outtarget: str, outfile: str) -> typing.List[str]: return [] - def get_pch_use_args(self, pch_dir: str, header: str) -> T.List[str]: + def get_pch_use_args(self, pch_dir: str, header: str) -> typing.List[str]: # FIXME: Add required arguments # NOTE from armcc user guide: # "Support for Precompiled Header (PCH) files is deprecated from ARM Compiler 5.05 @@ -106,19 +109,19 @@ # PCH files." return 'pch' - def thread_flags(self, env: 'Environment') -> T.List[str]: + def thread_flags(self, env: 'Environment') -> typing.List[str]: return [] - def get_coverage_args(self) -> T.List[str]: + def get_coverage_args(self) -> typing.List[str]: return [] - def get_optimization_args(self, optimization_level: str) -> T.List[str]: + def get_optimization_args(self, optimization_level: str) -> typing.List[str]: return arm_optimization_args[optimization_level] - def get_debug_args(self, is_debug: bool) -> T.List[str]: + def get_debug_args(self, is_debug: bool) -> typing.List[str]: return clike_debug_args[is_debug] - def compute_parameters_with_absolute_paths(self, parameter_list: T.List[str], build_dir: str) -> T.List[str]: + def compute_parameters_with_absolute_paths(self, parameter_list: typing.List[str], build_dir: str) -> typing.List[str]: for idx, i in enumerate(parameter_list): if i[:2] == '-I' or i[:2] == '-L': parameter_list[idx] = i[:2] + os.path.normpath(os.path.join(build_dir, i[2:])) @@ -127,7 +130,7 @@ class ArmclangCompiler: - def __init__(self): + def __init__(self, compiler_type: 'CompilerType'): if not self.is_cross: raise mesonlib.EnvironmentException('armclang supports only cross-compilation.') # Check whether 'armlink' is available in path @@ -143,7 +146,7 @@ if ver_str: ver_str = ver_str.group(0) else: - raise mesonlib.EnvironmentException('armlink version string not found') + mesonlib.EnvironmentException('armlink version string not found') assert ver_str # makes mypy happy # Using the regular expression from environment.search_version, # which is used for searching compiler version @@ -154,42 +157,43 @@ if not mesonlib.version_compare(self.version, '==' + linker_ver): raise mesonlib.EnvironmentException('armlink version does not match with compiler version') self.id = 'armclang' + self.compiler_type = compiler_type self.base_options = ['b_pch', 'b_lto', 'b_pgo', 'b_sanitize', 'b_coverage', 'b_ndebug', 'b_staticpic', 'b_colorout'] # Assembly - self.can_compile_suffixes.add('s') + self.can_compile_suffixes.update('s') - def get_pic_args(self) -> T.List[str]: + def get_pic_args(self) -> typing.List[str]: # PIC support is not enabled by default for ARM, # if users want to use it, they need to add the required arguments explicitly return [] - def get_colorout_args(self, colortype: str) -> T.List[str]: + def get_colorout_args(self, colortype: str) -> typing.List[str]: return clang_color_args[colortype][:] - def get_buildtype_args(self, buildtype: str) -> T.List[str]: + def get_buildtype_args(self, buildtype: str) -> typing.List[str]: return armclang_buildtype_args[buildtype] def get_pch_suffix(self) -> str: return 'gch' - def get_pch_use_args(self, pch_dir: str, header: str) -> T.List[str]: + def get_pch_use_args(self, pch_dir: str, header: str) -> typing.List[str]: # Workaround for Clang bug http://llvm.org/bugs/show_bug.cgi?id=15136 # This flag is internal to Clang (or at least not documented on the man page) # so it might change semantics at any time. return ['-include-pch', os.path.join(pch_dir, self.get_pch_name(header))] # Override CCompiler.get_dependency_gen_args - def get_dependency_gen_args(self, outtarget: str, outfile: str) -> T.List[str]: + def get_dependency_gen_args(self, outtarget: str, outfile: str) -> typing.List[str]: return [] - def get_optimization_args(self, optimization_level: str) -> T.List[str]: + def get_optimization_args(self, optimization_level: str) -> typing.List[str]: return armclang_optimization_args[optimization_level] - def get_debug_args(self, is_debug: bool) -> T.List[str]: + def get_debug_args(self, is_debug: bool) -> typing.List[str]: return clike_debug_args[is_debug] - def compute_parameters_with_absolute_paths(self, parameter_list: T.List[str], build_dir: str) -> T.List[str]: + def compute_parameters_with_absolute_paths(self, parameter_list: typing.List[str], build_dir: str) -> typing.List[str]: for idx, i in enumerate(parameter_list): if i[:2] == '-I' or i[:2] == '-L': parameter_list[idx] = i[:2] + os.path.normpath(os.path.join(build_dir, i[2:])) diff -Nru meson-0.53.2/mesonbuild/compilers/mixins/ccrx.py meson-0.52.1/mesonbuild/compilers/mixins/ccrx.py --- meson-0.53.2/mesonbuild/compilers/mixins/ccrx.py 2020-02-25 18:00:46.000000000 +0000 +++ meson-0.52.1/mesonbuild/compilers/mixins/ccrx.py 2019-11-28 17:37:44.000000000 +0000 @@ -15,11 +15,12 @@ """Representations specific to the Renesas CC-RX compiler family.""" import os -import typing as T +import typing -from ...mesonlib import EnvironmentException +from ...mesonlib import Popen_safe, EnvironmentException -if T.TYPE_CHECKING: +if typing.TYPE_CHECKING: + from ..compilers import CompilerType from ...environment import Environment ccrx_buildtype_args = { @@ -29,7 +30,7 @@ 'release': [], 'minsize': [], 'custom': [], -} # type: T.Dict[str, T.List[str]] +} # type: typing.Dict[str, typing.List[str]] ccrx_optimization_args = { '0': ['-optimize=0'], @@ -38,65 +39,60 @@ '2': ['-optimize=2'], '3': ['-optimize=max'], 's': ['-optimize=2', '-size'] -} # type: T.Dict[str, T.List[str]] +} # type: typing.Dict[str, typing.List[str]] ccrx_debug_args = { False: [], True: ['-debug'] -} # type: T.Dict[bool, T.List[str]] +} # type: typing.Dict[bool, typing.List[str]] class CcrxCompiler: - def __init__(self): + def __init__(self, compiler_type: 'CompilerType'): if not self.is_cross: raise EnvironmentException('ccrx supports only cross-compilation.') self.id = 'ccrx' + self.compiler_type = compiler_type # Assembly - self.can_compile_suffixes.add('src') - default_warn_args = [] # type: T.List[str] + self.can_compile_suffixes.update('s') + default_warn_args = [] # type: typing.List[str] self.warn_args = {'0': [], '1': default_warn_args, '2': default_warn_args + [], '3': default_warn_args + []} - def get_pic_args(self) -> T.List[str]: + def get_pic_args(self) -> typing.List[str]: # PIC support is not enabled by default for CCRX, # if users want to use it, they need to add the required arguments explicitly return [] - def get_buildtype_args(self, buildtype: str) -> T.List[str]: + def get_buildtype_args(self, buildtype: str) -> typing.List[str]: return ccrx_buildtype_args[buildtype] def get_pch_suffix(self) -> str: return 'pch' - def get_pch_use_args(self, pch_dir: str, header: str) -> T.List[str]: + def get_pch_use_args(self, pch_dir: str, header: str) -> typing.List[str]: return [] # Override CCompiler.get_dependency_gen_args - def get_dependency_gen_args(self, outtarget: str, outfile: str) -> T.List[str]: + def get_dependency_gen_args(self, outtarget: str, outfile: str) -> typing.List[str]: return [] - def thread_flags(self, env: 'Environment') -> T.List[str]: + def thread_flags(self, env: 'Environment') -> typing.List[str]: return [] - def get_coverage_args(self) -> T.List[str]: + def get_coverage_args(self) -> typing.List[str]: return [] - def get_no_stdinc_args(self) -> T.List[str]: - return [] - - def get_no_stdlib_link_args(self) -> T.List[str]: - return [] - - def get_optimization_args(self, optimization_level: str) -> T.List[str]: + def get_optimization_args(self, optimization_level: str) -> typing.List[str]: return ccrx_optimization_args[optimization_level] - def get_debug_args(self, is_debug: bool) -> T.List[str]: + def get_debug_args(self, is_debug: bool) -> typing.List[str]: return ccrx_debug_args[is_debug] @classmethod - def unix_args_to_native(cls, args: T.List[str]) -> T.List[str]: + def unix_args_to_native(cls, args: typing.List[str]) -> typing.List[str]: result = [] for i in args: if i.startswith('-D'): @@ -114,7 +110,7 @@ result.append(i) return result - def compute_parameters_with_absolute_paths(self, parameter_list: T.List[str], build_dir: str) -> T.List[str]: + def compute_parameters_with_absolute_paths(self, parameter_list: typing.List[str], build_dir: str) -> typing.List[str]: for idx, i in enumerate(parameter_list): if i[:9] == '-include=': parameter_list[idx] = i[:9] + os.path.normpath(os.path.join(build_dir, i[9:])) diff -Nru meson-0.53.2/mesonbuild/compilers/mixins/clang.py meson-0.52.1/mesonbuild/compilers/mixins/clang.py --- meson-0.53.2/mesonbuild/compilers/mixins/clang.py 2020-01-23 12:51:19.000000000 +0000 +++ meson-0.52.1/mesonbuild/compilers/mixins/clang.py 2019-11-28 17:37:44.000000000 +0000 @@ -15,14 +15,14 @@ """Abstractions for the LLVM/Clang compiler family.""" import os -import typing as T +import typing -from ... import mesonlib -from ...linkers import AppleDynamicLinker -from ..compilers import clike_optimization_args from .gnu import GnuLikeCompiler +from ..compilers import clike_optimization_args +from ... import mesonlib -if T.TYPE_CHECKING: +if typing.TYPE_CHECKING: + from ..compilers import CompilerType from ...environment import Environment from ...dependencies import Dependency # noqa: F401 @@ -30,37 +30,35 @@ 'auto': ['-Xclang', '-fcolor-diagnostics'], 'always': ['-Xclang', '-fcolor-diagnostics'], 'never': ['-Xclang', '-fno-color-diagnostics'], -} # type: T.Dict[str, T.List[str]] +} # type: typing.Dict[str, typing.List[str]] class ClangCompiler(GnuLikeCompiler): - def __init__(self): - super().__init__() + def __init__(self, compiler_type: 'CompilerType'): + super().__init__(compiler_type) self.id = 'clang' self.base_options.append('b_colorout') - # TODO: this really should be part of the linker base_options, but - # linkers don't have base_options. - if isinstance(self.linker, AppleDynamicLinker): + if self.compiler_type.is_osx_compiler: self.base_options.append('b_bitcode') # All Clang backends can also do LLVM IR self.can_compile_suffixes.add('ll') - def get_colorout_args(self, colortype: str) -> T.List[str]: + def get_colorout_args(self, colortype: str) -> typing.List[str]: return clang_color_args[colortype][:] - def get_optimization_args(self, optimization_level: str) -> T.List[str]: + def get_optimization_args(self, optimization_level: str) -> typing.List[str]: return clike_optimization_args[optimization_level] def get_pch_suffix(self) -> str: return 'pch' - def get_pch_use_args(self, pch_dir: str, header: str) -> T.List[str]: + def get_pch_use_args(self, pch_dir: str, header: str) -> typing.List[str]: # Workaround for Clang bug http://llvm.org/bugs/show_bug.cgi?id=15136 # This flag is internal to Clang (or at least not documented on the man page) # so it might change semantics at any time. return ['-include-pch', os.path.join(pch_dir, self.get_pch_name(header))] - def has_multi_arguments(self, args: T.List[str], env: 'Environment') -> T.List[str]: + def has_multi_arguments(self, args: typing.List[str], env: 'Environment') -> typing.List[str]: myargs = ['-Werror=unknown-warning-option', '-Werror=unused-command-line-argument'] if mesonlib.version_compare(self.version, '>=3.6.0'): myargs.append('-Werror=ignored-optimization-argument') @@ -69,21 +67,20 @@ env) def has_function(self, funcname: str, prefix: str, env: 'Environment', *, - extra_args: T.Optional[T.List[str]] = None, - dependencies: T.Optional[T.List['Dependency']] = None) -> bool: + extra_args: typing.Optional[typing.List[str]] = None, + dependencies: typing.Optional[typing.List['Dependency']] = None) -> bool: if extra_args is None: extra_args = [] # Starting with XCode 8, we need to pass this to force linker # visibility to obey OS X/iOS/tvOS minimum version targets with # -mmacosx-version-min, -miphoneos-version-min, -mtvos-version-min etc. # https://github.com/Homebrew/homebrew-core/issues/3727 - # TODO: this really should be communicated by the linker - if isinstance(self.linker, AppleDynamicLinker) and mesonlib.version_compare(self.version, '>=8.0'): + if self.compiler_type.is_osx_compiler and mesonlib.version_compare(self.version, '>=8.0'): extra_args.append('-Wl,-no_weak_imports') return super().has_function(funcname, prefix, env, extra_args=extra_args, dependencies=dependencies) - def openmp_flags(self) -> T.List[str]: + def openmp_flags(self) -> typing.List[str]: if mesonlib.version_compare(self.version, '>=3.8.0'): return ['-fopenmp'] elif mesonlib.version_compare(self.version, '>=3.7.0'): diff -Nru meson-0.53.2/mesonbuild/compilers/mixins/clike.py meson-0.52.1/mesonbuild/compilers/mixins/clike.py --- meson-0.53.2/mesonbuild/compilers/mixins/clike.py 2020-01-23 12:51:19.000000000 +0000 +++ meson-0.52.1/mesonbuild/compilers/mixins/clike.py 2019-11-28 17:37:44.000000000 +0000 @@ -26,7 +26,7 @@ import os import re import subprocess -import typing as T +import typing from pathlib import Path from ... import mesonlib @@ -35,7 +35,7 @@ from .. import compilers from .visualstudio import VisualStudioLikeCompiler -if T.TYPE_CHECKING: +if typing.TYPE_CHECKING: from ...environment import Environment @@ -50,7 +50,7 @@ find_framework_cache = {} internal_libs = compilers.unixy_compiler_internal_libs - def __init__(self, is_cross: bool, exe_wrapper: T.Optional[str] = None): + def __init__(self, is_cross: bool, exe_wrapper: typing.Optional[str] = None): # If a child ObjC or CPP class has already set it, don't set it ourselves self.is_cross = is_cross self.can_compile_suffixes.add('h') @@ -117,7 +117,7 @@ def get_coverage_args(self): return ['--coverage'] - def get_coverage_link_args(self) -> T.List[str]: + def get_coverage_link_args(self) -> typing.List[str]: return self.linker.get_coverage_args() def get_werror_args(self): @@ -134,7 +134,7 @@ return ['-isystem', path] return ['-I' + path] - def get_compiler_dirs(self, env: 'Environment', name: str) -> T.List[str]: + def get_compiler_dirs(self, env: 'Environment', name: str) -> typing.List[str]: ''' Get dirs from the compiler, either `libraries:` or `programs:` ''' @@ -167,6 +167,7 @@ retval.append(d) # at this point, it's an ELF file which doesn't match the # appropriate elf_class, so skip this one + pass return tuple(retval) @functools.lru_cache() @@ -177,28 +178,28 @@ ''' return self.get_compiler_dirs(env, 'programs') - def get_pic_args(self) -> T.List[str]: + def get_pic_args(self) -> typing.List[str]: return ['-fPIC'] def name_string(self) -> str: return ' '.join(self.exelist) - def get_pch_use_args(self, pch_dir: str, header: str) -> T.List[str]: + def get_pch_use_args(self, pch_dir: str, header: str) -> typing.List[str]: return ['-include', os.path.basename(header)] def get_pch_name(self, header_name: str) -> str: return os.path.basename(header_name) + '.' + self.get_pch_suffix() - def get_linker_search_args(self, dirname: str) -> T.List[str]: + def get_linker_search_args(self, dirname: str) -> typing.List[str]: return self.linker.get_search_args(dirname) def get_default_include_dirs(self): return [] - def gen_export_dynamic_link_args(self, env: 'Environment') -> T.List[str]: + def gen_export_dynamic_link_args(self, env: 'Environment') -> typing.List[str]: return self.linker.export_dynamic_args(env) - def gen_import_library_args(self, implibname: str) -> T.List[str]: + def gen_import_library_args(self, implibname: str) -> typing.List[str]: return self.linker.import_library_args(implibname) def sanity_check_impl(self, work_dir, environment, sname, code): @@ -257,7 +258,7 @@ raise mesonlib.EnvironmentException('Executables created by {0} compiler {1} are not runnable.'.format(self.language, self.name_string())) def sanity_check(self, work_dir, environment): - code = 'int main(void) { int class=0; return class; }\n' + code = 'int main() { int class=0; return class; }\n' return self.sanity_check_impl(work_dir, environment, 'sanitycheckc.c', code) def check_header(self, hname, prefix, env, *, extra_args=None, dependencies=None): @@ -284,7 +285,7 @@ fargs = {'prefix': prefix, 'header': hname, 'symbol': symbol} t = '''{prefix} #include <{header}> - int main(void) {{ + int main () {{ /* If it's not defined as a macro, try to use as a symbol */ #ifndef {symbol} {symbol}; @@ -397,7 +398,7 @@ fargs = {'prefix': prefix, 'expression': expression} t = '''#include {prefix} - int main(void) {{ static int a[1-2*!({expression})]; a[0]=0; return 0; }}''' + int main() {{ static int a[1-2*!({expression})]; a[0]=0; return 0; }}''' return self.compiles(t.format(**fargs), env, extra_args=extra_args, dependencies=dependencies)[0] @@ -422,7 +423,7 @@ cur = maxint high = cur else: - high = cur = -1 + low = cur = -1 while self._compile_int('%s < %d' % (expression, cur), prefix, env, extra_args, dependencies): high = cur - 1 if high < minint: @@ -457,7 +458,7 @@ fargs = {'prefix': prefix, 'expression': expression} t = '''#include {prefix} - int main(void) {{ + int main() {{ printf("%ld\\n", (long)({expression})); return 0; }};''' @@ -475,7 +476,7 @@ fargs = {'prefix': prefix, 'type': typename} t = '''#include {prefix} - int main(void) {{ + int main() {{ {type} something; return 0; }}''' @@ -493,7 +494,7 @@ dependencies=dependencies) t = '''#include {prefix} - int main(void) {{ + int main() {{ printf("%ld\\n", (long)(sizeof({type}))); return 0; }};''' @@ -511,7 +512,7 @@ fargs = {'prefix': prefix, 'type': typename} t = '''#include {prefix} - int main(void) {{ + int main() {{ {type} something; return 0; }}''' @@ -540,7 +541,7 @@ char c; {type} target; }}; - int main(void) {{ + int main() {{ printf("%d", (int)offsetof(struct tmp, target)); return 0; }}''' @@ -590,7 +591,7 @@ fargs = {'prefix': prefix, 'f': fname, 'cast': cast, 'fmt': fmt} code = '''{prefix} #include - int main(void) {{ + int main() {{ printf ("{fmt}", {cast} {f}()); return 0; }}'''.format(**fargs) @@ -633,11 +634,11 @@ #ifdef __cplusplus extern "C" #endif - char {func} (void); + char {func} (); ''' # The actual function call main = ''' - int main(void) {{ + int main () {{ return {func} (); }}''' return head, main @@ -656,7 +657,7 @@ # Just taking the address or comparing it to void is not enough because # compilers are smart enough to optimize it away. The resulting binary # is not run so we don't care what the return value is. - main = '''\nint main(void) {{ + main = '''\nint main() {{ void *a = (void*) &{func}; long b = (long) a; return (int) b; @@ -728,7 +729,7 @@ # can just directly use the __has_builtin() macro. fargs['no_includes'] = '#include' not in prefix t = '''{prefix} - int main(void) {{ + int main() {{ #ifdef __has_builtin #if !__has_builtin(__builtin_{func}) #error "__builtin_{func} not found" @@ -760,7 +761,7 @@ members += '{}.{};\n'.format(fargs['name'], member) fargs['members'] = members t = '''{prefix} - void bar(void) {{ + void bar() {{ {type} {name}; {members} }};''' @@ -770,7 +771,7 @@ def has_type(self, typename, prefix, env, extra_args, dependencies=None): fargs = {'prefix': prefix, 'type': typename} t = '''{prefix} - void bar(void) {{ + void bar() {{ sizeof({type}); }};''' return self.compiles(t.format(**fargs), env, extra_args=extra_args, @@ -784,7 +785,7 @@ code = '''#ifdef __cplusplus extern "C" { #endif - void ''' + symbol_name.decode() + ''' (void) {} + void ''' + symbol_name.decode() + ''' () {} #ifdef __cplusplus } #endif @@ -901,7 +902,7 @@ return [f] @staticmethod - def _get_file_from_list(env, files: T.List[str]) -> Path: + def _get_file_from_list(env, files: typing.List[str]) -> Path: ''' We just check whether the library exists. We can't do a link check because the library might have unresolved symbols that require other @@ -992,7 +993,7 @@ return value[:] def find_library(self, libname, env, extra_dirs, libtype: LibType = LibType.PREFER_SHARED): - code = 'int main(void) { return 0; }' + code = 'int main() { return 0; }' return self.find_library_impl(libname, env, extra_dirs, code, libtype) def find_framework_paths(self, env): @@ -1022,7 +1023,7 @@ return paths def find_framework_real(self, name, env, extra_dirs, allow_system): - code = 'int main(void) { return 0; }' + code = 'int main() { return 0; }' link_args = [] for d in extra_dirs: link_args += ['-F' + d] @@ -1055,10 +1056,10 @@ raise mesonlib.MesonException('Cannot find frameworks with non-clang compiler') return self.find_framework_impl(name, env, extra_dirs, allow_system) - def get_crt_compile_args(self, crt_val: str, buildtype: str) -> T.List[str]: + def get_crt_compile_args(self, crt_val: str, buildtype: str) -> typing.List[str]: return [] - def get_crt_link_args(self, crt_val: str, buildtype: str) -> T.List[str]: + def get_crt_link_args(self, crt_val: str, buildtype: str) -> typing.List[str]: return [] def thread_flags(self, env): @@ -1067,7 +1068,7 @@ return [] return ['-pthread'] - def thread_link_flags(self, env: 'Environment') -> T.List[str]: + def thread_link_flags(self, env: 'Environment') -> typing.List[str]: return self.linker.thread_flags(env) def linker_to_compiler_args(self, args): @@ -1101,7 +1102,7 @@ # false positive. args = self.linker.fatal_warnings() + args args = self.linker_to_compiler_args(args) - code = 'int main(void) { return 0; }' + code = 'int main() { return 0; }' return self.has_arguments(args, env, code, mode='link') @staticmethod diff -Nru meson-0.53.2/mesonbuild/compilers/mixins/elbrus.py meson-0.52.1/mesonbuild/compilers/mixins/elbrus.py --- meson-0.53.2/mesonbuild/compilers/mixins/elbrus.py 2020-02-25 18:00:46.000000000 +0000 +++ meson-0.52.1/mesonbuild/compilers/mixins/elbrus.py 2019-11-28 17:37:44.000000000 +0000 @@ -15,23 +15,21 @@ """Abstractions for the Elbrus family of compilers.""" import os -import typing as T -import subprocess -import re +import typing -from .gnu import GnuLikeCompiler -from .gnu import gnu_optimization_args +from .gnu import GnuCompiler from ...mesonlib import Popen_safe -if T.TYPE_CHECKING: +if typing.TYPE_CHECKING: + from ..compilers import CompilerType from ...environment import Environment -class ElbrusCompiler(GnuLikeCompiler): +class ElbrusCompiler(GnuCompiler): # Elbrus compiler is nearly like GCC, but does not support # PCH, LTO, sanitizers and color output as of version 1.21.x. - def __init__(self): - super().__init__() + def __init__(self, compiler_type: 'CompilerType', defines: typing.Dict[str, str]): + GnuCompiler.__init__(self, compiler_type, defines) self.id = 'lcc' self.base_options = ['b_pgo', 'b_coverage', 'b_ndebug', 'b_staticpic', @@ -39,18 +37,18 @@ # FIXME: use _build_wrapper to call this so that linker flags from the env # get applied - def get_library_dirs(self, env: 'Environment', elf_class: T.Optional[int] = None) -> T.List[str]: + def get_library_dirs(self, env: 'Environment', elf_class: typing.Optional[int] = None) -> typing.List[str]: os_env = os.environ.copy() os_env['LC_ALL'] = 'C' stdo = Popen_safe(self.exelist + ['--print-search-dirs'], env=os_env)[1] for line in stdo.split('\n'): if line.startswith('libraries:'): - # lcc does not include '=' in --print-search-dirs output. Also it could show nonexistent dirs. + # lcc does not include '=' in --print-search-dirs output. libstr = line.split(' ', 1)[1] - return [os.path.realpath(p) for p in libstr.split(':') if os.path.exists(p)] + return [os.path.realpath(p) for p in libstr.split(':')] return [] - def get_program_dirs(self, env: 'Environment') -> T.List[str]: + def get_program_dirs(self, env: 'Environment') -> typing.List[str]: os_env = os.environ.copy() os_env['LC_ALL'] = 'C' stdo = Popen_safe(self.exelist + ['--print-search-dirs'], env=os_env)[1] @@ -60,24 +58,3 @@ libstr = line.split(' ', 1)[1] return [os.path.realpath(p) for p in libstr.split(':')] return [] - - def get_default_include_dirs(self) -> T.List[str]: - os_env = os.environ.copy() - os_env['LC_ALL'] = 'C' - p = subprocess.Popen(self.exelist + ['-xc', '-E', '-v', '-'], env=os_env, stdin=subprocess.DEVNULL, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - stderr = p.stderr.read().decode('utf-8', errors='replace') - includes = [] - for line in stderr.split('\n'): - if line.lstrip().startswith('--sys_include'): - includes.append(re.sub(r'\s*\\$', '', re.sub(r'^\s*--sys_include\s*', '', line))) - return includes - - def get_optimization_args(self, optimization_level: str) -> T.List[str]: - return gnu_optimization_args[optimization_level] - - def get_pch_suffix(self) -> str: - # Actually it's not supported for now, but probably will be supported in future - return 'pch' - - def openmp_flags(self) -> T.List[str]: - return ['-fopenmp'] diff -Nru meson-0.53.2/mesonbuild/compilers/mixins/emscripten.py meson-0.52.1/mesonbuild/compilers/mixins/emscripten.py --- meson-0.53.2/mesonbuild/compilers/mixins/emscripten.py 2020-01-23 12:51:19.000000000 +0000 +++ meson-0.52.1/mesonbuild/compilers/mixins/emscripten.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -# Copyright 2019 The meson development team -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Provides a mixin for shared code between C and C++ Emscripten compilers.""" - -import os.path -import typing as T - -from ...mesonlib import MesonException - -class EmscriptenMixin: - def get_option_link_args(self, options): - return [] - - def get_soname_args(self, *args, **kwargs): - raise MesonException('Emscripten does not support shared libraries.') - - def get_allow_undefined_link_args(self) -> T.List[str]: - return ['-s', 'ERROR_ON_UNDEFINED_SYMBOLS=0'] - - def get_linker_output_args(self, output: str) -> T.List[str]: - return ['-o', output] - - def _get_compile_output(self, dirname, mode): - # In pre-processor mode, the output is sent to stdout and discarded - if mode == 'preprocess': - return None - # Unlike sane toolchains, emcc infers the kind of output from its name. - # This is the only reason why this method is overridden; compiler tests - # do not work well with the default exe/obj suffices. - if mode == 'link': - suffix = 'js' - else: - suffix = 'wasm' - return os.path.join(dirname, 'output.' + suffix) diff -Nru meson-0.53.2/mesonbuild/compilers/mixins/gnu.py meson-0.52.1/mesonbuild/compilers/mixins/gnu.py --- meson-0.53.2/mesonbuild/compilers/mixins/gnu.py 2020-01-23 12:51:19.000000000 +0000 +++ meson-0.52.1/mesonbuild/compilers/mixins/gnu.py 2019-11-28 17:37:44.000000000 +0000 @@ -20,12 +20,13 @@ import pathlib import re import subprocess -import typing as T +import typing from ... import mesonlib from ... import mlog -if T.TYPE_CHECKING: +if typing.TYPE_CHECKING: + from ..compilers import CompilerType from ...coredata import UserOption # noqa: F401 from ...environment import Environment @@ -34,7 +35,7 @@ clike_debug_args = { False: [], True: ['-g'], -} # type: T.Dict[bool, T.List[str]] +} # type: typing.Dict[bool, typing.List[str]] gnulike_buildtype_args = { 'plain': [], @@ -43,7 +44,7 @@ 'release': [], 'minsize': [], 'custom': [], -} # type: T.Dict[str, T.List[str]] +} # type: typing.Dict[str, typing.List[str]] gnu_optimization_args = { '0': [], @@ -52,7 +53,7 @@ '2': ['-O2'], '3': ['-O3'], 's': ['-Os'], -} # type: T.Dict[str, T.List[str]] +} # type: typing.Dict[str, typing.List[str]] gnulike_instruction_set_args = { 'mmx': ['-mmmx'], @@ -65,7 +66,7 @@ 'avx': ['-mavx'], 'avx2': ['-mavx2'], 'neon': ['-mfpu=neon'], -} # type: T.Dict[str, T.List[str]] +} # type: typing.Dict[str, typing.List[str]] gnu_symbol_visibility_args = { '': [], @@ -74,17 +75,17 @@ 'hidden': ['-fvisibility=hidden'], 'protected': ['-fvisibility=protected'], 'inlineshidden': ['-fvisibility=hidden', '-fvisibility-inlines-hidden'], -} # type: T.Dict[str, T.List[str]] +} # type: typing.Dict[str, typing.List[str]] gnu_color_args = { 'auto': ['-fdiagnostics-color=auto'], 'always': ['-fdiagnostics-color=always'], 'never': ['-fdiagnostics-color=never'], -} # type: T.Dict[str, T.List[str]] +} # type: typing.Dict[str, typing.List[str]] @functools.lru_cache(maxsize=None) -def gnulike_default_include_dirs(compiler: T.Tuple[str], lang: str) -> T.List[str]: +def gnulike_default_include_dirs(compiler: typing.Tuple[str], lang: str) -> typing.List[str]: lang_map = { 'c': 'c', 'cpp': 'c++', @@ -100,15 +101,14 @@ p = subprocess.Popen( cmd, stdin=subprocess.DEVNULL, - stderr=subprocess.STDOUT, + stderr=subprocess.PIPE, stdout=subprocess.PIPE, env=env ) - stdout = p.stdout.read().decode('utf-8', errors='replace') + stderr = p.stderr.read().decode('utf-8', errors='replace') parse_state = 0 paths = [] - for line in stdout.split('\n'): - line = line.strip(' \n\r\t') + for line in stderr.split('\n'): if parse_state == 0: if line == '#include "..." search starts here:': parse_state = 1 @@ -116,16 +116,14 @@ if line == '#include <...> search starts here:': parse_state = 2 else: - paths.append(line) + paths.append(line[1:]) elif parse_state == 2: if line == 'End of search list.': break else: - paths.append(line) + paths.append(line[1:]) if not paths: mlog.warning('No include directory found parsing "{cmd}" output'.format(cmd=" ".join(cmd))) - # Append a normalized copy of paths to make path lookup easier - paths += [os.path.normpath(x) for x in paths] return paths @@ -139,60 +137,61 @@ LINKER_PREFIX = '-Wl,' - def __init__(self): + def __init__(self, compiler_type: 'CompilerType'): + self.compiler_type = compiler_type self.base_options = ['b_pch', 'b_lto', 'b_pgo', 'b_sanitize', 'b_coverage', 'b_ndebug', 'b_staticpic', 'b_pie'] - if not (self.info.is_windows() or self.info.is_cygwin() or self.info.is_openbsd()): + if not (self.compiler_type.is_windows_compiler or mesonlib.is_openbsd()): self.base_options.append('b_lundef') - if not self.info.is_windows() or self.info.is_cygwin(): + if not self.compiler_type.is_windows_compiler: self.base_options.append('b_asneeded') # All GCC-like backends can do assembly self.can_compile_suffixes.add('s') - def get_pic_args(self) -> T.List[str]: - if self.info.is_windows() or self.info.is_cygwin() or self.info.is_darwin(): + def get_pic_args(self) -> typing.List[str]: + if self.compiler_type.is_osx_compiler or self.compiler_type.is_windows_compiler: return [] # On Window and OS X, pic is always on. return ['-fPIC'] - def get_pie_args(self) -> T.List[str]: + def get_pie_args(self) -> typing.List[str]: return ['-fPIE'] - def get_buildtype_args(self, buildtype: str) -> T.List[str]: + def get_buildtype_args(self, buildtype: str) -> typing.List[str]: return gnulike_buildtype_args[buildtype] @abc.abstractmethod - def get_optimization_args(self, optimization_level: str) -> T.List[str]: + def get_optimization_args(self, optimization_level: str) -> typing.List[str]: raise NotImplementedError("get_optimization_args not implemented") - def get_debug_args(self, is_debug: bool) -> T.List[str]: + def get_debug_args(self, is_debug: bool) -> typing.List[str]: return clike_debug_args[is_debug] @abc.abstractmethod def get_pch_suffix(self) -> str: raise NotImplementedError("get_pch_suffix not implemented") - def split_shlib_to_parts(self, fname: str) -> T.Tuple[str, str]: + def split_shlib_to_parts(self, fname: str) -> typing.Tuple[str, str]: return os.path.dirname(fname), fname - def get_instruction_set_args(self, instruction_set: str) -> T.Optional[T.List[str]]: + def get_instruction_set_args(self, instruction_set: str) -> typing.Optional[typing.List[str]]: return gnulike_instruction_set_args.get(instruction_set, None) - def get_default_include_dirs(self) -> T.List[str]: + def get_default_include_dirs(self) -> typing.List[str]: return gnulike_default_include_dirs(tuple(self.exelist), self.language) @abc.abstractmethod - def openmp_flags(self) -> T.List[str]: + def openmp_flags(self) -> typing.List[str]: raise NotImplementedError("openmp_flags not implemented") - def gnu_symbol_visibility_args(self, vistype: str) -> T.List[str]: + def gnu_symbol_visibility_args(self, vistype: str) -> typing.List[str]: return gnu_symbol_visibility_args[vistype] - def gen_vs_module_defs_args(self, defsfile: str) -> T.List[str]: + def gen_vs_module_defs_args(self, defsfile: str) -> typing.List[str]: if not isinstance(defsfile, str): raise RuntimeError('Module definitions file should be str') # On Windows targets, .def files may be specified on the linker command # line like an object file. - if self.info.is_windows() or self.info.is_cygwin(): + if self.compiler_type.is_windows_compiler: return [defsfile] # For other targets, discard the .def file. return [] @@ -200,18 +199,18 @@ def get_argument_syntax(self) -> str: return 'gcc' - def get_profile_generate_args(self) -> T.List[str]: + def get_profile_generate_args(self) -> typing.List[str]: return ['-fprofile-generate'] - def get_profile_use_args(self) -> T.List[str]: + def get_profile_use_args(self) -> typing.List[str]: return ['-fprofile-use', '-fprofile-correction'] - def get_gui_app_args(self, value: bool) -> T.List[str]: - if self.info.is_windows() or self.info.is_cygwin(): + def get_gui_app_args(self, value: bool) -> typing.List[str]: + if self.compiler_type.is_windows_compiler: return ['-mwindows' if value else '-mconsole'] return [] - def compute_parameters_with_absolute_paths(self, parameter_list: T.List[str], build_dir: str) -> T.List[str]: + def compute_parameters_with_absolute_paths(self, parameter_list: typing.List[str], build_dir: str) -> typing.List[str]: for idx, i in enumerate(parameter_list): if i[:2] == '-I' or i[:2] == '-L': parameter_list[idx] = i[:2] + os.path.normpath(os.path.join(build_dir, i[2:])) @@ -228,7 +227,7 @@ stdo = p.stdo return stdo - def _split_fetch_real_dirs(self, pathstr: str) -> T.List[str]: + def _split_fetch_real_dirs(self, pathstr: str) -> typing.List[str]: # We need to use the path separator used by the compiler for printing # lists of paths ("gcc --print-search-dirs"). By default # we assume it uses the platform native separator. @@ -265,7 +264,7 @@ pass return result - def get_compiler_dirs(self, env: 'Environment', name: str) -> T.List[str]: + def get_compiler_dirs(self, env: 'Environment', name: str) -> typing.List[str]: ''' Get dirs from the compiler, either `libraries:` or `programs:` ''' @@ -275,10 +274,10 @@ return self._split_fetch_real_dirs(line.split('=', 1)[1]) return [] - def get_lto_compile_args(self) -> T.List[str]: + def get_lto_compile_args(self) -> typing.List[str]: return ['-flto'] - def sanitizer_compile_args(self, value: str) -> T.List[str]: + def sanitizer_compile_args(self, value: str) -> typing.List[str]: if value == 'none': return [] args = ['-fsanitize=' + value] @@ -286,26 +285,22 @@ args.append('-fno-omit-frame-pointer') return args - def get_output_args(self, target: str) -> T.List[str]: + def get_output_args(self, target: str) -> typing.List[str]: return ['-o', target] def get_dependency_gen_args(self, outtarget, outfile): return ['-MD', '-MQ', outtarget, '-MF', outfile] - def get_compile_only_args(self) -> T.List[str]: + def get_compile_only_args(self) -> typing.List[str]: return ['-c'] - def get_include_args(self, path: str, is_system: bool) -> T.List[str]: + def get_include_args(self, path: str, is_system: bool) -> typing.List[str]: if not path: path = '.' if is_system: return ['-isystem' + path] return ['-I' + path] - @classmethod - def use_linker_args(cls, linker: str) -> T.List[str]: - return ['-fuse-ld={}'.format(linker)] - class GnuCompiler(GnuLikeCompiler): """ @@ -313,18 +308,18 @@ Compilers imitating GCC (Clang/Intel) should use the GnuLikeCompiler ABC. """ - def __init__(self, defines: T.Dict[str, str]): - super().__init__() + def __init__(self, compiler_type: 'CompilerType', defines: typing.Dict[str, str]): + super().__init__(compiler_type) self.id = 'gcc' self.defines = defines or {} self.base_options.append('b_colorout') - def get_colorout_args(self, colortype: str) -> T.List[str]: + def get_colorout_args(self, colortype: str) -> typing.List[str]: if mesonlib.version_compare(self.version, '>=4.9.0'): return gnu_color_args[colortype][:] return [] - def get_warn_args(self, level: str) -> T.List[str]: + def get_warn_args(self, level: str) -> typing.List[str]: args = super().get_warn_args(level) if mesonlib.version_compare(self.version, '<4.8.0') and '-Wpedantic' in args: # -Wpedantic was added in 4.8.0 @@ -335,28 +330,16 @@ def has_builtin_define(self, define: str) -> bool: return define in self.defines - def get_builtin_define(self, define: str) -> T.Optional[str]: + def get_builtin_define(self, define: str) -> typing.Optional[str]: if define in self.defines: return self.defines[define] return None - def get_optimization_args(self, optimization_level: str) -> T.List[str]: + def get_optimization_args(self, optimization_level: str) -> typing.List[str]: return gnu_optimization_args[optimization_level] def get_pch_suffix(self) -> str: return 'gch' - def openmp_flags(self) -> T.List[str]: + def openmp_flags(self) -> typing.List[str]: return ['-fopenmp'] - - def has_arguments(self, args, env, code, mode): - # For some compiler command line arguments, the GNU compilers will - # emit a warning on stderr indicating that an option is valid for a - # another language, but still complete with exit_success - with self._build_wrapper(code, env, args, None, mode, disable_cache=False, want_output=True) as p: - result = p.returncode == 0 - if self.language in {'cpp', 'objcpp'} and 'is valid for C/ObjC' in p.stde: - result = False - if self.language in {'c', 'objc'} and 'is valid for C++/ObjC++' in p.stde: - result = False - return result, p.cached diff -Nru meson-0.53.2/mesonbuild/compilers/mixins/intel.py meson-0.52.1/mesonbuild/compilers/mixins/intel.py --- meson-0.53.2/mesonbuild/compilers/mixins/intel.py 2020-01-23 12:51:19.000000000 +0000 +++ meson-0.52.1/mesonbuild/compilers/mixins/intel.py 2019-11-28 17:37:44.000000000 +0000 @@ -14,63 +14,38 @@ """Abstractions for the Intel Compiler families. -Intel provides both a posix/gcc-like compiler (ICC) for MacOS and Linux, -with Meson mixin IntelGnuLikeCompiler. -For Windows, the Intel msvc-like compiler (ICL) Meson mixin -is IntelVisualStudioLikeCompiler. +Intel provides both a posix/gcc-like compiler (ICC) and an msvc-like compiler +(ICL). """ import os -import typing as T +import typing from ... import mesonlib +from ..compilers import CompilerType from .gnu import GnuLikeCompiler from .visualstudio import VisualStudioLikeCompiler -if T.TYPE_CHECKING: +if typing.TYPE_CHECKING: import subprocess # noqa: F401 # XXX: avoid circular dependencies # TODO: this belongs in a posix compiler class -# NOTE: the default Intel optimization is -O2, unlike GNU which defaults to -O0. -# this can be surprising, particularly for debug builds, so we specify the -# default as -O0. -# https://software.intel.com/en-us/cpp-compiler-developer-guide-and-reference-o -# https://software.intel.com/en-us/cpp-compiler-developer-guide-and-reference-g -# https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-o -# https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-g -# https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-traceback -# https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html +clike_optimization_args = { + '0': [], + 'g': [], + '1': ['-O1'], + '2': ['-O2'], + '3': ['-O3'], + 's': ['-Os'], +} # type: typing.Dict[str, typing.List[str]] +# Tested on linux for ICC 14.0.3, 15.0.6, 16.0.4, 17.0.1, 19.0.0 class IntelGnuLikeCompiler(GnuLikeCompiler): - """ - Tested on linux for ICC 14.0.3, 15.0.6, 16.0.4, 17.0.1, 19.0 - debugoptimized: -g -O2 - release: -O3 - minsize: -O2 - """ - - BUILD_ARGS = { - 'plain': [], - 'debug': ["-g", "-traceback"], - 'debugoptimized': ["-g", "-traceback"], - 'release': [], - 'minsize': [], - 'custom': [], - } # type: T.Dict[str, T.List[str]] - - OPTIM_ARGS = { - '0': ['-O0'], - 'g': ['-O0'], - '1': ['-O1'], - '2': ['-O2'], - '3': ['-O3'], - 's': ['-Os'], - } - def __init__(self): - super().__init__() + def __init__(self, compiler_type: 'CompilerType'): + super().__init__(compiler_type) # As of 19.0.0 ICC doesn't have sanitizer, color, or lto support. # # It does have IPO, which serves much the same purpose as LOT, but @@ -81,23 +56,26 @@ self.id = 'intel' self.lang_header = 'none' + def get_optimization_args(self, optimization_level: str) -> typing.List[str]: + return clike_optimization_args[optimization_level] + def get_pch_suffix(self) -> str: return 'pchi' - def get_pch_use_args(self, pch_dir: str, header: str) -> T.List[str]: + def get_pch_use_args(self, pch_dir: str, header: str) -> typing.List[str]: return ['-pch', '-pch_dir', os.path.join(pch_dir), '-x', self.lang_header, '-include', header, '-x', 'none'] def get_pch_name(self, header_name: str) -> str: return os.path.basename(header_name) + '.' + self.get_pch_suffix() - def openmp_flags(self) -> T.List[str]: + def openmp_flags(self) -> typing.List[str]: if mesonlib.version_compare(self.version, '>=15.0.0'): return ['-qopenmp'] else: return ['-openmp'] - def compiles(self, *args, **kwargs) -> T.Tuple[bool, bool]: + def compiles(self, *args, **kwargs) -> typing.Tuple[bool, bool]: # This covers a case that .get('foo', []) doesn't, that extra_args is # defined and is None extra_args = kwargs.get('extra_args') or [] @@ -113,46 +91,23 @@ ] return super().compiles(*args, **kwargs) - def get_profile_generate_args(self) -> T.List[str]: + def get_profile_generate_args(self) -> typing.List[str]: return ['-prof-gen=threadsafe'] - def get_profile_use_args(self) -> T.List[str]: + def get_profile_use_args(self) -> typing.List[str]: return ['-prof-use'] - def get_buildtype_args(self, buildtype: str) -> T.List[str]: - return self.BUILD_ARGS[buildtype] - - def get_optimization_args(self, optimization_level: str) -> T.List[str]: - return self.OPTIM_ARGS[optimization_level] - class IntelVisualStudioLikeCompiler(VisualStudioLikeCompiler): """Abstractions for ICL, the Intel compiler on Windows.""" - BUILD_ARGS = { - 'plain': [], - 'debug': ["/Zi", "/traceback"], - 'debugoptimized': ["/Zi", "/traceback"], - 'release': [], - 'minsize': [], - 'custom': [], - } # type: T.Dict[str, T.List[str]] - - OPTIM_ARGS = { - '0': ['/O0'], - 'g': ['/O0'], - '1': ['/O1'], - '2': ['/O2'], - '3': ['/O3'], - 's': ['/Os'], - } - def __init__(self, target: str): super().__init__(target) + self.compiler_type = CompilerType.ICC_WIN self.id = 'intel-cl' - def compile(self, code, *, extra_args: T.Optional[T.List[str]] = None, **kwargs) -> T.Iterator['subprocess.Popen']: + def compile(self, code, *, extra_args: typing.Optional[typing.List[str]] = None, **kwargs) -> typing.Iterator['subprocess.Popen']: # This covers a case that .get('foo', []) doesn't, that extra_args is if kwargs.get('mode', 'compile') != 'link': extra_args = extra_args.copy() if extra_args is not None else [] @@ -166,7 +121,7 @@ ]) return super().compile(code, extra_args, **kwargs) - def get_toolset_version(self) -> T.Optional[str]: + def get_toolset_version(self) -> typing.Optional[str]: # Avoid circular dependencies.... from ...environment import search_version @@ -178,11 +133,5 @@ version = int(v1 + v2) return self._calculate_toolset_version(version) - def openmp_flags(self) -> T.List[str]: + def openmp_flags(self) -> typing.List[str]: return ['/Qopenmp'] - - def get_buildtype_args(self, buildtype: str) -> T.List[str]: - return self.BUILD_ARGS[buildtype] - - def get_optimization_args(self, optimization_level: str) -> T.List[str]: - return self.OPTIM_ARGS[optimization_level] diff -Nru meson-0.53.2/mesonbuild/compilers/mixins/islinker.py meson-0.52.1/mesonbuild/compilers/mixins/islinker.py --- meson-0.53.2/mesonbuild/compilers/mixins/islinker.py 2020-01-23 12:51:19.000000000 +0000 +++ meson-0.52.1/mesonbuild/compilers/mixins/islinker.py 2019-10-14 21:38:13.000000000 +0000 @@ -21,11 +21,11 @@ """ import os -import typing as T +import typing from ... import mesonlib -if T.TYPE_CHECKING: +if typing.TYPE_CHECKING: from ...coredata import OptionDictType from ...environment import Environment @@ -34,7 +34,7 @@ """Mixin reading LDFLAGS from the environment.""" - def get_linker_args_from_envvars(self) -> T.List[str]: + def get_linker_args_from_envvars(self) -> typing.List[str]: flags = os.environ.get('LDFLAGS') if not flags: return [] @@ -50,83 +50,83 @@ functionality itself. """ - def sanitizer_link_args(self, value: str) -> T.List[str]: + def sanitizer_link_args(self, value: str) -> typing.List[str]: return [] - def get_lto_link_args(self) -> T.List[str]: + def get_lto_link_args(self) -> typing.List[str]: return [] def can_linker_accept_rsp(self) -> bool: return mesonlib.is_windows() - def get_linker_exelist(self) -> T.List[str]: + def get_linker_exelist(self) -> typing.List[str]: return self.exelist.copy() - def get_linker_output_args(self, output: str) -> T.List[str]: + def get_linker_output_args(self, output: str) -> typing.List[str]: return [] - def get_linker_always_args(self) -> T.List[str]: + def get_linker_always_args(self) -> typing.List[str]: return [] def get_linker_lib_prefix(self) -> str: return '' - def get_option_link_args(self, options: 'OptionDictType') -> T.List[str]: + def get_option_link_args(self, options: 'OptionDictType') -> typing.List[str]: return [] - def has_multi_link_args(self, args: T.List[str], env: 'Environment') -> T.Tuple[bool, bool]: + def has_multi_link_args(self, args: typing.List[str], env: 'Environment') -> typing.Tuple[bool, bool]: return False, False - def get_link_debugfile_args(self, targetfile: str) -> T.List[str]: + def get_link_debugfile_args(self, targetfile: str) -> typing.List[str]: return [] - def get_std_shared_lib_link_args(self) -> T.List[str]: + def get_std_shared_lib_link_args(self) -> typing.List[str]: return [] - def get_std_shared_module_args(self, options: 'OptionDictType') -> T.List[str]: + def get_std_shared_module_args(self, options: 'OptionDictType') -> typing.List[str]: return self.get_std_shared_lib_link_args() - def get_link_whole_for(self, args: T.List[str]) -> T.List[str]: + def get_link_whole_for(self, args: typing.List[str]) -> typing.List[str]: raise mesonlib.EnvironmentException( 'Linker {} does not support link_whole'.format(self.id)) - def get_allow_undefined_link_args(self) -> T.List[str]: + def get_allow_undefined_link_args(self) -> typing.List[str]: raise mesonlib.EnvironmentException( 'Linker {} does not support allow undefined'.format(self.id)) - def get_pie_link_args(self) -> T.List[str]: + def get_pie_link_args(self) -> typing.List[str]: m = 'Linker {} does not support position-independent executable' raise mesonlib.EnvironmentException(m.format(self.id)) - def get_undefined_link_args(self) -> T.List[str]: + def get_undefined_link_args(self) -> typing.List[str]: return [] - def get_coverage_link_args(self) -> T.List[str]: + def get_coverage_link_args(self) -> typing.List[str]: m = "Linker {} doesn't implement coverage data generation.".format(self.id) raise mesonlib.EnvironmentException(m) - def no_undefined_link_args(self) -> T.List[str]: + def no_undefined_link_args(self) -> typing.List[str]: return [] - def bitcode_args(self) -> T.List[str]: + def bitcode_args(self) -> typing.List[str]: raise mesonlib.MesonException("This linker doesn't support bitcode bundles") def get_soname_args(self, for_machine: 'mesonlib.MachineChoice', prefix: str, shlib_name: str, suffix: str, soversion: str, - darwin_versions: T.Tuple[str, str], - is_shared_module: bool) -> T.List[str]: + darwin_versions: typing.Tuple[str, str], + is_shared_module: bool) -> typing.List[str]: raise mesonlib.MesonException("This linker doesn't support soname args") def build_rpath_args(self, env: 'Environment', build_dir: str, from_dir: str, rpath_paths: str, build_rpath: str, - install_rpath: str) -> T.List[str]: + install_rpath: str) -> typing.List[str]: return [] - def get_linker_debug_crt_args(self) -> T.List[str]: + def get_linker_debug_crt_args(self) -> typing.List[str]: return [] - def get_asneeded_args(self) -> T.List[str]: + def get_asneeded_args(self) -> typing.List[str]: return [] - def get_buildtype_linker_args(self, buildtype: str) -> T.List[str]: + def get_buildtype_linker_args(self, buildtype: str) -> typing.List[str]: return [] diff -Nru meson-0.53.2/mesonbuild/compilers/mixins/pgi.py meson-0.52.1/mesonbuild/compilers/mixins/pgi.py --- meson-0.53.2/mesonbuild/compilers/mixins/pgi.py 2020-01-23 12:51:19.000000000 +0000 +++ meson-0.52.1/mesonbuild/compilers/mixins/pgi.py 2019-11-28 17:37:44.000000000 +0000 @@ -14,12 +14,15 @@ """Abstractions for the PGI family of compilers.""" -import typing as T +import typing import os from pathlib import Path from ..compilers import clike_debug_args, clike_optimization_args +if typing.TYPE_CHECKING: + from ..compilers import CompilerType + pgi_buildtype_args = { 'plain': [], 'debug': [], @@ -27,13 +30,14 @@ 'release': [], 'minsize': [], 'custom': [], -} # type: T.Dict[str, T.List[str]] +} # type: typing.Dict[str, typing.List[str]] class PGICompiler: - def __init__(self): + def __init__(self, compiler_type: 'CompilerType'): self.base_options = ['b_pch'] self.id = 'pgi' + self.compiler_type = compiler_type default_warn_args = ['-Minform=inform'] self.warn_args = {'0': [], @@ -41,50 +45,50 @@ '2': default_warn_args, '3': default_warn_args} - def get_module_incdir_args(self) -> T.Tuple[str]: + def get_module_incdir_args(self) -> typing.Tuple[str]: return ('-module', ) - def get_no_warn_args(self) -> T.List[str]: + def get_no_warn_args(self) -> typing.List[str]: return ['-silent'] - def gen_import_library_args(self, implibname: str) -> T.List[str]: + def gen_import_library_args(self, implibname: str) -> typing.List[str]: return [] - def get_pic_args(self) -> T.List[str]: + def get_pic_args(self) -> typing.List[str]: # PGI -fPIC is Linux only. - if self.info.is_linux(): + if self.compiler_type.is_standard_compiler: return ['-fPIC'] return [] - def openmp_flags(self) -> T.List[str]: + def openmp_flags(self) -> typing.List[str]: return ['-mp'] - def get_buildtype_args(self, buildtype: str) -> T.List[str]: + def get_buildtype_args(self, buildtype: str) -> typing.List[str]: return pgi_buildtype_args[buildtype] - def get_optimization_args(self, optimization_level: str) -> T.List[str]: + def get_optimization_args(self, optimization_level: str) -> typing.List[str]: return clike_optimization_args[optimization_level] - def get_debug_args(self, is_debug: bool) -> T.List[str]: + def get_debug_args(self, is_debug: bool) -> typing.List[str]: return clike_debug_args[is_debug] - def compute_parameters_with_absolute_paths(self, parameter_list: T.List[str], build_dir: str) -> T.List[str]: + def compute_parameters_with_absolute_paths(self, parameter_list: typing.List[str], build_dir: str) -> typing.List[str]: for idx, i in enumerate(parameter_list): if i[:2] == '-I' or i[:2] == '-L': parameter_list[idx] = i[:2] + os.path.normpath(os.path.join(build_dir, i[2:])) return parameter_list - def get_dependency_gen_args(self, outtarget: str, outfile: str) -> T.List[str]: + def get_dependency_gen_args(self, outtarget: str, outfile: str) -> typing.List[str]: return [] - def get_always_args(self) -> T.List[str]: + def get_always_args(self) -> typing.List[str]: return [] def get_pch_suffix(self) -> str: # PGI defaults to .pch suffix for PCH on Linux and Windows with --pch option return 'pch' - def get_pch_use_args(self, pch_dir: str, header: str) -> T.List[str]: + def get_pch_use_args(self, pch_dir: str, header: str) -> typing.List[str]: # PGI supports PCH for C++ only. hdr = Path(pch_dir).resolve().parent / header if self.language == 'cpp': diff -Nru meson-0.53.2/mesonbuild/compilers/mixins/visualstudio.py meson-0.52.1/mesonbuild/compilers/mixins/visualstudio.py --- meson-0.53.2/mesonbuild/compilers/mixins/visualstudio.py 2020-01-23 12:51:19.000000000 +0000 +++ meson-0.52.1/mesonbuild/compilers/mixins/visualstudio.py 2019-11-28 17:37:44.000000000 +0000 @@ -18,12 +18,12 @@ import abc import os -import typing as T +import typing from ... import mesonlib from ... import mlog -if T.TYPE_CHECKING: +if typing.TYPE_CHECKING: from ...environment import Environment vs32_instruction_set_args = { @@ -36,7 +36,7 @@ 'avx': ['/arch:AVX'], 'avx2': ['/arch:AVX2'], 'neon': None, -} # T.Dicst[str, T.Optional[T.List[str]]] +} # typing.Dicst[str, typing.Optional[typing.List[str]]] # The 64 bit compiler defaults to /arch:avx. vs64_instruction_set_args = { @@ -50,7 +50,7 @@ 'avx': ['/arch:AVX'], 'avx2': ['/arch:AVX2'], 'neon': None, -} # T.Dicst[str, T.Optional[T.List[str]]] +} # typing.Dicst[str, typing.Optional[typing.List[str]]] msvc_buildtype_args = { 'plain': [], @@ -59,7 +59,7 @@ 'release': ["/Ob2", "/Gw"], 'minsize': ["/Zi", "/Gw"], 'custom': [], -} # type: T.Dict[str, T.List[str]] +} # type: typing.Dict[str, typing.List[str]] msvc_optimization_args = { '0': [], @@ -68,12 +68,12 @@ '2': ['/O2'], '3': ['/O2'], 's': ['/O1'], # Implies /Os. -} # type: T.Dict[str, T.List[str]] +} # type: typing.Dict[str, typing.List[str]] msvc_debug_args = { False: [], True: [] # Fixme! -} # type: T.Dict[bool, T.List[str]] +} # type: typing.Dict[bool, typing.List[str]] class VisualStudioLikeCompiler(metaclass=abc.ABCMeta): @@ -83,7 +83,7 @@ A number of compilers attempt to mimic MSVC, with varying levels of success, such as Clang-CL and ICL (the Intel C/C++ Compiler for Windows). - This class implements as much common logic as possible. + This classs implements as much common logic as possible. """ std_warn_args = ['/W3'] @@ -99,7 +99,7 @@ 'mdd': ['/MDd'], 'mt': ['/MT'], 'mtd': ['/MTd'], - } # type: T.Dict[str, T.List[str]] + } # type: typing.Dict[str, typing.List[str]] # /showIncludes is needed for build dependency tracking in Ninja # See: https://ninja-build.org/manual.html#_deps @@ -109,9 +109,7 @@ '1': ['/W2'], '2': ['/W3'], '3': ['/W4'], - } # type: T.Dict[str, T.List[str]] - - INVOKES_LINKER = False + } # type: typing.Dict[str, typing.List[str]] def __init__(self, target: str): self.base_options = ['b_pch', 'b_ndebug', 'b_vscrt'] # FIXME add lto, pgo and the like @@ -127,10 +125,10 @@ self.linker.machine = self.machine # Override CCompiler.get_always_args - def get_always_args(self) -> T.List[str]: + def get_always_args(self) -> typing.List[str]: return self.always_args - def get_buildtype_args(self, buildtype: str) -> T.List[str]: + def get_buildtype_args(self, buildtype: str) -> typing.List[str]: args = msvc_buildtype_args[buildtype] if self.id == 'msvc' and mesonlib.version_compare(self.version, '<18.0'): args = [arg for arg in args if arg != '/Gw'] @@ -145,40 +143,40 @@ pchname = '.'.join(chopped) return pchname - def get_pch_use_args(self, pch_dir: str, header: str) -> T.List[str]: + def get_pch_use_args(self, pch_dir: str, header: str) -> typing.List[str]: base = os.path.basename(header) if self.id == 'clang-cl': base = header pchname = self.get_pch_name(header) return ['/FI' + base, '/Yu' + base, '/Fp' + os.path.join(pch_dir, pchname)] - def get_preprocess_only_args(self) -> T.List[str]: + def get_preprocess_only_args(self) -> typing.List[str]: return ['/EP'] - def get_compile_only_args(self) -> T.List[str]: + def get_compile_only_args(self) -> typing.List[str]: return ['/c'] - def get_no_optimization_args(self) -> T.List[str]: + def get_no_optimization_args(self) -> typing.List[str]: return ['/Od'] - def get_output_args(self, target: str) -> T.List[str]: + def get_output_args(self, target: str) -> typing.List[str]: if target.endswith('.exe'): return ['/Fe' + target] return ['/Fo' + target] - def get_optimization_args(self, optimization_level: str) -> T.List[str]: + def get_optimization_args(self, optimization_level: str) -> typing.List[str]: return msvc_optimization_args[optimization_level] - def get_debug_args(self, is_debug: bool) -> T.List[str]: + def get_debug_args(self, is_debug: bool) -> typing.List[str]: return msvc_debug_args[is_debug] - def get_dependency_gen_args(self, outtarget: str, outfile: str) -> T.List[str]: + def get_dependency_gen_args(self, outtarget: str, outfile: str) -> typing.List[str]: return [] - def linker_to_compiler_args(self, args: T.List[str]) -> T.List[str]: + def linker_to_compiler_args(self, args: typing.List[str]) -> typing.List[str]: return ['/link'] + args - def get_gui_app_args(self, value: bool) -> T.List[str]: + def get_gui_app_args(self, value: bool) -> typing.List[str]: # the default is for the linker to guess the subsystem based on presence # of main or WinMain symbols, so always be explicit if value: @@ -186,42 +184,40 @@ else: return ['/SUBSYSTEM:CONSOLE'] - def get_pic_args(self) -> T.List[str]: + def get_pic_args(self) -> typing.List[str]: return [] # PIC is handled by the loader on Windows - def gen_vs_module_defs_args(self, defsfile: str) -> T.List[str]: + def gen_vs_module_defs_args(self, defsfile: str) -> typing.List[str]: if not isinstance(defsfile, str): raise RuntimeError('Module definitions file should be str') # With MSVC, DLLs only export symbols that are explicitly exported, # so if a module defs file is specified, we use that to export symbols return ['/DEF:' + defsfile] - def gen_pch_args(self, header: str, source: str, pchname: str) -> T.Tuple[str, T.List[str]]: + def gen_pch_args(self, header: str, source: str, pchname: str) -> typing.Tuple[str, typing.List[str]]: objname = os.path.splitext(pchname)[0] + '.obj' return objname, ['/Yc' + header, '/Fp' + pchname, '/Fo' + objname] - def gen_import_library_args(self, implibname: str) -> T.List[str]: + def gen_import_library_args(self, implibname: str) -> typing.List[str]: "The name of the outputted import library" return ['/IMPLIB:' + implibname] - def openmp_flags(self) -> T.List[str]: + def openmp_flags(self) -> typing.List[str]: return ['/openmp'] # FIXME, no idea what these should be. - def thread_flags(self, env: 'Environment') -> T.List[str]: + def thread_flags(self, env: 'Environment') -> typing.List[str]: return [] @classmethod - def unix_args_to_native(cls, args: T.List[str]) -> T.List[str]: + def unix_args_to_native(cls, args: typing.List[str]) -> typing.List[str]: result = [] for i in args: # -mms-bitfields is specific to MinGW-GCC # -pthread is only valid for GCC if i in ('-mms-bitfields', '-pthread'): continue - if i.startswith('-LIBPATH:'): - i = '/LIBPATH:' + i[9:] - elif i.startswith('-L'): + if i.startswith('-L'): i = '/LIBPATH:' + i[2:] # Translate GNU-style -lfoo library name to the import library elif i.startswith('-l'): @@ -251,10 +247,10 @@ return result @classmethod - def native_args_to_unix(cls, args: T.List[str]) -> T.List[str]: + def native_args_to_unix(cls, args: typing.List[str]) -> typing.List[str]: result = [] for arg in args: - if arg.startswith(('/LIBPATH:', '-LIBPATH:')): + if arg.startswith('/LIBPATH:'): result.append('-L' + arg[9:]) elif arg.endswith(('.a', '.lib')) and not os.path.isabs(arg): result.append('-l' + arg) @@ -262,16 +258,16 @@ result.append(arg) return result - def get_werror_args(self) -> T.List[str]: + def get_werror_args(self) -> typing.List[str]: return ['/WX'] - def get_include_args(self, path: str, is_system: bool) -> T.List[str]: + def get_include_args(self, path: str, is_system: bool) -> typing.List[str]: if path == '': path = '.' # msvc does not have a concept of system header dirs. return ['-I' + path] - def compute_parameters_with_absolute_paths(self, parameter_list: T.List[str], build_dir: str) -> T.List[str]: + def compute_parameters_with_absolute_paths(self, parameter_list: typing.List[str], build_dir: str) -> typing.List[str]: for idx, i in enumerate(parameter_list): if i[:2] == '-I' or i[:2] == '/I': parameter_list[idx] = i[:2] + os.path.normpath(os.path.join(build_dir, i[2:])) @@ -283,7 +279,7 @@ # Visual Studio is special. It ignores some arguments it does not # understand and you can't tell it to error out on those. # http://stackoverflow.com/questions/15259720/how-can-i-make-the-microsoft-c-compiler-treat-unknown-flags-as-errors-rather-t - def has_arguments(self, args: T.List[str], env: 'Environment', code, mode: str) -> T.Tuple[bool, bool]: + def has_arguments(self, args: typing.List[str], env: 'Environment', code, mode: str) -> typing.Tuple[bool, bool]: warning_text = '4044' if mode == 'link' else '9002' if self.id == 'clang-cl' and mode != 'link': args = args + ['-Werror=unknown-argument'] @@ -292,7 +288,7 @@ return False, p.cached return not(warning_text in p.stde or warning_text in p.stdo), p.cached - def get_compile_debugfile_args(self, rel_obj: str, pch: bool = False) -> T.List[str]: + def get_compile_debugfile_args(self, rel_obj: str, pch: bool = False) -> typing.List[str]: pdbarr = rel_obj.split('.')[:-1] pdbarr += ['pdb'] args = ['/Fd' + '.'.join(pdbarr)] @@ -306,7 +302,7 @@ args = ['/FS'] + args return args - def get_instruction_set_args(self, instruction_set: str) -> T.Optional[T.List[str]]: + def get_instruction_set_args(self, instruction_set: str) -> typing.Optional[typing.List[str]]: if self.is_64: return vs64_instruction_set_args.get(instruction_set, None) if self.id == 'msvc' and self.version.split('.')[0] == '16' and instruction_set == 'avx': @@ -316,7 +312,7 @@ return None return vs32_instruction_set_args.get(instruction_set, None) - def _calculate_toolset_version(self, version: int) -> T.Optional[str]: + def _calculate_toolset_version(self, version: int) -> typing.Optional[str]: if version < 1310: return '7.0' elif version < 1400: @@ -340,7 +336,7 @@ mlog.warning('Could not find toolset for version {!r}'.format(self.version)) return None - def get_toolset_version(self) -> T.Optional[str]: + def get_toolset_version(self) -> typing.Optional[str]: if self.id == 'clang-cl': # I have no idea return '14.1' @@ -352,12 +348,12 @@ return None return self._calculate_toolset_version(version) - def get_default_include_dirs(self) -> T.List[str]: + def get_default_include_dirs(self) -> typing.List[str]: if 'INCLUDE' not in os.environ: return [] return os.environ['INCLUDE'].split(os.pathsep) - def get_crt_compile_args(self, crt_val: str, buildtype: str) -> T.List[str]: + def get_crt_compile_args(self, crt_val: str, buildtype: str) -> typing.List[str]: if crt_val in self.crt_args: return self.crt_args[crt_val] assert(crt_val == 'from_buildtype') @@ -376,14 +372,10 @@ assert(buildtype == 'custom') raise mesonlib.EnvironmentException('Requested C runtime based on buildtype, but buildtype is "custom".') - def has_func_attribute(self, name: str, env: 'Environment') -> T.Tuple[bool, bool]: + def has_func_attribute(self, name: str, env: 'Environment') -> typing.Tuple[bool, bool]: # MSVC doesn't have __attribute__ like Clang and GCC do, so just return # false without compiling anything return name in ['dllimport', 'dllexport'], False def get_argument_syntax(self) -> str: return 'msvc' - - @classmethod - def use_linker_args(cls, linker: str) -> T.List[str]: - return [] diff -Nru meson-0.53.2/mesonbuild/compilers/objcpp.py meson-0.52.1/mesonbuild/compilers/objcpp.py --- meson-0.53.2/mesonbuild/compilers/objcpp.py 2020-01-23 12:51:19.000000000 +0000 +++ meson-0.52.1/mesonbuild/compilers/objcpp.py 2019-11-28 17:37:44.000000000 +0000 @@ -13,7 +13,7 @@ # limitations under the License. import os.path, subprocess -import typing as T +import typing from ..mesonlib import EnvironmentException, MachineChoice @@ -22,21 +22,13 @@ from .mixins.gnu import GnuCompiler from .mixins.clang import ClangCompiler -if T.TYPE_CHECKING: - from ..envconfig import MachineInfo - class ObjCPPCompiler(CLikeCompiler, Compiler): - - language = 'objcpp' - - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross: bool, info: 'MachineInfo', - exe_wrap: T.Optional[str], **kwargs): - Compiler.__init__(self, exelist, version, for_machine, info, **kwargs) + def __init__(self, exelist, version, for_machine: MachineChoice, is_cross: bool, exe_wrap: typing.Optional[str], **kwargs): + self.language = 'objcpp' + Compiler.__init__(self, exelist, version, for_machine, **kwargs) CLikeCompiler.__init__(self, is_cross, exe_wrap) - @staticmethod - def get_display_language(): + def get_display_language(self): return 'Objective-C++' def sanity_check(self, work_dir, environment): @@ -51,7 +43,7 @@ with open(source_name, 'w') as ofile: ofile.write('#import\n' 'class MyClass;' - 'int main(void) { return 0; }\n') + 'int main() { return 0; }\n') pc = subprocess.Popen(self.exelist + extra_flags + [source_name, '-o', binary_name]) pc.wait() if pc.returncode != 0: @@ -66,11 +58,9 @@ class GnuObjCPPCompiler(GnuCompiler, ObjCPPCompiler): - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross, info: 'MachineInfo', exe_wrapper=None, - defines=None, **kwargs): - ObjCPPCompiler.__init__(self, exelist, version, for_machine, is_cross, info, exe_wrapper, **kwargs) - GnuCompiler.__init__(self, defines) + def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, defines=None, **kwargs): + ObjCPPCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwargs) + GnuCompiler.__init__(self, compiler_type, defines) default_warn_args = ['-Wall', '-Winvalid-pch', '-Wnon-virtual-dtor'] self.warn_args = {'0': [], '1': default_warn_args, @@ -79,11 +69,9 @@ class ClangObjCPPCompiler(ClangCompiler, ObjCPPCompiler): - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross, info: 'MachineInfo', exe_wrapper=None, - **kwargs): - ObjCPPCompiler.__init__(self, exelist, version, for_machine, is_cross, info, exe_wrapper, **kwargs) - ClangCompiler.__init__(self) + def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwargs): + ObjCPPCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwargs) + ClangCompiler.__init__(self, compiler_type) default_warn_args = ['-Wall', '-Winvalid-pch', '-Wnon-virtual-dtor'] self.warn_args = {'0': [], '1': default_warn_args, diff -Nru meson-0.53.2/mesonbuild/compilers/objc.py meson-0.52.1/mesonbuild/compilers/objc.py --- meson-0.53.2/mesonbuild/compilers/objc.py 2020-01-23 12:51:19.000000000 +0000 +++ meson-0.52.1/mesonbuild/compilers/objc.py 2019-11-28 17:37:44.000000000 +0000 @@ -13,7 +13,7 @@ # limitations under the License. import os.path, subprocess -import typing as T +import typing from ..mesonlib import EnvironmentException, MachineChoice @@ -22,22 +22,13 @@ from .mixins.gnu import GnuCompiler from .mixins.clang import ClangCompiler -if T.TYPE_CHECKING: - from ..envconfig import MachineInfo - - class ObjCCompiler(CLikeCompiler, Compiler): - - language = 'objc' - - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross: bool, info: 'MachineInfo', - exe_wrap: T.Optional[str], **kwargs): - Compiler.__init__(self, exelist, version, for_machine, info, **kwargs) + def __init__(self, exelist, version, for_machine: MachineChoice, is_cross: bool, exe_wrap: typing.Optional[str], **kwargs): + self.language = 'objc' + Compiler.__init__(self, exelist, version, for_machine, **kwargs) CLikeCompiler.__init__(self, is_cross, exe_wrap) - @staticmethod - def get_display_language(): + def get_display_language(self): return 'Objective-C' def sanity_check(self, work_dir, environment): @@ -51,7 +42,7 @@ extra_flags += environment.coredata.get_external_link_args(self.for_machine, self.language) with open(source_name, 'w') as ofile: ofile.write('#import\n' - 'int main(void) { return 0; }\n') + 'int main() { return 0; }\n') pc = subprocess.Popen(self.exelist + extra_flags + [source_name, '-o', binary_name]) pc.wait() if pc.returncode != 0: @@ -66,12 +57,9 @@ class GnuObjCCompiler(GnuCompiler, ObjCCompiler): - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross, info: 'MachineInfo', exe_wrapper=None, - defines=None, **kwargs): - ObjCCompiler.__init__(self, exelist, version, for_machine, is_cross, - info, exe_wrapper, **kwargs) - GnuCompiler.__init__(self, defines) + def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, defines=None, **kwargs): + ObjCCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwargs) + GnuCompiler.__init__(self, compiler_type, defines) default_warn_args = ['-Wall', '-Winvalid-pch'] self.warn_args = {'0': [], '1': default_warn_args, @@ -80,12 +68,9 @@ class ClangObjCCompiler(ClangCompiler, ObjCCompiler): - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross, info: 'MachineInfo', exe_wrapper=None, - **kwargs): - ObjCCompiler.__init__(self, exelist, version, for_machine, is_cross, - info, exe_wrapper, **kwargs) - ClangCompiler.__init__(self) + def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwargs): + ObjCCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwargs) + ClangCompiler.__init__(self, compiler_type) default_warn_args = ['-Wall', '-Winvalid-pch'] self.warn_args = {'0': [], '1': default_warn_args, diff -Nru meson-0.53.2/mesonbuild/compilers/rust.py meson-0.52.1/mesonbuild/compilers/rust.py --- meson-0.53.2/mesonbuild/compilers/rust.py 2020-01-23 12:51:19.000000000 +0000 +++ meson-0.52.1/mesonbuild/compilers/rust.py 2019-11-28 17:37:44.000000000 +0000 @@ -13,13 +13,12 @@ # limitations under the License. import subprocess, os.path -import typing as T +import typing from ..mesonlib import EnvironmentException, MachineChoice, Popen_safe from .compilers import Compiler, rust_buildtype_args, clike_debug_args -if T.TYPE_CHECKING: - from ..envconfig import MachineInfo +if typing.TYPE_CHECKING: from ..environment import Environment # noqa: F401 rust_optimization_args = {'0': [], @@ -31,13 +30,9 @@ } class RustCompiler(Compiler): - - # rustc doesn't invoke the compiler itself, it doesn't need a LINKER_PREFIX - language = 'rust' - - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross, info: 'MachineInfo', exe_wrapper=None, **kwargs): - super().__init__(exelist, version, for_machine, info, **kwargs) + def __init__(self, exelist, version, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwargs): + self.language = 'rust' + super().__init__(exelist, version, for_machine, **kwargs) self.exe_wrapper = exe_wrapper self.id = 'rustc' self.is_cross = is_cross @@ -109,7 +104,3 @@ def get_std_exe_link_args(self): return [] - - # Rust does not have a use_linker_args because it dispatches to a gcc-like - # C compiler for dynamic linking, as such we invoke the C compiler's - # use_linker_args method instead. diff -Nru meson-0.53.2/mesonbuild/compilers/swift.py meson-0.52.1/mesonbuild/compilers/swift.py --- meson-0.53.2/mesonbuild/compilers/swift.py 2020-01-23 12:51:19.000000000 +0000 +++ meson-0.52.1/mesonbuild/compilers/swift.py 2019-11-28 17:37:44.000000000 +0000 @@ -13,15 +13,11 @@ # limitations under the License. import subprocess, os.path -import typing as T from ..mesonlib import EnvironmentException, MachineChoice from .compilers import Compiler, swift_buildtype_args, clike_debug_args -if T.TYPE_CHECKING: - from ..envconfig import MachineInfo - swift_optimization_args = {'0': [], 'g': [], '1': ['-O'], @@ -33,11 +29,10 @@ class SwiftCompiler(Compiler): LINKER_PREFIX = ['-Xlinker'] - language = 'swift' - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross, info: 'MachineInfo', **kwargs): - super().__init__(exelist, version, for_machine, info, **kwargs) + def __init__(self, exelist, version, for_machine: MachineChoice, is_cross, **kwargs): + self.language = 'swift' + super().__init__(exelist, version, for_machine, **kwargs) self.version = version self.id = 'llvm' self.is_cross = is_cross diff -Nru meson-0.53.2/mesonbuild/compilers/vala.py meson-0.52.1/mesonbuild/compilers/vala.py --- meson-0.53.2/mesonbuild/compilers/vala.py 2020-01-23 12:51:19.000000000 +0000 +++ meson-0.52.1/mesonbuild/compilers/vala.py 2019-11-28 17:37:44.000000000 +0000 @@ -13,23 +13,16 @@ # limitations under the License. import os.path -import typing as T from .. import mlog from ..mesonlib import EnvironmentException, MachineChoice, version_compare from .compilers import Compiler -if T.TYPE_CHECKING: - from ..envconfig import MachineInfo - class ValaCompiler(Compiler): - - language = 'vala' - - def __init__(self, exelist, version, for_machine: MachineChoice, - is_cross, info: 'MachineInfo'): - super().__init__(exelist, version, for_machine, info) + def __init__(self, exelist, version, for_machine: MachineChoice, is_cross): + self.language = 'vala' + super().__init__(exelist, version, for_machine) self.version = version self.is_cross = is_cross self.id = 'valac' diff -Nru meson-0.53.2/mesonbuild/coredata.py meson-0.52.1/mesonbuild/coredata.py --- meson-0.53.2/mesonbuild/coredata.py 2020-02-25 18:00:46.000000000 +0000 +++ meson-0.52.1/mesonbuild/coredata.py 2019-11-28 17:37:44.000000000 +0000 @@ -26,26 +26,27 @@ import ast import argparse import configparser +from typing import ( + Any, Dict, Generic, Iterable, List, Optional, Type, TypeVar, Union +) +import typing import enum import shlex -import typing as T -if T.TYPE_CHECKING: +if typing.TYPE_CHECKING: from . import dependencies - from .compilers import Compiler # noqa: F401 - from .environment import Environment - OptionDictType = T.Dict[str, 'UserOption[T.Any]'] + OptionDictType = typing.Dict[str, 'UserOption[Any]'] -version = '0.53.2' +version = '0.52.1' backendlist = ['ninja', 'vs', 'vs2010', 'vs2015', 'vs2017', 'vs2019', 'xcode'] default_yielding = False # Can't bind this near the class method it seems, sadly. -_T = T.TypeVar('_T') +_T = TypeVar('_T') -class UserOption(T.Generic[_T]): +class UserOption(Generic[_T]): def __init__(self, description, choices, yielding): super().__init__() self.choices = choices @@ -62,7 +63,7 @@ # Check that the input is a valid value and return the # "cleaned" or "native" version. For example the Boolean # option could take the string "true" and return True. - def validate_value(self, value: T.Any) -> _T: + def validate_value(self, value: Any) -> _T: raise RuntimeError('Derived option class did not override validate_value.') def set_value(self, newvalue): @@ -123,9 +124,9 @@ try: return int(valuestring) except ValueError: - raise MesonException('Value string "%s" is not convertible to an integer.' % valuestring) + raise MesonException('Value string "%s" is not convertable to an integer.' % valuestring) -class UserUmaskOption(UserIntegerOption, UserOption[T.Union[str, int]]): +class UserUmaskOption(UserIntegerOption, UserOption[Union[str, int]]): def __init__(self, description, value, yielding=None): super().__init__(description, 0, 0o777, value, yielding) self.choices = ['preserve', '0000-0777'] @@ -147,7 +148,7 @@ raise MesonException('Invalid mode: {}'.format(e)) class UserComboOption(UserOption[str]): - def __init__(self, description, choices: T.List[str], value, yielding=None): + def __init__(self, description, choices: List[str], value, yielding=None): super().__init__(description, choices, yielding) if not isinstance(self.choices, list): raise MesonException('Combo choices must be an array.') @@ -162,14 +163,14 @@ raise MesonException('Value "%s" for combo option is not one of the choices. Possible choices are: %s.' % (value, optionsstring)) return value -class UserArrayOption(UserOption[T.List[str]]): +class UserArrayOption(UserOption[List[str]]): def __init__(self, description, value, split_args=False, user_input=False, allow_dups=False, **kwargs): super().__init__(description, kwargs.get('choices', []), yielding=kwargs.get('yielding', None)) self.split_args = split_args self.allow_dups = allow_dups self.value = self.validate_value(value, user_input=user_input) - def validate_value(self, value, user_input: bool = True) -> T.List[str]: + def validate_value(self, value, user_input=True) -> List[str]: # User input is for options defined on the command line (via -D # options). Users can put their input in as a comma separated # string, but for defining options in meson_options.txt the format @@ -179,10 +180,7 @@ if isinstance(value, str): if value.startswith('['): - try: - newvalue = ast.literal_eval(value) - except ValueError: - raise MesonException('malformed option {}'.format(value)) + newvalue = ast.literal_eval(value) elif value == '': newvalue = [] else: @@ -193,7 +191,7 @@ elif isinstance(value, list): newvalue = value else: - raise MesonException('"{}" should be a string array, but it is not'.format(newvalue)) + raise MesonException('"{0}" should be a string array, but it is not'.format(str(newvalue))) if not self.allow_dups and len(set(newvalue)) != len(newvalue): msg = 'Duplicated values in array option is deprecated. ' \ @@ -226,16 +224,16 @@ return self.value == 'auto' -def load_configs(filenames: T.List[str]) -> configparser.ConfigParser: +def load_configs(filenames: List[str]) -> configparser.ConfigParser: """Load configuration files from a named subdirectory.""" config = configparser.ConfigParser() config.read(filenames) return config -if T.TYPE_CHECKING: - CacheKeyType = T.Tuple[T.Tuple[T.Any, ...], ...] - SubCacheKeyType = T.Tuple[T.Any, ...] +if typing.TYPE_CHECKING: + CacheKeyType = typing.Tuple[typing.Tuple[typing.Any, ...], ...] + SubCacheKeyType = typing.Tuple[typing.Any, ...] class DependencyCacheType(enum.Enum): @@ -259,7 +257,7 @@ def __init__(self, type_: DependencyCacheType): self.types = [type_] - self.__cache = {} # type: T.Dict[SubCacheKeyType, dependencies.Dependency] + self.__cache = {} # type: typing.Dict[SubCacheKeyType, dependencies.Dependency] def __getitem__(self, key: 'SubCacheKeyType') -> 'dependencies.Dependency': return self.__cache[key] @@ -270,7 +268,7 @@ def __contains__(self, key: 'SubCacheKeyType') -> bool: return key in self.__cache - def values(self) -> T.Iterable['dependencies.Dependency']: + def values(self) -> typing.Iterable['dependencies.Dependency']: return self.__cache.values() @@ -282,12 +280,12 @@ successfully lookup by providing a simple get/put interface. """ - def __init__(self, builtins_per_machine: PerMachine[T.Dict[str, UserOption[T.Any]]], for_machine: MachineChoice): - self.__cache = OrderedDict() # type: T.MutableMapping[CacheKeyType, DependencySubCache] + def __init__(self, builtins_per_machine: PerMachine[typing.Dict[str, UserOption[typing.Any]]], for_machine: MachineChoice): + self.__cache = OrderedDict() # type: typing.MutableMapping[CacheKeyType, DependencySubCache] self.__builtins_per_machine = builtins_per_machine self.__for_machine = for_machine - def __calculate_subkey(self, type_: DependencyCacheType) -> T.Tuple[T.Any, ...]: + def __calculate_subkey(self, type_: DependencyCacheType) -> typing.Tuple[typing.Any, ...]: if type_ is DependencyCacheType.PKG_CONFIG: return tuple(self.__builtins_per_machine[self.__for_machine]['pkg_config_path'].value) elif type_ is DependencyCacheType.CMAKE: @@ -295,7 +293,7 @@ assert type_ is DependencyCacheType.OTHER, 'Someone forgot to update subkey calculations for a new type' return tuple() - def __iter__(self) -> T.Iterator['CacheKeyType']: + def __iter__(self) -> typing.Iterator['CacheKeyType']: return self.keys() def put(self, key: 'CacheKeyType', dep: 'dependencies.Dependency') -> None: @@ -305,7 +303,7 @@ subkey = self.__calculate_subkey(t) self.__cache[key][subkey] = dep - def get(self, key: 'CacheKeyType') -> T.Optional['dependencies.Dependency']: + def get(self, key: 'CacheKeyType') -> typing.Optional['dependencies.Dependency']: """Get a value from the cache. If there is no cache entry then None will be returned. @@ -323,14 +321,14 @@ pass return None - def values(self) -> T.Iterator['dependencies.Dependency']: + def values(self) -> typing.Iterator['dependencies.Dependency']: for c in self.__cache.values(): yield from c.values() - def keys(self) -> T.Iterator['CacheKeyType']: + def keys(self) -> typing.Iterator['CacheKeyType']: return iter(self.__cache.keys()) - def items(self) -> T.Iterator[T.Tuple['CacheKeyType', T.List['dependencies.Dependency']]]: + def items(self) -> typing.Iterator[typing.Tuple['CacheKeyType', typing.List['dependencies.Dependency']]]: for k, v in self.__cache.items(): vs = [] for t in v.types: @@ -343,7 +341,7 @@ self.__cache.clear() # Can't bind this near the class method it seems, sadly. -_V = T.TypeVar('_V') +_V = TypeVar('_V') # This class contains all data that must persist over multiple # invocations of Meson. It is roughly the same thing as @@ -365,10 +363,10 @@ self.target_guids = {} self.version = version self.init_builtins() - self.backend_options = {} # : T.Dict[str, UserOption] - self.user_options = {} # : T.Dict[str, UserOption] + self.backend_options = {} # : Dict[str, UserOption] + self.user_options = {} # : Dict[str, UserOption] self.compiler_options = PerMachine({}, {}) - self.base_options = {} # : T.Dict[str, UserOption] + self.base_options = {} # : Dict[str, UserOption] self.cross_files = self.__load_config_files(options, scratch_dir, 'cross') self.compilers = PerMachine(OrderedDict(), OrderedDict()) @@ -381,7 +379,7 @@ self.libdir_cross_fixup() @staticmethod - def __load_config_files(options: argparse.Namespace, scratch_dir: str, ftype: str) -> T.List[str]: + def __load_config_files(options: argparse.Namespace, scratch_dir: str, ftype: str) -> List[str]: # Need to try and make the passed filenames absolute because when the # files are parsed later we'll have chdir()d. if ftype == 'cross': @@ -392,9 +390,9 @@ if not filenames: return [] - found_invalid = [] # type: T.List[str] - missing = [] # type: T.List[str] - real = [] # type: T.List[str] + found_invalid = [] # type: typing.List[str] + missing = [] # type: typing.List[str] + real = [] # type: typing.List[str] for i, f in enumerate(filenames): f = os.path.expanduser(os.path.expandvars(f)) if os.path.exists(f): @@ -414,7 +412,7 @@ real.append(copy) # Also replace the command line argument, as the pipe - # probably won't exist on reconfigure + # probably wont exist on reconfigure filenames[i] = copy continue if sys.platform != 'win32': @@ -492,7 +490,7 @@ # Create builtin options with default values self.builtins = {} for key, opt in builtin_options.items(): - self.builtins[key] = opt.init_option(key, default_prefix()) + self.builtins[key] = opt.init_option() self.builtins_per_machine = PerMachine({}, {}) for for_machine in iter(MachineChoice): for key, opt in builtin_options_per_machine.items(): @@ -588,8 +586,8 @@ @staticmethod def get_prefixed_options_per_machine( - options_per_machine # : PerMachine[T.Dict[str, _V]]] - ) -> T.Iterable[T.Dict[str, _V]]: + options_per_machine # : PerMachine[Dict[str, _V]]] + ) -> Iterable[Dict[str, _V]]: for for_machine in iter(MachineChoice): prefix = for_machine.get_prefix() yield { @@ -597,17 +595,17 @@ for k, v in options_per_machine[for_machine].items() } - def _get_all_nonbuiltin_options(self) -> T.Iterable[T.Dict[str, UserOption]]: + def _get_all_nonbuiltin_options(self) -> Iterable[Dict[str, UserOption]]: yield self.backend_options yield self.user_options yield from self.get_prefixed_options_per_machine(self.compiler_options) yield self.base_options - def _get_all_builtin_options(self) -> T.Dict[str, UserOption]: + def _get_all_builtin_options(self) -> Dict[str, UserOption]: yield from self.get_prefixed_options_per_machine(self.builtins_per_machine) yield self.builtins - def get_all_options(self) -> T.Dict[str, UserOption]: + def get_all_options(self) -> Dict[str, UserOption]: yield from self._get_all_nonbuiltin_options() yield from self._get_all_builtin_options() @@ -620,7 +618,8 @@ except MesonException as e: raise type(e)(('Validation failed for option %s: ' % option_name) + str(e)) \ .with_traceback(sys.exc_info()[2]) - raise MesonException('Tried to validate unknown option %s.' % option_name) + else: + raise MesonException('Tried to validate unknown option %s.' % option_name) def get_external_args(self, for_machine: MachineChoice, lang): return self.compiler_options[for_machine][lang + '_args'].value @@ -660,6 +659,7 @@ if not self.is_cross_build(): options = self.strip_build_option_names(options) # Set prefix first because it's needed to sanitize other options + prefix = self.builtins['prefix'].value if 'prefix' in options: prefix = self.sanitize_prefix(options['prefix']) self.builtins['prefix'].set_value(prefix) @@ -741,29 +741,13 @@ self.set_options(options, subproject=subproject) - def add_lang_args(self, lang: str, comp: T.Type['Compiler'], - for_machine: MachineChoice, env: 'Environment') -> None: - """Add global language arguments that are needed before compiler/linker detection.""" - from .compilers import compilers - - optprefix = lang + '_' - for k, o in compilers.get_global_options(lang, comp, env.properties[for_machine]).items(): - if not k.startswith(optprefix): - raise MesonException('Internal error, %s has incorrect prefix.' % k) - # prefixed compiler options affect just this machine - opt_prefix = for_machine.get_prefix() - if opt_prefix + k in env.cmd_line_options: - o.set_value(env.cmd_line_options[opt_prefix + k]) - self.compiler_options[for_machine].setdefault(k, o) - - def process_new_compiler(self, lang: str, comp: T.Type['Compiler'], env: 'Environment') -> None: + def process_new_compiler(self, lang: str, comp, env): from . import compilers self.compilers[comp.for_machine][lang] = comp - enabled_opts = [] optprefix = lang + '_' - for k, o in comp.get_options().items(): + for k, o in comp.get_and_default_options(env.properties[comp.for_machine]).items(): if not k.startswith(optprefix): raise MesonException('Internal error, %s has incorrect prefix.' % k) # prefixed compiler options affect just this machine @@ -792,7 +776,7 @@ def __init__(self): # We don't want ':' as key delimiter, otherwise it would break when # storing subproject options like "subproject:option=value" - super().__init__(delimiters=['='], interpolation=None) + super().__init__(delimiters=['=']) def get_cmd_line_file(build_dir): return os.path.join(build_dir, 'meson-private', 'cmd_line.txt') @@ -819,9 +803,6 @@ # literal_eval to get it into the list of strings. options.native_file = ast.literal_eval(properties.get('native_file', '[]')) -def cmd_line_options_to_string(options): - return {k: str(v) for k, v in options.cmd_line_options.items()} - def write_cmd_line_file(build_dir, options): filename = get_cmd_line_file(build_dir) config = CmdLineFileParser() @@ -832,7 +813,7 @@ if options.native_file: properties['native_file'] = options.native_file - config['options'] = cmd_line_options_to_string(options) + config['options'] = options.cmd_line_options config['properties'] = properties with open(filename, 'w') as f: config.write(f) @@ -841,7 +822,7 @@ filename = get_cmd_line_file(build_dir) config = CmdLineFileParser() config.read(filename) - config['options'].update(cmd_line_options_to_string(options)) + config['options'].update(options.cmd_line_options) with open(filename, 'w') as f: config.write(f) @@ -934,38 +915,38 @@ delattr(args, name) -_U = T.TypeVar('_U', bound=UserOption[_T]) +_U = TypeVar('_U', bound=UserOption[_T]) -class BuiltinOption(T.Generic[_T, _U]): +class BuiltinOption(Generic[_T, _U]): """Class for a builtin option type. Currently doesn't support UserIntegerOption, or a few other cases. """ - def __init__(self, opt_type: T.Type[_U], description: str, default: T.Any, yielding: T.Optional[bool] = None, *, - choices: T.Any = None): + def __init__(self, opt_type: Type[_U], description: str, default: Any, yielding: Optional[bool] = None, *, + choices: Any = None): self.opt_type = opt_type self.description = description self.default = default self.choices = choices self.yielding = yielding - def init_option(self, name: str = 'prefix', prefix: str = '') -> _U: + def init_option(self) -> _U: """Create an instance of opt_type and return it.""" - keywords = {'yielding': self.yielding, 'value': self.prefixed_default(name, prefix)} + keywords = {'yielding': self.yielding, 'value': self.default} if self.choices: keywords['choices'] = self.choices return self.opt_type(self.description, **keywords) - def _argparse_action(self) -> T.Optional[str]: + def _argparse_action(self) -> Optional[str]: if self.default is True: return 'store_false' elif self.default is False: return 'store_true' return None - def _argparse_choices(self) -> T.Any: + def _argparse_choices(self) -> Any: if self.opt_type is UserBooleanOption: return [True, False] elif self.opt_type is UserFeatureOption: @@ -979,7 +960,7 @@ else: return '--' + name.replace('_', '-') - def prefixed_default(self, name: str, prefix: str = '') -> T.Any: + def prefixed_default(self, name: str, prefix: str = '') -> Any: if self.opt_type in [UserComboOption, UserIntegerOption]: return self.default try: @@ -1042,8 +1023,8 @@ ]) builtin_options_per_machine = OrderedDict([ - ('pkg_config_path', BuiltinOption(UserArrayOption, 'T.List of additional paths for pkg-config to search', [])), - ('cmake_prefix_path', BuiltinOption(UserArrayOption, 'T.List of additional prefixes for cmake to search', [])), + ('pkg_config_path', BuiltinOption(UserArrayOption, 'List of additional paths for pkg-config to search', [])), + ('cmake_prefix_path', BuiltinOption(UserArrayOption, 'List of additional prefixes for cmake to search', [])), ]) # Special prefix-dependent defaults for installation directories that reside in diff -Nru meson-0.53.2/mesonbuild/dependencies/base.py meson-0.52.1/mesonbuild/dependencies/base.py --- meson-0.53.2/mesonbuild/dependencies/base.py 2020-02-25 18:00:46.000000000 +0000 +++ meson-0.52.1/mesonbuild/dependencies/base.py 2019-11-28 17:37:44.000000000 +0000 @@ -21,10 +21,10 @@ import json import shlex import shutil -import stat import textwrap import platform -import typing as T +import typing +from typing import Any, Dict, List, Tuple from enum import Enum from pathlib import Path, PurePath @@ -127,7 +127,7 @@ self.sources = [] self.methods = self._process_method_kw(kwargs) self.include_type = self._process_include_type_kw(kwargs) - self.ext_deps = [] # type: T.List[Dependency] + self.ext_deps = [] # type: List[Dependency] def __repr__(self): s = '<{0} {1}: {2}>' @@ -152,7 +152,7 @@ return converted return self.compile_args - def get_link_args(self, raw: bool = False) -> T.List[str]: + def get_link_args(self, raw=False): if raw and self.raw_link_args is not None: return self.raw_link_args return self.link_args @@ -196,7 +196,7 @@ """Create a new dependency that contains part of the parent dependency. The following options can be inherited: - links -- all link_with arguments + links -- all link_with arguemnts includes -- all include_directory and -I/-isystem calls sources -- any source, header, or generated sources compile_args -- any compile args @@ -208,8 +208,8 @@ """ raise RuntimeError('Unreachable code in partial_dependency called') - def _add_sub_dependency(self, dep_type: T.Type['Dependency'], env: Environment, - kwargs: T.Dict[str, T.Any], *, + def _add_sub_dependency(self, dep_type: typing.Type['Dependency'], env: Environment, + kwargs: typing.Dict[str, typing.Any], *, method: DependencyMethods = DependencyMethods.AUTO) -> None: """Add an internal dependency of of the given type. @@ -222,14 +222,14 @@ kwargs['method'] = method self.ext_deps.append(dep_type(env, kwargs)) - def get_variable(self, *, cmake: T.Optional[str] = None, pkgconfig: T.Optional[str] = None, - configtool: T.Optional[str] = None, default_value: T.Optional[str] = None, - pkgconfig_define: T.Optional[T.List[str]] = None) -> T.Union[str, T.List[str]]: + def get_variable(self, *, cmake: typing.Optional[str] = None, pkgconfig: typing.Optional[str] = None, + configtool: typing.Optional[str] = None, default_value: typing.Optional[str] = None, + pkgconfig_define: typing.Optional[typing.List[str]] = None) -> typing.Union[str, typing.List[str]]: if default_value is not None: return default_value raise DependencyException('No default provided for dependency {!r}, which is not pkg-config, cmake, or config-tool based.'.format(self)) - def generate_system_dependency(self, include_type: str) -> T.Type['Dependency']: + def generate_system_dependency(self, include_type: str) -> typing.Type['Dependency']: new_dep = copy.deepcopy(self) new_dep.include_type = self._process_include_type_kw({'include_type': include_type}) return new_dep @@ -274,10 +274,7 @@ class HasNativeKwarg: def __init__(self, kwargs): - self.for_machine = self.get_for_machine_from_kwargs(kwargs) - - def get_for_machine_from_kwargs(self, kwargs): - return MachineChoice.BUILD if kwargs.get('native', False) else MachineChoice.HOST + self.for_machine = MachineChoice.BUILD if kwargs.get('native', False) else MachineChoice.HOST class ExternalDependency(Dependency, HasNativeKwarg): def __init__(self, type_name, environment, language, kwargs): @@ -368,8 +365,8 @@ if not self.is_found: found_msg = ['Dependency', mlog.bold(self.name), 'found:'] found_msg += [mlog.red('NO'), - 'found', mlog.normal_cyan(self.version), 'but need:', - mlog.bold(', '.join(["'{}'".format(e) for e in not_found]))] + 'found {!r} but need:'.format(self.version), + ', '.join(["'{}'".format(e) for e in not_found])] if found: found_msg += ['; matched:', ', '.join(["'{}'".format(e) for e in found])] @@ -400,7 +397,7 @@ tools = None tool_name = None - __strip_version = re.compile(r'^[0-9][0-9.]+') + __strip_version = re.compile(r'^[0-9.]*') def __init__(self, name, environment, language, kwargs): super().__init__('config-tool', environment, language, kwargs) @@ -452,7 +449,7 @@ return cls.__new__(cls) def find_config(self, versions=None): - """Helper method that searches for config tool binaries in PATH and + """Helper method that searchs for config tool binaries in PATH and returns the one that best matches the given version requirements. """ if not isinstance(versions, list) and versions is not None: @@ -553,9 +550,9 @@ def log_tried(self): return self.type_name - def get_variable(self, *, cmake: T.Optional[str] = None, pkgconfig: T.Optional[str] = None, - configtool: T.Optional[str] = None, default_value: T.Optional[str] = None, - pkgconfig_define: T.Optional[T.List[str]] = None) -> T.Union[str, T.List[str]]: + def get_variable(self, *, cmake: typing.Optional[str] = None, pkgconfig: typing.Optional[str] = None, + configtool: typing.Optional[str] = None, default_value: typing.Optional[str] = None, + pkgconfig_define: typing.Optional[typing.List[str]] = None) -> typing.Union[str, typing.List[str]]: if configtool: # In the not required case '' (empty string) will be returned if the # variable is not found. Since '' is a valid value to return we @@ -704,7 +701,7 @@ cache[(self.pkgbin, targs, fenv)] = self._call_pkgbin_real(args, env) return cache[(self.pkgbin, targs, fenv)] - def _convert_mingw_paths(self, args: T.List[str]) -> T.List[str]: + def _convert_mingw_paths(self, args): ''' Both MSVC and native Python on Windows cannot handle MinGW-esque /c/foo paths so convert them to C:/foo. We cannot resolve other paths starting @@ -727,9 +724,6 @@ elif arg.startswith('/'): pargs = PurePath(arg).parts tmpl = '{}:/{}' - elif arg.startswith(('-L', '-I')) or (len(arg) > 2 and arg[1] == ':'): - # clean out improper '\\ ' as comes from some Windows pkg-config files - arg = arg.replace('\\ ', ' ') if len(pargs) > 1 and len(pargs[1]) == 1: arg = tmpl.format(pargs[1], '/'.join(pargs[2:])) converted.append(arg) @@ -788,22 +782,6 @@ # Resolve the path as a compiler in the build directory would path = os.path.join(self.env.get_build_dir(), path) prefix_libpaths.add(path) - # Library paths are not always ordered in a meaningful way - # - # Instead of relying on pkg-config or pkgconf to provide -L flags in a - # specific order, we reorder library paths ourselves, according to th - # order specified in PKG_CONFIG_PATH. See: - # https://github.com/mesonbuild/meson/issues/4271 - # - # Only prefix_libpaths are reordered here because there should not be - # too many system_libpaths to cause library version issues. - pkg_config_path = os.environ.get('PKG_CONFIG_PATH') - if pkg_config_path: - pkg_config_path = pkg_config_path.split(os.pathsep) - else: - pkg_config_path = [] - pkg_config_path = self._convert_mingw_paths(pkg_config_path) - prefix_libpaths = sort_libpaths(prefix_libpaths, pkg_config_path) system_libpaths = OrderedSet() full_args = self._convert_mingw_paths(self._split_args(out)) for arg in full_args: @@ -1006,9 +984,9 @@ def log_tried(self): return self.type_name - def get_variable(self, *, cmake: T.Optional[str] = None, pkgconfig: T.Optional[str] = None, - configtool: T.Optional[str] = None, default_value: T.Optional[str] = None, - pkgconfig_define: T.Optional[T.List[str]] = None) -> T.Union[str, T.List[str]]: + def get_variable(self, *, cmake: typing.Optional[str] = None, pkgconfig: typing.Optional[str] = None, + configtool: typing.Optional[str] = None, default_value: typing.Optional[str] = None, + pkgconfig_define: typing.Optional[typing.List[str]] = None) -> typing.Union[str, typing.List[str]]: if pkgconfig: kwargs = {} if default_value is not None: @@ -1039,10 +1017,10 @@ def _main_cmake_file(self) -> str: return 'CMakeLists.txt' - def _extra_cmake_opts(self) -> T.List[str]: + def _extra_cmake_opts(self) -> List[str]: return [] - def _map_module_list(self, modules: T.List[T.Tuple[str, bool]]) -> T.List[T.Tuple[str, bool]]: + def _map_module_list(self, modules: List[Tuple[str, bool]]) -> List[Tuple[str, bool]]: # Map the input module list to something else # This function will only be executed AFTER the initial CMake # interpreter pass has completed. Thus variables defined in the @@ -1054,28 +1032,7 @@ # one module return module - def __init__(self, name: str, environment: Environment, kwargs, language: str = None): - # Gather a list of all languages to support - self.language_list = [] # type: T.List[str] - if language is None: - compilers = None - if kwargs.get('native', False): - compilers = environment.coredata.compilers.build - else: - compilers = environment.coredata.compilers.host - - candidates = ['c', 'cpp', 'fortran', 'objc', 'objcxx'] - self.language_list += [x for x in candidates if x in compilers] - else: - self.language_list += [language] - - # Add additional languages if required - if 'fortran' in self.language_list: - self.language_list += ['c'] - - # Ensure that the list is unique - self.language_list = list(set(self.language_list)) - + def __init__(self, name: str, environment: Environment, kwargs, language=None): super().__init__('cmake', environment, language, kwargs) self.name = name self.is_libtool = False @@ -1088,7 +1045,7 @@ # Where all CMake "build dirs" are located self.cmake_root_dir = environment.scratch_dir - # T.List of successfully found modules + # List of successfully found modules self.found_modules = [] self.cmakebin = CMakeExecutor(environment, CMakeDependency.class_cmake_version, self.for_machine, silent=self.silent) @@ -1125,7 +1082,6 @@ cm_args.append('-DCMAKE_PREFIX_PATH={}'.format(';'.join(pref_path))) if not self._preliminary_find_check(name, cm_path, pref_path, environment.machines[self.for_machine]): - mlog.debug('Preliminary CMake check failed. Aborting.') return self._detect_dep(name, modules, cm_args) @@ -1209,7 +1165,7 @@ @staticmethod @functools.lru_cache(maxsize=None) - def _cached_listdir(path: str) -> T.Tuple[T.Tuple[str, str]]: + def _cached_listdir(path: str) -> Tuple[Tuple[str, str]]: try: return tuple((x, str(x).lower()) for x in os.listdir(path)) except OSError: @@ -1223,7 +1179,7 @@ except OSError: return False - def _preliminary_find_check(self, name: str, module_path: T.List[str], prefix_path: T.List[str], machine: MachineInfo) -> bool: + def _preliminary_find_check(self, name: str, module_path: List[str], prefix_path: List[str], machine: MachineInfo) -> bool: lname = str(name).lower() # Checks , /cmake, /CMake @@ -1232,12 +1188,9 @@ if not self._cached_isdir(i): continue - # Check the directory case insensitve - content = self._cached_listdir(i) - candidates = ['Find{}.cmake', '{}Config.cmake', '{}-config.cmake'] - candidates = [x.format(name).lower() for x in candidates] - if any([x[1] in candidates for x in content]): - return True + for j in ['Find{}.cmake', '{}Config.cmake', '{}-config.cmake']: + if os.path.isfile(os.path.join(i, j.format(name))): + return True return False # Search in /(lib/|lib*|share) for cmake files @@ -1304,7 +1257,7 @@ return False - def _detect_dep(self, name: str, modules: T.List[T.Tuple[str, bool]], args: T.List[str]): + def _detect_dep(self, name: str, modules: List[Tuple[str, bool]], args: List[str]): # Detect a dependency with CMake using the '--find-package' mode # and the trace output (stderr) # @@ -1419,7 +1372,7 @@ for i, required in modules: if i not in self.traceparser.targets: if not required: - mlog.warning('CMake: T.Optional module', mlog.bold(self._original_module_name(i)), 'for', mlog.bold(name), 'was not found') + mlog.warning('CMake: Optional module', mlog.bold(self._original_module_name(i)), 'for', mlog.bold(name), 'was not found') continue raise self._gen_exception('CMake: invalid module {} for {}.\n' 'Try to explicitly specify one or more targets with the "modules" property.\n' @@ -1502,30 +1455,9 @@ build_dir = Path(self.cmake_root_dir) / 'cmake_{}'.format(self.name) build_dir.mkdir(parents=True, exist_ok=True) - # Insert language parameters into the CMakeLists.txt and write new CMakeLists.txt + # Copy the CMakeLists.txt src_cmake = Path(__file__).parent / 'data' / cmake_file - cmake_txt = src_cmake.read_text() - - # In general, some Fortran CMake find_package() also require C language enabled, - # even if nothing from C is directly used. An easy Fortran example that fails - # without C language is - # find_package(Threads) - # To make this general to - # any other language that might need this, we use a list for all - # languages and expand in the cmake Project(... LANGUAGES ...) statement. - from ..cmake import language_map - cmake_language = [language_map[x] for x in self.language_list if x in language_map] - if not cmake_language: - cmake_language += ['NONE'] - - cmake_txt = """ -cmake_minimum_required(VERSION ${{CMAKE_VERSION}}) -project(MesonTemp LANGUAGES {}) -""".format(' '.join(cmake_language)) + cmake_txt - - cm_file = build_dir / 'CMakeLists.txt' - cm_file.write_text(cmake_txt) - mlog.cmd_ci_include(cm_file.absolute().as_posix()) + shutil.copyfile(str(src_cmake), str(build_dir / 'CMakeLists.txt')) # str() is for Python 3.5 return str(build_dir) @@ -1547,9 +1479,9 @@ return 'modules: ' + ', '.join(modules) return '' - def get_variable(self, *, cmake: T.Optional[str] = None, pkgconfig: T.Optional[str] = None, - configtool: T.Optional[str] = None, default_value: T.Optional[str] = None, - pkgconfig_define: T.Optional[T.List[str]] = None) -> T.Union[str, T.List[str]]: + def get_variable(self, *, cmake: typing.Optional[str] = None, pkgconfig: typing.Optional[str] = None, + configtool: typing.Optional[str] = None, default_value: typing.Optional[str] = None, + pkgconfig_define: typing.Optional[typing.List[str]] = None) -> typing.Union[str, typing.List[str]]: if cmake: try: v = self.traceparser.vars[cmake] @@ -1764,20 +1696,13 @@ # An 'ExternalProgram' always runs on the build machine for_machine = MachineChoice.BUILD - def __init__(self, name: str, command: T.Optional[T.List[str]] = None, - silent: bool = False, search_dir: T.Optional[str] = None, - extra_search_dirs: T.Optional[T.List[str]] = None): + def __init__(self, name: str, command: typing.Optional[typing.List[str]] = None, + silent: bool = False, search_dir: typing.Optional[str] = None): self.name = name if command is not None: self.command = listify(command) else: - all_search_dirs = [search_dir] - if extra_search_dirs: - all_search_dirs += extra_search_dirs - for d in all_search_dirs: - self.command = self._search(name, d) - if self.found(): - break + self.command = self._search(name, search_dir) # Set path to be the last item that is actually a file (in order to # skip options in something like ['python', '-u', 'file.py']. If we @@ -1790,9 +1715,7 @@ break if not silent: - # ignore the warning because derived classes never call this __init__ - # method, and thus only the found() method of this class is ever executed - if self.found(): # lgtm [py/init-calls-subclass] + if self.found(): mlog.log('Program', mlog.bold(name), 'found:', mlog.green('YES'), '(%s)' % ' '.join(self.command)) else: @@ -1814,22 +1737,6 @@ return cls.from_entry(name, command) @staticmethod - @functools.lru_cache(maxsize=None) - def _windows_sanitize_path(path: str) -> str: - # Ensure that we use USERPROFILE even when inside MSYS, MSYS2, Cygwin, etc. - if 'USERPROFILE' not in os.environ: - return path - # Ignore executables in the WindowsApps directory which are - # zero-sized wrappers that magically open the Windows Store to - # install the application. - appstore_dir = Path(os.environ['USERPROFILE']) / 'AppData' / 'Local' / 'Microsoft' / 'WindowsApps' - paths = [] - for each in path.split(os.pathsep): - if Path(each) != appstore_dir: - paths.append(each) - return os.pathsep.join(paths) - - @staticmethod def from_entry(name, command): if isinstance(command, list): if len(command) == 1: @@ -1886,16 +1793,16 @@ return commands + [script] except Exception as e: mlog.debug(e) + pass mlog.debug('Unusable script {!r}'.format(script)) return False def _is_executable(self, path): suffix = os.path.splitext(path)[-1].lower()[1:] - execmask = stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH if mesonlib.is_windows(): if suffix in self.windows_exts: return True - elif os.stat(path).st_mode & execmask: + elif os.access(path, os.X_OK): return not os.path.isdir(path) return False @@ -1954,7 +1861,7 @@ # On Windows, interpreted scripts must have an extension otherwise they # cannot be found by a standard PATH search. So we do a custom search # where we manually search for a script with a shebang in PATH. - search_dirs = self._windows_sanitize_path(os.environ.get('PATH', '')).split(';') + search_dirs = os.environ.get('PATH', '').split(';') for search_dir in search_dirs: commands = self._search_dir(name, search_dir) if commands: @@ -1970,10 +1877,7 @@ if commands: return commands # Do a standard search in PATH - path = os.environ.get('PATH', None) - if mesonlib.is_windows() and path: - path = self._windows_sanitize_path(path) - command = shutil.which(name, path=path) + command = shutil.which(name) if mesonlib.is_windows(): return self._search_windows_special_cases(name, command) # On UNIX-like platforms, shutil.which() is enough to find @@ -1993,7 +1897,7 @@ return self.name -class NonExistingExternalProgram(ExternalProgram): # lgtm [py/missing-call-to-init] +class NonExistingExternalProgram(ExternalProgram): "A program that will never exist" def __init__(self, name='nonexistingprogram'): @@ -2009,7 +1913,7 @@ return False -class EmptyExternalProgram(ExternalProgram): # lgtm [py/missing-call-to-init] +class EmptyExternalProgram(ExternalProgram): ''' A program object that returns an empty list of commands. Used for cases such as a cross file exe_wrapper to represent that it's not required. @@ -2171,7 +2075,7 @@ return 'framework' -def get_dep_identifier(name, kwargs) -> T.Tuple: +def get_dep_identifier(name, kwargs) -> Tuple: identifier = (name, ) for key, value in kwargs.items(): # 'version' is irrelevant for caching; the caller must check version matches @@ -2189,7 +2093,6 @@ display_name_map = { 'boost': 'Boost', - 'cuda': 'CUDA', 'dub': 'DUB', 'gmock': 'GMock', 'gtest': 'GTest', @@ -2250,13 +2153,15 @@ info = [] if d.version: - info.append(mlog.normal_cyan(d.version)) + info.append(d.version) log_info = d.log_info() if log_info: info.append('(' + log_info + ')') - mlog.log(type_text, mlog.bold(display_name), details + 'found:', mlog.green('YES'), *info) + info = ' '.join(info) + + mlog.log(type_text, mlog.bold(display_name), details + 'found:', mlog.green('YES'), info) return d @@ -2285,7 +2190,7 @@ return NotFoundDependency(env) -def _build_external_dependency_list(name, env: Environment, kwargs: T.Dict[str, T.Any]) -> list: +def _build_external_dependency_list(name, env: Environment, kwargs: Dict[str, Any]) -> list: # First check if the method is valid if 'method' in kwargs and kwargs['method'] not in [e.value for e in DependencyMethods]: raise DependencyException('method {!r} is invalid'.format(kwargs['method'])) @@ -2330,42 +2235,16 @@ # Otherwise, just use the pkgconfig and cmake dependency detector if 'auto' == kwargs.get('method', 'auto'): candidates.append(functools.partial(PkgConfigDependency, name, env, kwargs)) + candidates.append(functools.partial(CMakeDependency, name, env, kwargs)) # On OSX, also try framework dependency detector if mesonlib.is_osx(): candidates.append(functools.partial(ExtraFrameworkDependency, name, False, None, env, None, kwargs)) - # Only use CMake as a last resort, since it might not work 100% (see #6113) - candidates.append(functools.partial(CMakeDependency, name, env, kwargs)) - return candidates -def sort_libpaths(libpaths: T.List[str], refpaths: T.List[str]) -> T.List[str]: - """Sort according to - - It is intended to be used to sort -L flags returned by pkg-config. - Pkg-config returns flags in random order which cannot be relied on. - """ - if len(refpaths) == 0: - return list(libpaths) - - def key_func(libpath): - common_lengths = [] - for refpath in refpaths: - try: - common_path = os.path.commonpath([libpath, refpath]) - except ValueError: - common_path = '' - common_lengths.append(len(common_path)) - max_length = max(common_lengths) - max_index = common_lengths.index(max_length) - reversed_max_length = len(refpaths[max_index]) - max_length - return (max_index, reversed_max_length) - return sorted(libpaths, key=key_func) - - def strip_system_libdirs(environment, for_machine: MachineChoice, link_args): """Remove -L arguments. diff -Nru meson-0.53.2/mesonbuild/dependencies/coarrays.py meson-0.52.1/mesonbuild/dependencies/coarrays.py --- meson-0.53.2/mesonbuild/dependencies/coarrays.py 2019-12-29 22:47:27.000000000 +0000 +++ meson-0.52.1/mesonbuild/dependencies/coarrays.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,83 +0,0 @@ -# Copyright 2013-2019 The Meson development team - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from ..mesonlib import listify -from .base import CMakeDependency, DependencyMethods, ExternalDependency, PkgConfigDependency - - -class CoarrayDependency(ExternalDependency): - """ - Coarrays are a Fortran 2008 feature. - - Coarrays are sometimes implemented via external library (GCC+OpenCoarrays), - while other compilers just build in support (Cray, IBM, Intel, NAG). - Coarrays may be thought of as a high-level language abstraction of - low-level MPI calls. - """ - def __init__(self, environment, kwargs: dict): - super().__init__('coarray', environment, 'fortran', kwargs) - kwargs['required'] = False - kwargs['silent'] = True - self.is_found = False - methods = listify(self.methods) - - cid = self.get_compiler().get_id() - if cid == 'gcc': - """ OpenCoarrays is the most commonly used method for Fortran Coarray with GCC """ - - if set([DependencyMethods.AUTO, DependencyMethods.PKGCONFIG]).intersection(methods): - for pkg in ['caf-openmpi', 'caf']: - pkgdep = PkgConfigDependency(pkg, environment, kwargs, language=self.language) - if pkgdep.found(): - self.compile_args = pkgdep.get_compile_args() - self.link_args = pkgdep.get_link_args() - self.version = pkgdep.get_version() - self.is_found = True - self.pcdep = pkgdep - return - - if set([DependencyMethods.AUTO, DependencyMethods.CMAKE]).intersection(methods): - if not kwargs.get('modules'): - kwargs['modules'] = 'OpenCoarrays::caf_mpi' - cmakedep = CMakeDependency('OpenCoarrays', environment, kwargs, language=self.language) - if cmakedep.found(): - self.compile_args = cmakedep.get_compile_args() - self.link_args = cmakedep.get_link_args() - self.version = cmakedep.get_version() - self.is_found = True - return - - if DependencyMethods.AUTO in methods: - # fallback to single image - self.compile_args = ['-fcoarray=single'] - self.version = 'single image (fallback)' - self.is_found = True - return - - elif cid == 'intel': - """ Coarrays are built into Intel compilers, no external library needed """ - self.is_found = True - self.link_args = ['-coarray=shared'] - self.compile_args = self.link_args - elif cid == 'intel-cl': - """ Coarrays are built into Intel compilers, no external library needed """ - self.is_found = True - self.compile_args = ['/Qcoarray:shared'] - elif cid == 'nagfor': - """ NAG doesn't require any special arguments for Coarray """ - self.is_found = True - - @staticmethod - def get_methods(): - return [DependencyMethods.AUTO, DependencyMethods.CMAKE, DependencyMethods.PKGCONFIG] diff -Nru meson-0.53.2/mesonbuild/dependencies/cuda.py meson-0.52.1/mesonbuild/dependencies/cuda.py --- meson-0.53.2/mesonbuild/dependencies/cuda.py 2019-12-29 22:47:27.000000000 +0000 +++ meson-0.52.1/mesonbuild/dependencies/cuda.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,252 +0,0 @@ -# Copyright 2013-2019 The Meson development team - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import glob -import re -import os - -from .. import mlog -from .. import mesonlib -from ..environment import detect_cpu_family - -from .base import (DependencyException, ExternalDependency) - - -class CudaDependency(ExternalDependency): - - supported_languages = ['cuda', 'cpp', 'c'] # see also _default_language - - def __init__(self, environment, kwargs): - compilers = environment.coredata.compilers[self.get_for_machine_from_kwargs(kwargs)] - language = self._detect_language(compilers) - if language not in self.supported_languages: - raise DependencyException('Language \'{}\' is not supported by the CUDA Toolkit. Supported languages are {}.'.format(language, self.supported_languages)) - - super().__init__('cuda', environment, language, kwargs) - self.requested_modules = self.get_requested(kwargs) - if 'cudart' not in self.requested_modules: - self.requested_modules = ['cudart'] + self.requested_modules - - (self.cuda_path, self.version, self.is_found) = self._detect_cuda_path_and_version() - if not self.is_found: - return - - if not os.path.isabs(self.cuda_path): - raise DependencyException('CUDA Toolkit path must be absolute, got \'{}\'.'.format(self.cuda_path)) - - # nvcc already knows where to find the CUDA Toolkit, but if we're compiling - # a mixed C/C++/CUDA project, we still need to make the include dir searchable - if self.language != 'cuda' or len(compilers) > 1: - self.incdir = os.path.join(self.cuda_path, 'include') - self.compile_args += ['-I{}'.format(self.incdir)] - - if self.language != 'cuda': - arch_libdir = self._detect_arch_libdir() - self.libdir = os.path.join(self.cuda_path, arch_libdir) - mlog.debug('CUDA library directory is', mlog.bold(self.libdir)) - else: - self.libdir = None - - self.is_found = self._find_requested_libraries() - - @classmethod - def _detect_language(cls, compilers): - for lang in cls.supported_languages: - if lang in compilers: - return lang - return list(compilers.keys())[0] - - def _detect_cuda_path_and_version(self): - self.env_var = self._default_path_env_var() - mlog.debug('Default path env var:', mlog.bold(self.env_var)) - - version_reqs = self.version_reqs - if self.language == 'cuda': - nvcc_version = self._strip_patch_version(self.get_compiler().version) - mlog.debug('nvcc version:', mlog.bold(nvcc_version)) - if version_reqs: - # make sure nvcc version satisfies specified version requirements - (found_some, not_found, found) = mesonlib.version_compare_many(nvcc_version, version_reqs) - if not_found: - msg = 'The current nvcc version {} does not satisfy the specified CUDA Toolkit version requirements {}.'.format(nvcc_version, version_reqs) - return self._report_dependency_error(msg, (None, None, False)) - - # use nvcc version to find a matching CUDA Toolkit - version_reqs = ['={}'.format(nvcc_version)] - else: - nvcc_version = None - - paths = [(path, self._cuda_toolkit_version(path), default) for (path, default) in self._cuda_paths()] - if version_reqs: - return self._find_matching_toolkit(paths, version_reqs, nvcc_version) - - defaults = [(path, version) for (path, version, default) in paths if default] - if defaults: - return (defaults[0][0], defaults[0][1], True) - - platform_msg = 'set the CUDA_PATH environment variable' if self._is_windows() \ - else 'set the CUDA_PATH environment variable/create the \'/usr/local/cuda\' symbolic link' - msg = 'Please specify the desired CUDA Toolkit version (e.g. dependency(\'cuda\', version : \'>=10.1\')) or {} to point to the location of your desired version.'.format(platform_msg) - return self._report_dependency_error(msg, (None, None, False)) - - def _find_matching_toolkit(self, paths, version_reqs, nvcc_version): - # keep the default paths order intact, sort the rest in the descending order - # according to the toolkit version - defaults, rest = mesonlib.partition(lambda t: not t[2], paths) - defaults = list(defaults) - paths = defaults + sorted(rest, key=lambda t: mesonlib.Version(t[1]), reverse=True) - mlog.debug('Search paths: {}'.format(paths)) - - if nvcc_version and defaults: - default_src = "the {} environment variable".format(self.env_var) if self.env_var else "the \'/usr/local/cuda\' symbolic link" - nvcc_warning = 'The default CUDA Toolkit as designated by {} ({}) doesn\'t match the current nvcc version {} and will be ignored.'.format(default_src, os.path.realpath(defaults[0][0]), nvcc_version) - else: - nvcc_warning = None - - for (path, version, default) in paths: - (found_some, not_found, found) = mesonlib.version_compare_many(version, version_reqs) - if not not_found: - if not default and nvcc_warning: - mlog.warning(nvcc_warning) - return (path, version, True) - - if nvcc_warning: - mlog.warning(nvcc_warning) - return (None, None, False) - - def _default_path_env_var(self): - env_vars = ['CUDA_PATH'] if self._is_windows() else ['CUDA_PATH', 'CUDA_HOME', 'CUDA_ROOT'] - env_vars = [var for var in env_vars if var in os.environ] - user_defaults = set([os.environ[var] for var in env_vars]) - if len(user_defaults) > 1: - mlog.warning('Environment variables {} point to conflicting toolkit locations ({}). Toolkit selection might produce unexpected results.'.format(', '.join(env_vars), ', '.join(user_defaults))) - return env_vars[0] if env_vars else None - - def _cuda_paths(self): - return ([(os.environ[self.env_var], True)] if self.env_var else []) \ - + (self._cuda_paths_win() if self._is_windows() else self._cuda_paths_nix()) - - def _cuda_paths_win(self): - env_vars = os.environ.keys() - return [(os.environ[var], False) for var in env_vars if var.startswith('CUDA_PATH_')] - - def _cuda_paths_nix(self): - # include /usr/local/cuda default only if no env_var was found - pattern = '/usr/local/cuda-*' if self.env_var else '/usr/local/cuda*' - return [(path, os.path.basename(path) == 'cuda') for path in glob.iglob(pattern)] - - toolkit_version_regex = re.compile(r'^CUDA Version\s+(.*)$') - path_version_win_regex = re.compile(r'^v(.*)$') - path_version_nix_regex = re.compile(r'^cuda-(.*)$') - - def _cuda_toolkit_version(self, path): - version = self._read_toolkit_version_txt(path) - if version: - return version - - mlog.debug('Falling back to extracting version from path') - path_version_regex = self.path_version_win_regex if self._is_windows() else self.path_version_nix_regex - m = path_version_regex.match(os.path.basename(path)) - if m: - return m[1] - - mlog.warning('Could not detect CUDA Toolkit version for {}'.format(path)) - return '0.0' - - def _read_toolkit_version_txt(self, path): - # Read 'version.txt' at the root of the CUDA Toolkit directory to determine the tookit version - version_file_path = os.path.join(path, 'version.txt') - try: - with open(version_file_path) as version_file: - version_str = version_file.readline() # e.g. 'CUDA Version 10.1.168' - m = self.toolkit_version_regex.match(version_str) - if m: - return self._strip_patch_version(m[1]) - except Exception as e: - mlog.debug('Could not read CUDA Toolkit\'s version file {}: {}'.format(version_file_path, str(e))) - - return None - - @classmethod - def _strip_patch_version(cls, version): - return '.'.join(version.split('.')[:2]) - - def _detect_arch_libdir(self): - arch = detect_cpu_family(self.env.coredata.compilers.host) - machine = self.env.machines[self.for_machine] - msg = '{} architecture is not supported in {} version of the CUDA Toolkit.' - if machine.is_windows(): - libdirs = {'x86': 'Win32', 'x86_64': 'x64'} - if arch not in libdirs: - raise DependencyException(msg.format(arch, 'Windows')) - return os.path.join('lib', libdirs[arch]) - elif machine.is_linux(): - libdirs = {'x86_64': 'lib64', 'ppc64': 'lib'} - if arch not in libdirs: - raise DependencyException(msg.format(arch, 'Linux')) - return libdirs[arch] - elif machine.is_osx(): - libdirs = {'x86_64': 'lib64'} - if arch not in libdirs: - raise DependencyException(msg.format(arch, 'macOS')) - return libdirs[arch] - else: - raise DependencyException('CUDA Toolkit: unsupported platform.') - - def _find_requested_libraries(self): - self.lib_modules = {} - all_found = True - - for module in self.requested_modules: - args = self.clib_compiler.find_library(module, self.env, [self.libdir] if self.libdir else []) - if args is None: - self._report_dependency_error('Couldn\'t find requested CUDA module \'{}\''.format(module)) - all_found = False - else: - mlog.debug('Link args for CUDA module \'{}\' are {}'.format(module, args)) - self.lib_modules[module] = args - - return all_found - - def _is_windows(self): - return self.env.machines[self.for_machine].is_windows() - - def _report_dependency_error(self, msg, ret_val=None): - if self.required: - raise DependencyException(msg) - - mlog.debug(msg) - return ret_val - - def log_details(self): - module_str = ', '.join(self.requested_modules) - return 'modules: ' + module_str - - def log_info(self): - return self.cuda_path if self.cuda_path else '' - - def get_requested(self, kwargs): - candidates = mesonlib.extract_as_list(kwargs, 'modules') - for c in candidates: - if not isinstance(c, str): - raise DependencyException('CUDA module argument is not a string.') - return candidates - - def get_link_args(self, **kwargs): - args = [] - if self.libdir: - args += self.clib_compiler.get_linker_search_args(self.libdir) - for lib in self.requested_modules: - args += self.lib_modules[lib] - return args diff -Nru meson-0.53.2/mesonbuild/dependencies/data/CMakeLists.txt meson-0.52.1/mesonbuild/dependencies/data/CMakeLists.txt --- meson-0.53.2/mesonbuild/dependencies/data/CMakeLists.txt 2019-12-29 22:47:27.000000000 +0000 +++ meson-0.52.1/mesonbuild/dependencies/data/CMakeLists.txt 2019-02-28 20:43:18.000000000 +0000 @@ -1,8 +1,4 @@ -# fail noisily if attempt to use this file without setting: -# cmake_minimum_required(VERSION ${CMAKE_VERSION}) -# project(... LANGUAGES ...) - -cmake_policy(SET CMP0000 NEW) +cmake_minimum_required(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} ) set(PACKAGE_FOUND FALSE) set(_packageName "${NAME}") diff -Nru meson-0.53.2/mesonbuild/dependencies/dev.py meson-0.52.1/mesonbuild/dependencies/dev.py --- meson-0.53.2/mesonbuild/dependencies/dev.py 2020-01-23 12:51:19.000000000 +0000 +++ meson-0.52.1/mesonbuild/dependencies/dev.py 2019-11-28 17:37:44.000000000 +0000 @@ -25,15 +25,15 @@ from ..environment import get_llvm_tool_names from .base import ( DependencyException, DependencyMethods, ExternalDependency, PkgConfigDependency, - strip_system_libdirs, ConfigToolDependency, CMakeDependency + strip_system_libdirs, ConfigToolDependency, CMakeDependency, HasNativeKwarg ) from .misc import ThreadDependency -import typing as T +from typing import List, Tuple def get_shared_library_suffix(environment, for_machine: MachineChoice): - """This is only guaranteed to work for languages that compile to machine + """This is only gauranteed to work for languages that compile to machine code, not for languages like C# that use a bytecode and always end in .dll """ m = environment.machines[for_machine] @@ -205,13 +205,17 @@ __cpp_blacklist = {'-DNDEBUG'} def __init__(self, environment, kwargs): + # Already called by `super().__init__`, but need `self.for_machine` + # before `super().__init__` is called. + HasNativeKwarg.__init__(self, kwargs) + self.tools = get_llvm_tool_names('llvm-config') # Fedora starting with Fedora 30 adds a suffix of the number # of bits in the isa that llvm targets, for example, on x86_64 # and aarch64 the name will be llvm-config-64, on x86 and arm # it will be llvm-config-32. - if environment.machines[self.get_for_machine_from_kwargs(kwargs)].is_64_bit: + if environment.machines[self.for_machine].is_64_bit: self.tools.append('llvm-config-64') else: self.tools.append('llvm-config-32') @@ -288,7 +292,7 @@ if not self.static and mode == 'static': # If llvm is configured with LLVM_BUILD_LLVM_DYLIB but not with # LLVM_LINK_LLVM_DYLIB and not LLVM_BUILD_SHARED_LIBS (which - # upstream doesn't recommend using), then llvm-config will lie to + # upstreams doesn't recomend using), then llvm-config will lie to # you about how to do shared-linking. It wants to link to a a bunch # of individual shared libs (which don't exist because llvm wasn't # built with LLVM_BUILD_SHARED_LIBS. @@ -301,7 +305,7 @@ except DependencyException: lib_ext = get_shared_library_suffix(environment, self.for_machine) libdir = self.get_config_value(['--libdir'], 'link_args')[0] - # Sort for reproducibility + # Sort for reproducability matches = sorted(glob.iglob(os.path.join(libdir, 'libLLVM*{}'.format(lib_ext)))) if not matches: if self.required: @@ -407,10 +411,10 @@ # Use a custom CMakeLists.txt for LLVM return 'CMakeListsLLVM.txt' - def _extra_cmake_opts(self) -> T.List[str]: + def _extra_cmake_opts(self) -> List[str]: return ['-DLLVM_MESON_MODULES={}'.format(';'.join(self.llvm_modules + self.llvm_opt_modules))] - def _map_module_list(self, modules: T.List[T.Tuple[str, bool]]) -> T.List[T.Tuple[str, bool]]: + def _map_module_list(self, modules: List[Tuple[str, bool]]) -> List[Tuple[str, bool]]: res = [] for mod, required in modules: cm_targets = self.traceparser.get_cmake_var('MESON_LLVM_TARGETS_{}'.format(mod)) diff -Nru meson-0.53.2/mesonbuild/dependencies/hdf5.py meson-0.52.1/mesonbuild/dependencies/hdf5.py --- meson-0.53.2/mesonbuild/dependencies/hdf5.py 2020-01-23 12:51:19.000000000 +0000 +++ meson-0.52.1/mesonbuild/dependencies/hdf5.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,130 +0,0 @@ -# Copyright 2013-2019 The Meson development team - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# This file contains the detection logic for miscellaneous external dependencies. - -import subprocess -import shutil -from pathlib import Path - -from .. import mlog -from ..mesonlib import split_args, listify -from .base import (DependencyException, DependencyMethods, ExternalDependency, ExternalProgram, - PkgConfigDependency) - -class HDF5Dependency(ExternalDependency): - - def __init__(self, environment, kwargs): - language = kwargs.get('language', 'c') - super().__init__('hdf5', environment, language, kwargs) - kwargs['required'] = False - kwargs['silent'] = True - self.is_found = False - methods = listify(self.methods) - - if language not in ('c', 'cpp', 'fortran'): - raise DependencyException('Language {} is not supported with HDF5.'.format(language)) - - if set([DependencyMethods.AUTO, DependencyMethods.PKGCONFIG]).intersection(methods): - pkgconfig_files = ['hdf5', 'hdf5-serial'] - PCEXE = shutil.which('pkg-config') - if PCEXE: - # some distros put hdf5-1.2.3.pc with version number in .pc filename. - ret = subprocess.run([PCEXE, '--list-all'], stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, - universal_newlines=True) - if ret.returncode == 0: - for pkg in ret.stdout.split('\n'): - if pkg.startswith(('hdf5')): - pkgconfig_files.append(pkg.split(' ', 1)[0]) - pkgconfig_files = list(set(pkgconfig_files)) # dedupe - - for pkg in pkgconfig_files: - pkgdep = PkgConfigDependency(pkg, environment, kwargs, language=self.language) - if not pkgdep.found(): - continue - - self.compile_args = pkgdep.get_compile_args() - # some broken pkgconfig don't actually list the full path to the needed includes - newinc = [] - for arg in self.compile_args: - if arg.startswith('-I'): - stem = 'static' if kwargs.get('static', False) else 'shared' - if (Path(arg[2:]) / stem).is_dir(): - newinc.append('-I' + str(Path(arg[2:]) / stem)) - self.compile_args += newinc - - # derive needed libraries by language - pd_link_args = pkgdep.get_link_args() - link_args = [] - for larg in pd_link_args: - lpath = Path(larg) - # some pkg-config hdf5.pc (e.g. Ubuntu) don't include the commonly-used HL HDF5 libraries, - # so let's add them if they exist - # additionally, some pkgconfig HDF5 HL files are malformed so let's be sure to find HL anyway - if lpath.is_file(): - hl = [] - if language == 'cpp': - hl += ['_hl_cpp', '_cpp'] - elif language == 'fortran': - hl += ['_hl_fortran', 'hl_fortran', '_fortran'] - hl += ['_hl'] # C HL library, always needed - - suffix = '.' + lpath.name.split('.', 1)[1] # in case of .dll.a - for h in hl: - hlfn = lpath.parent / (lpath.name.split('.', 1)[0] + h + suffix) - if hlfn.is_file(): - link_args.append(str(hlfn)) - # HDF5 C libs are required by other HDF5 languages - link_args.append(larg) - else: - link_args.append(larg) - - self.link_args = link_args - self.version = pkgdep.get_version() - self.is_found = True - self.pcdep = pkgdep - return - - if DependencyMethods.AUTO in methods: - wrappers = {'c': 'h5cc', 'cpp': 'h5c++', 'fortran': 'h5fc'} - comp_args = [] - link_args = [] - # have to always do C as well as desired language - for lang in set([language, 'c']): - prog = ExternalProgram(wrappers[lang], silent=True) - if not prog.found(): - return - cmd = prog.get_command() + ['-show'] - p = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True, timeout=15) - if p.returncode != 0: - mlog.debug('Command', mlog.bold(cmd), 'failed to run:') - mlog.debug(mlog.bold('Standard output\n'), p.stdout) - mlog.debug(mlog.bold('Standard error\n'), p.stderr) - return - args = split_args(p.stdout) - for arg in args[1:]: - if arg.startswith(('-I', '-f', '-D')) or arg == '-pthread': - comp_args.append(arg) - elif arg.startswith(('-L', '-l', '-Wl')): - link_args.append(arg) - elif Path(arg).is_file(): - link_args.append(arg) - self.compile_args = comp_args - self.link_args = link_args - self.is_found = True - return - - @staticmethod - def get_methods(): - return [DependencyMethods.AUTO, DependencyMethods.PKGCONFIG] diff -Nru meson-0.53.2/mesonbuild/dependencies/__init__.py meson-0.52.1/mesonbuild/dependencies/__init__.py --- meson-0.53.2/mesonbuild/dependencies/__init__.py 2020-01-23 22:29:05.000000000 +0000 +++ meson-0.52.1/mesonbuild/dependencies/__init__.py 2019-11-28 17:37:44.000000000 +0000 @@ -13,17 +13,12 @@ # limitations under the License. from .boost import BoostDependency -from .cuda import CudaDependency -from .hdf5 import HDF5Dependency from .base import ( # noqa: F401 Dependency, DependencyException, DependencyMethods, ExternalProgram, EmptyExternalProgram, NonExistingExternalProgram, ExternalDependency, NotFoundDependency, ExternalLibrary, ExtraFrameworkDependency, InternalDependency, PkgConfigDependency, CMakeDependency, find_external_dependency, get_dep_identifier, packages, _packages_accept_language) from .dev import GMockDependency, GTestDependency, LLVMDependency, ValgrindDependency -from .coarrays import CoarrayDependency -from .mpi import MPIDependency -from .scalapack import ScalapackDependency -from .misc import (BlocksDependency, NetCDFDependency, OpenMPDependency, Python3Dependency, ThreadDependency, PcapDependency, CupsDependency, LibWmfDependency, LibGCryptDependency, GpgmeDependency, ShadercDependency) +from .misc import (BlocksDependency, CoarrayDependency, HDF5Dependency, MPIDependency, NetCDFDependency, OpenMPDependency, Python3Dependency, ThreadDependency, PcapDependency, CupsDependency, LibWmfDependency, LibGCryptDependency, GpgmeDependency, ShadercDependency) from .platform import AppleFrameworks from .ui import GLDependency, GnuStepDependency, Qt4Dependency, Qt5Dependency, SDL2Dependency, WxDependency, VulkanDependency @@ -35,17 +30,12 @@ 'llvm': LLVMDependency, 'valgrind': ValgrindDependency, + # From misc: + 'blocks': BlocksDependency, 'boost': BoostDependency, - 'cuda': CudaDependency, - - # per-file 'coarray': CoarrayDependency, - 'hdf5': HDF5Dependency, 'mpi': MPIDependency, - 'scalapack': ScalapackDependency, - - # From misc: - 'blocks': BlocksDependency, + 'hdf5': HDF5Dependency, 'netcdf': NetCDFDependency, 'openmp': OpenMPDependency, 'python3': Python3Dependency, diff -Nru meson-0.53.2/mesonbuild/dependencies/misc.py meson-0.52.1/mesonbuild/dependencies/misc.py --- meson-0.53.2/mesonbuild/dependencies/misc.py 2020-01-23 22:29:05.000000000 +0000 +++ meson-0.52.1/mesonbuild/dependencies/misc.py 2019-11-28 17:37:44.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright 2013-2019 The Meson development team +# Copyright 2013-2017 The Meson development team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,21 +16,112 @@ from pathlib import Path import functools +import os import re import sysconfig from .. import mlog from .. import mesonlib +from ..mesonlib import split_args from ..environment import detect_cpu_family -from ..mesonlib import listify from .base import ( DependencyException, DependencyMethods, ExternalDependency, - ExtraFrameworkDependency, PkgConfigDependency, + ExternalProgram, ExtraFrameworkDependency, PkgConfigDependency, CMakeDependency, ConfigToolDependency, ) +class CoarrayDependency(ExternalDependency): + """ + Coarrays are a Fortran 2008 feature. + + Coarrays are sometimes implemented via external library (GCC+OpenCoarrays), + while other compilers just build in support (Cray, IBM, Intel, NAG). + Coarrays may be thought of as a high-level language abstraction of + low-level MPI calls. + """ + def __init__(self, environment, kwargs): + super().__init__('coarray', environment, 'fortran', kwargs) + kwargs['required'] = False + kwargs['silent'] = True + self.is_found = False + + cid = self.get_compiler().get_id() + if cid == 'gcc': + """ OpenCoarrays is the most commonly used method for Fortran Coarray with GCC """ + self.is_found = True + kwargs['modules'] = 'OpenCoarrays::caf_mpi' + cmakedep = CMakeDependency('OpenCoarrays', environment, kwargs) + if not cmakedep.found(): + self.compile_args = ['-fcoarray=single'] + self.version = 'single image' + return + + self.compile_args = cmakedep.get_compile_args() + self.link_args = cmakedep.get_link_args() + self.version = cmakedep.get_version() + elif cid == 'intel': + """ Coarrays are built into Intel compilers, no external library needed """ + self.is_found = True + self.link_args = ['-coarray=shared'] + self.compile_args = self.link_args + elif cid == 'intel-cl': + """ Coarrays are built into Intel compilers, no external library needed """ + self.is_found = True + self.compile_args = ['/Qcoarray:shared'] + elif cid == 'nagfor': + """ NAG doesn't require any special arguments for Coarray """ + self.is_found = True + + +class HDF5Dependency(ExternalDependency): + + def __init__(self, environment, kwargs): + language = kwargs.get('language', 'c') + super().__init__('hdf5', environment, language, kwargs) + kwargs['required'] = False + kwargs['silent'] = True + self.is_found = False + + pkgconfig_files = ['hdf5'] + + if language not in ('c', 'cpp', 'fortran'): + raise DependencyException('Language {} is not supported with HDF5.'.format(language)) + + for pkg in pkgconfig_files: + try: + pkgdep = PkgConfigDependency(pkg, environment, kwargs, language=self.language) + if pkgdep.found(): + self.compile_args = pkgdep.get_compile_args() + # derive needed libraries by language + pd_link_args = pkgdep.get_link_args() + link_args = [] + for larg in pd_link_args: + lpath = Path(larg) + if lpath.is_file(): + if language == 'cpp': + link_args.append(str(lpath.parent / (lpath.stem + '_hl_cpp' + lpath.suffix))) + link_args.append(str(lpath.parent / (lpath.stem + '_cpp' + lpath.suffix))) + elif language == 'fortran': + link_args.append(str(lpath.parent / (lpath.stem + 'hl_fortran' + lpath.suffix))) + link_args.append(str(lpath.parent / (lpath.stem + '_fortran' + lpath.suffix))) + + # HDF5 C libs are required by other HDF5 languages + link_args.append(str(lpath.parent / (lpath.stem + '_hl' + lpath.suffix))) + link_args.append(larg) + else: + link_args.append(larg) + + self.link_args = link_args + self.version = pkgdep.get_version() + self.is_found = True + self.pcdep = pkgdep + break + except Exception: + pass + + class NetCDFDependency(ExternalDependency): def __init__(self, environment, kwargs): @@ -39,43 +130,226 @@ kwargs['required'] = False kwargs['silent'] = True self.is_found = False - methods = listify(self.methods) + + pkgconfig_files = ['netcdf'] if language not in ('c', 'cpp', 'fortran'): raise DependencyException('Language {} is not supported with NetCDF.'.format(language)) - if set([DependencyMethods.AUTO, DependencyMethods.PKGCONFIG]).intersection(methods): - pkgconfig_files = ['netcdf'] + if language == 'fortran': + pkgconfig_files.append('netcdf-fortran') - if language == 'fortran': - pkgconfig_files.append('netcdf-fortran') + self.compile_args = [] + self.link_args = [] + self.pcdep = [] + for pkg in pkgconfig_files: + pkgdep = PkgConfigDependency(pkg, environment, kwargs, language=self.language) + if pkgdep.found(): + self.compile_args.extend(pkgdep.get_compile_args()) + self.link_args.extend(pkgdep.get_link_args()) + self.version = pkgdep.get_version() + self.is_found = True + self.pcdep.append(pkgdep) - self.compile_args = [] - self.link_args = [] - self.pcdep = [] - for pkg in pkgconfig_files: +class MPIDependency(ExternalDependency): + + def __init__(self, environment, kwargs): + language = kwargs.get('language', 'c') + super().__init__('mpi', environment, language, kwargs) + kwargs['required'] = False + kwargs['silent'] = True + self.is_found = False + + # NOTE: Only OpenMPI supplies a pkg-config file at the moment. + if language == 'c': + env_vars = ['MPICC'] + pkgconfig_files = ['ompi-c'] + default_wrappers = ['mpicc'] + elif language == 'cpp': + env_vars = ['MPICXX'] + pkgconfig_files = ['ompi-cxx'] + default_wrappers = ['mpic++', 'mpicxx', 'mpiCC'] + elif language == 'fortran': + env_vars = ['MPIFC', 'MPIF90', 'MPIF77'] + pkgconfig_files = ['ompi-fort'] + default_wrappers = ['mpifort', 'mpif90', 'mpif77'] + else: + raise DependencyException('Language {} is not supported with MPI.'.format(language)) + + for pkg in pkgconfig_files: + try: pkgdep = PkgConfigDependency(pkg, environment, kwargs, language=self.language) if pkgdep.found(): - self.compile_args.extend(pkgdep.get_compile_args()) - self.link_args.extend(pkgdep.get_link_args()) + self.compile_args = pkgdep.get_compile_args() + self.link_args = pkgdep.get_link_args() self.version = pkgdep.get_version() self.is_found = True - self.pcdep.append(pkgdep) - if self.is_found: - return + self.pcdep = pkgdep + break + except Exception: + pass + + if not self.is_found: + # Prefer environment. + for var in env_vars: + if var in os.environ: + wrappers = [os.environ[var]] + break + else: + # Or search for default wrappers. + wrappers = default_wrappers + + for prog in wrappers: + result = self._try_openmpi_wrapper(prog) + if result is not None: + self.is_found = True + self.version = result[0] + self.compile_args = self._filter_compile_args(result[1]) + self.link_args = self._filter_link_args(result[2]) + break + result = self._try_other_wrapper(prog) + if result is not None: + self.is_found = True + self.version = result[0] + self.compile_args = self._filter_compile_args(result[1]) + self.link_args = self._filter_link_args(result[2]) + break - if set([DependencyMethods.AUTO, DependencyMethods.CMAKE]).intersection(methods): - cmakedep = CMakeDependency('NetCDF', environment, kwargs, language=self.language) - if cmakedep.found(): - self.compile_args = cmakedep.get_compile_args() - self.link_args = cmakedep.get_link_args() - self.version = cmakedep.get_version() + if not self.is_found and mesonlib.is_windows(): + # only Intel Fortran compiler is compatible with Microsoft MPI at this time. + if language == 'fortran' and environment.detect_fortran_compiler(self.for_machine).name_string() != 'intel-cl': + return + result = self._try_msmpi() + if result is not None: self.is_found = True + self.version, self.compile_args, self.link_args = result + + def _filter_compile_args(self, args): + """ + MPI wrappers return a bunch of garbage args. + Drop -O2 and everything that is not needed. + """ + result = [] + multi_args = ('-I', ) + if self.language == 'fortran': + fc = self.env.coredata.compilers[self.for_machine]['fortran'] + multi_args += fc.get_module_incdir_args() + + include_next = False + for f in args: + if f.startswith(('-D', '-f') + multi_args) or f == '-pthread' \ + or (f.startswith('-W') and f != '-Wall' and not f.startswith('-Werror')): + result.append(f) + if f in multi_args: + # Path is a separate argument. + include_next = True + elif include_next: + include_next = False + result.append(f) + return result + + def _filter_link_args(self, args): + """ + MPI wrappers return a bunch of garbage args. + Drop -O2 and everything that is not needed. + """ + result = [] + include_next = False + for f in args: + if f.startswith(('-L', '-l', '-Xlinker')) or f == '-pthread' \ + or (f.startswith('-W') and f != '-Wall' and not f.startswith('-Werror')): + result.append(f) + if f in ('-L', '-Xlinker'): + include_next = True + elif include_next: + include_next = False + result.append(f) + return result + + def _try_openmpi_wrapper(self, prog): + prog = ExternalProgram(prog, silent=True) + if prog.found(): + cmd = prog.get_command() + ['--showme:compile'] + p, o, e = mesonlib.Popen_safe(cmd) + p.wait() + if p.returncode != 0: + mlog.debug('Command', mlog.bold(cmd), 'failed to run:') + mlog.debug(mlog.bold('Standard output\n'), o) + mlog.debug(mlog.bold('Standard error\n'), e) + return + cargs = split_args(o) + + cmd = prog.get_command() + ['--showme:link'] + p, o, e = mesonlib.Popen_safe(cmd) + p.wait() + if p.returncode != 0: + mlog.debug('Command', mlog.bold(cmd), 'failed to run:') + mlog.debug(mlog.bold('Standard output\n'), o) + mlog.debug(mlog.bold('Standard error\n'), e) + return + libs = split_args(o) + + cmd = prog.get_command() + ['--showme:version'] + p, o, e = mesonlib.Popen_safe(cmd) + p.wait() + if p.returncode != 0: + mlog.debug('Command', mlog.bold(cmd), 'failed to run:') + mlog.debug(mlog.bold('Standard output\n'), o) + mlog.debug(mlog.bold('Standard error\n'), e) + return + version = re.search(r'\d+.\d+.\d+', o) + if version: + version = version.group(0) + else: + version = None + + return version, cargs, libs + + def _try_other_wrapper(self, prog): + prog = ExternalProgram(prog, silent=True) + if prog.found(): + cmd = prog.get_command() + ['-show'] + p, o, e = mesonlib.Popen_safe(cmd) + p.wait() + if p.returncode != 0: + mlog.debug('Command', mlog.bold(cmd), 'failed to run:') + mlog.debug(mlog.bold('Standard output\n'), o) + mlog.debug(mlog.bold('Standard error\n'), e) return + args = split_args(o) + + version = None + + return version, args, args - @staticmethod - def get_methods(): - return [DependencyMethods.AUTO, DependencyMethods.PKGCONFIG, DependencyMethods.CMAKE] + def _try_msmpi(self): + if self.language == 'cpp': + # MS-MPI does not support the C++ version of MPI, only the standard C API. + return + if 'MSMPI_INC' not in os.environ: + return + incdir = os.environ['MSMPI_INC'] + arch = detect_cpu_family(self.env.coredata.compilers.host) + if arch == 'x86': + if 'MSMPI_LIB32' not in os.environ: + return + libdir = os.environ['MSMPI_LIB32'] + post = 'x86' + elif arch == 'x86_64': + if 'MSMPI_LIB64' not in os.environ: + return + libdir = os.environ['MSMPI_LIB64'] + post = 'x64' + else: + return + if self.language == 'fortran': + return (None, + ['-I' + incdir, '-I' + os.path.join(incdir, post)], + [os.path.join(libdir, 'msmpi.lib'), os.path.join(libdir, 'msmpifec.lib')]) + else: + return (None, + ['-I' + incdir, '-I' + os.path.join(incdir, post)], + [os.path.join(libdir, 'msmpi.lib')]) class OpenMPDependency(ExternalDependency): @@ -127,34 +401,15 @@ def __init__(self, environment, kwargs): super().__init__('threads', environment, None, kwargs) self.name = 'threads' - self.is_found = False - methods = listify(self.methods) - if DependencyMethods.AUTO in methods: - self.is_found = True - # Happens if you are using a language with threads - # concept without C, such as plain Cuda. - if self.clib_compiler is None: - self.compile_args = [] - self.link_args = [] - else: - self.compile_args = self.clib_compiler.thread_flags(environment) - self.link_args = self.clib_compiler.thread_link_flags(environment) - return - - if DependencyMethods.CMAKE in methods: - # for unit tests and for those who simply want - # dependency('threads', method: 'cmake') - cmakedep = CMakeDependency('Threads', environment, kwargs) - if cmakedep.found(): - self.compile_args = cmakedep.get_compile_args() - self.link_args = cmakedep.get_link_args() - self.version = cmakedep.get_version() - self.is_found = True - return - - @staticmethod - def get_methods(): - return [DependencyMethods.AUTO, DependencyMethods.CMAKE] + self.is_found = True + # Happens if you are using a language with threads + # concept without C, such as plain Cuda. + if self.clib_compiler is None: + self.compile_args = [] + self.link_args = [] + else: + self.compile_args = self.clib_compiler.thread_flags(environment) + self.link_args = self.clib_compiler.thread_link_flags(environment) class BlocksDependency(ExternalDependency): diff -Nru meson-0.53.2/mesonbuild/dependencies/mpi.py meson-0.52.1/mesonbuild/dependencies/mpi.py --- meson-0.53.2/mesonbuild/dependencies/mpi.py 2020-01-23 12:51:19.000000000 +0000 +++ meson-0.52.1/mesonbuild/dependencies/mpi.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,279 +0,0 @@ -# Copyright 2013-2019 The Meson development team - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import typing as T -import os -import re -import subprocess - -from .. import mlog -from .. import mesonlib -from ..mesonlib import split_args, listify -from ..environment import detect_cpu_family -from .base import (DependencyException, DependencyMethods, ExternalDependency, ExternalProgram, - PkgConfigDependency) - - -class MPIDependency(ExternalDependency): - - def __init__(self, environment, kwargs: dict): - language = kwargs.get('language', 'c') - super().__init__('mpi', environment, language, kwargs) - kwargs['required'] = False - kwargs['silent'] = True - self.is_found = False - methods = listify(self.methods) - - env_vars = [] - default_wrappers = [] - pkgconfig_files = [] - if language == 'c': - cid = environment.detect_c_compiler(self.for_machine).get_id() - if cid in ('intel', 'intel-cl'): - env_vars.append('I_MPI_CC') - # IntelMPI doesn't have .pc files - default_wrappers.append('mpiicc') - else: - env_vars.append('MPICC') - pkgconfig_files.append('ompi-c') - default_wrappers.append('mpicc') - elif language == 'cpp': - cid = environment.detect_cpp_compiler(self.for_machine).get_id() - if cid in ('intel', 'intel-cl'): - env_vars.append('I_MPI_CXX') - # IntelMPI doesn't have .pc files - default_wrappers.append('mpiicpc') - else: - env_vars.append('MPICXX') - pkgconfig_files.append('ompi-cxx') - default_wrappers += ['mpic++', 'mpicxx', 'mpiCC'] # these are not for intelmpi - elif language == 'fortran': - cid = environment.detect_fortran_compiler(self.for_machine).get_id() - if cid in ('intel', 'intel-cl'): - env_vars.append('I_MPI_F90') - # IntelMPI doesn't have .pc files - default_wrappers.append('mpiifort') - else: - env_vars += ['MPIFC', 'MPIF90', 'MPIF77'] - pkgconfig_files.append('ompi-fort') - default_wrappers += ['mpifort', 'mpif90', 'mpif77'] - else: - raise DependencyException('Language {} is not supported with MPI.'.format(language)) - - if set([DependencyMethods.AUTO, DependencyMethods.PKGCONFIG]).intersection(methods): - for pkg in pkgconfig_files: - pkgdep = PkgConfigDependency(pkg, environment, kwargs, language=self.language) - if pkgdep.found(): - self.compile_args = pkgdep.get_compile_args() - self.link_args = pkgdep.get_link_args() - self.version = pkgdep.get_version() - self.is_found = True - self.pcdep = pkgdep - return - - if DependencyMethods.AUTO in methods: - for var in env_vars: - if var in os.environ: - wrappers = [os.environ[var]] - break - else: - # Or search for default wrappers. - wrappers = default_wrappers - - for prog in wrappers: - # Note: Some use OpenMPI with Intel compilers on Linux - result = self._try_openmpi_wrapper(prog, cid) - if result is not None: - self.is_found = True - self.version = result[0] - self.compile_args = self._filter_compile_args(result[1]) - self.link_args = self._filter_link_args(result[2], cid) - break - result = self._try_other_wrapper(prog, cid) - if result is not None: - self.is_found = True - self.version = result[0] - self.compile_args = self._filter_compile_args(result[1]) - self.link_args = self._filter_link_args(result[2], cid) - break - - if not self.is_found and mesonlib.is_windows(): - # only Intel Fortran compiler is compatible with Microsoft MPI at this time. - if language == 'fortran' and cid != 'intel-cl': - return - result = self._try_msmpi() - if result is not None: - self.is_found = True - self.version, self.compile_args, self.link_args = result - return - - def _filter_compile_args(self, args: T.Sequence[str]) -> T.List[str]: - """ - MPI wrappers return a bunch of garbage args. - Drop -O2 and everything that is not needed. - """ - result = [] - multi_args = ('-I', ) - if self.language == 'fortran': - fc = self.env.coredata.compilers[self.for_machine]['fortran'] - multi_args += fc.get_module_incdir_args() - - include_next = False - for f in args: - if f.startswith(('-D', '-f') + multi_args) or f == '-pthread' \ - or (f.startswith('-W') and f != '-Wall' and not f.startswith('-Werror')): - result.append(f) - if f in multi_args: - # Path is a separate argument. - include_next = True - elif include_next: - include_next = False - result.append(f) - return result - - def _filter_link_args(self, args: T.Sequence[str], cid: str) -> T.List[str]: - """ - MPI wrappers return a bunch of garbage args. - Drop -O2 and everything that is not needed. - """ - result = [] - include_next = False - for f in args: - if self._is_link_arg(f, cid): - result.append(f) - if f in ('-L', '-Xlinker'): - include_next = True - elif include_next: - include_next = False - result.append(f) - return result - - @staticmethod - def _is_link_arg(f: str, cid: str) -> bool: - if cid == 'intel-cl': - return f == '/link' or f.startswith('/LIBPATH') or f.endswith('.lib') # always .lib whether static or dynamic - else: - return (f.startswith(('-L', '-l', '-Xlinker')) or - f == '-pthread' or - (f.startswith('-W') and f != '-Wall' and not f.startswith('-Werror'))) - - def _try_openmpi_wrapper(self, prog, cid: str): - # https://www.open-mpi.org/doc/v4.0/man1/mpifort.1.php - if cid == 'intel-cl': # IntelCl doesn't support OpenMPI - return None - prog = ExternalProgram(prog, silent=True) - if not prog.found(): - return None - - # compiler args - cmd = prog.get_command() + ['--showme:compile'] - p = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True, timeout=15) - if p.returncode != 0: - mlog.debug('Command', mlog.bold(cmd), 'failed to run:') - mlog.debug(mlog.bold('Standard output\n'), p.stdout) - mlog.debug(mlog.bold('Standard error\n'), p.stderr) - return None - cargs = split_args(p.stdout) - # link args - cmd = prog.get_command() + ['--showme:link'] - p = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True, timeout=15) - if p.returncode != 0: - mlog.debug('Command', mlog.bold(cmd), 'failed to run:') - mlog.debug(mlog.bold('Standard output\n'), p.stdout) - mlog.debug(mlog.bold('Standard error\n'), p.stderr) - return None - libs = split_args(p.stdout) - # version - cmd = prog.get_command() + ['--showme:version'] - p = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True, timeout=15) - if p.returncode != 0: - mlog.debug('Command', mlog.bold(cmd), 'failed to run:') - mlog.debug(mlog.bold('Standard output\n'), p.stdout) - mlog.debug(mlog.bold('Standard error\n'), p.stderr) - return None - v = re.search(r'\d+.\d+.\d+', p.stdout) - if v: - version = v.group(0) - else: - version = None - - return version, cargs, libs - - def _try_other_wrapper(self, prog, cid: str) -> T.Tuple[str, T.List[str], T.List[str]]: - prog = ExternalProgram(prog, silent=True) - if not prog.found(): - return None - - cmd = prog.get_command() - if cid == 'intel-cl': - cmd.append('/show') - else: - cmd.append('-show') - p = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True, timeout=15) - if p.returncode != 0: - mlog.debug('Command', mlog.bold(cmd), 'failed to run:') - mlog.debug(mlog.bold('Standard output\n'), p.stdout) - mlog.debug(mlog.bold('Standard error\n'), p.stderr) - return None - - version = None - stdout = p.stdout - if 'Intel(R) MPI Library' in p.stdout: # intel-cl: remove messy compiler logo - out = stdout.split('\n', 2) - version = out[0] - stdout = out[2] - - if version is None: - p = subprocess.run(cmd + ['-v'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True, timeout=15) - if p.returncode == 0: - version = p.stdout.split('\n', 1)[0] - - args = split_args(stdout) - - return version, args, args - - def _try_msmpi(self) -> T.Tuple[str, T.List[str], T.List[str]]: - if self.language == 'cpp': - # MS-MPI does not support the C++ version of MPI, only the standard C API. - return None - if 'MSMPI_INC' not in os.environ: - return None - - incdir = os.environ['MSMPI_INC'] - arch = detect_cpu_family(self.env.coredata.compilers.host) - if arch == 'x86': - if 'MSMPI_LIB32' not in os.environ: - return None - libdir = os.environ['MSMPI_LIB32'] - post = 'x86' - elif arch == 'x86_64': - if 'MSMPI_LIB64' not in os.environ: - return None - libdir = os.environ['MSMPI_LIB64'] - post = 'x64' - else: - return None - - if self.language == 'fortran': - return (None, - ['-I' + incdir, '-I' + os.path.join(incdir, post)], - [os.path.join(libdir, 'msmpi.lib'), os.path.join(libdir, 'msmpifec.lib')]) - else: - return (None, - ['-I' + incdir, '-I' + os.path.join(incdir, post)], - [os.path.join(libdir, 'msmpi.lib')]) - - @staticmethod - def get_methods(): - return [DependencyMethods.AUTO, DependencyMethods.PKGCONFIG] diff -Nru meson-0.53.2/mesonbuild/dependencies/scalapack.py meson-0.52.1/mesonbuild/dependencies/scalapack.py --- meson-0.53.2/mesonbuild/dependencies/scalapack.py 2019-12-29 22:47:27.000000000 +0000 +++ meson-0.52.1/mesonbuild/dependencies/scalapack.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,120 +0,0 @@ -# Copyright 2013-2019 The Meson development team - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from pathlib import Path -import os - -from .. import mesonlib -from .base import CMakeDependency, DependencyMethods, ExternalDependency, PkgConfigDependency - - -class ScalapackDependency(ExternalDependency): - def __init__(self, environment, kwargs: dict): - super().__init__('scalapack', environment, None, kwargs) - kwargs['required'] = False - kwargs['silent'] = True - self.is_found = False - self.static = kwargs.get('static', False) - methods = mesonlib.listify(self.methods) - - if set([DependencyMethods.AUTO, DependencyMethods.PKGCONFIG]).intersection(methods): - pkgconfig_files = [] - mklroot = None - is_gcc = self.clib_compiler.get_id() == 'gcc' - # Intel MKL works with non-Intel compilers too -- but not gcc on windows - if 'MKLROOT' in os.environ and not (mesonlib.is_windows() and is_gcc): - try: - mklroot = Path(os.environ['MKLROOT']).resolve() - except Exception: - pass - if mklroot is not None: - # MKL pkg-config is a start, but you have to add / change stuff - # https://software.intel.com/en-us/articles/intel-math-kernel-library-intel-mkl-and-pkg-config-tool - pkgconfig_files = ( - ['mkl-static-lp64-iomp'] if self.static else ['mkl-dynamic-lp64-iomp'] - ) - if mesonlib.is_windows(): - suffix = '.lib' - elif self.static: - suffix = '.a' - else: - suffix = '' - libdir = mklroot / 'lib/intel64' - # Intel compiler might not have Parallel Suite - pkgconfig_files += ['scalapack-openmpi', 'scalapack'] - - for pkg in pkgconfig_files: - pkgdep = PkgConfigDependency( - pkg, environment, kwargs, language=self.language - ) - if pkgdep.found(): - self.compile_args = pkgdep.get_compile_args() - if mklroot: - link_args = pkgdep.get_link_args() - if is_gcc: - for i, a in enumerate(link_args): - if 'mkl_intel_lp64' in a: - link_args[i] = a.replace('intel', 'gf') - break - # MKL pkg-config omits scalapack - # be sure "-L" and "-Wl" are first if present - i = 0 - for j, a in enumerate(link_args): - if a.startswith(('-L', '-Wl')): - i = j + 1 - elif j > 3: - break - if mesonlib.is_windows() or self.static: - link_args.insert( - i, str(libdir / ('mkl_scalapack_lp64' + suffix)) - ) - link_args.insert( - i + 1, str(libdir / ('mkl_blacs_intelmpi_lp64' + suffix)) - ) - else: - link_args.insert(i, '-lmkl_scalapack_lp64') - link_args.insert(i + 1, '-lmkl_blacs_intelmpi_lp64') - else: - link_args = pkgdep.get_link_args() - self.link_args = link_args - - self.version = pkgdep.get_version() - if self.version == 'unknown' and mklroot: - try: - v = ( - mklroot.as_posix() - .split('compilers_and_libraries_')[1] - .split('/', 1)[0] - ) - if v: - self.version = v - except IndexError: - pass - - self.is_found = True - self.pcdep = pkgdep - return - - if set([DependencyMethods.AUTO, DependencyMethods.CMAKE]).intersection(methods): - cmakedep = CMakeDependency('Scalapack', environment, kwargs, language=self.language) - if cmakedep.found(): - self.compile_args = cmakedep.get_compile_args() - self.link_args = cmakedep.get_link_args() - self.version = cmakedep.get_version() - self.is_found = True - return - - @staticmethod - def get_methods(): - return [DependencyMethods.AUTO, DependencyMethods.PKGCONFIG, DependencyMethods.CMAKE] diff -Nru meson-0.53.2/mesonbuild/dependencies/ui.py meson-0.52.1/mesonbuild/dependencies/ui.py --- meson-0.53.2/mesonbuild/dependencies/ui.py 2020-01-23 12:51:19.000000000 +0000 +++ meson-0.52.1/mesonbuild/dependencies/ui.py 2019-11-28 17:37:44.000000000 +0000 @@ -25,7 +25,7 @@ from ..mesonlib import ( MesonException, Popen_safe, extract_as_list, version_compare_many ) -from ..environment import detect_cpu_family +from ..environment import detect_cpu from .base import DependencyException, DependencyMethods from .base import ExternalDependency, ExternalProgram, NonExistingExternalProgram @@ -373,8 +373,7 @@ (k, v) = tuple(line.split(':', 1)) qvars[k] = v # Qt on macOS uses a framework, but Qt for iOS/tvOS does not - xspec = qvars.get('QMAKE_XSPEC', '') - if self.env.machines.host.is_darwin() and not any(s in xspec for s in ['ios', 'tvos']): + if self.env.machines.host.is_darwin() and 'ios' not in qvars['QMAKE_XSPEC'] and 'tvos' not in qvars['QMAKE_XSPEC']: mlog.debug("Building for macOS, looking for framework") self._framework_detect(qvars, mods, kwargs) return qmake @@ -606,14 +605,16 @@ # TODO: this config might not work on some platforms, fix bugs as reported # we should at least detect other 64-bit platforms (e.g. armv8) lib_name = 'vulkan' - lib_dir = 'lib' - inc_dir = 'include' if mesonlib.is_windows(): lib_name = 'vulkan-1' lib_dir = 'Lib32' inc_dir = 'Include' - if detect_cpu_family(self.env.coredata.compilers.host) == 'x86_64': + if detect_cpu({}) == 'x86_64': lib_dir = 'Lib' + else: + lib_name = 'vulkan' + lib_dir = 'lib' + inc_dir = 'include' # make sure header and lib are valid inc_path = os.path.join(self.vulkan_sdk, inc_dir) diff -Nru meson-0.53.2/mesonbuild/envconfig.py meson-0.52.1/mesonbuild/envconfig.py --- meson-0.53.2/mesonbuild/envconfig.py 2020-01-23 22:34:28.000000000 +0000 +++ meson-0.52.1/mesonbuild/envconfig.py 2019-11-28 17:37:44.000000000 +0000 @@ -13,13 +13,13 @@ # limitations under the License. import configparser, os, subprocess -import typing as T +import typing from . import mesonlib from .mesonlib import EnvironmentException, split_args from . import mlog -_T = T.TypeVar('_T') +_T = typing.TypeVar('_T') # These classes contains all the data pulled from configuration files (native @@ -37,12 +37,10 @@ known_cpu_families = ( 'aarch64', - 'alpha', 'arc', 'arm', 'e2k', 'ia64', - 'm68k', 'microblaze', 'mips', 'mips64', @@ -53,7 +51,6 @@ 'riscv64', 'rl78', 'rx', - 's390', 's390x', 'sparc', 'sparc64', @@ -67,12 +64,10 @@ # python identifiers cannot start with numbers CPU_FAMILES_64_BIT = [ 'aarch64', - 'alpha', 'ia64', 'mips64', 'ppc64', 'riscv64', - 's390x', 'sparc64', 'wasm64', 'x86_64', @@ -80,7 +75,7 @@ class MesonConfigFile: @classmethod - def from_config_parser(cls, parser: configparser.ConfigParser) -> T.Dict[str, T.Dict[str, T.Dict[str, str]]]: + def from_config_parser(cls, parser: configparser.ConfigParser) -> typing.Dict[str, typing.Dict[str, typing.Dict[str, str]]]: out = {} # This is a bit hackish at the moment. for s in parser.sections(): @@ -123,10 +118,10 @@ class Properties(HasEnvVarFallback): def __init__( self, - properties: T.Optional[T.Dict[str, T.Union[str, T.List[str]]]] = None, + properties: typing.Optional[typing.Dict[str, typing.Union[str, typing.List[str]]]] = None, fallback: bool = True): super().__init__(fallback) - self.properties = properties or {} # type: T.Dict[str, T.Union[str, T.List[str]]] + self.properties = properties or {} # type: typing.Dict[str, typing.Union[str, typing.List[str]]] def has_stdlib(self, language: str) -> bool: return language + '_stdlib' in self.properties @@ -134,30 +129,30 @@ # Some of get_stdlib, get_root, get_sys_root are wider than is actually # true, but without heterogenious dict annotations it's not practical to # narrow them - def get_stdlib(self, language: str) -> T.Union[str, T.List[str]]: + def get_stdlib(self, language: str) -> typing.Union[str, typing.List[str]]: return self.properties[language + '_stdlib'] - def get_root(self) -> T.Optional[T.Union[str, T.List[str]]]: + def get_root(self) -> typing.Optional[typing.Union[str, typing.List[str]]]: return self.properties.get('root', None) - def get_sys_root(self) -> T.Optional[T.Union[str, T.List[str]]]: + def get_sys_root(self) -> typing.Optional[typing.Union[str, typing.List[str]]]: return self.properties.get('sys_root', None) - def __eq__(self, other: T.Any) -> 'T.Union[bool, NotImplemented]': + def __eq__(self, other: typing.Any) -> 'typing.Union[bool, NotImplemented]': if isinstance(other, type(self)): return self.properties == other.properties return NotImplemented # TODO consider removing so Properties is less freeform - def __getitem__(self, key: str) -> T.Any: + def __getitem__(self, key: str) -> typing.Any: return self.properties[key] # TODO consider removing so Properties is less freeform - def __contains__(self, item: T.Any) -> bool: + def __contains__(self, item: typing.Any) -> bool: return item in self.properties # TODO consider removing, for same reasons as above - def get(self, key: str, default: T.Any = None) -> T.Any: + def get(self, key: str, default: typing.Any = None) -> typing.Any: return self.properties.get(key, default) class MachineInfo: @@ -168,7 +163,7 @@ self.endian = endian self.is_64_bit = cpu_family in CPU_FAMILES_64_BIT # type: bool - def __eq__(self, other: T.Any) -> 'T.Union[bool, NotImplemented]': + def __eq__(self, other: typing.Any) -> 'typing.Union[bool, NotImplemented]': if self.__class__ is not other.__class__: return NotImplemented return \ @@ -177,7 +172,7 @@ self.cpu == other.cpu and \ self.endian == other.endian - def __ne__(self, other: T.Any) -> 'T.Union[bool, NotImplemented]': + def __ne__(self, other: typing.Any) -> 'typing.Union[bool, NotImplemented]': if self.__class__ is not other.__class__: return NotImplemented return not self.__eq__(other) @@ -186,7 +181,7 @@ return ''.format(self.system, self.cpu_family, self.cpu) @classmethod - def from_literal(cls, literal: T.Dict[str, str]) -> 'MachineInfo': + def from_literal(cls, literal: typing.Dict[str, str]) -> 'MachineInfo': minimum_literal = {'cpu', 'cpu_family', 'endian', 'system'} if set(literal) < minimum_literal: raise EnvironmentException( @@ -263,9 +258,11 @@ """Machine is illumos or Solaris?""" return self.system == 'sunos' + # Various prefixes and suffixes for import libraries, shared libraries, # static libraries, and executables. # Versioning is added to these names in the backends as-needed. + def get_exe_suffix(self) -> str: if self.is_windows() or self.is_cygwin(): return 'exe' @@ -284,10 +281,10 @@ class BinaryTable(HasEnvVarFallback): def __init__( self, - binaries: T.Optional[T.Dict[str, T.Union[str, T.List[str]]]] = None, + binaries: typing.Optional[typing.Dict[str, typing.Union[str, typing.List[str]]]] = None, fallback: bool = True): super().__init__(fallback) - self.binaries = binaries or {} # type: T.Dict[str, T.Union[str, T.List[str]]] + self.binaries = binaries or {} # type: typing.Dict[str, typing.Union[str, typing.List[str]]] for name, command in self.binaries.items(): if not isinstance(command, (list, str)): # TODO generalize message @@ -308,28 +305,18 @@ 'rust': 'RUSTC', 'vala': 'VALAC', - # Linkers - 'c_ld': 'CC_LD', - 'cpp_ld': 'CXX_LD', - 'd_ld': 'D_LD', - 'fortran_ld': 'F_LD', - 'objc_ld': 'OBJC_LD', - 'objcpp_ld': 'OBJCPP_LD', - 'rust_ld': 'RUST_LD', - # Binutils 'strip': 'STRIP', 'ar': 'AR', 'windres': 'WINDRES', - # Other tools 'cmake': 'CMAKE', 'qmake': 'QMAKE', 'pkgconfig': 'PKG_CONFIG', - } # type: T.Dict[str, str] + } # type: typing.Dict[str, str] @staticmethod - def detect_ccache() -> T.List[str]: + def detect_ccache() -> typing.List[str]: try: subprocess.check_call(['ccache', '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) except (OSError, subprocess.CalledProcessError): @@ -344,7 +331,7 @@ This is probably wrong, it should always point to the native compiler.''' % evar) @classmethod - def parse_entry(cls, entry: T.Union[str, T.List[str]]) -> T.Tuple[T.List[str], T.List[str]]: + def parse_entry(cls, entry: typing.Union[str, typing.List[str]]) -> typing.Tuple[typing.List[str], typing.List[str]]: compiler = mesonlib.stringlistify(entry) # Ensure ccache exists and remove it if it doesn't if compiler[0] == 'ccache': @@ -355,7 +342,7 @@ # Return value has to be a list of compiler 'choices' return compiler, ccache - def lookup_entry(self, name: str) -> T.Optional[T.List[str]]: + def lookup_entry(self, name: str) -> typing.Optional[typing.List[str]]: """Lookup binaryk Returns command with args as list if found, Returns `None` if nothing is @@ -363,7 +350,7 @@ First tries looking in explicit map, then tries environment variable. """ - # Try explicit map, don't fall back on env var + # Try explict map, don't fall back on env var command = self.binaries.get(name) if command is not None: command = mesonlib.stringlistify(command) @@ -388,13 +375,13 @@ builds. """ - def __init__(self, bindir: T.Optional[str] = None, datadir: T.Optional[str] = None, - includedir: T.Optional[str] = None, infodir: T.Optional[str] = None, - libdir: T.Optional[str] = None, libexecdir: T.Optional[str] = None, - localedir: T.Optional[str] = None, localstatedir: T.Optional[str] = None, - mandir: T.Optional[str] = None, prefix: T.Optional[str] = None, - sbindir: T.Optional[str] = None, sharedstatedir: T.Optional[str] = None, - sysconfdir: T.Optional[str] = None): + def __init__(self, bindir: typing.Optional[str] = None, datadir: typing.Optional[str] = None, + includedir: typing.Optional[str] = None, infodir: typing.Optional[str] = None, + libdir: typing.Optional[str] = None, libexecdir: typing.Optional[str] = None, + localedir: typing.Optional[str] = None, localstatedir: typing.Optional[str] = None, + mandir: typing.Optional[str] = None, prefix: typing.Optional[str] = None, + sbindir: typing.Optional[str] = None, sharedstatedir: typing.Optional[str] = None, + sysconfdir: typing.Optional[str] = None): self.bindir = bindir self.datadir = datadir self.includedir = includedir @@ -412,12 +399,12 @@ def __contains__(self, key: str) -> bool: return hasattr(self, key) - def __getitem__(self, key: str) -> T.Optional[str]: + def __getitem__(self, key: str) -> typing.Optional[str]: # Mypy can't figure out what to do with getattr here, so we'll case for it - return T.cast(T.Optional[str], getattr(self, key)) + return typing.cast(typing.Optional[str], getattr(self, key)) - def __setitem__(self, key: str, value: T.Optional[str]) -> None: + def __setitem__(self, key: str, value: typing.Optional[str]) -> None: setattr(self, key, value) - def __iter__(self) -> T.Iterator[T.Tuple[str, str]]: + def __iter__(self) -> typing.Iterator[typing.Tuple[str, str]]: return iter(self.__dict__.items()) diff -Nru meson-0.53.2/mesonbuild/environment.py meson-0.52.1/mesonbuild/environment.py --- meson-0.53.2/mesonbuild/environment.py 2020-02-25 18:00:46.000000000 +0000 +++ meson-0.52.1/mesonbuild/environment.py 2019-11-28 17:37:44.000000000 +0000 @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os, platform, re, sys, shutil, subprocess +import os, platform, re, sys, shutil, subprocess, typing import tempfile import shlex -import typing as T from . import coredata from .linkers import ArLinker, ArmarLinker, VisualStudioLinker, DLinker, CcrxLinker, IntelVisualStudioLinker @@ -33,6 +32,7 @@ from . import compilers from .compilers import ( Compiler, + CompilerType, is_assembly, is_header, is_library, @@ -47,17 +47,17 @@ CcrxDynamicLinker, ClangClDynamicLinker, DynamicLinker, - GnuBFDDynamicLinker, - GnuGoldDynamicLinker, + GnuDynamicLinker, LLVMDynamicLinker, MSVCDynamicLinker, OptlinkDynamicLinker, PGIDynamicLinker, PGIStaticLinker, SolarisDynamicLinker, + XildAppleDynamicLinker, + XildLinuxDynamicLinker, XilinkDynamicLinker, CudaLinker, - VisualStudioLikeLinkerMixin, ) from functools import lru_cache from .compilers import ( @@ -65,8 +65,6 @@ ArmCPPCompiler, ArmclangCCompiler, ArmclangCPPCompiler, - AppleClangCCompiler, - AppleClangCPPCompiler, ClangCCompiler, ClangCPPCompiler, ClangObjCCompiler, @@ -112,7 +110,7 @@ build_filename = 'meson.build' -CompilersDict = T.Dict[str, Compiler] +CompilersDict = typing.Dict[str, Compiler] def detect_gcovr(min_version='3.3', new_rootdir_version='4.2', log=False): gcovr_exe = 'gcovr' @@ -142,10 +140,6 @@ return gcovr_exe, gcovr_new_rootdir, lcov_exe, genhtml_exe def detect_ninja(version: str = '1.5', log: bool = False) -> str: - r = detect_ninja_command_and_version(version, log) - return r[0] if r else None - -def detect_ninja_command_and_version(version: str = '1.5', log: bool = False) -> (str, str): env_ninja = os.environ.get('NINJA', None) for n in [env_ninja] if env_ninja else ['ninja', 'ninja-build', 'samu']: try: @@ -167,9 +161,9 @@ if name == 'samu': name = 'samurai' mlog.log('Found {}-{} at {}'.format(name, found, quote_arg(n))) - return (n, found) + return n -def get_llvm_tool_names(tool: str) -> T.List[str]: +def get_llvm_tool_names(tool: str) -> typing.List[str]: # Ordered list of possible suffixes of LLVM executables to try. Start with # base, then try newest back to oldest (3.5 is arbitrary), and finally the # devel version. Please note that the development snapshot in Debian does @@ -196,7 +190,7 @@ names.append(tool + suffix) return names -def detect_scanbuild() -> T.List[str]: +def detect_scanbuild() -> typing.List[str]: """ Look for scan-build binary on build platform First, if a SCANBUILD env variable has been provided, give it precedence @@ -227,7 +221,7 @@ return [tool] return [] -def detect_clangformat() -> T.List[str]: +def detect_clangformat() -> typing.List[str]: """ Look for clang-format binary on build platform Do the same thing as detect_scanbuild to find clang-format except it @@ -336,8 +330,6 @@ trial = 'ppc' elif trial in ('amd64', 'x64', 'i86pc'): trial = 'x86_64' - elif trial in {'sun4u', 'sun4v'}: - trial = 'sparc64' # On Linux (and maybe others) there can be any mixture of 32/64 bit code in # the kernel, Python, system, 32-bit chroot on 64-bit host, etc. The only @@ -357,7 +349,7 @@ if trial not in known_cpu_families: mlog.warning('Unknown CPU family {!r}, please report this at ' - 'https://github.com/mesonbuild/meson/issues/new with the ' + 'https://github.com/mesonbuild/meson/issues/new with the' 'output of `uname -a` and `cat /proc/cpuinfo`'.format(trial)) return trial @@ -399,7 +391,7 @@ return os.environ['MSYSTEM_CARCH'] return None -def detect_machine_info(compilers: T.Optional[CompilersDict] = None) -> MachineInfo: +def detect_machine_info(compilers: typing.Optional[CompilersDict] = None) -> MachineInfo: """Detect the machine we're running on If compilers are not provided, we cannot know as much. None out those @@ -587,19 +579,11 @@ self.default_objcpp = ['c++', 'g++'] self.default_cs = ['csc', 'mcs'] else: - if platform.machine().lower() == 'e2k': - # There are no objc or objc++ compilers for Elbrus, - # and there's no clang which can build binaries for host. - self.default_c = ['cc', 'gcc', 'lcc'] - self.default_cpp = ['c++', 'g++', 'l++'] - self.default_objc = [] - self.default_objcpp = [] - else: - self.default_c = ['cc', 'gcc', 'clang', 'pgcc', 'icc'] - self.default_cpp = ['c++', 'g++', 'clang++', 'pgc++', 'icpc'] - self.default_objc = ['cc', 'gcc', 'clang'] - self.default_objcpp = ['c++', 'g++', 'clang++'] + self.default_c = ['cc', 'gcc', 'clang', 'pgcc', 'icc'] + self.default_cpp = ['c++', 'g++', 'clang++', 'pgc++', 'icpc'] self.default_fortran = ['gfortran', 'flang', 'pgfortran', 'ifort', 'g95'] + self.default_objc = ['cc', 'gcc', 'clang'] + self.default_objcpp = ['c++', 'g++', 'clang++'] self.default_cs = ['mcs', 'csc'] self.default_d = ['ldc2', 'ldc', 'gdc', 'dmd'] self.default_java = ['javac'] @@ -711,6 +695,17 @@ minor = defines.get('__LCC_MINOR__', '0') return dot.join((generation, major, minor)) + @staticmethod + def get_gnu_compiler_type(defines): + # Detect GCC type (Apple, MinGW, Cygwin, Unix) + if '__APPLE__' in defines: + return CompilerType.GCC_OSX + elif '__MINGW32__' in defines or '__MINGW64__' in defines: + return CompilerType.GCC_MINGW + elif '__CYGWIN__' in defines: + return CompilerType.GCC_CYGWIN + return CompilerType.GCC_STANDARD + def _get_compilers(self, lang, for_machine): ''' The list of compilers is detected in the exact same way for @@ -742,95 +737,55 @@ errmsg += '\nRunning "{0}" gave "{1}"'.format(c, e) raise EnvironmentException(errmsg) - def _guess_win_linker(self, compiler: T.List[str], comp_class: Compiler, - for_machine: MachineChoice, *, - use_linker_prefix: bool = True) -> 'DynamicLinker': - self.coredata.add_lang_args(comp_class.language, comp_class, for_machine, self) - + @staticmethod + def _guess_win_linker(compiler: typing.List[str], for_machine: MachineChoice, + prefix: typing.Union[str, typing.List[str]]) -> 'DynamicLinker': # Explicitly pass logo here so that we can get the version of link.exe - if not use_linker_prefix or comp_class.LINKER_PREFIX is None: - check_args = ['/logo', '--version'] - elif isinstance(comp_class.LINKER_PREFIX, str): - check_args = [comp_class.LINKER_PREFIX + '/logo', comp_class.LINKER_PREFIX + '--version'] - elif isinstance(comp_class.LINKER_PREFIX, list): - check_args = comp_class.LINKER_PREFIX + ['/logo'] + comp_class.LINKER_PREFIX + ['--version'] - - check_args += self.coredata.compiler_options[for_machine][comp_class.language + '_args'].value - - override = [] # type: T.List[str] - value = self.binaries[for_machine].lookup_entry(comp_class.language + '_ld') - if value is not None: - override = comp_class.use_linker_args(value[0]) - check_args += override - + if isinstance(prefix, str): + check_args = [prefix + '/logo', prefix + '--version'] + else: + check_args = prefix + ['/logo'] + prefix + ['--version'] p, o, _ = Popen_safe(compiler + check_args) if o.startswith('LLD'): if '(compatible with GNU linkers)' in o: - return LLVMDynamicLinker( - compiler, for_machine, comp_class.LINKER_PREFIX, - override, version=search_version(o)) - - if value is not None: - compiler = value - - p, o, e = Popen_safe(compiler + check_args) - if o.startswith('LLD'): - return ClangClDynamicLinker( - for_machine, [], - prefix=comp_class.LINKER_PREFIX if use_linker_prefix else [], - exelist=compiler, version=search_version(o)) - elif 'OPTLINK' in o: - # Opltink's stdout *may* beging with a \r character. - return OptlinkDynamicLinker(for_machine, version=search_version(o)) - elif o.startswith('Microsoft') or e.startswith('Microsoft'): - out = o or e - match = re.search(r'.*(X86|X64|ARM|ARM64).*', out) + return LLVMDynamicLinker(compiler, for_machine, 'lld', prefix, version=search_version(o)) + else: + return ClangClDynamicLinker(for_machine, exelist=compiler, prefix=prefix, version=search_version(o)) + elif o.startswith('Microsoft'): + match = re.search(r'.*(X86|X64|ARM|ARM64).*', o) if match: target = str(match.group(1)) else: target = 'x86' - return MSVCDynamicLinker( - for_machine, [], machine=target, exelist=compiler, - prefix=comp_class.LINKER_PREFIX if use_linker_prefix else [], - version=search_version(out)) - elif 'GNU coreutils' in o: - raise EnvironmentException( - "Found GNU link.exe instead of MSVC link.exe. This link.exe " - "is not a linker. You may need to reorder entries to your " - "%PATH% variable to resolve this.") - raise EnvironmentException('Unable to determine dynamic linker') - - def _guess_nix_linker(self, compiler: T.List[str], comp_class: T.Type[Compiler], - for_machine: MachineChoice, *, - extra_args: T.Optional[T.List[str]] = None) -> 'DynamicLinker': + for_machine, machine=target, exelist=compiler, prefix=prefix, + version=search_version(o)) + raise MesonException('Cannot guess dynamic linker') + + @staticmethod + def _guess_nix_linker(compiler: typing.List[str], for_machine: MachineChoice, + prefix: typing.Union[str, typing.List[str]], *, + extra_args: typing.Optional[typing.List[str]] = None) -> 'DynamicLinker': """Helper for guessing what linker to use on Unix-Like OSes. - :compiler: Invocation to use to get linker - :comp_class: The Compiler Type (uninstantiated) - :for_machine: which machine this linker targets - :extra_args: Any additional arguments required (such as a source file) + :prefix: The prefix that the compiler uses to proxy arguments to the + linker, if required. This can be passed as a string or a list of + strings. If it is passed as a string then the arguments to be + proxied to the linker will be concatenated, if it is a list they + will be appended. This means that if a space is required (such as + with swift which wants `-Xlinker --version` and *not* + `-Xlinker=--version`) you must pass as a list. + :extra_args: Any addtional arguments rquired (such as a source file) """ - self.coredata.add_lang_args(comp_class.language, comp_class, for_machine, self) - extra_args = T.cast(T.List[str], extra_args or []) - extra_args += self.coredata.compiler_options[for_machine][comp_class.language + '_args'].value - - if isinstance(comp_class.LINKER_PREFIX, str): - check_args = [comp_class.LINKER_PREFIX + '--version'] + extra_args + extra_args = typing.cast(typing.List[str], extra_args or []) + if isinstance(prefix, str): + check_args = [prefix + '--version'] + extra_args else: - check_args = comp_class.LINKER_PREFIX + ['--version'] + extra_args - - override = [] # type: T.List[str] - value = self.binaries[for_machine].lookup_entry(comp_class.language + '_ld') - if value is not None: - override = comp_class.use_linker_args(value[0]) - check_args += override - + check_args = prefix + ['--version'] + extra_args _, o, e = Popen_safe(compiler + check_args) v = search_version(o) if o.startswith('LLD'): - linker = LLVMDynamicLinker( - compiler, for_machine, comp_class.LINKER_PREFIX, override, version=v) # type: DynamicLinker + linker = LLVMDynamicLinker(compiler, for_machine, 'lld', prefix, version=v) # type: DynamicLinker elif e.startswith('lld-link: '): # Toolchain wrapper got in the way; this happens with e.g. https://github.com/mstorsjo/llvm-mingw # Let's try to extract the linker invocation command to grab the version. @@ -846,45 +801,43 @@ _, o, e = Popen_safe([linker_cmd, '--version']) v = search_version(o) - linker = LLVMDynamicLinker(compiler, for_machine, comp_class.LINKER_PREFIX, override, version=v) - # first is for apple clang, second is for real gcc, the third is icc - elif e.endswith('(use -v to see invocation)\n') or 'macosx_version' in e or 'ld: unknown option:' in e: - if isinstance(comp_class.LINKER_PREFIX, str): - _, _, e = Popen_safe(compiler + [comp_class.LINKER_PREFIX + '-v'] + extra_args) + linker = LLVMDynamicLinker(compiler, for_machine, 'lld', prefix, version=v) + # first is for apple clang, second is for real gcc + elif e.endswith('(use -v to see invocation)\n') or 'macosx_version' in e: + if isinstance(prefix, str): + _, _, e = Popen_safe(compiler + [prefix + '-v'] + extra_args) else: - _, _, e = Popen_safe(compiler + comp_class.LINKER_PREFIX + ['-v'] + extra_args) + _, _, e = Popen_safe(compiler + prefix + ['-v'] + extra_args) + i = 'APPLE ld' for line in e.split('\n'): if 'PROJECT:ld' in line: v = line.split('-')[1] break else: v = 'unknown version' - linker = AppleDynamicLinker(compiler, for_machine, comp_class.LINKER_PREFIX, override, version=v) + linker = AppleDynamicLinker(compiler, for_machine, i, prefix, version=v) elif 'GNU' in o: if 'gold' in o: - cls = GnuGoldDynamicLinker + i = 'GNU ld.gold' else: - cls = GnuBFDDynamicLinker - linker = cls(compiler, for_machine, comp_class.LINKER_PREFIX, override, version=v) + i = 'GNU ld.bfd' + linker = GnuDynamicLinker(compiler, for_machine, i, prefix, version=v) elif 'Solaris' in e or 'Solaris' in o: linker = SolarisDynamicLinker( - compiler, for_machine, comp_class.LINKER_PREFIX, override, + compiler, for_machine, 'solaris', prefix, version=search_version(e)) else: - raise EnvironmentException('Unable to determine dynamic linker') + raise MesonException('Unable to determine dynamic linker.') return linker def _detect_c_or_cpp_compiler(self, lang: str, for_machine: MachineChoice) -> Compiler: popen_exceptions = {} compilers, ccache, exe_wrap = self._get_compilers(lang, for_machine) is_cross = not self.machines.matches_build_machine(for_machine) - info = self.machines[for_machine] for compiler in compilers: if isinstance(compiler, str): compiler = [compiler] - compiler_name = os.path.basename(compiler[0]) - if not set(['cl', 'cl.exe', 'clang-cl', 'clang-cl.exe']).isdisjoint(compiler): # Watcom C provides it's own cl.exe clone that mimics an older # version of Microsoft's compiler. Since Watcom's cl.exe is @@ -905,11 +858,11 @@ if found_cl in watcom_cls: continue arg = '/?' - elif 'armcc' in compiler_name: + elif 'armcc' in compiler[0]: arg = '--vsn' - elif 'ccrx' in compiler_name: + elif 'ccrx' in compiler[0]: arg = '-v' - elif 'icl' in compiler_name: + elif 'icl' in compiler[0]: # if you pass anything to icl you get stuck in a pager arg = '' else: @@ -921,7 +874,7 @@ popen_exceptions[' '.join(compiler + [arg])] = e continue - if 'ccrx' in compiler_name: + if 'ccrx' in compiler[0]: out = err full_version = out.split('\n', 1)[0] @@ -938,6 +891,7 @@ if not defines: popen_exceptions[' '.join(compiler)] = 'no pre-processor defines' continue + compiler_type = self.get_gnu_compiler_type(defines) if guess_gcc_or_lcc == 'lcc': version = self.get_lcc_version_from_defines(defines) @@ -946,19 +900,15 @@ version = self.get_gnu_version_from_defines(defines) cls = GnuCCompiler if lang == 'c' else GnuCPPCompiler - linker = self._guess_nix_linker(compiler, cls, for_machine) - - return cls( - ccache + compiler, version, for_machine, is_cross, - info, exe_wrap, defines, full_version=full_version, - linker=linker) + linker = self._guess_nix_linker(compiler, for_machine, cls.LINKER_PREFIX) + return cls(ccache + compiler, version, compiler_type, + for_machine, is_cross, exe_wrap, defines, + full_version=full_version, linker=linker) if 'Emscripten' in out: cls = EmscriptenCCompiler if lang == 'c' else EmscriptenCPPCompiler - self.coredata.add_lang_args(cls.language, cls, for_machine, self) - return cls( - ccache + compiler, version, for_machine, is_cross, info, - exe_wrap, full_version=full_version) + compiler_type = CompilerType.CLANG_EMSCRIPTEN + return cls(ccache + compiler, version, compiler_type, for_machine, is_cross, exe_wrap, full_version=full_version) if 'armclang' in out: # The compiler version is not present in the first line of output, @@ -974,12 +924,10 @@ # Override previous values version = search_version(arm_ver_str) full_version = arm_ver_str + compiler_type = CompilerType.ARM_WIN cls = ArmclangCCompiler if lang == 'c' else ArmclangCPPCompiler linker = ArmClangDynamicLinker(for_machine, version=version) - self.coredata.add_lang_args(cls.language, cls, for_machine, self) - return cls( - ccache + compiler, version, for_machine, is_cross, info, - exe_wrap, full_version=full_version, linker=linker) + return cls(ccache + compiler, version, compiler_type, for_machine, is_cross, exe_wrap, full_version=full_version, linker=linker) if 'CL.EXE COMPATIBILITY' in out: # if this is clang-cl masquerading as cl, detect it as cl, not # clang @@ -995,44 +943,31 @@ else: target = 'unknown target' cls = ClangClCCompiler if lang == 'c' else ClangClCPPCompiler - linker = self._guess_win_linker(['lld-link'], cls, for_machine) - return cls( - compiler, version, for_machine, is_cross, info, exe_wrap, - target, linker=linker) + linker = ClangClDynamicLinker(for_machine, version=version) + return cls(compiler, version, for_machine, is_cross, exe_wrap, target, linker=linker) if 'clang' in out: linker = None - - # Even if the for_machine is darwin, we could be using vanilla - # clang. - if 'Apple' in out: - cls = AppleClangCCompiler if lang == 'c' else AppleClangCPPCompiler - else: - cls = ClangCCompiler if lang == 'c' else ClangCPPCompiler - - if 'windows' in out or self.machines[for_machine].is_windows(): - # If we're in a MINGW context this actually will use a gnu - # style ld, but for clang on "real" windows we'll use - # either link.exe or lld-link.exe + cls = ClangCCompiler if lang == 'c' else ClangCPPCompiler + if 'Apple' in out or self.machines[for_machine].is_darwin(): + compiler_type = CompilerType.CLANG_OSX + elif 'windows' in out or self.machines[for_machine].is_windows(): + compiler_type = CompilerType.CLANG_MINGW + # If we're in a MINGW context this actually will use a gnu style ld try: - linker = self._guess_win_linker(compiler, cls, for_machine) + linker = self._guess_win_linker(compiler, for_machine, cls.LINKER_PREFIX) except MesonException: pass + else: + compiler_type = CompilerType.CLANG_STANDARD if linker is None: - linker = self._guess_nix_linker(compiler, cls, for_machine) - - return cls( - ccache + compiler, version, for_machine, is_cross, info, - exe_wrap, full_version=full_version, linker=linker) - + linker = self._guess_nix_linker(compiler, for_machine, cls.LINKER_PREFIX) + return cls(ccache + compiler, version, compiler_type, for_machine, is_cross, exe_wrap, full_version=full_version, linker=linker) if 'Intel(R) C++ Intel(R)' in err: version = search_version(err) target = 'x86' if 'IA-32' in err else 'x86_64' cls = IntelClCCompiler if lang == 'c' else IntelClCPPCompiler - self.coredata.add_lang_args(cls.language, cls, for_machine, self) - linker = XilinkDynamicLinker(for_machine, [], version=version) - return cls( - compiler, version, for_machine, is_cross, info=info, - exe_wrap=exe_wrap, target=target, linker=linker) + linker = XilinkDynamicLinker(for_machine, version=version) + return cls(compiler, version, for_machine, is_cross, exe_wrap, target, linker=linker) if 'Microsoft' in out or 'Microsoft' in err: # Latest versions of Visual Studio print version # number to stderr but earlier ones print version @@ -1045,45 +980,43 @@ else: m = 'Failed to detect MSVC compiler version: stderr was\n{!r}' raise EnvironmentException(m.format(err)) - cl_signature = lookat.split('\n')[0] - match = re.search('.*(x86|x64|ARM|ARM64)$', cl_signature) + match = re.search(' for .*(x86|x64|ARM|ARM64)$', lookat.split('\n')[0]) if match: target = match.group(1) else: - m = 'Failed to detect MSVC compiler target architecture: \'cl /?\' output is\n{}' - raise EnvironmentException(m.format(cl_signature)) + target = 'x86' + linker = MSVCDynamicLinker(for_machine, version=version) cls = VisualStudioCCompiler if lang == 'c' else VisualStudioCPPCompiler - linker = self._guess_win_linker(['link'], cls, for_machine) - return cls( - compiler, version, for_machine, is_cross, info, exe_wrap, - target, linker=linker) + return cls(compiler, version, for_machine, is_cross, exe_wrap, target, linker=linker) if 'PGI Compilers' in out: + if self.machines[for_machine].is_darwin(): + compiler_type = CompilerType.PGI_OSX + elif self.machines[for_machine].is_windows(): + compiler_type = CompilerType.PGI_WIN + else: + compiler_type = CompilerType.PGI_STANDARD cls = PGICCompiler if lang == 'c' else PGICPPCompiler - self.coredata.add_lang_args(cls.language, cls, for_machine, self) - linker = PGIDynamicLinker(compiler, for_machine, cls.LINKER_PREFIX, [], version=version) - return cls( - ccache + compiler, version, for_machine, is_cross, - info, exe_wrap, linker=linker) + linker = PGIDynamicLinker(compiler, for_machine, 'pgi', cls.LINKER_PREFIX, version=version) + return cls(ccache + compiler, version, compiler_type, for_machine, is_cross, exe_wrap, linker=linker) if '(ICC)' in out: cls = IntelCCompiler if lang == 'c' else IntelCPPCompiler - l = self._guess_nix_linker(compiler, cls, for_machine) - return cls( - ccache + compiler, version, for_machine, is_cross, info, - exe_wrap, full_version=full_version, linker=l) + if self.machines[for_machine].is_darwin(): + compiler_type = CompilerType.ICC_OSX + l = XildAppleDynamicLinker(compiler, for_machine, 'xild', '-Wl,', version=version) + else: + compiler_type = CompilerType.ICC_STANDARD + l = XildLinuxDynamicLinker(compiler, for_machine, 'xild', '-Wl,', version=version) + return cls(ccache + compiler, version, compiler_type, for_machine, is_cross, exe_wrap, full_version=full_version, linker=l) if 'ARM' in out: + compiler_type = CompilerType.ARM_WIN cls = ArmCCompiler if lang == 'c' else ArmCPPCompiler - self.coredata.add_lang_args(cls.language, cls, for_machine, self) linker = ArmDynamicLinker(for_machine, version=version) - return cls( - ccache + compiler, version, for_machine, is_cross, - info, exe_wrap, full_version=full_version, linker=linker) + return cls(ccache + compiler, version, compiler_type, for_machine, is_cross, exe_wrap, full_version=full_version, linker=linker) if 'RX Family' in out: + compiler_type = CompilerType.CCRX_WIN cls = CcrxCCompiler if lang == 'c' else CcrxCPPCompiler - self.coredata.add_lang_args(cls.language, cls, for_machine, self) linker = CcrxDynamicLinker(for_machine, version=version) - return cls( - ccache + compiler, version, for_machine, is_cross, info, - exe_wrap, full_version=full_version, linker=linker) + return cls(ccache + compiler, version, compiler_type, for_machine, is_cross, exe_wrap, full_version=full_version, linker=linker) self._handle_exceptions(popen_exceptions, compilers) @@ -1097,7 +1030,6 @@ popen_exceptions = {} is_cross = not self.machines.matches_build_machine(for_machine) compilers, ccache, exe_wrap = self._get_compilers('cuda', for_machine) - info = self.machines[for_machine] for compiler in compilers: if isinstance(compiler, str): compiler = [compiler] @@ -1126,17 +1058,14 @@ # the full version: version = out.strip().split('V')[-1] cpp_compiler = self.detect_cpp_compiler(for_machine) - cls = CudaCompiler - self.coredata.add_lang_args(cls.language, cls, for_machine, self) - linker = CudaLinker(compiler, for_machine, 'nvlink', CudaCompiler.LINKER_PREFIX, [], version=CudaLinker.parse_version()) - return cls(ccache + compiler, version, for_machine, is_cross, exe_wrap, host_compiler=cpp_compiler, info=info, linker=linker) + linker = CudaLinker(compiler, for_machine, 'nvlink', CudaCompiler.LINKER_PREFIX, version=CudaLinker.parse_version()) + return CudaCompiler(ccache + compiler, version, for_machine, is_cross, exe_wrap, host_compiler=cpp_compiler, linker=linker) raise EnvironmentException('Could not find suitable CUDA compiler: "' + ' '.join(compilers) + '"') def detect_fortran_compiler(self, for_machine: MachineChoice): popen_exceptions = {} compilers, ccache, exe_wrap = self._get_compilers('fortran', for_machine) is_cross = not self.machines.matches_build_machine(for_machine) - info = self.machines[for_machine] for compiler in compilers: if isinstance(compiler, str): compiler = [compiler] @@ -1161,85 +1090,59 @@ if not defines: popen_exceptions[' '.join(compiler)] = 'no pre-processor defines' continue + compiler_type = self.get_gnu_compiler_type(defines) if guess_gcc_or_lcc == 'lcc': version = self.get_lcc_version_from_defines(defines) cls = ElbrusFortranCompiler else: version = self.get_gnu_version_from_defines(defines) cls = GnuFortranCompiler - linker = self._guess_nix_linker( - compiler, cls, for_machine) - return cls( - compiler, version, for_machine, is_cross, info, - exe_wrap, defines, full_version=full_version, - linker=linker) + linker = self._guess_nix_linker(compiler, for_machine, cls.LINKER_PREFIX) + return cls(compiler, version, compiler_type, for_machine, is_cross, exe_wrap, defines, full_version=full_version, linker=linker) if 'G95' in out: - linker = self._guess_nix_linker( - compiler, cls, for_machine) - return G95FortranCompiler( - compiler, version, for_machine, is_cross, info, - exe_wrap, full_version=full_version, linker=linker) + linker = self._guess_nix_linker(compiler, for_machine, G95FortranCompiler.LINKER_PREFIX) + return G95FortranCompiler(compiler, version, for_machine, is_cross, exe_wrap, full_version=full_version, linker=linker) if 'Sun Fortran' in err: version = search_version(err) - linker = self._guess_nix_linker( - compiler, cls, for_machine) - return SunFortranCompiler( - compiler, version, for_machine, is_cross, info, - exe_wrap, full_version=full_version, linker=linker) + linker = self._guess_nix_linker(compiler, for_machine, SunFortranCompiler.LINKER_PREFIX) + return SunFortranCompiler(compiler, version, for_machine, is_cross, exe_wrap, full_version=full_version, linker=linker) if 'Intel(R) Visual Fortran' in err: version = search_version(err) target = 'x86' if 'IA-32' in err else 'x86_64' - cls = IntelClFortranCompiler - self.coredata.add_lang_args(cls.language, cls, for_machine, self) - linker = XilinkDynamicLinker(for_machine, [], version=version) - return cls( - compiler, version, for_machine, is_cross, target, - info, exe_wrap, linker=linker) + linker = XilinkDynamicLinker(for_machine, version=version) + return IntelClFortranCompiler(compiler, version, for_machine, is_cross, target, exe_wrap, linker=linker) if 'ifort (IFORT)' in out: - linker = self._guess_nix_linker(compiler, IntelFortranCompiler, for_machine) - return IntelFortranCompiler( - compiler, version, for_machine, is_cross, info, - exe_wrap, full_version=full_version, linker=linker) + linker = XildLinuxDynamicLinker(compiler, for_machine, 'xild', '-Wl,', version=version) + return IntelFortranCompiler(compiler, version, for_machine, is_cross, exe_wrap, full_version=full_version, linker=linker) if 'PathScale EKOPath(tm)' in err: - return PathScaleFortranCompiler( - compiler, version, for_machine, is_cross, info, - exe_wrap, full_version=full_version) + return PathScaleFortranCompiler(compiler, version, for_machine, is_cross, exe_wrap, full_version=full_version) if 'PGI Compilers' in out: - cls = PGIFortranCompiler - self.coredata.add_lang_args(cls.language, cls, for_machine, self) - linker = PGIDynamicLinker(compiler, for_machine, - cls.LINKER_PREFIX, [], version=version) - return cls( - compiler, version, for_machine, is_cross, info, exe_wrap, - full_version=full_version, linker=linker) + if self.machines[for_machine].is_darwin(): + compiler_type = CompilerType.PGI_OSX + elif self.machines[for_machine].is_windows(): + compiler_type = CompilerType.PGI_WIN + else: + compiler_type = CompilerType.PGI_STANDARD + linker = PGIDynamicLinker(compiler, for_machine, 'pgi', PGIFortranCompiler.LINKER_PREFIX, version=version) + return PGIFortranCompiler(compiler, version, compiler_type, for_machine, is_cross, exe_wrap, full_version=full_version, linker=linker) if 'flang' in out or 'clang' in out: - linker = self._guess_nix_linker( - compiler, FlangFortranCompiler, for_machine) - return FlangFortranCompiler( - compiler, version, for_machine, is_cross, info, - exe_wrap, full_version=full_version, linker=linker) + linker = self._guess_nix_linker(compiler, for_machine, FlangFortranCompiler.LINKER_PREFIX) + return FlangFortranCompiler(compiler, version, for_machine, is_cross, exe_wrap, full_version=full_version, linker=linker) if 'Open64 Compiler Suite' in err: - linker = self._guess_nix_linker( - compiler, Open64FortranCompiler, for_machine) - return Open64FortranCompiler( - compiler, version, for_machine, is_cross, info, - exe_wrap, full_version=full_version, linker=linker) + linker = self._guess_nix_linker(compiler, for_machine, Open64FortranCompiler.LINKER_PREFIX) + return Open64FortranCompiler(compiler, version, for_machine, is_cross, exe_wrap, full_version=full_version, linker=linker) if 'NAG Fortran' in err: - linker = self._guess_nix_linker( - compiler, NAGFortranCompiler, for_machine) - return NAGFortranCompiler( - compiler, version, for_machine, is_cross, info, - exe_wrap, full_version=full_version, linker=linker) - + linker = self._guess_nix_linker(compiler, for_machine, NAGFortranCompiler.LINKER_PREFIX) + return NAGFortranCompiler(compiler, version, for_machine, is_cross, exe_wrap, full_version=full_version, linker=linker) self._handle_exceptions(popen_exceptions, compilers) def get_scratch_dir(self): @@ -1255,8 +1158,6 @@ popen_exceptions = {} compilers, ccache, exe_wrap = self._get_compilers('objc' if objc else 'objcpp', for_machine) is_cross = not self.machines.matches_build_machine(for_machine) - info = self.machines[for_machine] - for compiler in compilers: if isinstance(compiler, str): compiler = [compiler] @@ -1267,38 +1168,37 @@ popen_exceptions[' '.join(compiler + arg)] = e continue version = search_version(out) - if 'Free Software Foundation' in out: + if 'Free Software Foundation' in out or ('e2k' in out and 'lcc' in out): defines = self.get_gnu_compiler_defines(compiler) if not defines: popen_exceptions[' '.join(compiler)] = 'no pre-processor defines' continue + compiler_type = self.get_gnu_compiler_type(defines) version = self.get_gnu_version_from_defines(defines) comp = GnuObjCCompiler if objc else GnuObjCPPCompiler - linker = self._guess_nix_linker(compiler, comp, for_machine) - return comp( - ccache + compiler, version, for_machine, is_cross, info, - exe_wrap, defines, linker=linker) + linker = self._guess_nix_linker(compiler, for_machine, comp.LINKER_PREFIX) + return comp(ccache + compiler, version, compiler_type, for_machine, is_cross, exe_wrap, defines, linker=linker) if 'clang' in out: linker = None comp = ClangObjCCompiler if objc else ClangObjCPPCompiler - if 'windows' in out or self.machines[for_machine].is_windows(): + if 'Apple' in out or self.machines[for_machine].is_darwin(): + compiler_type = CompilerType.CLANG_OSX + elif 'windows' in out or self.machines[for_machine].is_windows(): + compiler_type = CompilerType.CLANG_MINGW # If we're in a MINGW context this actually will use a gnu style ld try: - linker = self._guess_win_linker(compiler, comp, for_machine) + linker = self._guess_win_linker(compiler, for_machine, comp.LINKER_PREFIX) except MesonException: pass - + else: + compiler_type = CompilerType.CLANG_STANDARD if not linker: - linker = self._guess_nix_linker( - compiler, comp, for_machine) - return comp( - ccache + compiler, version, for_machine, - is_cross, info, exe_wrap, linker=linker) + linker = self._guess_nix_linker(compiler, for_machine, comp.LINKER_PREFIX) + return comp(ccache + compiler, version, compiler_type, for_machine, is_cross, exe_wrap, linker=linker) self._handle_exceptions(popen_exceptions, compilers) def detect_java_compiler(self, for_machine): exelist = self.binaries.host.lookup_entry('java') - info = self.machines[for_machine] if exelist is None: # TODO support fallback exelist = [self.default_java[0]] @@ -1313,15 +1213,12 @@ parts = (err if 'javac' in err else out).split() if len(parts) > 1: version = parts[1] - comp_class = JavaCompiler - self.coredata.add_lang_args(comp_class.language, comp_class, for_machine, self) - return comp_class(exelist, version, for_machine, info) + return JavaCompiler(exelist, version, for_machine) raise EnvironmentException('Unknown compiler "' + ' '.join(exelist) + '"') def detect_cs_compiler(self, for_machine): compilers, ccache, exe_wrap = self._get_compilers('cs', for_machine) popen_exceptions = {} - info = self.machines[for_machine] for comp in compilers: if not isinstance(comp, list): comp = [comp] @@ -1333,18 +1230,15 @@ version = search_version(out) if 'Mono' in out: - cls = MonoCompiler + return MonoCompiler(comp, version, for_machine) elif "Visual C#" in out: - cls = VisualStudioCsCompiler - self.coredata.add_lang_args(cls.language, cls, for_machine, self) - return cls(comp, version, for_machine, info) + return VisualStudioCsCompiler(comp, version, for_machine) self._handle_exceptions(popen_exceptions, compilers) def detect_vala_compiler(self, for_machine): exelist = self.binaries.host.lookup_entry('vala') is_cross = not self.machines.matches_build_machine(for_machine) - info = self.machines[for_machine] if exelist is None: # TODO support fallback exelist = [self.default_vala[0]] @@ -1355,21 +1249,13 @@ raise EnvironmentException('Could not execute Vala compiler "%s"' % ' '.join(exelist)) version = search_version(out) if 'Vala' in out: - comp_class = ValaCompiler - self.coredata.add_lang_args(comp_class.language, comp_class, for_machine, self) - return comp_class(exelist, version, for_machine, info, is_cross) + return ValaCompiler(exelist, version, for_machine, is_cross) raise EnvironmentException('Unknown compiler "' + ' '.join(exelist) + '"') def detect_rust_compiler(self, for_machine): popen_exceptions = {} compilers, ccache, exe_wrap = self._get_compilers('rust', for_machine) is_cross = not self.machines.matches_build_machine(for_machine) - info = self.machines[for_machine] - - cc = self.detect_c_compiler(for_machine) - is_link_exe = isinstance(cc.linker, VisualStudioLikeLinkerMixin) - override = self.binaries[for_machine].lookup_entry('rust_ld') - for compiler in compilers: if isinstance(compiler, str): compiler = [compiler] @@ -1383,157 +1269,104 @@ version = search_version(out) if 'rustc' in out: - # On Linux and mac rustc will invoke gcc (clang for mac - # presumably) and it can do this windows, for dynamic linking. - # this means the easiest way to C compiler for dynamic linking. - # figure out what linker to use is to just get the value of the - # C compiler and use that as the basis of the rust linker. - # However, there are two things we need to change, if CC is not - # the default use that, and second add the necessary arguments - # to rust to use -fuse-ld - - if override is None: - extra_args = {} - always_args = [] - if is_link_exe: - compiler.extend(['-C', 'linker={}'.format(cc.linker.exelist[0])]) - extra_args['direct'] = True - extra_args['machine'] = cc.linker.machine - elif not ((info.is_darwin() and isinstance(cc, AppleClangCCompiler)) or - isinstance(cc, GnuCCompiler)): - c = cc.exelist[1] if cc.exelist[0].endswith('ccache') else cc.exelist[0] - compiler.extend(['-C', 'linker={}'.format(c)]) - - # This trickery with type() gets us the class of the linker - # so we can initialize a new copy for the Rust Compiler - if is_link_exe: - linker = type(cc.linker)(for_machine, always_args, exelist=cc.linker.exelist, - version=cc.linker.version, **extra_args) - else: - linker = type(cc.linker)(compiler, for_machine, cc.LINKER_PREFIX, - always_args=always_args, version=cc.linker.version, - **extra_args) - elif 'link' in override[0]: - linker = self._guess_win_linker( - override, RustCompiler, for_machine, use_linker_prefix=False) - linker.direct = True + # Chalk up another quirk for rust. There is no way (AFAICT) to + # figure out what linker rustc is using for a non-nightly compiler + # (On nightly you can pass -Z print-link-args). So we're going to + # hard code the linker based on the platform. + # Currenty gnu ld is used for everything except apple by + # default, and apple ld is used on mac. + # TODO: find some better way to figure this out. + if self.machines[for_machine].is_darwin(): + linker = AppleDynamicLinker([], for_machine, 'Apple ld', '-Wl,') else: - # We're creating a new type of "C" compiler, that has rust - # as it's language. This is gross, but I can't figure out - # another way to handle this, because rustc is actually - # invoking the c compiler as it's linker. - b = type('b', (type(cc), ), {}) - b.language = RustCompiler.language - linker = self._guess_nix_linker(cc.exelist, b, for_machine) - - # Of course, we're not going to use any of that, we just - # need it to get the proper arguments to pass to rustc - c = cc.exelist[1] if cc.exelist[0].endswith('ccache') else cc.exelist[0] - compiler.extend(['-C', 'linker={}'.format(c)]) - compiler.extend(['-C', 'link-args={}'.format(' '.join(cc.use_linker_args(override[0])))]) - - self.coredata.add_lang_args(RustCompiler.language, RustCompiler, for_machine, self) - return RustCompiler( - compiler, version, for_machine, is_cross, info, exe_wrap, - linker=linker) + linker = GnuDynamicLinker([], for_machine, 'GNU ld', '-Wl,') + return RustCompiler(compiler, version, for_machine, is_cross, exe_wrap, linker=linker) self._handle_exceptions(popen_exceptions, compilers) def detect_d_compiler(self, for_machine: MachineChoice): - info = self.machines[for_machine] + exelist = self.binaries[for_machine].lookup_entry('d') + # Search for a D compiler. + # We prefer LDC over GDC unless overridden with the DC + # environment variable because LDC has a much more + # up to date language version at time (2016). + if exelist is not None: + if os.path.basename(exelist[-1]).startswith(('ldmd', 'gdmd')): + raise EnvironmentException( + 'Meson does not support {} as it is only a DMD frontend for another compiler.' + 'Please provide a valid value for DC or unset it so that Meson can resolve the compiler by itself.'.format(exelist[-1])) + else: + for d in self.default_d: + if shutil.which(d): + exelist = [d] + break + else: + raise EnvironmentException('Could not find any supported D compiler.') + + try: + p, out = Popen_safe(exelist + ['--version'])[0:2] + except OSError: + raise EnvironmentException('Could not execute D compiler "%s"' % ' '.join(exelist)) + version = search_version(out) + full_version = out.split('\n', 1)[0] # Detect the target architecture, required for proper architecture handling on Windows. - # MSVC compiler is required for correct platform detection. - c_compiler = {'c': self.detect_c_compiler(for_machine)} - is_msvc = isinstance(c_compiler['c'], VisualStudioCCompiler) - if not is_msvc: - c_compiler = {} + c_compiler = {} + is_msvc = mesonlib.is_windows() and 'VCINSTALLDIR' in os.environ + if is_msvc: + c_compiler = {'c': self.detect_c_compiler(for_machine)} # MSVC compiler is required for correct platform detection. arch = detect_cpu_family(c_compiler) if is_msvc and arch == 'x86': arch = 'x86_mscoff' - popen_exceptions = {} - is_cross = not self.machines.matches_build_machine(for_machine) - results, ccache, exe_wrap = self._get_compilers('d', for_machine) - for exelist in results: - # Search for a D compiler. - # We prefer LDC over GDC unless overridden with the DC - # environment variable because LDC has a much more - # up to date language version at time (2016). - if not isinstance(exelist, list): - exelist = [exelist] - if os.path.basename(exelist[-1]).startswith(('ldmd', 'gdmd')): - raise EnvironmentException( - 'Meson does not support {} as it is only a DMD frontend for another compiler.' - 'Please provide a valid value for DC or unset it so that Meson can resolve the compiler by itself.'.format(exelist[-1])) - try: - p, out = Popen_safe(exelist + ['--version'])[0:2] - except OSError as e: - popen_exceptions[' '.join(exelist + ['--version'])] = e - continue - version = search_version(out) - full_version = out.split('\n', 1)[0] - - if 'LLVM D compiler' in out: - # LDC seems to require a file - if info.is_windows() or info.is_cygwin(): - # Getting LDC on windows to give useful linker output when - # not doing real work is painfully hard. It ships with a - # version of lld-link, so unless we think the user wants - # link.exe, just assume that we're going to use lld-link - # with it. - linker = self._guess_win_linker( - ['link' if is_msvc else 'lld-link'], - compilers.LLVMDCompiler, for_machine, use_linker_prefix=False) + if 'LLVM D compiler' in out: + # LDC seems to require a file + m = self.machines[for_machine] + if m.is_windows() or m.is_cygwin(): + if is_msvc: + linker = MSVCDynamicLinker(for_machine, version=version) else: - with tempfile.NamedTemporaryFile(suffix='.d') as f: - # LDC writes an object file to the current working directory. - # Clean it up. - objectfile = os.path.basename(f.name)[:-1] + 'o' - linker = self._guess_nix_linker( - exelist, compilers.LLVMDCompiler, for_machine, - extra_args=[f.name]) - try: - os.unlink(objectfile) - except Exception: - # Thank you Windows file system semantics and virus scanners. - pass - return compilers.LLVMDCompiler( - exelist, version, for_machine, info, arch, - full_version=full_version, linker=linker) - elif 'gdc' in out: - linker = self._guess_nix_linker(exelist, compilers.GnuDCompiler, for_machine) - return compilers.GnuDCompiler( - exelist, version, for_machine, info, arch, is_cross, exe_wrap, - full_version=full_version, linker=linker) - elif 'The D Language Foundation' in out or 'Digital Mars' in out: - # DMD seems to require a file - if info.is_windows() or info.is_cygwin(): - if is_msvc: - linker_cmd = ['link'] - elif arch == 'x86': - linker_cmd = ['optlink'] - else: - linker_cmd = ['lld-link'] - linker = self._guess_win_linker(linker_cmd, compilers.DmdDCompiler, for_machine, - use_linker_prefix=False) + # Getting LDC on windows to give useful linker output when not + # doing real work is painfully hard. It ships with a verison of + # lld-link, so just assume that we're going to use lld-link + # with it. + _, o, _ = Popen_safe(['lld-link.exe', '--version']) + linker = ClangClDynamicLinker(for_machine, version=search_version(o)) + else: + with tempfile.NamedTemporaryFile(suffix='.d') as f: + linker = self._guess_nix_linker( + exelist, for_machine, + compilers.LLVMDCompiler.LINKER_PREFIX, + extra_args=[f.name]) + return compilers.LLVMDCompiler(exelist, version, for_machine, arch, full_version=full_version, linker=linker) + elif 'gdc' in out: + linker = self._guess_nix_linker(exelist, for_machine, compilers.GnuDCompiler.LINKER_PREFIX) + return compilers.GnuDCompiler(exelist, version, for_machine, arch, full_version=full_version, linker=linker) + elif 'The D Language Foundation' in out or 'Digital Mars' in out: + # DMD seems to require a file + m = self.machines[for_machine] + if m.is_windows() or m.is_cygwin(): + if is_msvc: + linker = MSVCDynamicLinker(for_machine, version=version) + elif arch == 'x86': + linker = OptlinkDynamicLinker(for_machine, version=full_version) else: - with tempfile.NamedTemporaryFile(suffix='.d') as f: - linker = self._guess_nix_linker( - exelist, compilers.DmdDCompiler, for_machine, - extra_args=[f.name]) - return compilers.DmdDCompiler( - exelist, version, for_machine, info, arch, - full_version=full_version, linker=linker) - raise EnvironmentException('Unknown compiler "' + ' '.join(exelist) + '"') - - self._handle_exceptions(popen_exceptions, compilers) + # DMD ships with lld-link + _, o, _ = Popen_safe(['lld-link.exe', '--version']) + linker = ClangClDynamicLinker(for_machine, version=search_version(o)) + else: + with tempfile.NamedTemporaryFile(suffix='.d') as f: + linker = self._guess_nix_linker( + exelist, for_machine, + compilers.LLVMDCompiler.LINKER_PREFIX, + extra_args=[f.name]) + return compilers.DmdDCompiler(exelist, version, for_machine, arch, full_version=full_version, linker=linker) + raise EnvironmentException('Unknown compiler "' + ' '.join(exelist) + '"') def detect_swift_compiler(self, for_machine): exelist = self.binaries.host.lookup_entry('swift') is_cross = not self.machines.matches_build_machine(for_machine) - info = self.machines[for_machine] if exelist is None: # TODO support fallback exelist = [self.default_swift[0]] @@ -1547,10 +1380,8 @@ # As for 5.0.1 swiftc *requires* a file to check the linker: with tempfile.NamedTemporaryFile(suffix='.swift') as f: linker = self._guess_nix_linker( - exelist, compilers.SwiftCompiler, for_machine, - extra_args=[f.name]) - return compilers.SwiftCompiler( - exelist, version, for_machine, info, is_cross, linker=linker) + exelist, for_machine, compilers.SwiftCompiler.LINKER_PREFIX, extra_args=[f.name]) + return compilers.SwiftCompiler(exelist, version, for_machine, is_cross, linker=linker) raise EnvironmentException('Unknown compiler "' + ' '.join(exelist) + '"') @@ -1619,7 +1450,7 @@ # Intel has it's own linker that acts like microsoft's lib linkers = ['xilib'] elif isinstance(compiler, (PGICCompiler, PGIFortranCompiler)) and mesonlib.is_windows(): - linkers = [['ar']] # For PGI on Windows, "ar" is just a wrapper calling link/lib. + linkers = [self.default_static_linker] # this is just a wrapper calling link/lib on Windows, keeping things simple. else: linkers = defaults popen_exceptions = {} diff -Nru meson-0.53.2/mesonbuild/interpreterbase.py meson-0.52.1/mesonbuild/interpreterbase.py --- meson-0.53.2/mesonbuild/interpreterbase.py 2019-12-29 22:47:27.000000000 +0000 +++ meson-0.52.1/mesonbuild/interpreterbase.py 2019-11-28 17:37:44.000000000 +0000 @@ -243,7 +243,7 @@ return 'Project specifies a minimum meson_version \'{}\' but uses features which were added in newer versions:'.format(tv) def log_usage_warning(self, tv): - mlog.warning('Project targeting \'{}\' but tried to use feature introduced ' + mlog.warning('Project targetting \'{}\' but tried to use feature introduced ' 'in \'{}\': {}'.format(tv, self.feature_version, self.feature_name)) class FeatureDeprecated(FeatureCheckBase): @@ -258,7 +258,7 @@ return 'Deprecated features used:' def log_usage_warning(self, tv): - mlog.deprecation('Project targeting \'{}\' but tried to use feature ' + mlog.deprecation('Project targetting \'{}\' but tried to use feature ' 'deprecated since \'{}\': {}' ''.format(tv, self.feature_version, self.feature_name)) @@ -383,7 +383,7 @@ try: self.ast = mparser.Parser(code, self.subdir).parse() except mesonlib.MesonException as me: - me.file = mesonfile + me.file = environment.build_filename raise me def join_path_strings(self, args): @@ -496,19 +496,7 @@ def evaluate_dictstatement(self, cur): (arguments, kwargs) = self.reduce_arguments(cur.args) assert (not arguments) - result = {} - self.argument_depth += 1 - for key, value in kwargs.items(): - if not isinstance(key, mparser.StringNode): - FeatureNew('Dictionary entry using non literal key', '0.53.0').use(self.subproject) - key = self.evaluate_statement(key) - if not isinstance(key, str): - raise InvalidArguments('Key must be a string') - if key in result: - raise InvalidArguments('Duplicate dictionary key: {}'.format(key)) - result[key] = value - self.argument_depth -= 1 - return result + return kwargs def evaluate_notstatement(self, cur): v = self.evaluate_statement(cur.value) @@ -1033,6 +1021,8 @@ reduced_pos = [self.evaluate_statement(arg) for arg in args.arguments] reduced_kw = {} for key in args.kwargs.keys(): + if not isinstance(key, str): + raise InvalidArguments('Keyword argument name is not a string.') a = args.kwargs[key] reduced_kw[key] = self.evaluate_statement(a) self.argument_depth -= 1 diff -Nru meson-0.53.2/mesonbuild/interpreter.py meson-0.52.1/mesonbuild/interpreter.py --- meson-0.53.2/mesonbuild/interpreter.py 2020-02-25 18:00:46.000000000 +0000 +++ meson-0.52.1/mesonbuild/interpreter.py 2019-11-28 17:37:44.000000000 +0000 @@ -38,10 +38,10 @@ import os, shutil, uuid import re, shlex import subprocess -import collections +from collections import namedtuple from itertools import chain import functools -import typing as T +from typing import Sequence, List, Union, Optional, Dict, Any import importlib @@ -119,18 +119,6 @@ return disabled, required, feature -def extract_search_dirs(kwargs): - search_dirs = mesonlib.stringlistify(kwargs.get('dirs', [])) - search_dirs = [Path(d).expanduser() for d in search_dirs] - for d in search_dirs: - if mesonlib.is_windows() and d.root.startswith('\\'): - # a Unix-path starting with `/` that is not absolute on Windows. - # discard without failing for end-user ease of cross-platform directory arrays - continue - if not d.is_absolute(): - raise InvalidCode('Search directory {} is not an absolute path.'.format(d)) - return list(map(str, search_dirs)) - class TryRunResultHolder(InterpreterObject): def __init__(self, res): super().__init__() @@ -543,7 +531,7 @@ output = res.stdout.strip() if not output: output = res.stderr.strip() - match = re.search(r'([0-9][0-9\.]+)', output) + match = re.search(r'([0-9\.]+)', output) if not match: m = 'Could not find a version number in output of {!r}' raise InterpreterException(m.format(raw_cmd)) @@ -894,10 +882,10 @@ def __getitem__(self, index): return CustomTargetIndexHolder(self.held_object[index]) - def __setitem__(self, index, value): # lgtm[py/unexpected-raise-in-special-method] + def __setitem__(self, index, value): raise InterpreterException('Cannot set a member of a CustomTarget') - def __delitem__(self, index): # lgtm[py/unexpected-raise-in-special-method] + def __delitem__(self, index): raise InterpreterException('Cannot delete a member of a CustomTarget') def outdir_include(self): @@ -914,10 +902,10 @@ return r.format(self.__class__.__name__, h.get_id(), h.command) class Test(InterpreterObject): - def __init__(self, name: str, project: str, suite: T.List[str], exe: build.Executable, - depends: T.List[T.Union[build.CustomTarget, build.BuildTarget]], - is_parallel: bool, cmd_args: T.List[str], env: build.EnvironmentVariables, - should_fail: bool, timeout: int, workdir: T.Optional[str], protocol: str, + def __init__(self, name: str, project: str, suite: List[str], exe: build.Executable, + depends: List[Union[build.CustomTarget, build.BuildTarget]], + is_parallel: bool, cmd_args: List[str], env: build.EnvironmentVariables, + should_fail: bool, timeout: int, workdir: Optional[str], protocol: str, priority: int): InterpreterObject.__init__(self) self.name = name @@ -1007,7 +995,6 @@ self.methods.update({'compiles': self.compiles_method, 'links': self.links_method, 'get_id': self.get_id_method, - 'get_linker_id': self.get_linker_id_method, 'compute_int': self.compute_int_method, 'sizeof': self.sizeof_method, 'get_define': self.get_define_method, @@ -1164,12 +1151,6 @@ @noPosargs @permittedKwargs({}) - @FeatureNew('compiler.get_linker_id', '0.53.0') - def get_linker_id_method(self, args, kwargs): - return self.compiler.get_linker_id() - - @noPosargs - @permittedKwargs({}) def symbols_have_underscore_prefix_method(self, args, kwargs): ''' Check if the compiler prefixes _ (underscore) to global C symbols @@ -1210,7 +1191,7 @@ self.environment, extra_args=extra_args, dependencies=deps) - cached = mlog.blue('(cached)') if cached else '' + cached = '(cached)' if cached else '' if had: hadtxt = mlog.green('YES') else: @@ -1240,7 +1221,7 @@ self.environment, extra_args=extra_args, dependencies=deps) - cached = mlog.blue('(cached)') if cached else '' + cached = '(cached)' if cached else '' if had: hadtxt = mlog.green('YES') else: @@ -1270,7 +1251,7 @@ had, cached = self.compiler.has_function(funcname, prefix, self.environment, extra_args=extra_args, dependencies=deps) - cached = mlog.blue('(cached)') if cached else '' + cached = '(cached)' if cached else '' if had: hadtxt = mlog.green('YES') else: @@ -1297,7 +1278,7 @@ deps, msg = self.determine_dependencies(kwargs) had, cached = self.compiler.has_type(typename, prefix, self.environment, extra_args=extra_args, dependencies=deps) - cached = mlog.blue('(cached)') if cached else '' + cached = '(cached)' if cached else '' if had: hadtxt = mlog.green('YES') else: @@ -1384,7 +1365,7 @@ value, cached = self.compiler.get_define(element, prefix, self.environment, extra_args=extra_args, dependencies=deps) - cached = mlog.blue('(cached)') if cached else '' + cached = '(cached)' if cached else '' mlog.log('Fetching value of define', mlog.bold(element, True), msg, value, cached) return value @@ -1417,7 +1398,7 @@ h = mlog.green('YES') else: h = mlog.red('NO') - cached = mlog.blue('(cached)') if cached else '' + cached = '(cached)' if cached else '' mlog.log('Checking if', mlog.bold(testname, True), msg, 'compiles:', h, cached) return result @@ -1445,7 +1426,7 @@ result, cached = self.compiler.links(code, self.environment, extra_args=extra_args, dependencies=deps) - cached = mlog.blue('(cached)') if cached else '' + cached = '(cached)' if cached else '' if len(testname) > 0: if result: h = mlog.green('YES') @@ -1474,7 +1455,7 @@ haz, cached = self.compiler.check_header(hname, prefix, self.environment, extra_args=extra_args, dependencies=deps) - cached = mlog.blue('(cached)') if cached else '' + cached = '(cached)' if cached else '' if required and not haz: raise InterpreterException('{} header {!r} not usable'.format(self.compiler.get_display_language(), hname)) elif haz: @@ -1502,7 +1483,7 @@ deps, msg = self.determine_dependencies(kwargs) haz, cached = self.compiler.has_header(hname, prefix, self.environment, extra_args=extra_args, dependencies=deps) - cached = mlog.blue('(cached)') if cached else '' + cached = '(cached)' if cached else '' if required and not haz: raise InterpreterException('{} header {!r} not found'.format(self.compiler.get_display_language(), hname)) elif haz: @@ -1537,7 +1518,7 @@ h = mlog.green('YES') else: h = mlog.red('NO') - cached = mlog.blue('(cached)') if cached else '' + cached = '(cached)' if cached else '' mlog.log('Header <{0}> has symbol'.format(hname), mlog.bold(symbol, True), msg, h, cached) return haz @@ -1573,7 +1554,16 @@ if not self.has_header_method([h], has_header_kwargs): return self.notfound_library(libname) - search_dirs = extract_search_dirs(kwargs) + search_dirs = mesonlib.stringlistify(kwargs.get('dirs', [])) + search_dirs = [Path(d).expanduser() for d in search_dirs] + for d in search_dirs: + if mesonlib.is_windows() and d.root.startswith('\\'): + # a Unix-path starting with `/` that is not absolute on Windows. + # discard without failing for end-user ease of cross-platform directory arrays + continue + if not d.is_absolute(): + raise InvalidCode('Search directory {} is not an absolute path.'.format(d)) + search_dirs = list(map(str, search_dirs)) libtype = mesonlib.LibType.PREFER_SHARED if 'static' in kwargs: @@ -1603,7 +1593,7 @@ h = mlog.green('YES') else: h = mlog.red('NO') - cached = mlog.blue('(cached)') if cached else '' + cached = '(cached)' if cached else '' mlog.log( 'Compiler for {} supports arguments {}:'.format( self.compiler.get_display_language(), ' '.join(args)), @@ -1642,7 +1632,7 @@ def has_multi_link_arguments_method(self, args, kwargs): args = mesonlib.stringlistify(args) result, cached = self.compiler.has_multi_link_arguments(args, self.environment) - cached = mlog.blue('(cached)') if cached else '' + cached = '(cached)' if cached else '' if result: h = mlog.green('YES') else: @@ -1680,7 +1670,7 @@ if len(args) != 1: raise InterpreterException('has_func_attribute takes exactly one argument.') result, cached = self.compiler.has_func_attribute(args[0], self.environment) - cached = mlog.blue('(cached)') if cached else '' + cached = '(cached)' if cached else '' h = mlog.green('YES') if result else mlog.red('NO') mlog.log('Compiler for {} supports function attribute {}:'.format(self.compiler.get_display_language(), args[0]), h, cached) return result @@ -1698,8 +1688,8 @@ return self.compiler.get_argument_syntax() -ModuleState = collections.namedtuple('ModuleState', [ - 'source_root', 'build_to_src', 'subproject', 'subdir', 'current_lineno', 'environment', +ModuleState = namedtuple('ModuleState', [ + 'build_to_src', 'subproject', 'subdir', 'current_lineno', 'environment', 'project_name', 'project_version', 'backend', 'targets', 'data', 'headers', 'man', 'global_args', 'project_args', 'build_machine', 'host_machine', 'target_machine', 'current_node']) @@ -1724,7 +1714,6 @@ # because the Build object contains dicts and lists. num_targets = len(self.interpreter.build.targets) state = ModuleState( - source_root = self.interpreter.environment.get_source_dir(), build_to_src=mesonlib.relpath(self.interpreter.environment.get_source_dir(), self.interpreter.environment.get_build_dir()), subproject=self.interpreter.subproject, @@ -1758,50 +1747,6 @@ raise InterpreterException('Extension module altered internal state illegally.') return self.interpreter.module_method_callback(value) - -class Summary: - def __init__(self, project_name, project_version): - self.project_name = project_name - self.project_version = project_version - self.sections = collections.defaultdict(dict) - self.max_key_len = 0 - - def add_section(self, section, values, kwargs): - bool_yn = kwargs.get('bool_yn', False) - if not isinstance(bool_yn, bool): - raise InterpreterException('bool_yn keyword argument must be boolean') - for k, v in values.items(): - if k in self.sections[section]: - raise InterpreterException('Summary section {!r} already have key {!r}'.format(section, k)) - formatted_values = [] - for i in listify(v): - if not isinstance(i, (str, int)): - m = 'Summary value in section {!r}, key {!r}, must be string, integer or boolean' - raise InterpreterException(m.format(section, k)) - if bool_yn and isinstance(i, bool): - formatted_values.append(mlog.green('YES') if i else mlog.red('NO')) - else: - formatted_values.append(i) - if not formatted_values: - formatted_values = [''] - self.sections[section][k] = formatted_values - self.max_key_len = max(self.max_key_len, len(k)) - - def dump(self): - mlog.log(self.project_name, mlog.normal_cyan(self.project_version)) - for section, values in self.sections.items(): - mlog.log('') # newline - if section: - mlog.log(' ', mlog.bold(section)) - for k, v in values.items(): - indent = self.max_key_len - len(k) + 3 - mlog.log(' ' * indent, k + ':', v[0]) - indent = self.max_key_len + 5 - for i in v[1:]: - mlog.log(' ' * indent, i) - mlog.log('') # newline - - class MesonMain(InterpreterObject): def __init__(self, build, interpreter): InterpreterObject.__init__(self) @@ -2064,7 +2009,6 @@ 'build_always_stale', 'console'}, 'dependency': {'default_options', - 'embed', 'fallback', 'language', 'main', @@ -2091,7 +2035,7 @@ 'version', }, 'executable': build.known_exe_kwargs, - 'find_program': {'required', 'native', 'version', 'dirs'}, + 'find_program': {'required', 'native', 'version'}, 'generator': {'arguments', 'output', 'depends', @@ -2130,7 +2074,6 @@ self.coredata = self.environment.get_coredata() self.backend = backend self.subproject = subproject - self.summary = {} if modules is None: self.modules = {} else: @@ -2168,7 +2111,7 @@ # Re-initialize machine descriptions. We can do a better job now because we # have the compilers needed to gain more knowledge, so wipe out old - # inference and start over. + # inferrence and start over. machines = self.build.environment.machines.miss_defaulting() machines.build = environment.detect_machine_info(self.coredata.compilers.build) self.build.environment.machines = machines.default_missing() @@ -2241,7 +2184,6 @@ 'subdir': self.func_subdir, 'subdir_done': self.func_subdir_done, 'subproject': self.func_subproject, - 'summary': self.func_summary, 'shared_library': self.func_shared_lib, 'shared_module': self.func_shared_module, 'static_library': self.func_static_lib, @@ -2320,29 +2262,6 @@ def get_build_def_files(self): return self.build_def_files - def add_build_def_file(self, f): - # Use relative path for files within source directory, and absolute path - # for system files. Skip files within build directory. Also skip not regular - # files (e.g. /dev/stdout) Normalize the path to avoid duplicates, this - # is especially important to convert '/' to '\' on Windows. - if isinstance(f, mesonlib.File): - if f.is_built: - return - f = os.path.normpath(f.relative_name()) - elif os.path.isfile(f) and not f.startswith('/dev'): - srcdir = self.environment.get_source_dir() - builddir = self.environment.get_build_dir() - f = os.path.normpath(f) - rel_path = mesonlib.relpath(f, start=srcdir) - if not rel_path.startswith('..'): - f = rel_path - elif not mesonlib.relpath(f, start=builddir).startswith('..'): - return - else: - return - if f not in self.build_def_files: - self.build_def_files.append(f) - def get_variables(self): return self.variables @@ -2420,24 +2339,14 @@ @noKwargs def func_assert(self, node, args, kwargs): - if len(args) == 1: - FeatureNew('assert function without message argument', '0.53.0').use(self.subproject) - value = args[0] - message = None - elif len(args) == 2: - value, message = args - if not isinstance(message, str): - raise InterpreterException('Assert message not a string.') - else: - raise InterpreterException('Assert takes between one and two arguments') + if len(args) != 2: + raise InterpreterException('Assert takes exactly two arguments') + value, message = args if not isinstance(value, bool): raise InterpreterException('Assert value not bool.') + if not isinstance(message, str): + raise InterpreterException('Assert message not a string.') if not value: - if message is None: - from .ast import AstPrinter - printer = AstPrinter() - node.args.arguments[0].accept(printer) - message = printer.result raise InterpreterException('Assert failed: ' + message) def validate_arguments(self, args, argcount, arg_types): @@ -2472,7 +2381,6 @@ m = 'must be a string, or the output of find_program(), files() '\ 'or configure_file(), or a compiler object; not {!r}' - expanded_args = [] if isinstance(cmd, ExternalProgramHolder): cmd = cmd.held_object if isinstance(cmd, build.Executable): @@ -2480,17 +2388,13 @@ msg = 'Program {!r} was overridden with the compiled executable {!r}'\ ' and therefore cannot be used during configuration' raise InterpreterException(msg.format(progname, cmd.description())) - if not cmd.found(): - raise InterpreterException('command {!r} not found or not executable'.format(cmd)) elif isinstance(cmd, CompilerHolder): - exelist = cmd.compiler.get_exelist() - cmd = exelist[0] + cmd = cmd.compiler.get_exelist()[0] prog = ExternalProgram(cmd, silent=True) if not prog.found(): raise InterpreterException('Program {!r} not found ' 'or not executable'.format(cmd)) cmd = prog - expanded_args = exelist[1:] else: if isinstance(cmd, mesonlib.File): cmd = cmd.absolute_path(srcdir, builddir) @@ -2503,6 +2407,14 @@ raise InterpreterException('Program or command {!r} not found ' 'or not executable'.format(cmd)) cmd = prog + cmd_path = mesonlib.relpath(cmd.get_path(), start=srcdir) + if not cmd_path.startswith('..'): + # On Windows, program on a different drive than srcdir won't have + # an expressible relative path; cmd_path will be absolute instead. + if not os.path.isabs(cmd_path): + if cmd_path not in self.build_def_files: + self.build_def_files.append(cmd_path) + expanded_args = [] for a in listify(cargs): if isinstance(a, str): expanded_args.append(a) @@ -2514,11 +2426,13 @@ raise InterpreterException('Arguments ' + m.format(a)) # If any file that was used as an argument to the command # changes, we must re-run the configuration step. - self.add_build_def_file(cmd.get_path()) for a in expanded_args: if not os.path.isabs(a): a = os.path.join(builddir if in_builddir else srcdir, self.subdir, a) - self.add_build_def_file(a) + if os.path.isfile(a): + a = mesonlib.relpath(a, start=srcdir) + if a not in self.build_def_files: + self.build_def_files.append(a) return RunProcess(cmd, expanded_args, env, srcdir, builddir, self.subdir, self.environment.get_build_command() + ['introspect'], in_builddir=in_builddir, check=check, capture=capture) @@ -2539,18 +2453,15 @@ dirname = args[0] return self.do_subproject(dirname, 'meson', kwargs) - def disabled_subproject(self, dirname, feature=None): - sub = SubprojectHolder(None, self.subproject_dir, dirname) - if feature: - sub.disabled_feature = feature - self.subprojects[dirname] = sub - return sub + def disabled_subproject(self, dirname): + self.subprojects[dirname] = SubprojectHolder(None, self.subproject_dir, dirname) + return self.subprojects[dirname] def do_subproject(self, dirname: str, method: str, kwargs): disabled, required, feature = extract_required_kwarg(kwargs, self.subproject) if disabled: mlog.log('Subproject', mlog.bold(dirname), ':', 'skipped: feature', mlog.bold(feature), 'disabled') - return self.disabled_subproject(dirname, feature) + return self.disabled_subproject(dirname) default_options = mesonlib.stringlistify(kwargs.get('default_options', [])) default_options = coredata.create_options_dict(default_options) @@ -2651,7 +2562,6 @@ self.build_def_files = list(set(self.build_def_files + subi.build_def_files)) self.build.merge(subi.build) self.build.subprojects[dirname] = subi.project_version - self.summary.update(subi.summary) return self.subprojects[dirname] def _do_subproject_cmake(self, dirname, subdir, subdir_abs, default_options, kwargs): @@ -2681,7 +2591,6 @@ f.write(printer.result) mlog.log('Build file:', meson_filename) - mlog.cmd_ci_include(meson_filename) mlog.log() result = self._do_subproject_meson(dirname, subdir, default_options, kwargs, ast, cm_int.bs_files) @@ -2888,48 +2797,6 @@ def message_impl(self, argstr): mlog.log(mlog.bold('Message:'), argstr) - @noArgsFlattening - @permittedKwargs({'section', 'bool_yn'}) - @FeatureNew('summary', '0.53.0') - def func_summary(self, node, args, kwargs): - if len(args) == 1: - if not isinstance(args[0], dict): - raise InterpreterException('Summary first argument must be dictionary.') - values = args[0] - elif len(args) == 2: - if not isinstance(args[0], str): - raise InterpreterException('Summary first argument must be string.') - values = {args[0]: args[1]} - else: - raise InterpreterException('Summary accepts at most 2 arguments.') - section = kwargs.get('section', '') - if not isinstance(section, str): - raise InterpreterException('Summary\'s section keyword argument must be string.') - self.summary_impl(section, values, kwargs) - - def summary_impl(self, section, values, kwargs): - if self.subproject not in self.summary: - self.summary[self.subproject] = Summary(self.active_projectname, self.project_version) - self.summary[self.subproject].add_section(section, values, kwargs) - - def _print_summary(self): - # Add automatic 'Supbrojects' section in main project. - all_subprojects = collections.OrderedDict() - for name, subp in sorted(self.subprojects.items()): - value = subp.found() - if not value and hasattr(subp, 'disabled_feature'): - value = 'Feature {!r} disabled'.format(subp.disabled_feature) - all_subprojects[name] = value - if all_subprojects: - self.summary_impl('Subprojects', all_subprojects, {'bool_yn': True}) - # Print all summaries, main project last. - mlog.log('') # newline - main_summary = self.summary.pop('', None) - for _, summary in sorted(self.summary.items()): - summary.dump() - if main_summary: - main_summary.dump() - @FeatureNew('warning', '0.44.0') @noKwargs def func_warning(self, node, args, kwargs): @@ -2946,7 +2813,7 @@ self.validate_arguments(args, 0, []) raise Exception() - def add_languages(self, args: T.Sequence[str], required: bool) -> bool: + def add_languages(self, args: Sequence[str], required: bool) -> bool: success = self.add_languages_for(args, required, MachineChoice.BUILD) success &= self.add_languages_for(args, required, MachineChoice.HOST) if not self.coredata.is_cross_build(): @@ -2985,7 +2852,7 @@ mlog.bold(' '.join(comp.get_exelist())), comp.get_version_string()) if comp.linker is not None: logger_fun(comp.get_display_language(), 'linker for the', machine_name, 'machine:', - mlog.bold(' '.join(comp.linker.get_exelist())), comp.linker.id, comp.linker.version) + mlog.bold(comp.linker.id), comp.linker.version) self.build.ensure_static_linker(comp) langs = self.coredata.compilers[for_machine].keys() @@ -3009,7 +2876,7 @@ return ExternalProgramHolder(prog) return None - def program_from_system(self, args, search_dirs, silent=False): + def program_from_system(self, args, silent=False): # Search for scripts relative to current subdir. # Do not cache found programs because find_program('foobar') # might give different results when run from different source dirs. @@ -3023,15 +2890,12 @@ search_dir = os.path.join(self.environment.get_source_dir(), exename.subdir) exename = exename.fname - extra_search_dirs = [] elif isinstance(exename, str): search_dir = source_dir - extra_search_dirs = search_dirs else: raise InvalidArguments('find_program only accepts strings and ' 'files, not {!r}'.format(exename)) extprog = dependencies.ExternalProgram(exename, search_dir=search_dir, - extra_search_dirs=extra_search_dirs, silent=silent) progobj = ExternalProgramHolder(extprog) if progobj.found(): @@ -3065,8 +2929,7 @@ # TODO update modules to always pass `for_machine`. It is bad-form to assume # the host machine. - def find_program_impl(self, args, for_machine: MachineChoice = MachineChoice.HOST, - required=True, silent=True, wanted='', search_dirs=None): + def find_program_impl(self, args, for_machine: MachineChoice = MachineChoice.HOST, required=True, silent=True, wanted=''): if not isinstance(args, list): args = [args] @@ -3074,7 +2937,7 @@ if progobj is None: progobj = self.program_from_file_for(for_machine, args, silent=silent) if progobj is None: - progobj = self.program_from_system(args, search_dirs, silent=silent) + progobj = self.program_from_system(args, silent=silent) if progobj is None and args[0].endswith('python3'): prog = dependencies.ExternalProgram('python3', mesonlib.python_command, silent=True) progobj = ExternalProgramHolder(prog) @@ -3097,7 +2960,6 @@ return ExternalProgramHolder(dependencies.NonExistingExternalProgram()) return progobj - @FeatureNewKwargs('find_program', '0.53.0', ['dirs']) @FeatureNewKwargs('find_program', '0.52.0', ['version']) @FeatureNewKwargs('find_program', '0.49.0', ['disabler']) @disablerIfNotFound @@ -3111,12 +2973,11 @@ mlog.log('Program', mlog.bold(' '.join(args)), 'skipped: feature', mlog.bold(feature), 'disabled') return ExternalProgramHolder(dependencies.NonExistingExternalProgram()) - search_dirs = extract_search_dirs(kwargs) + if not isinstance(required, bool): + raise InvalidArguments('"required" argument must be a boolean.') wanted = mesonlib.stringlistify(kwargs.get('version', [])) for_machine = self.machine_from_native_kwarg(kwargs) - return self.find_program_impl(args, for_machine, required=required, - silent=False, wanted=wanted, - search_dirs=search_dirs) + return self.find_program_impl(args, for_machine, required=required, silent=False, wanted=wanted) def func_find_library(self, node, args, kwargs): raise InvalidCode('find_library() is removed, use meson.get_compiler(\'name\').find_library() instead.\n' @@ -3134,25 +2995,22 @@ if cached_dep: if not cached_dep.found(): mlog.log('Dependency', mlog.bold(name), - 'found:', mlog.red('NO'), mlog.blue('(cached)')) + 'found:', mlog.red('NO'), '(cached)') return identifier, cached_dep # Verify the cached dep version match - wanted_vers = mesonlib.stringlistify(kwargs.get('version', [])) - found_vers = cached_dep.get_version() - if not wanted_vers or mesonlib.version_compare_many(found_vers, wanted_vers)[0]: - info = [mlog.blue('(cached)')] - if found_vers: - info = [mlog.normal_cyan(found_vers), *info] + wanted = kwargs.get('version', []) + found = cached_dep.get_version() + if not wanted or mesonlib.version_compare_many(found, wanted)[0]: mlog.log('Dependency', mlog.bold(name), - 'found:', mlog.green('YES'), *info) + 'found:', mlog.green('YES'), '(cached)') return identifier, cached_dep return identifier, None @staticmethod def check_subproject_version(wanted, found): - if not wanted: + if wanted == 'undefined': return True if found == 'undefined' or not mesonlib.version_compare_many(found, wanted)[0]: return False @@ -3175,7 +3033,7 @@ 'not a dependency object.'.format(varname, dirname)) required = kwargs.get('required', True) - wanted = mesonlib.stringlistify(kwargs.get('version', [])) + wanted = kwargs.get('version', 'undefined') subproj_path = os.path.join(self.subproject_dir, dirname) if not dep.found(): @@ -3194,15 +3052,13 @@ 'cached, requested incompatible version {} for ' 'dep {}'.format(found, dirname, wanted, display_name)) - mlog.log('Dependency', mlog.bold(display_name), 'from subproject', - mlog.bold(subproj_path), 'found:', mlog.red('NO'), - 'found', mlog.normal_cyan(found), 'but need:', - mlog.bold(', '.join(["'{}'".format(e) for e in wanted]))) + mlog.log('Subproject', mlog.bold(subproj_path), 'dependency', + mlog.bold(display_name), 'version is', mlog.bold(found), + 'but', mlog.bold(wanted), 'is required.') return self.notfound_dependency() - found = mlog.normal_cyan(found) if found else None mlog.log('Dependency', mlog.bold(display_name), 'from subproject', - mlog.bold(subproj_path), 'found:', mlog.green('YES'), found) + mlog.bold(subproj_path), 'found:', mlog.green('YES')) return dep def _handle_featurenew_dependencies(self, name): @@ -3409,7 +3265,7 @@ if 'input' not in kwargs or 'output' not in kwargs: raise InterpreterException('Keyword arguments input and output must exist') if 'fallback' not in kwargs: - FeatureNew('T.Optional fallback in vcs_tag', '0.41.0').use(self.subproject) + FeatureNew('Optional fallback in vcs_tag', '0.41.0').use(self.subproject) fallback = kwargs.pop('fallback', self.project_version) if not isinstance(fallback, str): raise InterpreterException('Keyword argument fallback must be a string.') @@ -3510,9 +3366,6 @@ command, *cmd_args = cleaned_args tg = RunTargetHolder(build.RunTarget(name, command, cmd_args, cleaned_deps, self.subdir, self.subproject), self) self.add_target(name, tg.held_object) - full_name = (self.subproject, name) - assert(full_name not in self.build.run_target_names) - self.build.run_target_names.add(full_name) return tg @FeatureNew('alias_target', '0.52.0') @@ -3844,7 +3697,6 @@ if isinstance(f, mesonlib.File): inputs_abs.append(f.absolute_path(self.environment.source_dir, self.environment.build_dir)) - self.add_build_def_file(f) else: raise InterpreterException('Inputs can only be strings or file objects') # Validate output @@ -3932,17 +3784,28 @@ df = DepFile(f.readlines()) deps = df.get_all_dependencies(ofile_fname) for dep in deps: - self.add_build_def_file(dep) + if dep not in self.build_def_files: + self.build_def_files.append(dep) elif 'copy' in kwargs: if len(inputs_abs) != 1: raise InterpreterException('Exactly one input file must be given in copy mode') os.makedirs(os.path.join(self.environment.build_dir, self.subdir), exist_ok=True) shutil.copyfile(inputs_abs[0], ofile_abs) - shutil.copystat(inputs_abs[0], ofile_abs) + shutil.copymode(inputs_abs[0], ofile_abs) else: # Not reachable raise AssertionError + # If the input is a source file, add it to the list of files that we + # need to reconfigure on when they change. + for f in chain(inputs, kwargs.get('command', [])): + if isinstance(f, mesonlib.File) and not f.is_built: + # Normalize the path of the conffile (relative to the + # source root) to avoid duplicates. This is especially + # important to convert '/' to '\' on Windows + conffile = os.path.normpath(f.relative_name()) + if conffile not in self.build_def_files: + self.build_def_files.append(conffile) # Install file if requested, we check for the empty string # for backwards compatibility. That was the behaviour before # 0.45.0 so preserve it. @@ -4092,23 +3955,17 @@ optargs = ('-O0', '-O2', '-O3', '-Os', '/O1', '/O2', '/Os') for arg in args: if arg in warnargs: - mlog.warning('Consider using the built-in warning_level option instead of using "{}".'.format(arg), - location=self.current_node) + mlog.warning("Consider using the builtin warning_level option instead of adding warning flags by hand.") elif arg in optargs: - mlog.warning('Consider using the built-in optimization level instead of using "{}".'.format(arg), - location=self.current_node) + mlog.warning('Consider using the builtin optimization level rather than adding flags by hand.') elif arg == '-g': - mlog.warning('Consider using the built-in debug option instead of using "{}".'.format(arg), - location=self.current_node) + mlog.warning('Consider using the builtin debug option rather than adding flags by hand.') elif arg == '-pipe': - mlog.warning("You don't need to add -pipe, Meson will use it automatically when it is available.", - location=self.current_node) + mlog.warning("You don't need to add -pipe, Meson will use it automatically when it is available.") elif arg.startswith('-fsanitize'): - mlog.warning('Consider using the built-in option for sanitizers instead of using "{}".'.format(arg), - location=self.current_node) + mlog.warning('Consider using the builtin option for sanitizers rather than adding flags by hand.') elif arg.startswith('-std=') or arg.startswith('/std:'): - mlog.warning('Consider using the built-in option for language standard version instead of using "{}".'.format(arg), - location=self.current_node) + mlog.warning('Consider using the builtin option for language standard version rather than adding flags by hand.') def add_global_arguments(self, node, argsdict, args, kwargs): if self.is_subproject(): @@ -4170,8 +4027,6 @@ FeatureDeprecated.report(self.subproject) if not self.is_subproject(): self.print_extra_warnings() - if self.subproject == '': - self._print_summary() def print_extra_warnings(self): # TODO cross compilation @@ -4471,7 +4326,7 @@ return varname in self.variables @staticmethod - def machine_from_native_kwarg(kwargs: T.Dict[str, T.Any]) -> MachineChoice: + def machine_from_native_kwarg(kwargs: Dict[str, Any]) -> MachineChoice: native = kwargs.get('native', False) if not isinstance(native, bool): raise InvalidArguments('Argument to "native" must be a boolean.') diff -Nru meson-0.53.2/mesonbuild/linkers.py meson-0.52.1/mesonbuild/linkers.py --- meson-0.53.2/mesonbuild/linkers.py 2020-02-25 18:00:46.000000000 +0000 +++ meson-0.52.1/mesonbuild/linkers.py 2019-11-28 17:37:44.000000000 +0000 @@ -14,18 +14,18 @@ import abc import os -import typing as T +import typing from . import mesonlib -if T.TYPE_CHECKING: +if typing.TYPE_CHECKING: from .coredata import OptionDictType from .environment import Environment class StaticLinker: - def __init__(self, exelist: T.List[str]): + def __init__(self, exelist: typing.List[str]): self.exelist = exelist def can_linker_accept_rsp(self) -> bool: @@ -34,55 +34,55 @@ """ return mesonlib.is_windows() - def get_base_link_args(self, options: 'OptionDictType') -> T.List[str]: + def get_base_link_args(self, options: 'OptionDictType') -> typing.List[str]: """Like compilers.get_base_link_args, but for the static linker.""" return [] - def get_exelist(self) -> T.List[str]: + def get_exelist(self) -> typing.List[str]: return self.exelist.copy() - def get_std_link_args(self) -> T.List[str]: + def get_std_link_args(self) -> typing.List[str]: return [] - def get_buildtype_linker_args(self, buildtype: str) -> T.List[str]: + def get_buildtype_linker_args(self, buildtype: str) -> typing.List[str]: return [] - def get_output_args(self, target: str) -> T.List[str]: + def get_output_args(self, target: str) -> typing.List[str]: return[] - def get_coverage_link_args(self) -> T.List[str]: + def get_coverage_link_args(self) -> typing.List[str]: return [] def build_rpath_args(self, env: 'Environment', build_dir: str, from_dir: str, rpath_paths: str, build_rpath: str, - install_rpath: str) -> T.List[str]: + install_rpath: str) -> typing.List[str]: return [] - def thread_link_flags(self, env: 'Environment') -> T.List[str]: + def thread_link_flags(self, env: 'Environment') -> typing.List[str]: return [] - def openmp_flags(self) -> T.List[str]: + def openmp_flags(self) -> typing.List[str]: return [] - def get_option_link_args(self, options: 'OptionDictType') -> T.List[str]: + def get_option_link_args(self, options: 'OptionDictType') -> typing.List[str]: return [] @classmethod - def unix_args_to_native(cls, args: T.List[str]) -> T.List[str]: + def unix_args_to_native(cls, args: typing.List[str]) -> typing.List[str]: return args[:] @classmethod - def native_args_to_unix(cls, args: T.List[str]) -> T.List[str]: + def native_args_to_unix(cls, args: typing.List[str]) -> typing.List[str]: return args[:] - def get_link_debugfile_args(self, targetfile: str) -> T.List[str]: + def get_link_debugfile_args(self, targetfile: str) -> typing.List[str]: # Static libraries do not have PDB files return [] - def get_always_args(self) -> T.List[str]: + def get_always_args(self) -> typing.List[str]: return [] - def get_linker_always_args(self) -> T.List[str]: + def get_linker_always_args(self) -> typing.List[str]: return [] @@ -92,26 +92,26 @@ def __init__(self, machine: str): self.machine = machine - def get_always_args(self) -> T.List[str]: + def get_always_args(self) -> typing.List[str]: return self.always_args.copy() - def get_linker_always_args(self) -> T.List[str]: + def get_linker_always_args(self) -> typing.List[str]: return self.always_args.copy() - def get_output_args(self, target: str) -> T.List[str]: - args = [] # type: T.List[str] + def get_output_args(self, target: str) -> typing.List[str]: + args = [] # type: typing.List[str] if self.machine: args += ['/MACHINE:' + self.machine] args += ['/OUT:' + target] return args @classmethod - def unix_args_to_native(cls, args: T.List[str]) -> T.List[str]: + def unix_args_to_native(cls, args: typing.List[str]) -> typing.List[str]: from .compilers import VisualStudioCCompiler return VisualStudioCCompiler.unix_args_to_native(args) @classmethod - def native_args_to_unix(cls, args: T.List[str]) -> T.List[str]: + def native_args_to_unix(cls, args: typing.List[str]) -> typing.List[str]: from .compilers import VisualStudioCCompiler return VisualStudioCCompiler.native_args_to_unix(args) @@ -120,7 +120,7 @@ """Microsoft's lib static linker.""" - def __init__(self, exelist: T.List[str], machine: str): + def __init__(self, exelist: typing.List[str], machine: str): StaticLinker.__init__(self, exelist) VisualStudioLikeLinker.__init__(self, machine) @@ -129,14 +129,14 @@ """Intel's xilib static linker.""" - def __init__(self, exelist: T.List[str], machine: str): + def __init__(self, exelist: typing.List[str], machine: str): StaticLinker.__init__(self, exelist) VisualStudioLikeLinker.__init__(self, machine) class ArLinker(StaticLinker): - def __init__(self, exelist: T.List[str]): + def __init__(self, exelist: typing.List[str]): super().__init__(exelist) self.id = 'ar' pc, stdo = mesonlib.Popen_safe(self.exelist + ['-h'])[0:2] @@ -146,38 +146,38 @@ else: self.std_args = ['csr'] - def get_std_link_args(self) -> T.List[str]: + def get_std_link_args(self) -> typing.List[str]: return self.std_args - def get_output_args(self, target: str) -> T.List[str]: + def get_output_args(self, target: str) -> typing.List[str]: return [target] -class ArmarLinker(ArLinker): # lgtm [py/missing-call-to-init] +class ArmarLinker(ArLinker): - def __init__(self, exelist: T.List[str]): + def __init__(self, exelist: typing.List[str]): StaticLinker.__init__(self, exelist) self.id = 'armar' self.std_args = ['-csr'] def can_linker_accept_rsp(self) -> bool: - # armar can't accept arguments using the @rsp syntax + # armar cann't accept arguments using the @rsp syntax return False class DLinker(StaticLinker): - def __init__(self, exelist: T.List[str], arch: str): + def __init__(self, exelist: typing.List[str], arch: str): super().__init__(exelist) self.id = exelist[0] self.arch = arch - def get_std_link_args(self) -> T.List[str]: + def get_std_link_args(self) -> typing.List[str]: return ['-lib'] - def get_output_args(self, target: str) -> T.List[str]: + def get_output_args(self, target: str) -> typing.List[str]: return ['-of=' + target] - def get_linker_always_args(self) -> T.List[str]: + def get_linker_always_args(self) -> typing.List[str]: if mesonlib.is_windows(): if self.arch == 'x86_64': return ['-m64'] @@ -189,21 +189,21 @@ class CcrxLinker(StaticLinker): - def __init__(self, exelist: T.List[str]): + def __init__(self, exelist: typing.List[str]): super().__init__(exelist) self.id = 'rlink' def can_linker_accept_rsp(self) -> bool: return False - def get_output_args(self, target: str) -> T.List[str]: + def get_output_args(self, target: str) -> typing.List[str]: return ['-output=%s' % target] - def get_linker_always_args(self) -> T.List[str]: + def get_linker_always_args(self) -> typing.List[str]: return ['-nologo', '-form=library'] -def prepare_rpaths(raw_rpaths: str, build_dir: str, from_dir: str) -> T.List[str]: +def prepare_rpaths(raw_rpaths: str, build_dir: str, from_dir: str) -> typing.List[str]: # The rpaths we write must be relative if they point to the build dir, # because otherwise they have different length depending on the build # directory. This breaks reproducible builds. @@ -212,7 +212,7 @@ return ordered_rpaths -def order_rpaths(rpath_list: T.List[str]) -> T.List[str]: +def order_rpaths(rpath_list: typing.List[str]) -> typing.List[str]: # We want rpaths that point inside our build dir to always override # those pointing to other places in the file system. This is so built # binaries prefer our libraries to the ones that may lie somewhere @@ -244,28 +244,20 @@ 'release': [], 'minsize': [], 'custom': [], - } # type: T.Dict[str, T.List[str]] + } # type: typing.Dict[str, typing.List[str]] - def _apply_prefix(self, arg: T.Union[str, T.List[str]]) -> T.List[str]: - args = [arg] if isinstance(arg, str) else arg - if self.prefix_arg is None: - return args - elif isinstance(self.prefix_arg, str): - return [self.prefix_arg + arg for arg in args] - ret = [] - for arg in args: - ret += self.prefix_arg + [arg] - return ret - - def __init__(self, id_: str, exelist: T.List[str], - for_machine: mesonlib.MachineChoice, prefix_arg: T.Union[str, T.List[str]], - always_args: T.List[str], *, version: str = 'unknown version'): + def _apply_prefix(self, arg: str) -> typing.List[str]: + if isinstance(self.prefix_arg, str): + return [self.prefix_arg + arg] + return self.prefix_arg + [arg] + + def __init__(self, exelist: typing.List[str], for_machine: mesonlib.MachineChoice, + id_: str, prefix_arg: str, *, version: str = 'unknown version'): self.exelist = exelist self.for_machine = for_machine self.version = version self.id = id_ self.prefix_arg = prefix_arg - self.always_args = always_args def __repr__(self) -> str: return '<{}: v{} `{}`>'.format(type(self).__name__, self.version, ' '.join(self.exelist)) @@ -276,36 +268,35 @@ def get_version_string(self) -> str: return '({} {})'.format(self.id, self.version) - def get_exelist(self) -> T.List[str]: + def get_exelist(self) -> typing.List[str]: return self.exelist.copy() def get_accepts_rsp(self) -> bool: - # rsp files are only used when building on Windows because we want to - # avoid issues with quoting and max argument length + # TODO: is it really a matter of is_windows or is it for_windows? return mesonlib.is_windows() - def get_always_args(self) -> T.List[str]: - return self.always_args.copy() + def get_always_args(self) -> typing.List[str]: + return [] def get_lib_prefix(self) -> str: return '' # XXX: is use_ldflags a compiler or a linker attribute? - def get_args_from_envvars(self) -> T.List[str]: + def get_args_from_envvars(self) -> typing.List[str]: flags = os.environ.get('LDFLAGS') if not flags: return [] return mesonlib.split_args(flags) - def get_option_args(self, options: 'OptionDictType') -> T.List[str]: + def get_option_args(self, options: 'OptionDictType') -> typing.List[str]: return [] - def has_multi_arguments(self, args: T.List[str], env: 'Environment') -> T.Tuple[bool, bool]: + def has_multi_arguments(self, args: typing.List[str], env: 'Environment') -> typing.Tuple[bool, bool]: m = 'Language {} does not support has_multi_link_arguments.' raise mesonlib.EnvironmentException(m.format(self.id)) - def get_debugfile_args(self, targetfile: str) -> T.List[str]: + def get_debugfile_args(self, targetfile: str) -> typing.List[str]: """Some compilers (MSVC) write debug into a separate file. This method takes the target object path and returns a list of @@ -314,67 +305,71 @@ """ return [] - def get_std_shared_lib_args(self) -> T.List[str]: + def get_std_shared_lib_args(self) -> typing.List[str]: return [] - def get_std_shared_module_args(self, options: 'OptionDictType') -> T.List[str]: + def get_std_shared_module_args(self, options: 'OptionDictType') -> typing.List[str]: return self.get_std_shared_lib_args() - def get_pie_args(self) -> T.List[str]: + def get_pie_args(self) -> typing.List[str]: # TODO: this really needs to take a boolean and return the args to # disable pie, otherwise it only acts to enable pie if pie *isn't* the # default. m = 'Linker {} does not support position-independent executable' raise mesonlib.EnvironmentException(m.format(self.id)) - def get_lto_args(self) -> T.List[str]: + def get_lto_args(self) -> typing.List[str]: return [] - def sanitizer_args(self, value: str) -> T.List[str]: + def sanitizer_args(self, value: str) -> typing.List[str]: return [] - def get_buildtype_args(self, buildtype: str) -> T.List[str]: + def get_buildtype_args(self, buildtype: str) -> typing.List[str]: # We can override these in children by just overriding the # _BUILDTYPE_ARGS value. return self._BUILDTYPE_ARGS[buildtype] - def get_asneeded_args(self) -> T.List[str]: + def get_asneeded_args(self) -> typing.List[str]: return [] - def get_link_whole_for(self, args: T.List[str]) -> T.List[str]: + def get_link_whole_for(self, args: typing.List[str]) -> typing.List[str]: raise mesonlib.EnvironmentException( 'Linker {} does not support link_whole'.format(self.id)) - def get_allow_undefined_args(self) -> T.List[str]: + def get_allow_undefined_args(self) -> typing.List[str]: raise mesonlib.EnvironmentException( 'Linker {} does not support allow undefined'.format(self.id)) + def invoked_by_compiler(self) -> bool: + """True if meson uses the compiler to invoke the linker.""" + return True + @abc.abstractmethod - def get_output_args(self, outname: str) -> T.List[str]: + def get_output_args(self, outname: str) -> typing.List[str]: pass - def get_coverage_args(self) -> T.List[str]: + def get_coverage_args(self) -> typing.List[str]: m = "Linker {} doesn't implement coverage data generation.".format(self.id) raise mesonlib.EnvironmentException(m) @abc.abstractmethod - def get_search_args(self, dirname: str) -> T.List[str]: + def get_search_args(self, dirname: str) -> typing.List[str]: pass - def export_dynamic_args(self, env: 'Environment') -> T.List[str]: + def export_dynamic_args(self, env: 'Environment') -> typing.List[str]: return [] - def import_library_args(self, implibname: str) -> T.List[str]: + def import_library_args(self, implibname: str) -> typing.List[str]: """The name of the outputted import library. This implementation is used only on Windows by compilers that use GNU ld """ return [] - def thread_flags(self, env: 'Environment') -> T.List[str]: + def thread_flags(self, env: 'Environment') -> typing.List[str]: return [] - def no_undefined_args(self) -> T.List[str]: + def no_undefined_args(self) -> typing.List[str]: """Arguments to error if there are any undefined symbols at link time. This is the inverse of get_allow_undefined_args(). @@ -385,24 +380,19 @@ """ return [] - def fatal_warnings(self) -> T.List[str]: + def fatal_warnings(self) -> typing.List[str]: """Arguments to make all warnings errors.""" return [] - def bitcode_args(self) -> T.List[str]: + def bitcode_args(self) -> typing.List[str]: raise mesonlib.MesonException('This linker does not support bitcode bundles') - def get_debug_crt_args(self) -> T.List[str]: + def get_debug_crt_args(self) -> typing.List[str]: return [] def build_rpath_args(self, env: 'Environment', build_dir: str, from_dir: str, rpath_paths: str, build_rpath: str, - install_rpath: str) -> T.List[str]: - return [] - - def get_soname_args(self, env: 'Environment', prefix: str, shlib_name: str, - suffix: str, soversion: str, darwin_versions: T.Tuple[str, str], - is_shared_module: bool) -> T.List[str]: + install_rpath: str) -> typing.List[str]: return [] @@ -415,13 +405,13 @@ GNU-like that it makes sense to split this out. """ - def get_output_args(self, outname: str) -> T.List[str]: + def get_output_args(self, outname: str) -> typing.List[str]: return ['-o', outname] - def get_std_shared_lib_args(self) -> T.List[str]: + def get_std_shared_lib_args(self) -> typing.List[str]: return ['-shared'] - def get_search_args(self, dirname: str) -> T.List[str]: + def get_search_args(self, dirname: str) -> typing.List[str]: return ['-L' + dirname] @@ -429,8 +419,8 @@ """Mixin class for dynamic linkers that provides gnu-like interface. - This acts as a base for the GNU linkers (bfd and gold), LLVM's lld, and - other linkers like GNU-ld. + This acts as a base for the GNU linkers (bfd and gold), the Intel Xild + (which comes with ICC), LLVM's lld, and other linkers like GNU-ld. """ _BUILDTYPE_ARGS = { @@ -440,61 +430,65 @@ 'release': ['-O1'], 'minsize': [], 'custom': [], - } # type: T.Dict[str, T.List[str]] + } # type: typing.Dict[str, typing.List[str]] - def get_buildtype_args(self, buildtype: str) -> T.List[str]: + def get_buildtype_args(self, buildtype: str) -> typing.List[str]: # We can override these in children by just overriding the # _BUILDTYPE_ARGS value. return mesonlib.listify([self._apply_prefix(a) for a in self._BUILDTYPE_ARGS[buildtype]]) - def get_pie_args(self) -> T.List[str]: + def get_pie_args(self) -> typing.List[str]: return ['-pie'] - def get_asneeded_args(self) -> T.List[str]: + def get_asneeded_args(self) -> typing.List[str]: return self._apply_prefix('--as-needed') - def get_link_whole_for(self, args: T.List[str]) -> T.List[str]: + def get_link_whole_for(self, args: typing.List[str]) -> typing.List[str]: if not args: return args return self._apply_prefix('--whole-archive') + args + self._apply_prefix('--no-whole-archive') - def get_allow_undefined_args(self) -> T.List[str]: + def get_allow_undefined_args(self) -> typing.List[str]: return self._apply_prefix('--allow-shlib-undefined') - def get_lto_args(self) -> T.List[str]: + def get_lto_args(self) -> typing.List[str]: return ['-flto'] - def sanitizer_args(self, value: str) -> T.List[str]: + def sanitizer_args(self, value: str) -> typing.List[str]: if value == 'none': return [] return ['-fsanitize=' + value] - def get_coverage_args(self) -> T.List[str]: + def invoked_by_compiler(self) -> bool: + """True if meson uses the compiler to invoke the linker.""" + return True + + def get_coverage_args(self) -> typing.List[str]: return ['--coverage'] - def export_dynamic_args(self, env: 'Environment') -> T.List[str]: + def export_dynamic_args(self, env: 'Environment') -> typing.List[str]: m = env.machines[self.for_machine] if m.is_windows() or m.is_cygwin(): return self._apply_prefix('--export-all-symbols') return self._apply_prefix('-export-dynamic') - def import_library_args(self, implibname: str) -> T.List[str]: + def import_library_args(self, implibname: str) -> typing.List[str]: return self._apply_prefix('--out-implib=' + implibname) - def thread_flags(self, env: 'Environment') -> T.List[str]: + def thread_flags(self, env: 'Environment') -> typing.List[str]: if env.machines[self.for_machine].is_haiku(): return [] return ['-pthread'] - def no_undefined_args(self) -> T.List[str]: + def no_undefined_args(self) -> typing.List[str]: return self._apply_prefix('--no-undefined') - def fatal_warnings(self) -> T.List[str]: + def fatal_warnings(self) -> typing.List[str]: return self._apply_prefix('--fatal-warnings') def get_soname_args(self, env: 'Environment', prefix: str, shlib_name: str, - suffix: str, soversion: str, darwin_versions: T.Tuple[str, str], - is_shared_module: bool) -> T.List[str]: + suffix: str, soversion: str, darwin_versions: typing.Tuple[str, str], + is_shared_module: bool) -> typing.List[str]: m = env.machines[self.for_machine] if m.is_windows() or m.is_cygwin(): # For PE/COFF the soname argument has no effect @@ -504,7 +498,7 @@ def build_rpath_args(self, env: 'Environment', build_dir: str, from_dir: str, rpath_paths: str, build_rpath: str, - install_rpath: str) -> T.List[str]: + install_rpath: str) -> typing.List[str]: m = env.machines[self.for_machine] if m.is_windows() or m.is_cygwin(): return [] @@ -570,51 +564,37 @@ """Apple's ld implementation.""" - def __init__(self, *args, **kwargs): - super().__init__('ld64', *args, **kwargs) - - def get_asneeded_args(self) -> T.List[str]: + def get_asneeded_args(self) -> typing.List[str]: return self._apply_prefix('-dead_strip_dylibs') - def get_allow_undefined_args(self) -> T.List[str]: + def get_allow_undefined_args(self) -> typing.List[str]: return self._apply_prefix('-undefined,dynamic_lookup') - def get_std_shared_module_args(self, options: 'OptionDictType') -> T.List[str]: + def get_std_shared_module_args(self, options: 'OptionDictType') -> typing.List[str]: return ['-bundle'] + self._apply_prefix('-undefined,dynamic_lookup') - def get_pie_args(self) -> T.List[str]: - return ['-pie'] - - def get_link_whole_for(self, args: T.List[str]) -> T.List[str]: - result = [] # type: T.List[str] + def get_link_whole_for(self, args: typing.List[str]) -> typing.List[str]: + result = [] # type: typing.List[str] for a in args: result.extend(self._apply_prefix('-force_load')) result.append(a) return result - def get_coverage_args(self) -> T.List[str]: - return ['--coverage'] - - def sanitizer_args(self, value: str) -> T.List[str]: - if value == 'none': - return [] - return ['-fsanitize=' + value] - - def no_undefined_args(self) -> T.List[str]: + def no_undefined_args(self) -> typing.List[str]: return self._apply_prefix('-undefined,error') - def get_always_args(self) -> T.List[str]: - return self._apply_prefix('-headerpad_max_install_names') + super().get_always_args() + def get_always_args(self) -> typing.List[str]: + return self._apply_prefix('-headerpad_max_install_names') - def bitcode_args(self) -> T.List[str]: + def bitcode_args(self) -> typing.List[str]: return self._apply_prefix('-bitcode_bundle') - def fatal_warnings(self) -> T.List[str]: + def fatal_warnings(self) -> typing.List[str]: return self._apply_prefix('-fatal_warnings') def get_soname_args(self, env: 'Environment', prefix: str, shlib_name: str, - suffix: str, soversion: str, darwin_versions: T.Tuple[str, str], - is_shared_module: bool) -> T.List[str]: + suffix: str, soversion: str, darwin_versions: typing.Tuple[str, str], + is_shared_module: bool) -> typing.List[str]: if is_shared_module: return [] install_name = ['@rpath/', prefix, shlib_name] @@ -629,7 +609,7 @@ def build_rpath_args(self, env: 'Environment', build_dir: str, from_dir: str, rpath_paths: str, build_rpath: str, - install_rpath: str) -> T.List[str]: + install_rpath: str) -> typing.List[str]: if not rpath_paths and not install_rpath and not build_rpath: return [] # Ensure that there is enough space for install_name_tool in-place @@ -652,29 +632,37 @@ """Representation of GNU ld.bfd and ld.gold.""" + pass -class GnuGoldDynamicLinker(GnuDynamicLinker): - def __init__(self, *args, **kwargs): - super().__init__('ld.gold', *args, **kwargs) +class LLVMDynamicLinker(GnuLikeDynamicLinkerMixin, PosixDynamicLinkerMixin, DynamicLinker): + """Representation of LLVM's lld (not lld-link) linker. -class GnuBFDDynamicLinker(GnuDynamicLinker): + This is only the posix-like linker. + """ - def __init__(self, *args, **kwargs): - super().__init__('ld.bfd', *args, **kwargs) + pass -class LLVMDynamicLinker(GnuLikeDynamicLinkerMixin, PosixDynamicLinkerMixin, DynamicLinker): +class XildLinuxDynamicLinker(GnuLikeDynamicLinkerMixin, PosixDynamicLinkerMixin, DynamicLinker): + + """Representation of Intel's Xild linker. + + This is only the linux-like linker which dispatches to Gnu ld. + """ + + pass + - """Representation of LLVM's ld.lld linker. +class XildAppleDynamicLinker(AppleDynamicLinker): - This is only the gnu-like linker, not the apple like or link.exe like - linkers. + """Representation of Intel's Xild linker. + + This is the apple linker, which dispatches to Apple's ld. """ - def __init__(self, *args, **kwargs): - super().__init__('ld.lld', *args, **kwargs) + pass class CcrxDynamicLinker(DynamicLinker): @@ -683,7 +671,7 @@ def __init__(self, for_machine: mesonlib.MachineChoice, *, version: str = 'unknown version'): - super().__init__('rlink', ['rlink.exe'], for_machine, '', [], + super().__init__(['rlink.exe'], for_machine, 'rlink', '', version=version) def get_accepts_rsp(self) -> bool: @@ -692,21 +680,21 @@ def get_lib_prefix(self) -> str: return '-lib=' - def get_std_shared_lib_args(self) -> T.List[str]: + def get_std_shared_lib_args(self) -> typing.List[str]: return [] - def get_output_args(self, outputname: str) -> T.List[str]: + def get_output_args(self, outputname: str) -> typing.List[str]: return ['-output=%s' % outputname] - def get_search_args(self, dirname: str) -> 'T.NoReturn': + def get_search_args(self, dirname: str) -> 'typing.NoReturn': raise EnvironmentError('rlink.exe does not have a search dir argument') - def get_allow_undefined_args(self) -> T.List[str]: + def get_allow_undefined_args(self) -> typing.List[str]: return [] def get_soname_args(self, env: 'Environment', prefix: str, shlib_name: str, - suffix: str, soversion: str, darwin_versions: T.Tuple[str, str], - is_shared_module: bool) -> T.List[str]: + suffix: str, soversion: str, darwin_versions: typing.Tuple[str, str], + is_shared_module: bool) -> typing.List[str]: return [] @@ -716,16 +704,16 @@ def __init__(self, for_machine: mesonlib.MachineChoice, *, version: str = 'unknown version'): - super().__init__('armlink', ['armlink'], for_machine, '', [], + super().__init__(['armlink'], for_machine, 'armlink', '', version=version) def get_accepts_rsp(self) -> bool: return False - def get_std_shared_lib_args(self) -> 'T.NoReturn': + def get_std_shared_lib_args(self) -> 'typing.NoReturn': raise mesonlib.MesonException('The Arm Linkers do not support shared libraries') - def get_allow_undefined_args(self) -> T.List[str]: + def get_allow_undefined_args(self) -> typing.List[str]: return [] @@ -737,10 +725,10 @@ extends a few things as needed. """ - def export_dynamic_args(self, env: 'Environment') -> T.List[str]: + def export_dynamic_args(self, env: 'Environment') -> typing.List[str]: return ['--export_dynamic'] - def import_library_args(self, implibname: str) -> T.List[str]: + def import_library_args(self, implibname: str) -> typing.List[str]: return ['--symdefs=' + implibname] @@ -748,18 +736,15 @@ """PGI linker.""" - def __init__(self, *args, **kwargs): - super().__init__('pgi', *args, **kwargs) - - def get_allow_undefined_args(self) -> T.List[str]: + def get_allow_undefined_args(self) -> typing.List[str]: return [] def get_soname_args(self, env: 'Environment', prefix: str, shlib_name: str, - suffix: str, soversion: str, darwin_versions: T.Tuple[str, str], - is_shared_module: bool) -> T.List[str]: + suffix: str, soversion: str, darwin_versions: typing.Tuple[str, str], + is_shared_module: bool) -> typing.List[str]: return [] - def get_std_shared_lib_args(self) -> T.List[str]: + def get_std_shared_lib_args(self) -> typing.List[str]: # PGI -shared is Linux only. if mesonlib.is_windows(): return ['-Bdynamic', '-Mmakedll'] @@ -769,25 +754,24 @@ def build_rpath_args(self, env: 'Environment', build_dir: str, from_dir: str, rpath_paths: str, build_rpath: str, - install_rpath: str) -> T.List[str]: + install_rpath: str) -> typing.List[str]: if not env.machines[self.for_machine].is_windows(): return ['-R' + os.path.join(build_dir, p) for p in rpath_paths] return [] class PGIStaticLinker(StaticLinker): - def __init__(self, exelist: T.List[str]): + def __init__(self, exelist: typing.List[str]): super().__init__(exelist) self.id = 'ar' self.std_args = ['-r'] - def get_std_link_args(self) -> T.List[str]: + def get_std_link_args(self) -> typing.List[str]: return self.std_args - def get_output_args(self, target: str) -> T.List[str]: + def get_output_args(self, target: str) -> typing.List[str]: return [target] - class VisualStudioLikeLinkerMixin: _BUILDTYPE_ARGS = { @@ -799,19 +783,17 @@ 'release': ['/OPT:REF'], 'minsize': ['/INCREMENTAL:NO', '/OPT:REF'], 'custom': [], - } # type: T.Dict[str, T.List[str]] + } # type: typing.Dict[str, typing.List[str]] def __init__(self, *args, direct: bool = True, machine: str = 'x86', **kwargs): super().__init__(*args, **kwargs) + self.direct = direct self.machine = machine - def get_buildtype_args(self, buildtype: str) -> T.List[str]: - return mesonlib.listify([self._apply_prefix(a) for a in self._BUILDTYPE_ARGS[buildtype]]) - def invoked_by_compiler(self) -> bool: - return not self.direct + return self.direct - def get_debug_crt_args(self) -> T.List[str]: + def get_debug_crt_args(self) -> typing.List[str]: """Arguments needed to select a debug crt for the linker. Sometimes we need to manually select the CRT (C runtime) to use with @@ -821,37 +803,38 @@ """ return self._apply_prefix('/MDd') - def get_output_args(self, outputname: str) -> T.List[str]: - return self._apply_prefix(['/MACHINE:' + self.machine, '/OUT:' + outputname]) + def get_output_args(self, outputname: str) -> typing.List[str]: + return self._apply_prefix('/MACHINE:' + self.machine) + self._apply_prefix('/OUT:' + outputname) - def get_always_args(self) -> T.List[str]: - return self._apply_prefix('/nologo') + super().get_always_args() + def get_always_args(self) -> typing.List[str]: + return self._apply_prefix('/nologo') - def get_search_args(self, dirname: str) -> T.List[str]: + def get_search_args(self, dirname: str) -> typing.List[str]: return self._apply_prefix('/LIBPATH:' + dirname) - def get_std_shared_lib_args(self) -> T.List[str]: + def get_std_shared_lib_args(self) -> typing.List[str]: return self._apply_prefix('/DLL') - def get_debugfile_args(self, targetfile: str) -> T.List[str]: + def get_debugfile_args(self, targetfile: str) -> typing.List[str]: pdbarr = targetfile.split('.')[:-1] pdbarr += ['pdb'] - return self._apply_prefix(['/DEBUG', '/PDB:' + '.'.join(pdbarr)]) + return self._apply_prefix('/DEBUG') + self._apply_prefix('/PDB:' + '.'.join(pdbarr)) - def get_link_whole_for(self, args: T.List[str]) -> T.List[str]: + def get_link_whole_for(self, args: typing.List[str]) -> typing.List[str]: # Only since VS2015 args = mesonlib.listify(args) - l = [] # T.List[str] + l = [] # typing.List[str] for a in args: l.extend(self._apply_prefix('/WHOLEARCHIVE:' + a)) return l - def get_allow_undefined_args(self) -> T.List[str]: - return [] + def get_allow_undefined_args(self) -> typing.List[str]: + # link.exe + return self._apply_prefix('/FORCE:UNRESOLVED') def get_soname_args(self, env: 'Environment', prefix: str, shlib_name: str, - suffix: str, soversion: str, darwin_versions: T.Tuple[str, str], - is_shared_module: bool) -> T.List[str]: + suffix: str, soversion: str, darwin_versions: typing.Tuple[str, str], + is_shared_module: bool) -> typing.List[str]: return [] @@ -859,64 +842,56 @@ """Microsoft's Link.exe.""" - def __init__(self, for_machine: mesonlib.MachineChoice, always_args: T.List[str], *, - exelist: T.Optional[T.List[str]] = None, - prefix: T.Union[str, T.List[str]] = '', - machine: str = 'x86', version: str = 'unknown version', - direct: bool = True): - super().__init__('link', exelist or ['link.exe'], for_machine, - prefix, always_args, machine=machine, version=version, direct=direct) - - def get_always_args(self) -> T.List[str]: - return self._apply_prefix(['/nologo', '/release']) + super().get_always_args() + def __init__(self, for_machine: mesonlib.MachineChoice, *, + exelist: typing.Optional[typing.List[str]] = None, + prefix: typing.Union[str, typing.List[str]] = '', + machine: str = 'x86', version: str = 'unknown version'): + super().__init__(exelist or ['link.exe'], for_machine, 'link', + prefix, machine=machine, version=version) class ClangClDynamicLinker(VisualStudioLikeLinkerMixin, DynamicLinker): """Clang's lld-link.exe.""" - def __init__(self, for_machine: mesonlib.MachineChoice, always_args: T.List[str], *, - exelist: T.Optional[T.List[str]] = None, - prefix: T.Union[str, T.List[str]] = '', - machine: str = 'x86', version: str = 'unknown version', - direct: bool = True): - super().__init__('lld-link', exelist or ['lld-link.exe'], for_machine, - prefix, always_args, machine=machine, version=version, direct=direct) + def __init__(self, for_machine: mesonlib.MachineChoice, *, + exelist: typing.Optional[typing.List[str]] = None, + prefix: typing.Union[str, typing.List[str]] = '', + version: str = 'unknown version'): + super().__init__(exelist or ['lld-link.exe'], for_machine, + 'lld-link', prefix, version=version) class XilinkDynamicLinker(VisualStudioLikeLinkerMixin, DynamicLinker): """Intel's Xilink.exe.""" - def __init__(self, for_machine: mesonlib.MachineChoice, always_args: T.List[str], + def __init__(self, for_machine: mesonlib.MachineChoice, *, version: str = 'unknown version'): - super().__init__('xilink', ['xilink.exe'], for_machine, '', always_args, version=version) + super().__init__(['xilink.exe'], for_machine, 'xilink', '', version=version) class SolarisDynamicLinker(PosixDynamicLinkerMixin, DynamicLinker): """Sys-V derived linker used on Solaris and OpenSolaris.""" - def __init__(self, *args, **kwargs): - super().__init__('ld.solaris', *args, **kwargs) - - def get_link_whole_for(self, args: T.List[str]) -> T.List[str]: + def get_link_whole_for(self, args: typing.List[str]) -> typing.List[str]: if not args: return args return self._apply_prefix('--whole-archive') + args + self._apply_prefix('--no-whole-archive') - def no_undefined_args(self) -> T.List[str]: + def no_undefined_args(self) -> typing.List[str]: return ['-z', 'defs'] - def get_allow_undefined_args(self) -> T.List[str]: + def get_allow_undefined_args(self) -> typing.List[str]: return ['-z', 'nodefs'] - def fatal_warnings(self) -> T.List[str]: + def fatal_warnings(self) -> typing.List[str]: return ['-z', 'fatal-warnings'] def build_rpath_args(self, env: 'Environment', build_dir: str, from_dir: str, rpath_paths: str, build_rpath: str, - install_rpath: str) -> T.List[str]: + install_rpath: str) -> typing.List[str]: if not rpath_paths and not install_rpath and not build_rpath: return [] processed_rpaths = prepare_rpaths(rpath_paths, build_dir, from_dir) @@ -936,8 +911,8 @@ return self._apply_prefix('-rpath,{}'.format(paths)) def get_soname_args(self, env: 'Environment', prefix: str, shlib_name: str, - suffix: str, soversion: str, darwin_versions: T.Tuple[str, str], - is_shared_module: bool) -> T.List[str]: + suffix: str, soversion: str, darwin_versions: typing.Tuple[str, str], + is_shared_module: bool) -> typing.List[str]: sostr = '' if soversion is None else '.' + soversion return self._apply_prefix('-soname,{}{}.{}{}'.format(prefix, shlib_name, suffix, sostr)) @@ -950,18 +925,13 @@ *, version: str = 'unknown version'): # Use optlink instead of link so we don't interfer with other link.exe # implementations. - super().__init__('optlink', ['optlink.exe'], for_machine, '', [], version=version) + super().__init__(['optlink.exe'], for_machine, 'optlink', prefix_arg='', version=version) - def get_allow_undefined_args(self) -> T.List[str]: + def get_allow_undefined_args(self) -> typing.List[str]: return [] - class CudaLinker(PosixDynamicLinkerMixin, DynamicLinker): """Cuda linker (nvlink)""" - - def __init__(self, *args, **kwargs): - super().__init__('nvlink', *args, **kwargs) - @staticmethod def parse_version(): version_cmd = ['nvlink', '--version'] @@ -994,13 +964,13 @@ from .compilers import CudaCompiler return CudaCompiler.LINKER_PREFIX - def fatal_warnings(self) -> T.List[str]: + def fatal_warnings(self) -> typing.List[str]: return ['--warning-as-error'] - def get_allow_undefined_args(self) -> T.List[str]: + def get_allow_undefined_args(self) -> typing.List[str]: return [] def get_soname_args(self, env: 'Environment', prefix: str, shlib_name: str, - suffix: str, soversion: str, darwin_versions: T.Tuple[str, str], - is_shared_module: bool) -> T.List[str]: + suffix: str, soversion: str, darwin_versions: typing.Tuple[str, str], + is_shared_module: bool) -> typing.List[str]: return [] diff -Nru meson-0.53.2/mesonbuild/mconf.py meson-0.52.1/mesonbuild/mconf.py --- meson-0.53.2/mesonbuild/mconf.py 2019-12-04 18:45:50.000000000 +0000 +++ meson-0.52.1/mesonbuild/mconf.py 2019-11-28 17:37:44.000000000 +0000 @@ -43,13 +43,6 @@ self.build_dir = os.path.dirname(self.build_dir) self.build = None self.max_choices_line_length = 60 - self.name_col = [] - self.value_col = [] - self.choices_col = [] - self.descr_col = [] - self.has_choices = False - self.all_subprojects = set() - self.yielding_options = set() if os.path.isdir(os.path.join(self.build_dir, 'meson-private')): self.build = build.load(self.build_dir) @@ -62,7 +55,7 @@ self.source_dir = os.path.abspath(os.path.realpath(self.build_dir)) intr = mintro.IntrospectionInterpreter(self.source_dir, '', 'ninja', visitors = [AstIDGenerator()]) intr.analyze() - # Re-enable logging just in case + # Reenable logging just in case mlog.enable() self.coredata = intr.coredata self.default_values_only = True @@ -86,89 +79,71 @@ # are erased when Meson is executed the next time, i.e. when # Ninja is run. - def print_aligned(self): - col_widths = (max([len(i) for i in self.name_col], default=0), - max([len(i) for i in self.value_col], default=0), - max([len(i) for i in self.choices_col], default=0)) - - for line in zip(self.name_col, self.value_col, self.choices_col, self.descr_col): - if self.has_choices: - print('{0:{width[0]}} {1:{width[1]}} {2:{width[2]}} {3}'.format(*line, width=col_widths)) - else: - print('{0:{width[0]}} {1:{width[1]}} {3}'.format(*line, width=col_widths)) + def print_aligned(self, arr): + if not arr: + return - def split_options_per_subproject(self, options): - result = {} - for k, o in options.items(): - subproject = '' - if ':' in k: - subproject, optname = k.split(':') - if o.yielding and optname in options: - self.yielding_options.add(k) - self.all_subprojects.add(subproject) - result.setdefault(subproject, {})[k] = o - return result - - def _add_line(self, name, value, choices, descr): - self.name_col.append(' ' * self.print_margin + name) - self.value_col.append(value) - self.choices_col.append(choices) - self.descr_col.append(descr) - - def add_option(self, name, descr, value, choices): - if isinstance(value, list): - value = '[{0}]'.format(', '.join(make_lower_case(value))) - else: - value = make_lower_case(value) + titles = {'name': 'Option', 'descr': 'Description', 'value': 'Current Value', 'choices': 'Possible Values'} + if self.default_values_only: + titles['value'] = 'Default Value' - if choices: - self.has_choices = True - if isinstance(choices, list): - choices_list = make_lower_case(choices) - current = '[' - while choices_list: - i = choices_list.pop(0) - if len(current) + len(i) >= self.max_choices_line_length: - self._add_line(name, value, current + ',', descr) - name = '' - value = '' - descr = '' - current = ' ' - if len(current) > 1: - current += ', ' - current += i - choices = current + ']' + name_col = [titles['name'], '-' * len(titles['name'])] + value_col = [titles['value'], '-' * len(titles['value'])] + choices_col = [titles['choices'], '-' * len(titles['choices'])] + descr_col = [titles['descr'], '-' * len(titles['descr'])] + + choices_found = False + for opt in arr: + name_col.append(opt['name']) + descr_col.append(opt['descr']) + if isinstance(opt['value'], list): + value_col.append('[{0}]'.format(', '.join(make_lower_case(opt['value'])))) else: - choices = make_lower_case(choices) - else: - choices = '' - - self._add_line(name, value, choices, descr) + value_col.append(make_lower_case(opt['value'])) + if opt['choices']: + choices_found = True + if isinstance(opt['choices'], list): + choices_list = make_lower_case(opt['choices']) + current = '[' + while choices_list: + i = choices_list.pop(0) + if len(current) + len(i) >= self.max_choices_line_length: + choices_col.append(current + ',') + name_col.append('') + value_col.append('') + descr_col.append('') + current = ' ' + if len(current) > 1: + current += ', ' + current += i + choices_col.append(current + ']') + else: + choices_col.append(make_lower_case(opt['choices'])) + else: + choices_col.append('') - def add_title(self, title): - titles = {'descr': 'Description', 'value': 'Current Value', 'choices': 'Possible Values'} - if self.default_values_only: - titles['value'] = 'Default Value' - self._add_line('', '', '', '') - self._add_line(title, titles['value'], titles['choices'], titles['descr']) - self._add_line('-' * len(title), '-' * len(titles['value']), '-' * len(titles['choices']), '-' * len(titles['descr'])) - - def add_section(self, section): - self.print_margin = 0 - self._add_line('', '', '', '') - self._add_line(section + ':', '', '', '') - self.print_margin = 2 + col_widths = (max([len(i) for i in name_col], default=0), + max([len(i) for i in value_col], default=0), + max([len(i) for i in choices_col], default=0), + max([len(i) for i in descr_col], default=0)) + + for line in zip(name_col, value_col, choices_col, descr_col): + if choices_found: + print(' {0:{width[0]}} {1:{width[1]}} {2:{width[2]}} {3:{width[3]}}'.format(*line, width=col_widths)) + else: + print(' {0:{width[0]}} {1:{width[1]}} {3:{width[3]}}'.format(*line, width=col_widths)) def print_options(self, title, options): + print('\n{}:'.format(title)) if not options: - return - if title: - self.add_title(title) + print(' No {}\n'.format(title.lower())) + arr = [] for k, o in sorted(options.items()): - printable_value = o.printable_value() - if k in self.yielding_options: - printable_value = '' - self.add_option(k, o.description, printable_value, o.choices) + d = o.description + v = o.printable_value() + c = o.choices + arr.append({'name': k, 'descr': d, 'value': v, 'choices': c}) + self.print_aligned(arr) def print_conf(self): def print_default_values_warning(): @@ -205,44 +180,26 @@ test_options = {k: o for k, o in self.coredata.builtins.items() if k in test_option_names} core_options = {k: o for k, o in self.coredata.builtins.items() if k in core_option_names} - def insert_build_prefix(k): - idx = k.find(':') - if idx < 0: - return 'build.' + k - return k[:idx + 1] + 'build.' + k[idx + 1:] - - core_options = self.split_options_per_subproject(core_options) - host_compiler_options = self.split_options_per_subproject(self.coredata.compiler_options.host) - build_compiler_options = self.split_options_per_subproject({insert_build_prefix(k): o for k, o in self.coredata.compiler_options.build.items()}) - project_options = self.split_options_per_subproject(self.coredata.user_options) - show_build_options = self.default_values_only or self.build.environment.is_cross_build() - - self.add_section('Main project options') - self.print_options('Core options', core_options['']) - self.print_options('', self.coredata.builtins_per_machine.host) - if show_build_options: - self.print_options('', {insert_build_prefix(k): o for k, o in self.coredata.builtins_per_machine.build.items()}) + self.print_options('Core options', core_options) + if self.default_values_only or self.build.environment.is_cross_build(): + self.print_options('Core options (for host machine)', self.coredata.builtins_per_machine.host) + self.print_options( + 'Core options (for build machine)', + {'build.' + k: o for k, o in self.coredata.builtins_per_machine.build.items()}) + else: + self.print_options('Core options', self.coredata.builtins_per_machine.host) self.print_options('Backend options', self.coredata.backend_options) self.print_options('Base options', self.coredata.base_options) - self.print_options('Compiler options', host_compiler_options.get('', {})) - if show_build_options: - self.print_options('', build_compiler_options.get('', {})) + if self.default_values_only or self.build.environment.is_cross_build(): + self.print_options('Compiler options (for host machine)', self.coredata.compiler_options.host) + self.print_options( + 'Compiler options (for build machine)', + {'build.' + k: o for k, o in self.coredata.compiler_options.build.items()}) + else: + self.print_options('Compiler options', self.coredata.compiler_options.host) self.print_options('Directories', dir_options) + self.print_options('Project options', self.coredata.user_options) self.print_options('Testing options', test_options) - self.print_options('Project options', project_options.get('', {})) - for subproject in sorted(self.all_subprojects): - if subproject == '': - continue - self.add_section('Subproject ' + subproject) - if subproject in core_options: - self.print_options('Core options', core_options[subproject]) - if subproject in host_compiler_options: - self.print_options('Compiler options', host_compiler_options[subproject]) - if subproject in build_compiler_options and show_build_options: - self.print_options('', build_compiler_options[subproject]) - if subproject in project_options: - self.print_options('Project options', project_options[subproject]) - self.print_aligned() # Print the warning twice so that the user shouldn't be able to miss it if self.default_values_only: diff -Nru meson-0.53.2/mesonbuild/mdist.py meson-0.52.1/mesonbuild/mdist.py --- meson-0.53.2/mesonbuild/mdist.py 2020-01-23 22:29:05.000000000 +0000 +++ meson-0.52.1/mesonbuild/mdist.py 2019-11-28 17:37:44.000000000 +0000 @@ -13,6 +13,7 @@ # limitations under the License. +import lzma import gzip import os import sys @@ -24,7 +25,6 @@ from pathlib import Path from mesonbuild.environment import detect_ninja from mesonbuild.mesonlib import windows_proof_rmtree, MesonException -from mesonbuild.wrap import wrap from mesonbuild import mlog, build archive_choices = ['gztar', 'xztar', 'zip'] @@ -37,8 +37,6 @@ help='directory to cd into before running') parser.add_argument('--formats', default='xztar', help='Comma separated list of archive types to create.') - parser.add_argument('--include-subprojects', action='store_true', - help='Include source code of subprojects that have been used for the build.') def create_hash(fname): @@ -90,37 +88,22 @@ print('Failed to run dist script {!r}'.format(name)) sys.exit(1) -def is_git(src_root): - _git = os.path.join(src_root, '.git') - return os.path.isdir(_git) or os.path.isfile(_git) def git_have_dirty_index(src_root): '''Check whether there are uncommitted changes in git''' ret = subprocess.call(['git', '-C', src_root, 'diff-index', '--quiet', 'HEAD']) return ret == 1 -def git_clone(src_root, distdir): +def create_dist_git(dist_name, archives, src_root, bld_root, dist_sub, dist_scripts): if git_have_dirty_index(src_root): mlog.warning('Repository has uncommitted changes that will not be included in the dist tarball') + distdir = os.path.join(dist_sub, dist_name) if os.path.exists(distdir): shutil.rmtree(distdir) os.makedirs(distdir) subprocess.check_call(['git', 'clone', '--shared', src_root, distdir]) process_submodules(distdir) del_gitfiles(distdir) - -def create_dist_git(dist_name, archives, src_root, bld_root, dist_sub, dist_scripts, subprojects): - distdir = os.path.join(dist_sub, dist_name) - git_clone(src_root, distdir) - for path in subprojects: - sub_src_root = os.path.join(src_root, path) - sub_distdir = os.path.join(distdir, path) - if os.path.exists(sub_distdir): - continue - if is_git(sub_src_root): - git_clone(sub_src_root, sub_distdir) - else: - shutil.copytree(sub_src_root, sub_distdir) run_dist_scripts(distdir, dist_scripts) output_names = [] for a in archives: @@ -130,8 +113,6 @@ shutil.rmtree(distdir) return output_names -def is_hg(src_root): - return os.path.isdir(os.path.join(src_root, '.hg')) def hg_have_dirty_index(src_root): '''Check whether there are uncommitted changes in hg''' @@ -152,7 +133,6 @@ if dist_scripts: mlog.warning('dist scripts are not supported in Mercurial projects') if 'xztar' in archives: - import lzma with lzma.open(xzname, 'wb') as xf, open(tarname, 'rb') as tf: shutil.copyfileobj(tf, xf) output_names.append(xzname) @@ -167,7 +147,7 @@ return output_names -def check_dist(packagename, meson_command, extra_meson_args, bld_root, privdir): +def check_dist(packagename, meson_command, bld_root, privdir): print('Testing distribution package %s' % packagename) unpackdir = os.path.join(privdir, 'dist-unpack') builddir = os.path.join(privdir, 'dist-build') @@ -185,7 +165,6 @@ with open(os.path.join(bld_root, 'meson-info', 'intro-buildoptions.json')) as boptions: meson_command += ['-D{name}={value}'.format(**o) for o in json.load(boptions) if o['name'] not in ['backend', 'install_umask']] - meson_command += extra_meson_args if subprocess.call(meson_command + ['--backend=ninja', unpacked_src_dir, builddir]) != 0: print('Running Meson on distribution package failed') return 1 @@ -235,21 +214,10 @@ archives = determine_archives_to_generate(options) - subprojects = [] - extra_meson_args = [] - if options.include_subprojects: - subproject_dir = os.path.join(src_root, b.subproject_dir) - for sub in b.subprojects: - _, directory = wrap.get_directory(subproject_dir, sub) - subprojects.append(os.path.join(b.subproject_dir, directory)) - extra_meson_args.append('-Dwrap_mode=nodownload') - - if is_git(src_root): - names = create_dist_git(dist_name, archives, src_root, bld_root, dist_sub, b.dist_scripts, subprojects) - elif is_hg(src_root): - if subprojects: - print('--include-subprojects option currently not supported with Mercurial') - return 1 + _git = os.path.join(src_root, '.git') + if os.path.isdir(_git) or os.path.isfile(_git): + names = create_dist_git(dist_name, archives, src_root, bld_root, dist_sub, b.dist_scripts) + elif os.path.isdir(os.path.join(src_root, '.hg')): names = create_dist_hg(dist_name, archives, src_root, bld_root, dist_sub, b.dist_scripts) else: print('Dist currently only works with Git or Mercurial repos') @@ -257,7 +225,7 @@ if names is None: return 1 # Check only one. - rc = check_dist(names[0], meson_command, extra_meson_args, bld_root, priv_dir) + rc = check_dist(names[0], meson_command, bld_root, priv_dir) if rc == 0: for name in names: create_hash(name) diff -Nru meson-0.53.2/mesonbuild/mesonlib.py meson-0.52.1/mesonbuild/mesonlib.py --- meson-0.53.2/mesonbuild/mesonlib.py 2020-02-25 18:00:46.000000000 +0000 +++ meson-0.52.1/mesonbuild/mesonlib.py 2019-11-28 17:37:44.000000000 +0000 @@ -21,14 +21,13 @@ import collections from enum import Enum from functools import lru_cache, update_wrapper -from itertools import tee, filterfalse -import typing as T +import typing import uuid from mesonbuild import mlog -_T = T.TypeVar('_T') -_U = T.TypeVar('_U') +_T = typing.TypeVar('_T') +_U = typing.TypeVar('_U') have_fcntl = False have_msvcrt = False @@ -56,19 +55,6 @@ python_command = [sys.executable] meson_command = None -GIT = shutil.which('git') -def git(cmd: T.List[str], workingdir: str, **kwargs) -> subprocess.CompletedProcess: - pc = subprocess.run([GIT, '-C', workingdir] + cmd, - # Redirect stdin to DEVNULL otherwise git messes up the - # console and ANSI colors stop working on Windows. - stdin=subprocess.DEVNULL, **kwargs) - # Sometimes git calls git recursively, such as `git submodule update - # --recursive` which will be without the above workaround, so set the - # console mode again just in case. - mlog.setup_console() - return pc - - def set_meson_command(mainfile): global python_command global meson_command @@ -273,7 +259,7 @@ def endswith(self, ending: str) -> bool: return self.fname.endswith(ending) - def split(self, s: str) -> T.List[str]: + def split(self, s: str) -> typing.List[str]: return self.fname.split(s) def __eq__(self, other) -> bool: @@ -344,7 +330,7 @@ return PerMachine('build.', '')[self] -class PerMachine(T.Generic[_T]): +class PerMachine(typing.Generic[_T]): def __init__(self, build: _T, host: _T): self.build = build self.host = host @@ -358,14 +344,14 @@ def __setitem__(self, machine: MachineChoice, val: _T) -> None: setattr(self, machine.get_lower_case_name(), val) - def miss_defaulting(self) -> "PerMachineDefaultable[T.Optional[_T]]": + def miss_defaulting(self) -> "PerMachineDefaultable[typing.Optional[_T]]": """Unset definition duplicated from their previous to None This is the inverse of ''default_missing''. By removing defaulted machines, we can elaborate the original and then redefault them and thus avoid repeating the elaboration explicitly. """ - unfreeze = PerMachineDefaultable() # type: PerMachineDefaultable[T.Optional[_T]] + unfreeze = PerMachineDefaultable() # type: PerMachineDefaultable[typing.Optional[_T]] unfreeze.build = self.build unfreeze.host = self.host if unfreeze.host == unfreeze.build: @@ -384,14 +370,14 @@ super().__init__(build, host) self.target = target - def miss_defaulting(self) -> "PerThreeMachineDefaultable[T.Optional[_T]]": + def miss_defaulting(self) -> "PerThreeMachineDefaultable[typing.Optional[_T]]": """Unset definition duplicated from their previous to None This is the inverse of ''default_missing''. By removing defaulted machines, we can elaborate the original and then redefault them and thus avoid repeating the elaboration explicitly. """ - unfreeze = PerThreeMachineDefaultable() # type: PerThreeMachineDefaultable[T.Optional[_T]] + unfreeze = PerThreeMachineDefaultable() # type: PerThreeMachineDefaultable[typing.Optional[_T]] unfreeze.build = self.build unfreeze.host = self.host unfreeze.target = self.target @@ -404,14 +390,14 @@ def matches_build_machine(self, machine: MachineChoice) -> bool: return self.build == self[machine] -class PerMachineDefaultable(PerMachine[T.Optional[_T]]): +class PerMachineDefaultable(PerMachine[typing.Optional[_T]]): """Extends `PerMachine` with the ability to default from `None`s. """ def __init__(self) -> None: super().__init__(None, None) - def default_missing(self) -> "PerMachine[T.Optional[_T]]": - """Default host to build + def default_missing(self) -> "PerMachine[typing.Optional[_T]]": + """Default host to buid This allows just specifying nothing in the native case, and just host in the cross non-compiler case. @@ -422,14 +408,14 @@ return freeze -class PerThreeMachineDefaultable(PerMachineDefaultable, PerThreeMachine[T.Optional[_T]]): +class PerThreeMachineDefaultable(PerMachineDefaultable, PerThreeMachine[typing.Optional[_T]]): """Extends `PerThreeMachine` with the ability to default from `None`s. """ def __init__(self) -> None: PerThreeMachine.__init__(self, None, None, None) - def default_missing(self) -> "PerThreeMachine[T.Optional[_T]]": - """Default host to build and target to host. + def default_missing(self) -> "PerThreeMachine[typing.Optional[_T]]": + """Default host to buid and target to host. This allows just specifying nothing in the native case, just host in the cross non-compiler case, and just target in the native-built @@ -480,7 +466,7 @@ def is_freebsd() -> bool: return platform.system().lower() == 'freebsd' -def exe_exists(arglist: T.List[str]) -> bool: +def exe_exists(arglist: typing.List[str]) -> bool: try: if subprocess.run(arglist, timeout=10).returncode == 0: return True @@ -591,7 +577,7 @@ # otherwise, the version with a suffix remaining is greater return comparator(len(self._v), len(other._v)) -def _version_extract_cmpop(vstr2: str) -> T.Tuple[T.Callable[[T.Any, T.Any], bool], str]: +def _version_extract_cmpop(vstr2: str) -> typing.Tuple[typing.Callable[[typing.Any, typing.Any], bool], str]: if vstr2.startswith('>='): cmpop = operator.ge vstr2 = vstr2[2:] @@ -699,11 +685,11 @@ def default_prefix(): return 'c:/' if is_windows() else '/usr/local' -def get_library_dirs() -> T.List[str]: +def get_library_dirs() -> typing.List[str]: if is_windows(): - return ['C:/mingw/lib'] # TODO: get programmatically + return ['C:/mingw/lib'] # TODO: get programatically if is_osx(): - return ['/usr/lib'] # TODO: get programmatically + return ['/usr/lib'] # TODO: get programatically # The following is probably Debian/Ubuntu specific. # /usr/local/lib is first because it contains stuff # installed by the sysadmin and is probably more up-to-date @@ -783,7 +769,7 @@ result += (num_backslashes * 2) * '\\' + '"' return result - def split_args(cmd: T.Sequence[str]) -> T.List[str]: + def split_args(cmd): result = [] arg = '' num_backslashes = 0 @@ -989,9 +975,7 @@ else: os.unlink(dst_tmp) -def listify(item: T.Any, - flatten: bool = True, - unholder: bool = False) -> T.List[T.Any]: +def listify(item, flatten=True, unholder=False): ''' Returns a list with all args embedded in a list if they are not a list. This function preserves order. @@ -1031,14 +1015,14 @@ result.append(listify(fetch(key, []), **kwargs)) return result -def typeslistify(item: 'T.Union[_T, T.List[_T]]', - types: 'T.Union[T.Type[_T], T.Tuple[T.Type[_T]]]') -> T.List[_T]: +def typeslistify(item: 'typing.Union[_T, typing.List[_T]]', + types: 'typing.Union[typing.Type[_T], typing.Tuple[typing.Type[_T]]]') -> typing.List[_T]: ''' Ensure that type(@item) is one of @types or a list of items all of which are of type @types ''' if isinstance(item, types): - item = T.cast(T.List[_T], [item]) + item = typing.cast(typing.List[_T], [item]) if not isinstance(item, list): raise MesonException('Item must be a list or one of {!r}'.format(types)) for i in item: @@ -1046,7 +1030,7 @@ raise MesonException('List item must be one of {!r}'.format(types)) return item -def stringlistify(item: T.Union[str, T.List[str]]) -> T.List[str]: +def stringlistify(item: typing.Union[str, typing.List[str]]) -> typing.List[str]: return typeslistify(item, str) def expand_arguments(args): @@ -1067,41 +1051,26 @@ return None return expended_args -def partition(pred, iterable): - 'Use a predicate to partition entries into false entries and true entries' - # partition(is_odd, range(10)) --> 0 2 4 6 8 and 1 3 5 7 9 - t1, t2 = tee(iterable) - return filterfalse(pred, t1), filter(pred, t2) - -def Popen_safe(args: T.List[str], write: T.Optional[str] = None, - stdout: T.Union[T.BinaryIO, int] = subprocess.PIPE, - stderr: T.Union[T.BinaryIO, int] = subprocess.PIPE, - **kwargs: T.Any) -> T.Tuple[subprocess.Popen, str, str]: +def Popen_safe(args: typing.List[str], write: typing.Optional[str] = None, + stdout: typing.Union[typing.BinaryIO, int] = subprocess.PIPE, + stderr: typing.Union[typing.BinaryIO, int] = subprocess.PIPE, + **kwargs: typing.Any) -> typing.Tuple[subprocess.Popen, str, str]: import locale encoding = locale.getpreferredencoding() - # Redirect stdin to DEVNULL otherwise the command run by us here might mess - # up the console and ANSI colors will stop working on Windows. - if 'stdin' not in kwargs: - kwargs['stdin'] = subprocess.DEVNULL if sys.version_info < (3, 6) or not sys.stdout.encoding or encoding.upper() != 'UTF-8': - p, o, e = Popen_safe_legacy(args, write=write, stdout=stdout, stderr=stderr, **kwargs) - else: - p = subprocess.Popen(args, universal_newlines=True, close_fds=False, - stdout=stdout, stderr=stderr, **kwargs) - o, e = p.communicate(write) - # Sometimes the command that we run will call another command which will be - # without the above stdin workaround, so set the console mode again just in - # case. - mlog.setup_console() + return Popen_safe_legacy(args, write=write, stdout=stdout, stderr=stderr, **kwargs) + p = subprocess.Popen(args, universal_newlines=True, close_fds=False, + stdout=stdout, stderr=stderr, **kwargs) + o, e = p.communicate(write) return p, o, e -def Popen_safe_legacy(args: T.List[str], write: T.Optional[str] = None, - stdout: T.Union[T.BinaryIO, int] = subprocess.PIPE, - stderr: T.Union[T.BinaryIO, int] = subprocess.PIPE, - **kwargs: T.Any) -> T.Tuple[subprocess.Popen, str, str]: +def Popen_safe_legacy(args: typing.List[str], write: typing.Optional[str] = None, + stdout: typing.Union[typing.BinaryIO, int] = subprocess.PIPE, + stderr: typing.Union[typing.BinaryIO, int] = subprocess.PIPE, + **kwargs: typing.Any) -> typing.Tuple[subprocess.Popen, str, str]: p = subprocess.Popen(args, universal_newlines=False, close_fds=False, stdout=stdout, stderr=stderr, **kwargs) - input_ = None # type: T.Optional[bytes] + input_ = None # type: typing.Optional[bytes] if write is not None: input_ = write.encode('utf-8') o, e = p.communicate(input_) @@ -1293,7 +1262,7 @@ return except FileNotFoundError: return - except OSError: + except (OSError, PermissionError): time.sleep(d) # Try one last time and throw if it fails. shutil.rmtree(f) @@ -1310,7 +1279,7 @@ return except FileNotFoundError: return - except OSError: + except (OSError, PermissionError): time.sleep(d) os.unlink(fpath) @@ -1349,7 +1318,7 @@ def get_error_location_string(fname: str, lineno: str) -> str: return '{}:{}:'.format(fname, lineno) -def substring_is_in_list(substr: str, strlist: T.List[str]) -> bool: +def substring_is_in_list(substr: str, strlist: typing.List[str]) -> bool: for s in strlist: if substr in s: return True @@ -1420,13 +1389,13 @@ msvcrt.locking(self.lockfile.fileno(), msvcrt.LK_UNLCK, 1) self.lockfile.close() -def relpath(path: str, start: str) -> str: +def relpath(path, start): # On Windows a relative path can't be evaluated for paths on two different # drives (i.e. c:\foo and f:\bar). The only thing left to do is to use the # original absolute path. try: return os.path.relpath(path, start) - except (TypeError, ValueError): + except ValueError: return path @@ -1440,14 +1409,8 @@ PREFER_STATIC = 3 -class ProgressBarFallback: # lgtm [py/iter-returns-non-self] - ''' - Fallback progress bar implementation when tqdm is not found - - Since this class is not an actual iterator, but only provides a minimal - fallback, it is safe to ignore the 'Iterator does not return self from - __iter__ method' warning. - ''' +class ProgressBarFallback: + '''Fallback progress bar implementation when tqdm is not found''' def __init__(self, iterable=None, total=None, bar_type=None, desc=None): if iterable is not None: self.iterable = iter(iterable) diff -Nru meson-0.53.2/mesonbuild/mesonmain.py meson-0.52.1/mesonbuild/mesonmain.py --- meson-0.53.2/mesonbuild/mesonmain.py 2019-12-04 18:45:50.000000000 +0000 +++ meson-0.52.1/mesonbuild/mesonmain.py 2019-11-28 17:37:44.000000000 +0000 @@ -33,11 +33,11 @@ class CommandLineParser: def __init__(self): self.term_width = shutil.get_terminal_size().columns - self.formatter = lambda prog: argparse.HelpFormatter(prog, max_help_position=int(self.term_width / 2), width=self.term_width) + self.formater = lambda prog: argparse.HelpFormatter(prog, max_help_position=int(self.term_width / 2), width=self.term_width) self.commands = {} self.hidden_commands = [] - self.parser = argparse.ArgumentParser(prog='meson', formatter_class=self.formatter) + self.parser = argparse.ArgumentParser(prog='meson', formatter_class=self.formater) self.subparsers = self.parser.add_subparsers(title='Commands', description='If no command is specified it defaults to setup command.') self.add_command('setup', msetup.add_arguments, msetup.run, @@ -60,7 +60,7 @@ help_msg='Manage subprojects') self.add_command('help', self.add_help_arguments, self.run_help_command, help_msg='Print help of a subcommand') - self.add_command('rewrite', lambda parser: rewriter.add_arguments(parser, self.formatter), rewriter.run, + self.add_command('rewrite', lambda parser: rewriter.add_arguments(parser, self.formater), rewriter.run, help_msg='Modify the project definition') # Hidden commands @@ -74,10 +74,10 @@ # FIXME: Cannot have hidden subparser: # https://bugs.python.org/issue22848 if help_msg == argparse.SUPPRESS: - p = argparse.ArgumentParser(prog='meson ' + name, formatter_class=self.formatter) + p = argparse.ArgumentParser(prog='meson ' + name, formatter_class=self.formater) self.hidden_commands.append(name) else: - p = self.subparsers.add_parser(name, help=help_msg, aliases=aliases, formatter_class=self.formatter) + p = self.subparsers.add_parser(name, help=help_msg, aliases=aliases, formatter_class=self.formater) add_arguments_func(p) p.set_defaults(run_func=run_func) for i in [name] + aliases: diff -Nru meson-0.53.2/mesonbuild/minit.py meson-0.52.1/mesonbuild/minit.py --- meson-0.53.2/mesonbuild/minit.py 2019-12-04 18:45:50.000000000 +0000 +++ meson-0.52.1/mesonbuild/minit.py 2019-11-28 17:37:44.000000000 +0000 @@ -14,20 +14,241 @@ """Code that creates simple startup projects.""" -from pathlib import Path -import re, shutil, subprocess +import os, sys, re, shutil, subprocess from glob import glob from mesonbuild import mesonlib from mesonbuild.environment import detect_ninja -from mesonbuild.templates.ctemplates import (create_exe_c_sample, create_lib_c_sample) -from mesonbuild.templates.cpptemplates import (create_exe_cpp_sample, create_lib_cpp_sample) -from mesonbuild.templates.objctemplates import (create_exe_objc_sample, create_lib_objc_sample) -from mesonbuild.templates.dlangtemplates import (create_exe_d_sample, create_lib_d_sample) -from mesonbuild.templates.fortrantemplates import (create_exe_fortran_sample, create_lib_fortran_sample) -from mesonbuild.templates.rusttemplates import (create_exe_rust_sample, create_lib_rust_sample) +lib_h_template = '''#pragma once +#if defined _WIN32 || defined __CYGWIN__ + #ifdef BUILDING_{utoken} + #define {utoken}_PUBLIC __declspec(dllexport) + #else + #define {utoken}_PUBLIC __declspec(dllimport) + #endif +#else + #ifdef BUILDING_{utoken} + #define {utoken}_PUBLIC __attribute__ ((visibility ("default"))) + #else + #define {utoken}_PUBLIC + #endif +#endif -FORTRAN_SUFFIXES = ['.f', '.for', '.F', '.f90', '.F90'] +int {utoken}_PUBLIC {function_name}(); + +''' + +lib_c_template = '''#include <{header_file}> + +/* This function will not be exported and is not + * directly callable by users of this library. + */ +int internal_function() {{ + return 0; +}} + +int {function_name}() {{ + return internal_function(); +}} +''' + +lib_c_test_template = '''#include <{header_file}> +#include + +int main(int argc, char **argv) {{ + if(argc != 1) {{ + printf("%s takes no arguments.\\n", argv[0]); + return 1; + }} + return {function_name}(); +}} +''' + +lib_c_meson_template = '''project('{project_name}', 'c', + version : '{version}', + default_options : ['warning_level=3']) + +# These arguments are only used to build the shared library +# not the executables that use the library. +lib_args = ['-DBUILDING_{utoken}'] + +shlib = shared_library('{lib_name}', '{source_file}', + install : true, + c_args : lib_args, + gnu_symbol_visibility : 'hidden', +) + +test_exe = executable('{test_exe_name}', '{test_source_file}', + link_with : shlib) +test('{test_name}', test_exe) + +# Make this library usable as a Meson subproject. +{ltoken}_dep = declare_dependency( + include_directories: include_directories('.'), + link_with : shlib) + +# Make this library usable from the system's +# package manager. +install_headers('{header_file}', subdir : '{header_dir}') + +pkg_mod = import('pkgconfig') +pkg_mod.generate( + name : '{project_name}', + filebase : '{ltoken}', + description : 'Meson sample project.', + subdirs : '{header_dir}', + libraries : shlib, + version : '{version}', +) +''' + +hello_c_template = '''#include + +#define PROJECT_NAME "{project_name}" + +int main(int argc, char **argv) {{ + if(argc != 1) {{ + printf("%s takes no arguments.\\n", argv[0]); + return 1; + }} + printf("This is project %s.\\n", PROJECT_NAME); + return 0; +}} +''' + +hello_c_meson_template = '''project('{project_name}', 'c', + version : '{version}', + default_options : ['warning_level=3']) + +exe = executable('{exe_name}', '{source_name}', + install : true) + +test('basic', exe) +''' + +hello_cpp_template = '''#include + +#define PROJECT_NAME "{project_name}" + +int main(int argc, char **argv) {{ + if(argc != 1) {{ + std::cout << argv[0] << "takes no arguments.\\n"; + return 1; + }} + std::cout << "This is project " << PROJECT_NAME << ".\\n"; + return 0; +}} +''' + +hello_cpp_meson_template = '''project('{project_name}', 'cpp', + version : '{version}', + default_options : ['warning_level=3', + 'cpp_std=c++14']) + +exe = executable('{exe_name}', '{source_name}', + install : true) + +test('basic', exe) +''' + +lib_hpp_template = '''#pragma once +#if defined _WIN32 || defined __CYGWIN__ + #ifdef BUILDING_{utoken} + #define {utoken}_PUBLIC __declspec(dllexport) + #else + #define {utoken}_PUBLIC __declspec(dllimport) + #endif +#else + #ifdef BUILDING_{utoken} + #define {utoken}_PUBLIC __attribute__ ((visibility ("default"))) + #else + #define {utoken}_PUBLIC + #endif +#endif + +namespace {namespace} {{ + +class {utoken}_PUBLIC {class_name} {{ + +public: + {class_name}(); + int get_number() const; + +private: + + int number; + +}}; + +}} + +''' + +lib_cpp_template = '''#include <{header_file}> + +namespace {namespace} {{ + +{class_name}::{class_name}() {{ + number = 6; +}} + +int {class_name}::get_number() const {{ + return number; +}} + +}} +''' + +lib_cpp_test_template = '''#include <{header_file}> +#include + +int main(int argc, char **argv) {{ + if(argc != 1) {{ + std::cout << argv[0] << " takes no arguments.\\n"; + return 1; + }} + {namespace}::{class_name} c; + return c.get_number() != 6; +}} +''' + +lib_cpp_meson_template = '''project('{project_name}', 'cpp', + version : '{version}', + default_options : ['warning_level=3', 'cpp_std=c++14']) + +# These arguments are only used to build the shared library +# not the executables that use the library. +lib_args = ['-DBUILDING_{utoken}'] + +shlib = shared_library('{lib_name}', '{source_file}', + install : true, + cpp_args : lib_args, + gnu_symbol_visibility : 'hidden', +) + +test_exe = executable('{test_exe_name}', '{test_source_file}', + link_with : shlib) +test('{test_name}', test_exe) + +# Make this library usable as a Meson subproject. +{ltoken}_dep = declare_dependency( + include_directories: include_directories('.'), + link_with : shlib) + +# Make this library usable from the system's +# package manager. +install_headers('{header_file}', subdir : '{header_dir}') + +pkg_mod = import('pkgconfig') +pkg_mod.generate( + name : '{project_name}', + filebase : '{ltoken}', + description : 'Meson sample project.', + subdirs : '{header_dir}', + libraries : shlib, + version : '{version}', +) +''' info_message = '''Sample project created. To build it run the following commands: @@ -36,6 +257,76 @@ ninja -C builddir ''' +def create_exe_c_sample(project_name, project_version): + lowercase_token = re.sub(r'[^a-z0-9]', '_', project_name.lower()) + source_name = lowercase_token + '.c' + open(source_name, 'w').write(hello_c_template.format(project_name=project_name)) + open('meson.build', 'w').write(hello_c_meson_template.format(project_name=project_name, + exe_name=lowercase_token, + source_name=source_name, + version=project_version)) + +def create_lib_c_sample(project_name, version): + lowercase_token = re.sub(r'[^a-z0-9]', '_', project_name.lower()) + uppercase_token = lowercase_token.upper() + function_name = lowercase_token[0:3] + '_func' + lib_h_name = lowercase_token + '.h' + lib_c_name = lowercase_token + '.c' + test_c_name = lowercase_token + '_test.c' + kwargs = {'utoken': uppercase_token, + 'ltoken': lowercase_token, + 'header_dir': lowercase_token, + 'function_name': function_name, + 'header_file': lib_h_name, + 'source_file': lib_c_name, + 'test_source_file': test_c_name, + 'test_exe_name': lowercase_token, + 'project_name': project_name, + 'lib_name': lowercase_token, + 'test_name': lowercase_token, + 'version': version, + } + open(lib_h_name, 'w').write(lib_h_template.format(**kwargs)) + open(lib_c_name, 'w').write(lib_c_template.format(**kwargs)) + open(test_c_name, 'w').write(lib_c_test_template.format(**kwargs)) + open('meson.build', 'w').write(lib_c_meson_template.format(**kwargs)) + +def create_exe_cpp_sample(project_name, project_version): + lowercase_token = re.sub(r'[^a-z0-9]', '_', project_name.lower()) + source_name = lowercase_token + '.cpp' + open(source_name, 'w').write(hello_cpp_template.format(project_name=project_name)) + open('meson.build', 'w').write(hello_cpp_meson_template.format(project_name=project_name, + exe_name=lowercase_token, + source_name=source_name, + version=project_version)) + +def create_lib_cpp_sample(project_name, version): + lowercase_token = re.sub(r'[^a-z0-9]', '_', project_name.lower()) + uppercase_token = lowercase_token.upper() + class_name = uppercase_token[0] + lowercase_token[1:] + namespace = lowercase_token + lib_h_name = lowercase_token + '.hpp' + lib_c_name = lowercase_token + '.cpp' + test_c_name = lowercase_token + '_test.cpp' + kwargs = {'utoken': uppercase_token, + 'ltoken': lowercase_token, + 'header_dir': lowercase_token, + 'class_name': class_name, + 'namespace': namespace, + 'header_file': lib_h_name, + 'source_file': lib_c_name, + 'test_source_file': test_c_name, + 'test_exe_name': lowercase_token, + 'project_name': project_name, + 'lib_name': lowercase_token, + 'test_name': lowercase_token, + 'version': version, + } + open(lib_h_name, 'w').write(lib_hpp_template.format(**kwargs)) + open(lib_c_name, 'w').write(lib_cpp_template.format(**kwargs)) + open(test_c_name, 'w').write(lib_cpp_test_template.format(**kwargs)) + open('meson.build', 'w').write(lib_cpp_meson_template.format(**kwargs)) + def create_sample(options): if options.language == 'c': if options.type == 'executable': @@ -51,44 +342,17 @@ create_lib_cpp_sample(options.name, options.version) else: raise RuntimeError('Unreachable code') - elif options.language == 'd': - if options.type == 'executable': - create_exe_d_sample(options.name, options.version) - elif options.type == 'library': - create_lib_d_sample(options.name, options.version) - else: - raise RuntimeError('Unreachable code') - elif options.language == 'fortran': - if options.type == 'executable': - create_exe_fortran_sample(options.name, options.version) - elif options.type == 'library': - create_lib_fortran_sample(options.name, options.version) - else: - raise RuntimeError('Unreachable code') - elif options.language == 'rust': - if options.type == 'executable': - create_exe_rust_sample(options.name, options.version) - elif options.type == 'library': - create_lib_rust_sample(options.name, options.version) - else: - raise RuntimeError('Unreachable code') - elif options.language == 'objc': - if options.type == 'executable': - create_exe_objc_sample(options.name, options.version) - elif options.type == 'library': - create_lib_objc_sample(options.name, options.version) - else: - raise RuntimeError('Unreachable code') else: raise RuntimeError('Unreachable code') print(info_message) -def autodetect_options(options, sample: bool = False): +def autodetect_options(options, sample=False): if not options.name: - options.name = Path().resolve().stem + options.name = os.path.basename(os.getcwd()) if not re.match('[a-zA-Z_][a-zA-Z0-9]*', options.name) and sample: - raise SystemExit('Name of current directory "{}" is not usable as a sample project name.\n' - 'Specify a project name with --name.'.format(options.name)) + print('Name of current directory "{}" is not usable as a sample project name.\n' + 'Specify a project name with --name.'.format(options.name)) + sys.exit(1) print('Using "{}" (name of current directory) as project name.' .format(options.name)) if not options.executable: @@ -100,40 +364,28 @@ return if not options.srcfiles: srcfiles = [] - for f in (f for f in Path().iterdir() if f.is_file()): - if f.suffix in (['.cc', '.cpp', '.c', '.d', '.m', '.rs'] + FORTRAN_SUFFIXES): + for f in os.listdir(): + if f.endswith('.cc') or f.endswith('.cpp') or f.endswith('.c'): srcfiles.append(f) if not srcfiles: - raise SystemExit('No recognizable source files found.\n' - 'Run meson init in an empty directory to create a sample project.') + print("No recognizable source files found.\n" + "Run me in an empty directory to create a sample project.") + sys.exit(1) options.srcfiles = srcfiles - print("Detected source files: " + ' '.join(map(str, srcfiles))) - options.srcfiles = [Path(f) for f in options.srcfiles] + print("Detected source files: " + ' '.join(srcfiles)) if not options.language: for f in options.srcfiles: - if f.suffix in ('.cc', '.cpp'): + if f.endswith('.cc') or f.endswith('.cpp'): options.language = 'cpp' break - if f.suffix == '.c': + if f.endswith('.c'): options.language = 'c' break - if f.suffix == '.d': - options.language = 'd' - break - if f.suffix in FORTRAN_SUFFIXES: - options.language = 'fortran' - break - if f.suffix == '.rs': - options.language = 'rust' - break - if f.suffix == '.m': - options.language = 'objc' - break if not options.language: - raise SystemExit("Can't autodetect language, please specify it with -l.") + print("Can't autodetect language, please specify it with -l.") + sys.exit(1) print("Detected language: " + options.language) - meson_executable_template = '''project('{project_name}', '{language}', version : '{version}', default_options : [{default_options}]) @@ -145,9 +397,10 @@ def create_meson_build(options): if options.type != 'executable': - raise SystemExit('\nGenerating a meson.build file from existing sources is\n' - 'supported only for project type "executable".\n' - 'Run meson init in an empty directory to create a sample project.') + print('\nGenerating a meson.build file from existing sources is\n' + 'supported only for project type "executable".\n' + 'Run me in an empty directory to create a sample project.') + sys.exit(1) default_options = ['warning_level=3'] if options.language == 'cpp': # This shows how to set this very common option. @@ -178,7 +431,7 @@ parser.add_argument("-n", "--name", help="project name. default: name of current directory") parser.add_argument("-e", "--executable", help="executable name. default: project name") parser.add_argument("-d", "--deps", help="dependencies, comma-separated") - parser.add_argument("-l", "--language", choices=['c', 'cpp', 'd', 'fortran', 'rust', 'objc'], + parser.add_argument("-l", "--language", choices=['c', 'cpp'], help="project language. default: autodetected based on source files") parser.add_argument("-b", "--build", help="build after generation", action='store_true') parser.add_argument("--builddir", help="directory for build", default='build') @@ -188,7 +441,7 @@ choices=['executable', 'library']) parser.add_argument('--version', default='0.1') -def run(options) -> int: +def run(options): if not glob('*'): autodetect_options(options, sample=True) if not options.language: @@ -197,20 +450,21 @@ create_sample(options) else: autodetect_options(options) - if Path('meson.build').is_file() and not options.force: - raise SystemExit('meson.build already exists. Use --force to overwrite.') + if os.path.isfile('meson.build') and not options.force: + print('meson.build already exists. Use --force to overwrite.') + sys.exit(1) create_meson_build(options) if options.build: - if Path(options.builddir).is_dir() and options.force: + if os.path.isdir(options.builddir) and options.force: print('Build directory already exists, deleting it.') shutil.rmtree(options.builddir) print('Building...') cmd = mesonlib.meson_command + [options.builddir] - ret = subprocess.run(cmd) - if ret.returncode: - raise SystemExit + err = subprocess.call(cmd) + if err: + sys.exit(1) cmd = [detect_ninja(), '-C', options.builddir] - ret = subprocess.run(cmd) - if ret.returncode: - raise SystemExit + err = subprocess.call(cmd) + if err: + sys.exit(1) return 0 diff -Nru meson-0.53.2/mesonbuild/minstall.py meson-0.52.1/mesonbuild/minstall.py --- meson-0.53.2/mesonbuild/minstall.py 2019-12-29 22:47:27.000000000 +0000 +++ meson-0.52.1/mesonbuild/minstall.py 2019-11-28 17:37:44.000000000 +0000 @@ -324,6 +324,7 @@ # FIXME: what about symlinks? self.do_copyfile(abs_src, abs_dst) set_mode(abs_dst, install_mode, data.install_umask) + append_to_log(self.lf, abs_dst) def do_install(self, datafilename): with open(datafilename, 'rb') as ifile: @@ -459,6 +460,11 @@ print('Stdout:\n%s\n' % stdo) print('Stderr:\n%s\n' % stde) sys.exit(1) + pdb_filename = os.path.splitext(fname)[0] + '.pdb' + if not should_strip and os.path.exists(pdb_filename): + pdb_outname = os.path.splitext(outname)[0] + '.pdb' + self.do_copyfile(pdb_filename, pdb_outname) + set_mode(pdb_outname, install_mode, d.install_umask) if fname.endswith('.js'): # Emscripten outputs js files and optionally a wasm file. # If one was generated, install it as well. @@ -503,6 +509,7 @@ log_dir = os.path.join(private_dir, '../meson-logs') if not os.path.exists(os.path.join(opts.wd, datafilename)): sys.exit('Install data not found. Run this command in build directory root.') + log_dir = os.path.join(private_dir, '../meson-logs') if not opts.no_rebuild: if not rebuild_all(opts.wd): sys.exit(-1) diff -Nru meson-0.53.2/mesonbuild/mintro.py meson-0.52.1/mesonbuild/mintro.py --- meson-0.53.2/mesonbuild/mintro.py 2020-01-23 12:51:19.000000000 +0000 +++ meson-0.52.1/mesonbuild/mintro.py 2019-11-28 17:37:44.000000000 +0000 @@ -26,32 +26,23 @@ from . import mlog from .backend import backends from .mparser import FunctionNode, ArrayNode, ArgumentNode, StringNode -import typing as T +from typing import Dict, List, Optional import os import pathlib -def get_meson_info_file(info_dir: str) -> str: +def get_meson_info_file(info_dir: str): return os.path.join(info_dir, 'meson-info.json') -def get_meson_introspection_version() -> str: +def get_meson_introspection_version(): return '1.0.0' -def get_meson_introspection_required_version() -> T.List[str]: +def get_meson_introspection_required_version(): return ['>=1.0', '<2.0'] -class IntroCommand: - def __init__(self, - desc: str, - func: T.Optional[T.Callable[[], T.Union[dict, list]]] = None, - no_bd: T.Optional[T.Callable[[IntrospectionInterpreter], T.Union[dict, list]]] = None) -> None: - self.desc = desc + '.' - self.func = func - self.no_bd = no_bd - -def get_meson_introspection_types(coredata: T.Optional[cdata.CoreData] = None, - builddata: T.Optional[build.Build] = None, - backend: T.Optional[backends.Backend] = None, - sourcedir: T.Optional[str] = None) -> T.Dict[str, IntroCommand]: +def get_meson_introspection_types(coredata: Optional[cdata.CoreData] = None, + builddata: Optional[build.Build] = None, + backend: Optional[backends.Backend] = None, + sourcedir: Optional[str] = None): if backend and builddata: benchmarkdata = backend.create_test_serialisation(builddata.get_benchmarks()) testdata = backend.create_test_serialisation(builddata.get_tests()) @@ -60,22 +51,55 @@ benchmarkdata = testdata = installdata = None return { - 'benchmarks': IntroCommand('T.List all benchmarks', func=lambda: list_benchmarks(benchmarkdata)), - 'buildoptions': IntroCommand('T.List all build options', func=lambda: list_buildoptions(coredata), no_bd=list_buildoptions_from_source), - 'buildsystem_files': IntroCommand('T.List files that make up the build system', func=lambda: list_buildsystem_files(builddata)), - 'dependencies': IntroCommand('T.List external dependencies', func=lambda: list_deps(coredata), no_bd=list_deps_from_source), - 'scan_dependencies': IntroCommand('Scan for dependencies used in the meson.build file', no_bd=list_deps_from_source), - 'installed': IntroCommand('T.List all installed files and directories', func=lambda: list_installed(installdata)), - 'projectinfo': IntroCommand('Information about projects', func=lambda: list_projinfo(builddata), no_bd=list_projinfo_from_source), - 'targets': IntroCommand('T.List top level targets', func=lambda: list_targets(builddata, installdata, backend), no_bd=list_targets_from_source), - 'tests': IntroCommand('T.List all unit tests', func=lambda: list_tests(testdata)), + 'benchmarks': { + 'func': lambda: list_benchmarks(benchmarkdata), + 'desc': 'List all benchmarks.', + }, + 'buildoptions': { + 'func': lambda: list_buildoptions(coredata), + 'no_bd': lambda intr: list_buildoptions_from_source(intr), + 'desc': 'List all build options.', + }, + 'buildsystem_files': { + 'func': lambda: list_buildsystem_files(builddata), + 'desc': 'List files that make up the build system.', + 'key': 'buildsystem-files', + }, + 'dependencies': { + 'func': lambda: list_deps(coredata), + 'no_bd': lambda intr: list_deps_from_source(intr), + 'desc': 'List external dependencies.', + }, + 'scan_dependencies': { + 'no_bd': lambda intr: list_deps_from_source(intr), + 'desc': 'Scan for dependencies used in the meson.build file.', + 'key': 'scan-dependencies', + }, + 'installed': { + 'func': lambda: list_installed(installdata), + 'desc': 'List all installed files and directories.', + }, + 'projectinfo': { + 'func': lambda: list_projinfo(builddata), + 'no_bd': lambda intr: list_projinfo_from_source(sourcedir, intr), + 'desc': 'Information about projects.', + }, + 'targets': { + 'func': lambda: list_targets(builddata, installdata, backend), + 'no_bd': lambda intr: list_targets_from_source(intr), + 'desc': 'List top level targets.', + }, + 'tests': { + 'func': lambda: list_tests(testdata), + 'desc': 'List all unit tests.', + } } def add_arguments(parser): intro_types = get_meson_introspection_types() for key, val in intro_types.items(): - flag = '--' + key.replace('_', '-') - parser.add_argument(flag, action='store_true', dest=key, default=False, help=val.desc) + flag = '--' + val.get('key', key) + parser.add_argument(flag, action='store_true', dest=key, default=False, help=val['desc']) parser.add_argument('--backend', choices=cdata.backendlist, dest='backend', default='ninja', help='The backend to use for the --buildoptions introspection.') @@ -103,12 +127,12 @@ res[path] = os.path.join(installdata.prefix, installpath) return res -def list_targets_from_source(intr: IntrospectionInterpreter) -> T.List[T.Dict[str, T.Union[bool, str, T.List[T.Union[str, T.Dict[str, T.Union[str, T.List[str], bool]]]]]]]: - tlist = [] # type: T.List[T.Dict[str, T.Union[bool, str, T.List[T.Union[str, T.Dict[str, T.Union[str, T.List[str], bool]]]]]]] +def list_targets_from_source(intr: IntrospectionInterpreter): + tlist = [] for i in intr.targets: - sources = [] # type: T.List[str] + sources = [] for n in i['sources']: - args = [] # type: T.List[T.Union[str, StringNode]] + args = [] if isinstance(n, FunctionNode): args = list(n.args.arguments) if n.func_name in build_target_functions: @@ -143,8 +167,8 @@ return tlist -def list_targets(builddata: build.Build, installdata, backend: backends.Backend) -> T.List[T.Dict[str, T.Union[bool, str, T.List[T.Union[str, T.Dict[str, T.Union[str, T.List[str], bool]]]]]]]: - tlist = [] # type: T.List[T.Dict[str, T.Union[bool, str, T.List[T.Union[str, T.Dict[str, T.Union[str, T.List[str], bool]]]]]]] +def list_targets(builddata: build.Build, installdata, backend: backends.Backend): + tlist = [] build_dir = builddata.environment.get_build_dir() src_dir = builddata.environment.get_source_dir() @@ -177,11 +201,11 @@ tlist.append(t) return tlist -def list_buildoptions_from_source(intr: IntrospectionInterpreter) -> T.List[T.Dict[str, T.Union[str, bool, int, T.List[str]]]]: +def list_buildoptions_from_source(intr: IntrospectionInterpreter) -> List[dict]: return list_buildoptions(intr.coredata) -def list_buildoptions(coredata: cdata.CoreData) -> T.List[T.Dict[str, T.Union[str, bool, int, T.List[str]]]]: - optlist = [] # type: T.List[T.Dict[str, T.Union[str, bool, int, T.List[str]]]] +def list_buildoptions(coredata: cdata.CoreData) -> List[dict]: + optlist = [] dir_option_names = ['bindir', 'datadir', @@ -204,87 +228,83 @@ test_options = {k: o for k, o in coredata.builtins.items() if k in test_option_names} core_options = {k: o for k, o in coredata.builtins.items() if k in core_option_names} - def add_keys(options: T.Dict[str, cdata.UserOption], section: str, machine: str = 'any') -> None: - for key in sorted(options.keys()): - opt = options[key] - optdict = {'name': key, 'value': opt.value, 'section': section, 'machine': machine} - if isinstance(opt, cdata.UserStringOption): - typestr = 'string' - elif isinstance(opt, cdata.UserBooleanOption): - typestr = 'boolean' - elif isinstance(opt, cdata.UserComboOption): - optdict['choices'] = opt.choices - typestr = 'combo' - elif isinstance(opt, cdata.UserIntegerOption): - typestr = 'integer' - elif isinstance(opt, cdata.UserArrayOption): - typestr = 'array' - else: - raise RuntimeError("Unknown option type") - optdict['type'] = typestr - optdict['description'] = opt.description - optlist.append(optdict) - - add_keys(core_options, 'core') - add_keys(coredata.builtins_per_machine.host, 'core', machine='host') + add_keys(optlist, core_options, 'core') + add_keys(optlist, coredata.builtins_per_machine.host, 'core', machine='host') add_keys( + optlist, {'build.' + k: o for k, o in coredata.builtins_per_machine.build.items()}, 'core', machine='build', ) - add_keys(coredata.backend_options, 'backend') - add_keys(coredata.base_options, 'base') - add_keys(coredata.compiler_options.host, 'compiler', machine='host') + add_keys(optlist, coredata.backend_options, 'backend') + add_keys(optlist, coredata.base_options, 'base') + add_keys(optlist, coredata.compiler_options.host, 'compiler', machine='host') add_keys( + optlist, {'build.' + k: o for k, o in coredata.compiler_options.build.items()}, 'compiler', machine='build', ) - add_keys(dir_options, 'directory') - add_keys(coredata.user_options, 'user') - add_keys(test_options, 'test') + add_keys(optlist, dir_options, 'directory') + add_keys(optlist, coredata.user_options, 'user') + add_keys(optlist, test_options, 'test') return optlist -def find_buildsystem_files_list(src_dir) -> T.List[str]: +def add_keys(optlist, options: Dict[str, cdata.UserOption], section: str, machine: str = 'any'): + keys = list(options.keys()) + keys.sort() + for key in keys: + opt = options[key] + optdict = {'name': key, 'value': opt.value, 'section': section, 'machine': machine} + if isinstance(opt, cdata.UserStringOption): + typestr = 'string' + elif isinstance(opt, cdata.UserBooleanOption): + typestr = 'boolean' + elif isinstance(opt, cdata.UserComboOption): + optdict['choices'] = opt.choices + typestr = 'combo' + elif isinstance(opt, cdata.UserIntegerOption): + typestr = 'integer' + elif isinstance(opt, cdata.UserArrayOption): + typestr = 'array' + else: + raise RuntimeError("Unknown option type") + optdict['type'] = typestr + optdict['description'] = opt.description + optlist.append(optdict) + +def find_buildsystem_files_list(src_dir): # I feel dirty about this. But only slightly. - filelist = [] # type: T.List[str] + filelist = [] for root, _, files in os.walk(src_dir): for f in files: if f == 'meson.build' or f == 'meson_options.txt': filelist.append(os.path.relpath(os.path.join(root, f), src_dir)) return filelist -def list_buildsystem_files(builddata: build.Build) -> T.List[str]: +def list_buildsystem_files(builddata: build.Build): src_dir = builddata.environment.get_source_dir() filelist = find_buildsystem_files_list(src_dir) filelist = [os.path.join(src_dir, x) for x in filelist] return filelist -def list_deps_from_source(intr: IntrospectionInterpreter) -> T.List[T.Dict[str, T.Union[str, bool]]]: - result = [] # type: T.List[T.Dict[str, T.Union[str, bool]]] +def list_deps_from_source(intr: IntrospectionInterpreter): + result = [] for i in intr.dependencies: - keys = [ - 'name', - 'required', - 'version', - 'has_fallback', - 'conditional', - ] - result += [{k: v for k, v in i.items() if k in keys}] + result += [{k: v for k, v in i.items() if k in ['name', 'required', 'has_fallback', 'conditional']}] return result -def list_deps(coredata: cdata.CoreData) -> T.List[T.Dict[str, T.Union[str, T.List[str]]]]: - result = [] # type: T.List[T.Dict[str, T.Union[str, T.List[str]]]] +def list_deps(coredata: cdata.CoreData): + result = [] for d in coredata.deps.host.values(): if d.found(): result += [{'name': d.name, - 'version': d.get_version(), 'compile_args': d.get_compile_args(), 'link_args': d.get_link_args()}] return result -def get_test_list(testdata) -> T.List[T.Dict[str, T.Union[str, int, T.List[str], T.Dict[str, str]]]]: - result = [] # type: T.List[T.Dict[str, T.Union[str, int, T.List[str], T.Dict[str, str]]]] +def get_test_list(testdata): + result = [] for t in testdata: to = {} if isinstance(t.fname, str): @@ -302,17 +322,16 @@ to['suite'] = t.suite to['is_parallel'] = t.is_parallel to['priority'] = t.priority - to['protocol'] = t.protocol result.append(to) return result -def list_tests(testdata) -> T.List[T.Dict[str, T.Union[str, int, T.List[str], T.Dict[str, str]]]]: +def list_tests(testdata): return get_test_list(testdata) -def list_benchmarks(benchdata) -> T.List[T.Dict[str, T.Union[str, int, T.List[str], T.Dict[str, str]]]]: +def list_benchmarks(benchdata): return get_test_list(benchdata) -def list_projinfo(builddata: build.Build) -> T.Dict[str, T.Union[str, T.List[T.Dict[str, str]]]]: +def list_projinfo(builddata: build.Build): result = {'version': builddata.project_version, 'descriptive_name': builddata.project_name, 'subproject_dir': builddata.subproject_dir} @@ -325,8 +344,7 @@ result['subprojects'] = subprojects return result -def list_projinfo_from_source(intr: IntrospectionInterpreter) -> T.Dict[str, T.Union[str, T.List[T.Dict[str, str]]]]: - sourcedir = intr.source_root +def list_projinfo_from_source(sourcedir: str, intr: IntrospectionInterpreter): files = find_buildsystem_files_list(sourcedir) files = [os.path.normpath(x) for x in files] @@ -339,7 +357,7 @@ intr.project_data['subproject_dir'] = intr.subproject_dir return intr.project_data -def print_results(options, results: T.Sequence[T.Tuple[str, T.Union[dict, T.List[T.Any]]]], indent: int) -> int: +def print_results(options, results, indent): if not results and not options.force_dict: print('No command specified') return 1 @@ -353,14 +371,14 @@ print(json.dumps(out, indent=indent)) return 0 -def run(options) -> int: +def run(options): datadir = 'meson-private' infodir = 'meson-info' if options.builddir is not None: datadir = os.path.join(options.builddir, datadir) infodir = os.path.join(options.builddir, infodir) indent = 4 if options.indent else None - results = [] # type: T.List[T.Tuple[str, T.Union[dict, T.List[T.Any]]]] + results = [] sourcedir = '.' if options.builddir == 'meson.build' else options.builddir[:-11] intro_types = get_meson_introspection_types(sourcedir=sourcedir) @@ -370,12 +388,12 @@ backend = backends.get_backend_from_name(options.backend, None) intr = IntrospectionInterpreter(sourcedir, '', backend.name, visitors = [AstIDGenerator(), AstIndentationGenerator(), AstConditionLevel()]) intr.analyze() - # Re-enable logging just in case + # Reenable logging just in case mlog.enable() for key, val in intro_types.items(): - if (not options.all and not getattr(options, key, False)) or not val.no_bd: + if (not options.all and not getattr(options, key, False)) or 'no_bd' not in val: continue - results += [(key, val.no_bd(intr))] + results += [(key, val['no_bd'](intr))] return print_results(options, results, indent) infofile = get_meson_info_file(infodir) @@ -386,6 +404,7 @@ 'meson version. Please regenerate it in this case.') return 1 + intro_vers = '0.0.0' with open(infofile, 'r') as fp: raw = json.load(fp) intro_vers = raw.get('introspection', {}).get('version', {}).get('full', '0.0.0') @@ -400,7 +419,7 @@ # Extract introspection information from JSON for i in intro_types.keys(): - if not intro_types[i].func: + if 'func' not in intro_types[i]: continue if not options.all and not getattr(options, i, False): continue @@ -413,9 +432,9 @@ return print_results(options, results, indent) -updated_introspection_files = [] # type: T.List[str] +updated_introspection_files = [] -def write_intro_info(intro_info: T.Sequence[T.Tuple[str, T.Union[dict, T.List[T.Any]]]], info_dir: str) -> None: +def write_intro_info(intro_info, info_dir): global updated_introspection_files for i in intro_info: out_file = os.path.join(info_dir, 'intro-{}.json'.format(i[0])) @@ -426,26 +445,26 @@ os.replace(tmp_file, out_file) updated_introspection_files += [i[0]] -def generate_introspection_file(builddata: build.Build, backend: backends.Backend) -> None: +def generate_introspection_file(builddata: build.Build, backend: backends.Backend): coredata = builddata.environment.get_coredata() intro_types = get_meson_introspection_types(coredata=coredata, builddata=builddata, backend=backend) - intro_info = [] # type: T.List[T.Tuple[str, T.Union[dict, T.List[T.Any]]]] + intro_info = [] for key, val in intro_types.items(): - if not val.func: + if 'func' not in val: continue - intro_info += [(key, val.func())] + intro_info += [(key, val['func']())] write_intro_info(intro_info, builddata.environment.info_dir) -def update_build_options(coredata: cdata.CoreData, info_dir) -> None: +def update_build_options(coredata: cdata.CoreData, info_dir): intro_info = [ ('buildoptions', list_buildoptions(coredata)) ] write_intro_info(intro_info, info_dir) -def split_version_string(version: str) -> T.Dict[str, T.Union[str, int]]: +def split_version_string(version: str): vers_list = version.split('.') return { 'full': version, @@ -454,7 +473,7 @@ 'patch': int(vers_list[2] if len(vers_list) > 2 else 0) } -def write_meson_info_file(builddata: build.Build, errors: list, build_files_updated: bool = False) -> None: +def write_meson_info_file(builddata: build.Build, errors: list, build_files_updated: bool = False): global updated_introspection_files info_dir = builddata.environment.info_dir info_file = get_meson_info_file(info_dir) @@ -462,7 +481,7 @@ intro_info = {} for i in intro_types.keys(): - if not intro_types[i].func: + if 'func' not in intro_types[i]: continue intro_info[i] = { 'file': 'intro-{}.json'.format(i), diff -Nru meson-0.53.2/mesonbuild/mlog.py meson-0.52.1/mesonbuild/mlog.py --- meson-0.53.2/mesonbuild/mlog.py 2020-02-25 18:00:46.000000000 +0000 +++ meson-0.52.1/mesonbuild/mlog.py 2019-11-28 17:37:44.000000000 +0000 @@ -17,9 +17,9 @@ import sys import time import platform -import typing as T from contextlib import contextmanager -from pathlib import Path +import typing +from typing import Any, Generator, List, Optional, Sequence, TextIO, Union """This is (mostly) a standalone module used to write logging information about Meson runs. Some output goes to screen, @@ -40,25 +40,21 @@ # original behavior return bool(kernel.SetConsoleMode(stdout, mode.value | 0x4) or os.environ.get('ANSICON')) -def setup_console() -> bool: - try: - if platform.system().lower() == 'windows': - return os.isatty(sys.stdout.fileno()) and _windows_ansi() - return os.isatty(sys.stdout.fileno()) and os.environ.get('TERM') != 'dumb' - except Exception: - return False - -colorize_console = setup_console() -log_dir = None # type: T.Optional[str] -log_file = None # type: T.Optional[T.TextIO] +try: + if platform.system().lower() == 'windows': + colorize_console = os.isatty(sys.stdout.fileno()) and _windows_ansi() # type: bool + else: + colorize_console = os.isatty(sys.stdout.fileno()) and os.environ.get('TERM') != 'dumb' +except Exception: + colorize_console = False +log_dir = None # type: Optional[str] +log_file = None # type: Optional[TextIO] log_fname = 'meson-log.txt' # type: str log_depth = 0 # type: int -log_timestamp_start = None # type: T.Optional[float] +log_timestamp_start = None # type: Optional[float] log_fatal_warnings = False # type: bool log_disable_stdout = False # type: bool log_errors_only = False # type: bool -_in_ci = 'CI' in os.environ # type: bool -_logged_once = set() # type: T.Set[T.Tuple[str, ...]] def disable() -> None: global log_disable_stdout @@ -86,7 +82,7 @@ global log_timestamp_start log_timestamp_start = start -def shutdown() -> T.Optional[str]: +def shutdown() -> Optional[str]: global log_file if log_file is not None: path = log_file.name @@ -130,25 +126,10 @@ def cyan(text: str) -> AnsiDecorator: return AnsiDecorator(text, "\033[1;36m") -def normal_red(text: str) -> AnsiDecorator: - return AnsiDecorator(text, "\033[31m") - -def normal_green(text: str) -> AnsiDecorator: - return AnsiDecorator(text, "\033[32m") - -def normal_yellow(text: str) -> AnsiDecorator: - return AnsiDecorator(text, "\033[33m") - -def normal_blue(text: str) -> AnsiDecorator: - return AnsiDecorator(text, "\033[34m") - -def normal_cyan(text: str) -> AnsiDecorator: - return AnsiDecorator(text, "\033[36m") - # This really should be AnsiDecorator or anything that implements # __str__(), but that requires protocols from typing_extensions -def process_markup(args: T.Sequence[T.Union[AnsiDecorator, str]], keep: bool) -> T.List[str]: - arr = [] # type: T.List[str] +def process_markup(args: Sequence[Union[AnsiDecorator, str]], keep: bool) -> List[str]: + arr = [] # type: List[str] if log_timestamp_start is not None: arr = ['[{:.3f}]'.format(time.monotonic() - log_timestamp_start)] for arg in args: @@ -162,7 +143,8 @@ arr.append(str(arg)) return arr -def force_print(*args: str, **kwargs: T.Any) -> None: +def force_print(*args: str, **kwargs: Any) -> None: + global log_disable_stdout if log_disable_stdout: return iostr = io.StringIO() @@ -181,24 +163,16 @@ cleaned = raw.encode('ascii', 'replace').decode('ascii') print(cleaned, end='') -# We really want a heterogeneous dict for this, but that's in typing_extensions -def debug(*args: T.Union[str, AnsiDecorator], **kwargs: T.Any) -> None: +# We really want a heterogenous dict for this, but that's in typing_extensions +def debug(*args: Union[str, AnsiDecorator], **kwargs: Any) -> None: arr = process_markup(args, False) if log_file is not None: print(*arr, file=log_file, **kwargs) log_file.flush() -def _debug_log_cmd(cmd: str, args: T.List[str]) -> None: - if not _in_ci: - return - args = ['"{}"'.format(x) for x in args] # Quote all args, just in case - debug('!meson_ci!/{} {}'.format(cmd, ' '.join(args))) - -def cmd_ci_include(file: str) -> None: - _debug_log_cmd('ci_include', [file]) - -def log(*args: T.Union[str, AnsiDecorator], is_error: bool = False, - **kwargs: T.Any) -> None: +def log(*args: Union[str, AnsiDecorator], is_error: bool = False, + **kwargs: Any) -> None: + global log_errors_only arr = process_markup(args, False) if log_file is not None: print(*arr, file=log_file, **kwargs) @@ -208,29 +182,15 @@ if not log_errors_only or is_error: force_print(*arr, **kwargs) -def log_once(*args: T.Union[str, AnsiDecorator], is_error: bool = False, - **kwargs: T.Any) -> None: - """Log variant that only prints a given message one time per meson invocation. - - This considers nasi decorated values by the values they wrap without - regard for the AnsiDecorator itself. - """ - t = tuple(a.text if isinstance(a, AnsiDecorator) else a for a in args) - if t in _logged_once: - return - _logged_once.add(t) - log(*args, is_error=is_error, **kwargs) - -def _log_error(severity: str, *rargs: T.Union[str, AnsiDecorator], - once: bool = False, **kwargs: T.Any) -> None: +def _log_error(severity: str, *rargs: Union[str, AnsiDecorator], **kwargs: Any) -> None: from .mesonlib import get_error_location_string from .environment import build_filename from .mesonlib import MesonException # The tping requirements here are non-obvious. Lists are invariant, - # therefore T.List[A] and T.List[T.Union[A, B]] are not able to be joined + # therefore List[A] and List[Union[A, B]] are not able to be joined if severity == 'warning': - label = [yellow('WARNING:')] # type: T.List[T.Union[str, AnsiDecorator]] + label = [yellow('WARNING:')] # type: List[Union[str, AnsiDecorator]] elif severity == 'error': label = [red('ERROR:')] elif severity == 'deprecation': @@ -244,53 +204,35 @@ if location is not None: location_file = os.path.join(location.subdir, build_filename) location_str = get_error_location_string(location_file, location.lineno) - # Unions are frankly awful, and we have to T.cast here to get mypy + # Unions are frankly awful, and we have to cast here to get mypy # to understand that the list concatenation is safe - location_list = T.cast(T.List[T.Union[str, AnsiDecorator]], [location_str]) + location_list = typing.cast(List[Union[str, AnsiDecorator]], [location_str]) args = location_list + args - if once: - log_once(*args, **kwargs) - else: - log(*args, **kwargs) + log(*args, **kwargs) + global log_fatal_warnings if log_fatal_warnings: raise MesonException("Fatal warnings enabled, aborting") -def error(*args: T.Union[str, AnsiDecorator], once: bool = False, **kwargs: T.Any) -> None: - return _log_error('error', *args, **kwargs, is_error=True, once=once) - -def warning(*args: T.Union[str, AnsiDecorator], once: bool = False, **kwargs: T.Any) -> None: - return _log_error('warning', *args, **kwargs, is_error=True, once=once) - -def deprecation(*args: T.Union[str, AnsiDecorator], once: bool = False, **kwargs: T.Any) -> None: - return _log_error('deprecation', *args, **kwargs, is_error=True, once=once) +def error(*args: Union[str, AnsiDecorator], **kwargs: Any) -> None: + return _log_error('error', *args, **kwargs, is_error=True) -def get_relative_path(target: Path, current: Path) -> Path: - """Get the path to target from current""" - # Go up "current" until we find a common ancestor to target - acc = ['.'] - for part in [current, *current.parents]: - try: - path = target.relative_to(part) - return Path(*acc, path) - except ValueError: - pass - acc += ['..'] +def warning(*args: Union[str, AnsiDecorator], **kwargs: Any) -> None: + return _log_error('warning', *args, **kwargs, is_error=True) - # we failed, should not get here - return target +def deprecation(*args: Union[str, AnsiDecorator], **kwargs: Any) -> None: + return _log_error('deprecation', *args, **kwargs, is_error=True) -def exception(e: Exception, prefix: T.Optional[AnsiDecorator] = None) -> None: +def exception(e: Exception, prefix: Optional[AnsiDecorator] = None) -> None: if prefix is None: prefix = red('ERROR:') log() - args = [] # type: T.List[T.Union[AnsiDecorator, str]] + args = [] # type: List[Union[AnsiDecorator, str]] if hasattr(e, 'file') and hasattr(e, 'lineno') and hasattr(e, 'colno'): # Mypy can't figure this out, and it's pretty easy to vidual inspect # that this is correct, so we'll just ignore it. - path = get_relative_path(Path(e.file), Path(os.getcwd())) - args.append('%s:%d:%d:' % (path, e.lineno, e.colno)) # type: ignore + args.append('%s:%d:%d:' % (e.file, e.lineno, e.colno)) # type: ignore if prefix: args.append(prefix) args.append(str(e)) @@ -298,7 +240,7 @@ # Format a list for logging purposes as a string. It separates # all but the last item with commas, and the last with 'and'. -def format_list(input_list: T.List[str]) -> str: +def format_list(input_list: List[str]) -> str: l = len(input_list) if l > 2: return ' and '.join([', '.join(input_list[:-1]), input_list[-1]]) @@ -310,7 +252,7 @@ return '' @contextmanager -def nested() -> T.Generator[None, None, None]: +def nested() -> Generator[None, None, None]: global log_depth log_depth += 1 try: diff -Nru meson-0.53.2/mesonbuild/modules/cmake.py meson-0.52.1/mesonbuild/modules/cmake.py --- meson-0.53.2/mesonbuild/modules/cmake.py 2020-02-25 18:00:46.000000000 +0000 +++ meson-0.52.1/mesonbuild/modules/cmake.py 2019-11-28 17:37:44.000000000 +0000 @@ -18,7 +18,7 @@ from . import ExtensionModule, ModuleReturnValue from .. import build, dependencies, mesonlib, mlog -from ..interpreterbase import permittedKwargs, FeatureNew, stringArgs, InterpreterObject, ObjectHolder, noPosargs +from ..interpreterbase import permittedKwargs, FeatureNew, stringArgs, InterpreterObject, ObjectHolder from ..interpreter import ConfigurationDataHolder, InterpreterException, SubprojectHolder @@ -66,7 +66,6 @@ 'target': self.target, 'target_type': self.target_type, 'target_list': self.target_list, - 'found': self.found_method, }) def _args_to_info(self, args): @@ -106,18 +105,12 @@ info = self._args_to_info(args) return info['func'] - @noPosargs @permittedKwargs({}) def target_list(self, args, kwargs): + if len(args) > 0: + raise InterpreterException('target_list does not take any parameters.') return self.held_object.cm_interpreter.target_list() - @noPosargs - @permittedKwargs({}) - @FeatureNew('CMakeSubproject.found()', '0.53.2') - def found_method(self, args, kwargs): - return self.held_object is not None - - class CmakeModule(ExtensionModule): cmake_detected = False cmake_root = None @@ -145,7 +138,7 @@ cmakebin = dependencies.ExternalProgram('cmake', silent=False) p, stdout, stderr = mesonlib.Popen_safe(cmakebin.get_command() + ['--system-information', '-G', 'Ninja'])[0:3] if p.returncode != 0: - mlog.log('error retrieving cmake information: returnCode={0} stdout={1} stderr={2}'.format(p.returncode, stdout, stderr)) + mlog.log('error retrieving cmake informations: returnCode={0} stdout={1} stderr={2}'.format(p.returncode, stdout, stderr)) return False match = re.search('\nCMAKE_ROOT \\"([^"]+)"\n', stdout.strip()) diff -Nru meson-0.53.2/mesonbuild/modules/fs.py meson-0.52.1/mesonbuild/modules/fs.py --- meson-0.53.2/mesonbuild/modules/fs.py 2020-01-23 12:51:19.000000000 +0000 +++ meson-0.52.1/mesonbuild/modules/fs.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,140 +0,0 @@ -# Copyright 2019 The Meson development team - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import typing as T -import hashlib -from pathlib import Path, PurePath - -from .. import mlog -from . import ExtensionModule -from . import ModuleReturnValue -from ..mesonlib import MesonException - -from ..interpreterbase import stringArgs, noKwargs -if T.TYPE_CHECKING: - from ..interpreter import ModuleState - -class FSModule(ExtensionModule): - - def __init__(self, interpreter): - super().__init__(interpreter) - self.snippets.add('generate_dub_file') - - def _resolve_dir(self, state: 'ModuleState', arg: str) -> Path: - """ - resolves (makes absolute) a directory relative to calling meson.build, - if not already absolute - """ - return Path(state.source_root) / state.subdir / Path(arg).expanduser() - - def _check(self, check: str, state: 'ModuleState', args: T.Sequence[str]) -> ModuleReturnValue: - if len(args) != 1: - raise MesonException('fs.{} takes exactly one argument.'.format(check)) - test_file = self._resolve_dir(state, args[0]) - return ModuleReturnValue(getattr(test_file, check)(), []) - - @stringArgs - @noKwargs - def exists(self, state: 'ModuleState', args: T.Sequence[str], kwargs: dict) -> ModuleReturnValue: - return self._check('exists', state, args) - - @stringArgs - @noKwargs - def is_symlink(self, state: 'ModuleState', args: T.Sequence[str], kwargs: dict) -> ModuleReturnValue: - return self._check('is_symlink', state, args) - - @stringArgs - @noKwargs - def is_file(self, state: 'ModuleState', args: T.Sequence[str], kwargs: dict) -> ModuleReturnValue: - return self._check('is_file', state, args) - - @stringArgs - @noKwargs - def is_dir(self, state: 'ModuleState', args: T.Sequence[str], kwargs: dict) -> ModuleReturnValue: - return self._check('is_dir', state, args) - - @stringArgs - @noKwargs - def hash(self, state: 'ModuleState', args: T.Sequence[str], kwargs: dict) -> ModuleReturnValue: - if len(args) != 2: - raise MesonException('method takes exactly two arguments.') - file = self._resolve_dir(state, args[0]) - if not file.is_file(): - raise MesonException('{} is not a file and therefore cannot be hashed'.format(file)) - try: - h = hashlib.new(args[1]) - except ValueError: - raise MesonException('hash algorithm {} is not available'.format(args[1])) - mlog.debug('computing {} sum of {} size {} bytes'.format(args[1], file, file.stat().st_size)) - h.update(file.read_bytes()) - return ModuleReturnValue(h.hexdigest(), []) - - @stringArgs - @noKwargs - def size(self, state: 'ModuleState', args: T.Sequence[str], kwargs: dict) -> ModuleReturnValue: - if len(args) != 1: - raise MesonException('method takes exactly one argument.') - file = self._resolve_dir(state, args[0]) - if not file.is_file(): - raise MesonException('{} is not a file and therefore cannot be sized'.format(file)) - try: - return ModuleReturnValue(file.stat().st_size, []) - except ValueError: - raise MesonException('{} size could not be determined'.format(args[0])) - - @stringArgs - @noKwargs - def is_samepath(self, state: 'ModuleState', args: T.Sequence[str], kwargs: dict) -> ModuleReturnValue: - if len(args) != 2: - raise MesonException('fs.is_samepath takes exactly two arguments.') - file1 = self._resolve_dir(state, args[0]) - file2 = self._resolve_dir(state, args[1]) - if not file1.exists(): - return ModuleReturnValue(False, []) - if not file2.exists(): - return ModuleReturnValue(False, []) - try: - return ModuleReturnValue(file1.samefile(file2), []) - except OSError: - return ModuleReturnValue(False, []) - - @stringArgs - @noKwargs - def replace_suffix(self, state: 'ModuleState', args: T.Sequence[str], kwargs: dict) -> ModuleReturnValue: - if len(args) != 2: - raise MesonException('method takes exactly two arguments.') - original = PurePath(args[0]) - new = original.with_suffix(args[1]) - return ModuleReturnValue(str(new), []) - - @stringArgs - @noKwargs - def parent(self, state: 'ModuleState', args: T.Sequence[str], kwargs: dict) -> ModuleReturnValue: - if len(args) != 1: - raise MesonException('method takes exactly one argument.') - original = PurePath(args[0]) - new = original.parent - return ModuleReturnValue(str(new), []) - - @stringArgs - @noKwargs - def name(self, state: 'ModuleState', args: T.Sequence[str], kwargs: dict) -> ModuleReturnValue: - if len(args) != 1: - raise MesonException('method takes exactly one argument.') - original = PurePath(args[0]) - new = original.name - return ModuleReturnValue(str(new), []) - -def initialize(*args, **kwargs) -> FSModule: - return FSModule(*args, **kwargs) diff -Nru meson-0.53.2/mesonbuild/modules/gnome.py meson-0.52.1/mesonbuild/modules/gnome.py --- meson-0.53.2/mesonbuild/modules/gnome.py 2019-12-04 18:45:50.000000000 +0000 +++ meson-0.52.1/mesonbuild/modules/gnome.py 2019-11-28 17:37:44.000000000 +0000 @@ -47,7 +47,7 @@ def gir_has_option(intr_obj, option): try: g_ir_scanner = intr_obj.find_program_impl('g-ir-scanner') - # Handle overridden g-ir-scanner + # Handle overriden g-ir-scanner if isinstance(getattr(g_ir_scanner, "held_object", g_ir_scanner), interpreter.OverrideProgram): assert option in ['--extra-library', '--sources-top-dirs'] return True diff -Nru meson-0.53.2/mesonbuild/modules/__init__.py meson-0.52.1/mesonbuild/modules/__init__.py --- meson-0.53.2/mesonbuild/modules/__init__.py 2019-12-04 18:45:50.000000000 +0000 +++ meson-0.52.1/mesonbuild/modules/__init__.py 2019-11-28 17:37:44.000000000 +0000 @@ -1,20 +1,3 @@ -# Copyright 2019 The Meson development team - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# This file contains the detection logic for external dependencies that -# are UI-related. - import os from .. import build diff -Nru meson-0.53.2/mesonbuild/modules/pkgconfig.py meson-0.52.1/mesonbuild/modules/pkgconfig.py --- meson-0.53.2/mesonbuild/modules/pkgconfig.py 2020-01-23 22:29:05.000000000 +0000 +++ meson-0.52.1/mesonbuild/modules/pkgconfig.py 2019-11-28 17:37:44.000000000 +0000 @@ -231,7 +231,7 @@ return l.name[3:] # If the library is imported via an import library which is always # named after the target name, '-lfoo' is correct. - if isinstance(l, build.SharedLibrary) and l.import_filename: + if l.import_filename: return l.name # In other cases, we can't guarantee that the compiler will be able to # find the library via '-lfoo', so tell the user that. @@ -437,10 +437,7 @@ pcfile = filebase + '.pc' pkgroot = kwargs.get('install_dir', default_install_dir) if pkgroot is None: - if mesonlib.is_freebsd(): - pkgroot = os.path.join(state.environment.coredata.get_builtin_option('prefix'), 'libdata', 'pkgconfig') - else: - pkgroot = os.path.join(state.environment.coredata.get_builtin_option('libdir'), 'pkgconfig') + pkgroot = os.path.join(state.environment.coredata.get_builtin_option('libdir'), 'pkgconfig') if not isinstance(pkgroot, str): raise mesonlib.MesonException('Install_dir must be a string.') self.generate_pkgconfig_file(state, deps, subdirs, name, description, url, diff -Nru meson-0.53.2/mesonbuild/modules/python.py meson-0.52.1/mesonbuild/modules/python.py --- meson-0.53.2/mesonbuild/modules/python.py 2020-02-25 18:00:46.000000000 +0000 +++ meson-0.52.1/mesonbuild/modules/python.py 2019-10-06 17:01:35.000000000 +0000 @@ -15,7 +15,7 @@ import os import json import shutil -import typing as T +import typing from pathlib import Path from .. import mesonlib @@ -27,7 +27,7 @@ InvalidArguments, FeatureNew, FeatureNewKwargs, disablerIfNotFound ) -from ..interpreter import ExternalProgramHolder, extract_required_kwarg, permitted_kwargs +from ..interpreter import ExternalProgramHolder, extract_required_kwarg from ..build import known_shmod_kwargs from .. import mlog from ..environment import detect_cpu_family @@ -47,7 +47,6 @@ super().__init__('python', environment, None, kwargs) self.name = 'python' self.static = kwargs.get('static', False) - self.embed = kwargs.get('embed', False) self.version = python_holder.version self.platform = python_holder.platform self.pkgdep = None @@ -63,11 +62,9 @@ if DependencyMethods.PKGCONFIG in self.methods and not python_holder.is_pypy: pkg_version = self.variables.get('LDVERSION') or self.version pkg_libdir = self.variables.get('LIBPC') - pkg_embed = '-embed' if self.embed and mesonlib.version_compare(self.version, '>=3.8') else '' - pkg_name = 'python-{}{}'.format(pkg_version, pkg_embed) # If python-X.Y.pc exists in LIBPC, we will try to use it - if pkg_libdir is not None and Path(os.path.join(pkg_libdir, '{}.pc'.format(pkg_name))).is_file(): + if pkg_libdir is not None and Path(os.path.join(pkg_libdir, 'python-{}.pc'.format(pkg_version))).is_file(): old_pkg_libdir = os.environ.get('PKG_CONFIG_LIBDIR') old_pkg_path = os.environ.get('PKG_CONFIG_PATH') @@ -77,11 +74,11 @@ os.environ['PKG_CONFIG_LIBDIR'] = pkg_libdir try: - self.pkgdep = PkgConfigDependency(pkg_name, environment, kwargs) - mlog.debug('Found "{}" via pkgconfig lookup in LIBPC ({})'.format(pkg_name, pkg_libdir)) + self.pkgdep = PkgConfigDependency('python-{}'.format(pkg_version), environment, kwargs) + mlog.debug('Found "python-{}" via pkgconfig lookup in LIBPC ({})'.format(pkg_version, pkg_libdir)) py_lookup_method = 'pkgconfig' except MesonException as e: - mlog.debug('"{}" could not be found in LIBPC ({})'.format(pkg_name, pkg_libdir)) + mlog.debug('"python-{}" could not be found in LIBPC ({})'.format(pkg_version, pkg_libdir)) mlog.debug(e) if old_pkg_path is not None: @@ -92,16 +89,16 @@ else: os.environ.pop('PKG_CONFIG_LIBDIR', None) else: - mlog.debug('"{}" could not be found in LIBPC ({}), this is likely due to a relocated python installation'.format(pkg_name, pkg_libdir)) + mlog.debug('"python-{}" could not be found in LIBPC ({}), this is likely due to a relocated python installation'.format(pkg_version, pkg_libdir)) # If lookup via LIBPC failed, try to use fallback PKG_CONFIG_LIBDIR/PKG_CONFIG_PATH mechanisms if self.pkgdep is None or not self.pkgdep.found(): try: - self.pkgdep = PkgConfigDependency(pkg_name, environment, kwargs) - mlog.debug('Found "{}" via fallback pkgconfig lookup in PKG_CONFIG_LIBDIR/PKG_CONFIG_PATH'.format(pkg_name)) + self.pkgdep = PkgConfigDependency('python-{}'.format(pkg_version), environment, kwargs) + mlog.debug('Found "python-{}" via fallback pkgconfig lookup in PKG_CONFIG_LIBDIR/PKG_CONFIG_PATH'.format(pkg_version)) py_lookup_method = 'pkgconfig-fallback' except MesonException as e: - mlog.debug('"{}" could not be found via fallback pkgconfig lookup in PKG_CONFIG_LIBDIR/PKG_CONFIG_PATH'.format(pkg_name)) + mlog.debug('"python-{}" could not be found via fallback pkgconfig lookup in PKG_CONFIG_LIBDIR/PKG_CONFIG_PATH'.format(pkg_version)) mlog.debug(e) if self.pkgdep and self.pkgdep.found(): @@ -348,14 +345,7 @@ return self.interpreter.func_shared_module(None, args, kwargs) - @permittedKwargs(permitted_kwargs['dependency']) - @FeatureNewKwargs('python_installation.dependency', '0.53.0', ['embed']) def dependency_method(self, args, kwargs): - if args: - mlog.warning('python_installation.dependency() does not take any ' - 'positional arguments. It always returns a Python ' - 'dependency. This will become an error in the future.', - location=self.interpreter.current_node) dep = PythonDependency(self, self.interpreter.environment, kwargs) return self.interpreter.holderify(dep) @@ -499,9 +489,9 @@ def find_installation(self, interpreter, state, args, kwargs): feature_check = FeatureNew('Passing "feature" option to find_installation', '0.48.0') disabled, required, feature = extract_required_kwarg(kwargs, state.subproject, feature_check) - want_modules = mesonlib.extract_as_list(kwargs, 'modules') # type: T.List[str] - found_modules = [] # type: T.List[str] - missing_modules = [] # type: T.List[str] + want_modules = mesonlib.extract_as_list(kwargs, 'modules') # type: typing.List[str] + found_modules = [] # type: typing.List[str] + missing_modules = [] # type: typing.List[str] if len(args) > 1: raise InvalidArguments('find_installation takes zero or one positional argument.') diff -Nru meson-0.53.2/mesonbuild/modules/qt.py meson-0.52.1/mesonbuild/modules/qt.py --- meson-0.53.2/mesonbuild/modules/qt.py 2019-12-04 18:45:50.000000000 +0000 +++ meson-0.52.1/mesonbuild/modules/qt.py 2019-11-28 17:37:44.000000000 +0000 @@ -206,9 +206,6 @@ self._detect_tools(state.environment, kwargs.get('method', 'auto')) translations = [] for ts in ts_files: - if not self.lrelease.found(): - raise MesonException('qt.compile_translations: ' + - self.lrelease.name + ' not found') cmd = [self.lrelease, '@INPUT@', '-qm', '@OUTPUT@'] lrelease_kwargs = {'output': '@BASENAME@.qm', 'input': ts, diff -Nru meson-0.53.2/mesonbuild/modules/rpm.py meson-0.52.1/mesonbuild/modules/rpm.py --- meson-0.53.2/mesonbuild/modules/rpm.py 2019-12-29 22:47:27.000000000 +0000 +++ meson-0.52.1/mesonbuild/modules/rpm.py 2019-05-22 21:53:22.000000000 +0000 @@ -151,7 +151,7 @@ def __get_required_compilers(self): required_compilers = set() - for compiler in self.coredata.environment.coredata.compilers.host.values(): + for compiler in self.coredata.compilers.values(): # Elbrus has one 'lcc' package for every compiler if isinstance(compiler, compilers.GnuCCompiler): required_compilers.add('gcc') diff -Nru meson-0.53.2/mesonbuild/modules/unstable_cuda.py meson-0.52.1/mesonbuild/modules/unstable_cuda.py --- meson-0.53.2/mesonbuild/modules/unstable_cuda.py 2019-12-04 18:45:50.000000000 +0000 +++ meson-0.52.1/mesonbuild/modules/unstable_cuda.py 2019-11-28 17:37:44.000000000 +0000 @@ -44,7 +44,6 @@ raise argerror driver_version_table = [ - {'cuda_version': '>=10.2.89', 'windows': '441.22', 'linux': '440.33'}, {'cuda_version': '>=10.1.105', 'windows': '418.96', 'linux': '418.39'}, {'cuda_version': '>=10.0.130', 'windows': '411.31', 'linux': '410.48'}, {'cuda_version': '>=9.2.148', 'windows': '398.26', 'linux': '396.37'}, diff -Nru meson-0.53.2/mesonbuild/modules/unstable_simd.py meson-0.52.1/mesonbuild/modules/unstable_simd.py --- meson-0.53.2/mesonbuild/modules/unstable_simd.py 2019-12-04 18:45:50.000000000 +0000 +++ meson-0.52.1/mesonbuild/modules/unstable_simd.py 2019-11-28 17:37:44.000000000 +0000 @@ -60,7 +60,7 @@ for iset in self.isets: if iset not in kwargs: continue - iset_fname = kwargs[iset] # Might also be an array or Files. static_library will validate. + iset_fname = kwargs[iset] # Migth also be an array or Files. static_library will validate. args = compiler.get_instruction_set_args(iset) if args is None: mlog.log('Compiler supports %s:' % iset, mlog.red('NO')) diff -Nru meson-0.53.2/mesonbuild/mparser.py meson-0.52.1/mesonbuild/mparser.py --- meson-0.53.2/mesonbuild/mparser.py 2019-12-29 22:47:27.000000000 +0000 +++ meson-0.52.1/mesonbuild/mparser.py 2019-11-28 17:37:44.000000000 +0000 @@ -674,8 +674,16 @@ a = ArgumentNode(s) while not isinstance(s, EmptyNode): + potential = self.current if self.accept('colon'): - a.set_kwarg(s, self.statement()) + if not isinstance(s, StringNode): + raise ParseException('Key must be a string.', + self.getline(), s.lineno, s.colno) + if s.value in a.kwargs: + # + 1 to colno to point to the actual string, not the opening quote + raise ParseException('Duplicate dictionary key: {}'.format(s.value), + self.getline(), s.lineno, s.colno + 1) + a.set_kwarg(s.value, self.statement()) potential = self.current if not self.accept('comma'): return a diff -Nru meson-0.53.2/mesonbuild/msetup.py meson-0.52.1/mesonbuild/msetup.py --- meson-0.53.2/mesonbuild/msetup.py 2020-01-23 12:51:19.000000000 +0000 +++ meson-0.52.1/mesonbuild/msetup.py 2019-11-28 17:37:44.000000000 +0000 @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import typing as T import time import sys, stat import datetime @@ -97,11 +96,11 @@ self.options = options - def has_build_file(self, dirname: str) -> bool: + def has_build_file(self, dirname): fname = os.path.join(dirname, environment.build_filename) return os.path.exists(fname) - def validate_core_dirs(self, dir1: str, dir2: str) -> T.Tuple[str, str]: + def validate_core_dirs(self, dir1, dir2): if dir1 is None: if dir2 is None: if not os.path.exists('meson.build') and os.path.exists('../meson.build'): @@ -131,7 +130,7 @@ return ndir2, ndir1 raise MesonException('Neither directory contains a build file %s.' % environment.build_filename) - def validate_dirs(self, dir1: str, dir2: str, reconfigure: bool, wipe: bool) -> T.Tuple[str, str]: + def validate_dirs(self, dir1, dir2, reconfigure, wipe): (src_dir, build_dir) = self.validate_core_dirs(dir1, dir2) priv_dir = os.path.join(build_dir, 'meson-private/coredata.dat') if os.path.exists(priv_dir): @@ -143,11 +142,12 @@ '\nIf build failures persist, run "meson setup --wipe" to rebuild from scratch\n' 'using the same options as passed when configuring the build.' '\nTo change option values, run "meson configure" instead.') - raise SystemExit + sys.exit(0) else: has_cmd_line_file = os.path.exists(coredata.get_cmd_line_file(build_dir)) if (wipe and not has_cmd_line_file) or (not wipe and reconfigure): - raise SystemExit('Directory does not contain a valid build tree:\n{}'.format(build_dir)) + print('Directory does not contain a valid build tree:\n{}'.format(build_dir)) + sys.exit(1) return src_dir, build_dir def generate(self): @@ -239,7 +239,7 @@ os.unlink(cdf) raise -def run(options) -> int: +def run(options): coredata.parse_cmd_line_options(options) app = MesonApp(options) app.generate() diff -Nru meson-0.53.2/mesonbuild/msubprojects.py meson-0.52.1/mesonbuild/msubprojects.py --- meson-0.53.2/mesonbuild/msubprojects.py 2020-01-23 12:51:19.000000000 +0000 +++ meson-0.52.1/mesonbuild/msubprojects.py 2019-11-28 15:13:28.000000000 +0000 @@ -2,7 +2,7 @@ import argparse from . import mlog -from .mesonlib import git, Popen_safe +from .mesonlib import Popen_safe from .wrap.wrap import API_ROOT, PackageDefinition, Resolver, WrapException from .wrap import wraptool @@ -39,12 +39,16 @@ mlog.log(' -> Subproject has not changed, or the new source/patch needs to be extracted on the same location.\n' + ' In that case, delete', mlog.bold(repo_dir), 'and run', mlog.bold('meson --reconfigure')) -def git_output(cmd, workingdir): - return git(cmd, workingdir, check=True, universal_newlines=True, - stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout +def git(cmd, workingdir): + return subprocess.check_output(['git', '-C', workingdir] + cmd, + # Redirect stdin to DEVNULL otherwise git + # messes up the console and ANSI colors stop + # working on Windows. + stdin=subprocess.DEVNULL, + stderr=subprocess.STDOUT).decode() def git_show(repo_dir): - commit_message = git_output(['show', '--quiet', '--pretty=format:%h%n%d%n%s%n[%an]'], repo_dir) + commit_message = git(['show', '--quiet', '--pretty=format:%h%n%d%n%s%n[%an]'], repo_dir) parts = [s.strip() for s in commit_message.split('\n')] mlog.log(' ->', mlog.yellow(parts[0]), mlog.red(parts[1]), parts[2], mlog.blue(parts[3])) @@ -53,12 +57,12 @@ mlog.log(' -> Not used.') return revision = wrap.get('revision') - ret = git_output(['rev-parse', '--abbrev-ref', 'HEAD'], repo_dir).strip() + ret = git(['rev-parse', '--abbrev-ref', 'HEAD'], repo_dir).strip() if ret == 'HEAD': try: # We are currently in detached mode, just checkout the new revision - git_output(['fetch'], repo_dir) - git_output(['checkout', revision], repo_dir) + git(['fetch'], repo_dir) + git(['checkout', revision], repo_dir) except subprocess.CalledProcessError as e: out = e.output.decode().strip() mlog.log(' -> Could not checkout revision', mlog.cyan(revision)) @@ -68,7 +72,7 @@ elif ret == revision: try: # We are in the same branch, pull latest commits - git_output(['-c', 'rebase.autoStash=true', 'pull', '--rebase'], repo_dir) + git(['-c', 'rebase.autoStash=true', 'pull', '--rebase'], repo_dir) except subprocess.CalledProcessError as e: out = e.output.decode().strip() mlog.log(' -> Could not rebase', mlog.bold(repo_dir), 'please fix and try again.') @@ -80,8 +84,8 @@ # we should rebase it on top of wrap's branch. if options.rebase: try: - git_output(['fetch'], repo_dir) - git_output(['-c', 'rebase.autoStash=true', 'rebase', revision], repo_dir) + git(['fetch'], repo_dir) + git(['-c', 'rebase.autoStash=true', 'rebase', revision], repo_dir) except subprocess.CalledProcessError as e: out = e.output.decode().strip() mlog.log(' -> Could not rebase', mlog.bold(repo_dir), 'please fix and try again.') @@ -93,7 +97,7 @@ ' To rebase your branch on top of', mlog.bold(revision), 'use', mlog.bold('--rebase'), 'option.') return - git_output(['submodule', 'update', '--checkout', '--recursive'], repo_dir) + git(['submodule', 'update', '--checkout', '--recursive'], repo_dir) git_show(repo_dir) def update_hg(wrap, repo_dir, options): @@ -150,7 +154,7 @@ cmd.insert(1, '-b') mlog.log('Checkout %s in %s...' % (branch_name, wrap.name)) try: - git_output(cmd, repo_dir) + git(cmd, repo_dir) git_show(repo_dir) except subprocess.CalledProcessError as e: out = e.output.decode().strip() @@ -174,17 +178,11 @@ mlog.log(' -> Not downloaded yet') return try: - out = subprocess.check_output([options.command] + options.args, - stderr=subprocess.STDOUT, - cwd=repo_dir).decode() - mlog.log(out, end='') + subprocess.check_call([options.command] + options.args, cwd=repo_dir) + mlog.log('') except subprocess.CalledProcessError as e: - err_message = "Command '%s' returned non-zero exit status %d." % (" ".join(e.cmd), e.returncode) - out = e.output.decode() - mlog.log(' -> ', mlog.red(err_message)) - mlog.log(out, end='') - except Exception as e: - mlog.log(' -> ', mlog.red(str(e))) + out = e.output.decode().strip() + mlog.log(' -> ', mlog.red(out)) def add_common_arguments(p): p.add_argument('--sourcedir', default='.', diff -Nru meson-0.53.2/mesonbuild/mtest.py meson-0.52.1/mesonbuild/mtest.py --- meson-0.53.2/mesonbuild/mtest.py 2020-01-23 12:51:19.000000000 +0000 +++ meson-0.52.1/mesonbuild/mtest.py 2019-11-28 17:37:44.000000000 +0000 @@ -34,7 +34,7 @@ import sys import tempfile import time -import typing as T +import typing from . import build from . import environment @@ -42,7 +42,7 @@ from .dependencies import ExternalProgram from .mesonlib import MesonException, get_wine_shortpath, split_args -if T.TYPE_CHECKING: +if typing.TYPE_CHECKING: from .backend.backends import TestSerialisation # GNU autotools interprets a return code of 77 from tests it executes to @@ -148,7 +148,7 @@ signame = 'SIGinvalid' return '(exit status %d or signal %d %s)' % (retcode, signum, signame) -def env_tuple_to_str(env: T.Iterable[T.Tuple[str, str]]) -> str: +def env_tuple_to_str(env: typing.Iterable[typing.Tuple[str, str]]) -> str: return ''.join(["%s='%s' " % (k, v) for k, v in env]) @@ -187,11 +187,11 @@ _RE_YAML_START = re.compile(r'(\s+)---.*') _RE_YAML_END = re.compile(r'\s+\.\.\.\s*') - def __init__(self, io: T.Iterator[str]): + def __init__(self, io: typing.Iterator[str]): self.io = io - def parse_test(self, ok: bool, num: int, name: str, directive: T.Optional[str], explanation: T.Optional[str]) -> \ - T.Generator[T.Union['TAPParser.Test', 'TAPParser.Error'], None, None]: + def parse_test(self, ok: bool, num: int, name: str, directive: typing.Optional[str], explanation: typing.Optional[str]) -> \ + typing.Generator[typing.Union['TAPParser.Test', 'TAPParser.Error'], None, None]: name = name.strip() explanation = explanation.strip() if explanation else None if directive is not None: @@ -208,7 +208,7 @@ yield self.Test(num, name, TestResult.OK if ok else TestResult.FAIL, explanation) - def parse(self) -> T.Generator[T.Union['TAPParser.Test', 'TAPParser.Error', 'TAPParser.Version', 'TAPParser.Plan', 'TAPParser.Bailout'], None, None]: + def parse(self) -> typing.Generator[typing.Union['TAPParser.Test', 'TAPParser.Error', 'TAPParser.Version', 'TAPParser.Plan', 'TAPParser.Bailout'], None, None]: found_late_test = False bailed_out = False plan = None @@ -319,10 +319,10 @@ class TestRun: @classmethod - def make_exitcode(cls, test: 'TestSerialisation', test_env: T.Dict[str, str], - returncode: int, starttime: float, duration: float, - stdo: T.Optional[str], stde: T.Optional[str], - cmd: T.Optional[T.List[str]]) -> 'TestRun': + def make_exitcode(cls, test: 'TestSerialisation', test_env: typing.Dict[str, str], + returncode: int, duration: float, stdo: typing.Optional[str], + stde: typing.Optional[str], + cmd: typing.Optional[typing.List[str]]) -> 'TestRun': if returncode == GNU_SKIP_RETURNCODE: res = TestResult.SKIP elif returncode == GNU_ERROR_RETURNCODE: @@ -331,13 +331,12 @@ res = TestResult.EXPECTEDFAIL if bool(returncode) else TestResult.UNEXPECTEDPASS else: res = TestResult.FAIL if bool(returncode) else TestResult.OK - return cls(test, test_env, res, returncode, starttime, duration, stdo, stde, cmd) + return cls(test, test_env, res, returncode, duration, stdo, stde, cmd) @classmethod - def make_tap(cls, test: 'TestSerialisation', test_env: T.Dict[str, str], - returncode: int, starttime: float, duration: float, - stdo: str, stde: str, - cmd: T.Optional[T.List[str]]) -> 'TestRun': + def make_tap(cls, test: 'TestSerialisation', test_env: typing.Dict[str, str], + returncode: int, duration: float, stdo: str, stde: str, + cmd: typing.Optional[typing.List[str]]) -> 'TestRun': res = None num_tests = 0 failed = False @@ -370,16 +369,15 @@ else: res = TestResult.FAIL if failed else TestResult.OK - return cls(test, test_env, res, returncode, starttime, duration, stdo, stde, cmd) + return cls(test, test_env, res, returncode, duration, stdo, stde, cmd) - def __init__(self, test: 'TestSerialisation', test_env: T.Dict[str, str], - res: TestResult, returncode: int, starttime: float, duration: float, - stdo: T.Optional[str], stde: T.Optional[str], - cmd: T.Optional[T.List[str]]): + def __init__(self, test: 'TestSerialisation', test_env: typing.Dict[str, str], + res: TestResult, returncode: int, duration: float, + stdo: typing.Optional[str], stde: typing.Optional[str], + cmd: typing.Optional[typing.List[str]]): assert isinstance(res, TestResult) self.res = res self.returncode = returncode - self.starttime = starttime self.duration = duration self.stdo = stdo self.stde = stde @@ -393,10 +391,7 @@ res += 'NONE\n' else: test_only_env = set(self.env.items()) - set(os.environ.items()) - starttime_str = time.strftime("%H:%M:%S", time.gmtime(self.starttime)) - res += '{} {}{}\n'.format( - starttime_str, env_tuple_to_str(test_only_env), ' '.join(self.cmd) - ) + res += '{}{}\n'.format(env_tuple_to_str(test_only_env), ' '.join(self.cmd)) if self.stdo: res += '--- stdout ---\n' res += self.stdo @@ -410,7 +405,7 @@ res += '-------\n\n' return res -def decode(stream: T.Union[None, bytes]) -> str: +def decode(stream: typing.Union[None, bytes]) -> str: if stream is None: return '' try: @@ -418,15 +413,14 @@ except UnicodeDecodeError: return stream.decode('iso-8859-1', errors='ignore') -def write_json_log(jsonlogfile: T.TextIO, test_name: str, result: TestRun) -> None: +def write_json_log(jsonlogfile: typing.TextIO, test_name: str, result: TestRun) -> None: jresult = {'name': test_name, 'stdout': result.stdo, 'result': result.res.value, - 'starttime': result.starttime, 'duration': result.duration, 'returncode': result.returncode, 'env': result.env, - 'command': result.cmd} # type: T.Dict[str, T.Any] + 'command': result.cmd} # type: typing.Dict[str, typing.Any] if result.stde: jresult['stderr'] = result.stde jsonlogfile.write(json.dumps(jresult) + '\n') @@ -436,33 +430,33 @@ return True return False -def load_benchmarks(build_dir: str) -> T.List['TestSerialisation']: +def load_benchmarks(build_dir: str) -> typing.List['TestSerialisation']: datafile = Path(build_dir) / 'meson-private' / 'meson_benchmark_setup.dat' if not datafile.is_file(): raise TestException('Directory {!r} does not seem to be a Meson build directory.'.format(build_dir)) with datafile.open('rb') as f: - obj = T.cast(T.List['TestSerialisation'], pickle.load(f)) + obj = typing.cast(typing.List['TestSerialisation'], pickle.load(f)) return obj -def load_tests(build_dir: str) -> T.List['TestSerialisation']: +def load_tests(build_dir: str) -> typing.List['TestSerialisation']: datafile = Path(build_dir) / 'meson-private' / 'meson_test_setup.dat' if not datafile.is_file(): raise TestException('Directory {!r} does not seem to be a Meson build directory.'.format(build_dir)) with datafile.open('rb') as f: - obj = T.cast(T.List['TestSerialisation'], pickle.load(f)) + obj = typing.cast(typing.List['TestSerialisation'], pickle.load(f)) return obj class SingleTestRunner: - def __init__(self, test: 'TestSerialisation', test_env: T.Dict[str, str], - env: T.Dict[str, str], options: argparse.Namespace): + def __init__(self, test: 'TestSerialisation', test_env: typing.Dict[str, str], + env: typing.Dict[str, str], options: argparse.Namespace): self.test = test self.test_env = test_env self.env = env self.options = options - def _get_cmd(self) -> T.Optional[T.List[str]]: + def _get_cmd(self) -> typing.Optional[typing.List[str]]: if self.test.fname[0].endswith('.jar'): return ['java', '-jar'] + self.test.fname elif not self.test.is_cross_built and run_with_mono(self.test.fname[0]): @@ -486,14 +480,14 @@ cmd = self._get_cmd() if cmd is None: skip_stdout = 'Not run because can not execute cross compiled binaries.' - return TestRun(self.test, self.test_env, TestResult.SKIP, GNU_SKIP_RETURNCODE, time.time(), 0.0, skip_stdout, None, None) + return TestRun(self.test, self.test_env, TestResult.SKIP, GNU_SKIP_RETURNCODE, 0.0, skip_stdout, None, None) else: wrap = TestHarness.get_wrapper(self.options) if self.options.gdb: self.test.timeout = None return self._run_cmd(wrap + cmd + self.test.cmd_args + self.options.test_args) - def _run_cmd(self, cmd: T.List[str]) -> TestRun: + def _run_cmd(self, cmd: typing.List[str]) -> TestRun: starttime = time.time() if len(self.test.extra_paths) > 0: @@ -539,7 +533,7 @@ # We don't want setsid() in gdb because gdb needs the # terminal in order to handle ^C and not show tcsetpgrp() # errors avoid not being able to use the terminal. - os.setsid() # type: ignore + os.setsid() p = subprocess.Popen(cmd, stdout=stdout, @@ -576,11 +570,11 @@ # killing a process and all its children so we need # to roll our own. if is_windows(): - subprocess.run(['taskkill', '/F', '/T', '/PID', str(p.pid)]) + subprocess.call(['taskkill', '/F', '/T', '/PID', str(p.pid)]) else: try: # Kill the process group that setsid() created. - os.killpg(p.pid, signal.SIGKILL) # type: ignore + os.killpg(p.pid, signal.SIGKILL) except ProcessLookupError: # Sometimes (e.g. with Wine) this happens. # There's nothing we can do (maybe the process @@ -616,20 +610,20 @@ stdo = "" stde = additional_error if timed_out: - return TestRun(self.test, self.test_env, TestResult.TIMEOUT, p.returncode, starttime, duration, stdo, stde, cmd) + return TestRun(self.test, self.test_env, TestResult.TIMEOUT, p.returncode, duration, stdo, stde, cmd) else: if self.test.protocol == 'exitcode': - return TestRun.make_exitcode(self.test, self.test_env, p.returncode, starttime, duration, stdo, stde, cmd) + return TestRun.make_exitcode(self.test, self.test_env, p.returncode, duration, stdo, stde, cmd) else: if self.options.verbose: print(stdo, end='') - return TestRun.make_tap(self.test, self.test_env, p.returncode, starttime, duration, stdo, stde, cmd) + return TestRun.make_tap(self.test, self.test_env, p.returncode, duration, stdo, stde, cmd) class TestHarness: def __init__(self, options: argparse.Namespace): self.options = options - self.collected_logs = [] # type: T.List[str] + self.collected_logs = [] # type: typing.List[str] self.fail_count = 0 self.expectedfail_count = 0 self.unexpectedpass_count = 0 @@ -638,9 +632,9 @@ self.timeout_count = 0 self.is_run = False self.tests = None - self.logfilename = None # type: T.Optional[str] - self.logfile = None # type: T.Optional[T.TextIO] - self.jsonlogfile = None # type: T.Optional[T.TextIO] + self.logfilename = None # type: typing.Optional[str] + self.logfile = None # type: typing.Optional[typing.TextIO] + self.jsonlogfile = None # type: typing.Optional[typing.TextIO] if self.options.benchmark: self.tests = load_benchmarks(options.wd) else: @@ -668,7 +662,7 @@ self.jsonlogfile.close() self.jsonlogfile = None - def merge_suite_options(self, options: argparse.Namespace, test: 'TestSerialisation') -> T.Dict[str, str]: + def merge_suite_options(self, options: argparse.Namespace, test: 'TestSerialisation') -> typing.Dict[str, str]: if ':' in options.setup: if options.setup not in self.build_data.test_setups: sys.exit("Unknown test setup '%s'." % options.setup) @@ -720,7 +714,7 @@ else: sys.exit('Unknown test result encountered: {}'.format(result.res)) - def print_stats(self, numlen: int, tests: T.List['TestSerialisation'], + def print_stats(self, numlen: int, tests: typing.List['TestSerialisation'], name: str, result: TestRun, i: int) -> None: startpad = ' ' * (numlen - len('%d' % (i + 1))) num = '%s%d/%d' % (startpad, i + 1, len(tests)) @@ -803,16 +797,16 @@ return self.total_failure_count() @staticmethod - def split_suite_string(suite: str) -> T.Tuple[str, str]: + def split_suite_string(suite: str) -> typing.Tuple[str, str]: if ':' in suite: # mypy can't figure out that str.split(n, 1) will return a list of # length 2, so we have to help it. - return T.cast(T.Tuple[str, str], tuple(suite.split(':', 1))) + return typing.cast(typing.Tuple[str, str], tuple(suite.split(':', 1))) else: return suite, "" @staticmethod - def test_in_suites(test: 'TestSerialisation', suites: T.List[str]) -> bool: + def test_in_suites(test: 'TestSerialisation', suites: typing.List[str]) -> bool: for suite in suites: (prj_match, st_match) = TestHarness.split_suite_string(suite) for prjst in test.suite: @@ -824,7 +818,7 @@ # project_name:suite_name # so we need to select only the test belonging to project_name - # this if handle the first case (i.e., SUITE == suite_name) + # this if hanlde the first case (i.e., SUITE == suite_name) # in this way we can run tests belonging to different # (sub)projects which share the same suite_name @@ -848,7 +842,7 @@ TestHarness.test_in_suites(test, self.options.include_suites)) and not TestHarness.test_in_suites(test, self.options.exclude_suites)) - def get_tests(self) -> T.List['TestSerialisation']: + def get_tests(self) -> typing.List['TestSerialisation']: if not self.tests: print('No tests defined.') return [] @@ -897,8 +891,8 @@ self.logfile.write('Inherited environment: {}\n\n'.format(inherit_env)) @staticmethod - def get_wrapper(options: argparse.Namespace) -> T.List[str]: - wrap = [] # type: T.List[str] + def get_wrapper(options: argparse.Namespace) -> typing.List[str]: + wrap = [] # type: typing.List[str] if options.gdb: wrap = [options.gdb_path, '--quiet', '--nh'] if options.repeat > 1: @@ -919,9 +913,9 @@ else: return test.name - def run_tests(self, tests: T.List['TestSerialisation']) -> None: + def run_tests(self, tests: typing.List['TestSerialisation']) -> None: executor = None - futures = [] # type: T.List[T.Tuple[conc.Future[TestRun], int, T.List[TestSerialisation], str, int]] + futures = [] # type: typing.List[typing.Tuple[conc.Future[TestRun], int, typing.List[TestSerialisation], str, int]] numlen = len('%d' % len(tests)) self.open_log_files() startdir = os.getcwd() @@ -960,7 +954,7 @@ finally: os.chdir(startdir) - def drain_futures(self, futures: T.List[T.Tuple['conc.Future[TestRun]', int, T.List['TestSerialisation'], str, int]]) -> None: + def drain_futures(self, futures: typing.List[typing.Tuple['conc.Future[TestRun]', int, typing.List['TestSerialisation'], str, int]]) -> None: for x in futures: (result, numlen, tests, name, i) = x if self.options.repeat > 1 and self.fail_count: @@ -1052,7 +1046,7 @@ print(e) return 1 -def run_with_args(args: T.List[str]) -> int: +def run_with_args(args: typing.List[str]) -> int: parser = argparse.ArgumentParser(prog='meson test') add_arguments(parser) options = parser.parse_args(args) diff -Nru meson-0.53.2/mesonbuild/munstable_coredata.py meson-0.52.1/mesonbuild/munstable_coredata.py --- meson-0.53.2/mesonbuild/munstable_coredata.py 2019-12-04 18:45:50.000000000 +0000 +++ meson-0.52.1/mesonbuild/munstable_coredata.py 2019-11-28 17:37:44.000000000 +0000 @@ -36,6 +36,9 @@ print(' Full version: ' + compiler.full_version) if compiler.version: print(' Detected version: ' + compiler.version) + if hasattr(compiler, 'compiler_type'): + print(' Detected type: ' + repr(compiler.compiler_type)) + #pprint.pprint(compiler.__dict__) def dump_guids(d): @@ -79,7 +82,7 @@ if all_backends or backend.startswith('vs'): print('Meson command used in build file regeneration: ' + ' '.join(v)) elif k == 'pkgconf_envvar': - print('Last seen PKGCONFIG environment variable value: ' + v) + print('Last seen PKGCONFIG enviroment variable value: ' + v) elif k == 'version': print('Meson version: ' + v) elif k == 'cross_files': diff -Nru meson-0.53.2/mesonbuild/optinterpreter.py meson-0.52.1/mesonbuild/optinterpreter.py --- meson-0.53.2/mesonbuild/optinterpreter.py 2020-01-23 12:51:19.000000000 +0000 +++ meson-0.52.1/mesonbuild/optinterpreter.py 2019-08-25 19:17:02.000000000 +0000 @@ -14,7 +14,7 @@ import os, re import functools -import typing as T +import typing from . import mparser from . import coredata @@ -131,7 +131,7 @@ 'integer': IntegerParser, 'array': string_array_parser, 'feature': FeatureParser, - } # type: T.Dict[str, T.Callable[[str, T.Dict], coredata.UserOption]] + } # type: typing.Dict[str, typing.Callable[[str, typing.Dict], coredata.UserOption]] class OptionInterpreter: def __init__(self, subproject): diff -Nru meson-0.53.2/mesonbuild/rewriter.py meson-0.52.1/mesonbuild/rewriter.py --- meson-0.53.2/mesonbuild/rewriter.py 2020-01-23 12:51:19.000000000 +0000 +++ meson-0.52.1/mesonbuild/rewriter.py 2019-11-28 17:37:44.000000000 +0000 @@ -27,21 +27,21 @@ from mesonbuild.mesonlib import MesonException from . import mlog, environment from functools import wraps +from typing import List, Dict, Optional from .mparser import Token, ArrayNode, ArgumentNode, AssignmentNode, BaseNode, BooleanNode, ElementaryNode, IdNode, FunctionNode, StringNode import json, os, re, sys -import typing as T class RewriterException(MesonException): pass -def add_arguments(parser, formatter=None): +def add_arguments(parser, formater=None): parser.add_argument('-s', '--sourcedir', type=str, default='.', metavar='SRCDIR', help='Path to source directory.') parser.add_argument('-V', '--verbose', action='store_true', default=False, help='Enable verbose output') parser.add_argument('-S', '--skip-errors', dest='skip', action='store_true', default=False, help='Skip errors instead of aborting') subparsers = parser.add_subparsers(dest='type', title='Rewriter commands', description='Rewrite command to execute') # Target - tgt_parser = subparsers.add_parser('target', help='Modify a target', formatter_class=formatter) + tgt_parser = subparsers.add_parser('target', help='Modify a target', formatter_class=formater) tgt_parser.add_argument('-s', '--subdir', default='', dest='subdir', help='Subdirectory of the new target (only for the "add_target" action)') tgt_parser.add_argument('--type', dest='tgt_type', choices=rewriter_keys['target']['target_type'][2], default='executable', help='Type of the target to add (only for the "add_target" action)') @@ -51,7 +51,7 @@ tgt_parser.add_argument('sources', nargs='*', help='Sources to add/remove') # KWARGS - kw_parser = subparsers.add_parser('kwargs', help='Modify keyword arguments', formatter_class=formatter) + kw_parser = subparsers.add_parser('kwargs', help='Modify keyword arguments', formatter_class=formater) kw_parser.add_argument('operation', choices=rewriter_keys['kwargs']['operation'][2], help='Action to execute') kw_parser.add_argument('function', choices=list(rewriter_func_kwargs.keys()), @@ -60,13 +60,13 @@ kw_parser.add_argument('kwargs', nargs='*', help='Pairs of keyword and value') # Default options - def_parser = subparsers.add_parser('default-options', help='Modify the project default options', formatter_class=formatter) + def_parser = subparsers.add_parser('default-options', help='Modify the project default options', formatter_class=formater) def_parser.add_argument('operation', choices=rewriter_keys['default_options']['operation'][2], help='Action to execute') def_parser.add_argument('options', nargs='*', help='Key, value pairs of configuration option') # JSON file/command - cmd_parser = subparsers.add_parser('command', help='Execute a JSON array of commands', formatter_class=formatter) + cmd_parser = subparsers.add_parser('command', help='Execute a JSON array of commands', formatter_class=formater) cmd_parser.add_argument('json', help='JSON string or file to execute') class RequiredKeys: @@ -101,13 +101,13 @@ return wrapped class MTypeBase: - def __init__(self, node: T.Optional[BaseNode] = None): + def __init__(self, node: Optional[BaseNode] = None): if node is None: - self.node = self._new_node() # lgtm [py/init-calls-subclass] (node creation does not depend on base class state) + self.node = self._new_node() else: self.node = node self.node_type = None - for i in self.supported_nodes(): # lgtm [py/init-calls-subclass] (listing nodes does not depend on base class state) + for i in self.supported_nodes(): if isinstance(self.node, i): self.node_type = i @@ -142,7 +142,7 @@ mlog.warning('Cannot remove a regex in type', mlog.bold(type(self).__name__), '--> skipping') class MTypeStr(MTypeBase): - def __init__(self, node: T.Optional[BaseNode] = None): + def __init__(self, node: Optional[BaseNode] = None): super().__init__(node) def _new_node(self): @@ -155,7 +155,7 @@ self.node.value = str(value) class MTypeBool(MTypeBase): - def __init__(self, node: T.Optional[BaseNode] = None): + def __init__(self, node: Optional[BaseNode] = None): super().__init__(node) def _new_node(self): @@ -168,7 +168,7 @@ self.node.value = bool(value) class MTypeID(MTypeBase): - def __init__(self, node: T.Optional[BaseNode] = None): + def __init__(self, node: Optional[BaseNode] = None): super().__init__(node) def _new_node(self): @@ -181,7 +181,7 @@ self.node.value = str(value) class MTypeList(MTypeBase): - def __init__(self, node: T.Optional[BaseNode] = None): + def __init__(self, node: Optional[BaseNode] = None): super().__init__(node) def _new_node(self): @@ -256,7 +256,7 @@ self._remove_helper(regex, self._check_regex_matches) class MTypeStrList(MTypeList): - def __init__(self, node: T.Optional[BaseNode] = None): + def __init__(self, node: Optional[BaseNode] = None): super().__init__(node) def _new_element_node(self, value): @@ -276,7 +276,7 @@ return [StringNode] class MTypeIDList(MTypeList): - def __init__(self, node: T.Optional[BaseNode] = None): + def __init__(self, node: Optional[BaseNode] = None): super().__init__(node) def _new_element_node(self, value): @@ -392,7 +392,7 @@ raise MesonException('Rewriting the meson.build failed') def find_target(self, target: str): - def check_list(name: str) -> T.List[BaseNode]: + def check_list(name: str) -> List[BaseNode]: result = [] for i in self.interpreter.targets: if name == i['name'] or name == i['id']: @@ -744,7 +744,7 @@ mlog.yellow('{}:{}'.format(os.path.join(to_remove.subdir, environment.build_filename), to_remove.lineno))) elif cmd['operation'] == 'info': - # T.List all sources in the target + # List all sources in the target src_list = [] for i in target['sources']: for j in arg_list_from_node(i): @@ -854,7 +854,7 @@ while raw[end] in [' ', '\n', '\t']: end += 1 - files[i['file']]['raw'] = raw[:start] + i['str'] + raw[end:] + raw = files[i['file']]['raw'] = raw[:start] + i['str'] + raw[end:] for i in str_list: if i['action'] in ['modify', 'rm']: @@ -876,20 +876,20 @@ 'info': 'info', } -def list_to_dict(in_list: T.List[str]) -> T.Dict[str, str]: +def list_to_dict(in_list: List[str]) -> Dict[str, str]: result = {} it = iter(in_list) try: for i in it: # calling next(it) is not a mistake, we're taking the next element from - # the iterator, avoiding the need to preprocess it into a sequence of + # the iterator, avoiding te need to preprocess it into a sequence of # key value pairs. result[i] = next(it) except StopIteration: raise TypeError('in_list parameter of list_to_dict must have an even length.') return result -def generate_target(options) -> T.List[dict]: +def generate_target(options) -> List[dict]: return [{ 'type': 'target', 'target': options.target, @@ -899,7 +899,7 @@ 'target_type': options.tgt_type, }] -def generate_kwargs(options) -> T.List[dict]: +def generate_kwargs(options) -> List[dict]: return [{ 'type': 'kwargs', 'function': options.function, @@ -908,14 +908,14 @@ 'kwargs': list_to_dict(options.kwargs), }] -def generate_def_opts(options) -> T.List[dict]: +def generate_def_opts(options) -> List[dict]: return [{ 'type': 'default_options', 'operation': options.operation, 'options': list_to_dict(options.options), }] -def genreate_cmd(options) -> T.List[dict]: +def genreate_cmd(options) -> List[dict]: if os.path.exists(options.json): with open(options.json, 'r') as fp: return json.load(fp) diff -Nru meson-0.53.2/mesonbuild/scripts/clangtidy.py meson-0.52.1/mesonbuild/scripts/clangtidy.py --- meson-0.53.2/mesonbuild/scripts/clangtidy.py 2019-12-04 18:45:50.000000000 +0000 +++ meson-0.52.1/mesonbuild/scripts/clangtidy.py 2019-11-28 17:37:44.000000000 +0000 @@ -14,37 +14,23 @@ import pathlib import subprocess -import shutil from concurrent.futures import ThreadPoolExecutor from ..compilers import lang_suffixes -def manual_clangformat(srcdir_name, builddir_name): +def clangformat(srcdir_name, builddir_name): srcdir = pathlib.Path(srcdir_name) suffixes = set(lang_suffixes['c']).union(set(lang_suffixes['cpp'])) suffixes.add('h') futures = [] - returncode = 0 with ThreadPoolExecutor() as e: for f in (x for suff in suffixes for x in srcdir.glob('**/*.' + suff)): strf = str(f) if strf.startswith(builddir_name): continue - futures.append(e.submit(subprocess.run, ['clang-tidy', '-p', builddir_name, strf])) - [max(returncode, x.result().returncode) for x in futures] - return returncode - -def clangformat(srcdir_name, builddir_name): - run_clang_tidy = None - for rct in ('run-clang-tidy', 'run-clang-tidy.py'): - if shutil.which(rct): - run_clang_tidy = rct - break - if run_clang_tidy: - return subprocess.run([run_clang_tidy, '-p', builddir_name]).returncode - else: - print('Could not find run-clang-tidy, running checks manually.') - manual_clangformat(srcdir_name, builddir_name) + futures.append(e.submit(subprocess.check_call, ['clang-tidy', '-p', builddir_name, strf])) + [x.result() for x in futures] + return 0 def run(args): srcdir_name = args[0] diff -Nru meson-0.53.2/mesonbuild/scripts/commandrunner.py meson-0.52.1/mesonbuild/scripts/commandrunner.py --- meson-0.53.2/mesonbuild/scripts/commandrunner.py 2019-12-04 18:45:50.000000000 +0000 +++ meson-0.52.1/mesonbuild/scripts/commandrunner.py 2019-11-28 17:37:44.000000000 +0000 @@ -71,12 +71,7 @@ command = args[4] arguments = args[5:] pc = run_command(src_dir, build_dir, subdir, meson_command, command, arguments) - while True: - try: - pc.wait() - break - except KeyboardInterrupt: - pass + pc.wait() return pc.returncode if __name__ == '__main__': diff -Nru meson-0.53.2/mesonbuild/scripts/depfixer.py meson-0.52.1/mesonbuild/scripts/depfixer.py --- meson-0.53.2/mesonbuild/scripts/depfixer.py 2019-12-04 18:45:50.000000000 +0000 +++ meson-0.52.1/mesonbuild/scripts/depfixer.py 2019-11-28 17:37:44.000000000 +0000 @@ -431,8 +431,8 @@ # Static libraries never have rpaths if fname.endswith('.a'): return - # DLLs and EXE never have rpaths - if fname.endswith('.dll') or fname.endswith('.exe'): + # DLLs never have rpaths + if fname.endswith('.dll'): return try: if fname.endswith('.jar'): diff -Nru meson-0.53.2/mesonbuild/scripts/scanbuild.py meson-0.52.1/mesonbuild/scripts/scanbuild.py --- meson-0.53.2/mesonbuild/scripts/scanbuild.py 2019-12-04 18:45:50.000000000 +0000 +++ meson-0.52.1/mesonbuild/scripts/scanbuild.py 2019-11-28 17:37:44.000000000 +0000 @@ -17,6 +17,7 @@ import shutil import tempfile from ..environment import detect_ninja, detect_scanbuild +from ..mesonlib import Popen_safe, split_args def scanbuild(exelist, srcdir, blddir, privdir, logdir, args): diff -Nru meson-0.53.2/mesonbuild/scripts/tags.py meson-0.52.1/mesonbuild/scripts/tags.py --- meson-0.53.2/mesonbuild/scripts/tags.py 2019-12-04 18:45:50.000000000 +0000 +++ meson-0.52.1/mesonbuild/scripts/tags.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ -# Copyright 2019 The Meson development team - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os -import subprocess -from pathlib import Path - - -def ls_as_bytestream(): - if os.path.exists('.git'): - return subprocess.run(['git', 'ls-tree', '-r', '--name-only', 'HEAD'], - stdout=subprocess.PIPE).stdout - - files = [str(p) for p in Path('.').glob('**/*') - if not p.is_dir() and - not next((x for x in p.parts if x.startswith('.')), None)] - return '\n'.join(files).encode() - - -def cscope(): - ls = b'\n'.join([b'"%s"' % f for f in ls_as_bytestream().split()]) - return subprocess.run(['cscope', '-v', '-b', '-i-'], input=ls).returncode - - -def ctags(): - ls = ls_as_bytestream() - return subprocess.run(['ctags', '-L-'], input=ls).returncode - - -def etags(): - ls = ls_as_bytestream() - return subprocess.run(['etags', '-'], input=ls).returncode - - -def run(args): - tool_name = args[0] - srcdir_name = args[1] - os.chdir(srcdir_name) - assert tool_name in ['cscope', 'ctags', 'etags'] - return globals()[tool_name]() diff -Nru meson-0.53.2/mesonbuild/templates/cpptemplates.py meson-0.52.1/mesonbuild/templates/cpptemplates.py --- meson-0.53.2/mesonbuild/templates/cpptemplates.py 2019-12-04 18:45:50.000000000 +0000 +++ meson-0.52.1/mesonbuild/templates/cpptemplates.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,177 +0,0 @@ -# Copyright 2019 The Meson development team - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import re - - -hello_cpp_template = '''#include - -#define PROJECT_NAME "{project_name}" - -int main(int argc, char **argv) {{ - if(argc != 1) {{ - std::cout << argv[0] << "takes no arguments.\\n"; - return 1; - }} - std::cout << "This is project " << PROJECT_NAME << ".\\n"; - return 0; -}} -''' - -hello_cpp_meson_template = '''project('{project_name}', 'cpp', - version : '{version}', - default_options : ['warning_level=3', - 'cpp_std=c++14']) - -exe = executable('{exe_name}', '{source_name}', - install : true) - -test('basic', exe) -''' - -lib_hpp_template = '''#pragma once -#if defined _WIN32 || defined __CYGWIN__ - #ifdef BUILDING_{utoken} - #define {utoken}_PUBLIC __declspec(dllexport) - #else - #define {utoken}_PUBLIC __declspec(dllimport) - #endif -#else - #ifdef BUILDING_{utoken} - #define {utoken}_PUBLIC __attribute__ ((visibility ("default"))) - #else - #define {utoken}_PUBLIC - #endif -#endif - -namespace {namespace} {{ - -class {utoken}_PUBLIC {class_name} {{ - -public: - {class_name}(); - int get_number() const; - -private: - - int number; - -}}; - -}} - -''' - -lib_cpp_template = '''#include <{header_file}> - -namespace {namespace} {{ - -{class_name}::{class_name}() {{ - number = 6; -}} - -int {class_name}::get_number() const {{ - return number; -}} - -}} -''' - -lib_cpp_test_template = '''#include <{header_file}> -#include - -int main(int argc, char **argv) {{ - if(argc != 1) {{ - std::cout << argv[0] << " takes no arguments.\\n"; - return 1; - }} - {namespace}::{class_name} c; - return c.get_number() != 6; -}} -''' - -lib_cpp_meson_template = '''project('{project_name}', 'cpp', - version : '{version}', - default_options : ['warning_level=3', 'cpp_std=c++14']) - -# These arguments are only used to build the shared library -# not the executables that use the library. -lib_args = ['-DBUILDING_{utoken}'] - -shlib = shared_library('{lib_name}', '{source_file}', - install : true, - cpp_args : lib_args, - gnu_symbol_visibility : 'hidden', -) - -test_exe = executable('{test_exe_name}', '{test_source_file}', - link_with : shlib) -test('{test_name}', test_exe) - -# Make this library usable as a Meson subproject. -{ltoken}_dep = declare_dependency( - include_directories: include_directories('.'), - link_with : shlib) - -# Make this library usable from the system's -# package manager. -install_headers('{header_file}', subdir : '{header_dir}') - -pkg_mod = import('pkgconfig') -pkg_mod.generate( - name : '{project_name}', - filebase : '{ltoken}', - description : 'Meson sample project.', - subdirs : '{header_dir}', - libraries : shlib, - version : '{version}', -) -''' - - -def create_exe_cpp_sample(project_name, project_version): - lowercase_token = re.sub(r'[^a-z0-9]', '_', project_name.lower()) - source_name = lowercase_token + '.cpp' - open(source_name, 'w').write(hello_cpp_template.format(project_name=project_name)) - open('meson.build', 'w').write(hello_cpp_meson_template.format(project_name=project_name, - exe_name=lowercase_token, - source_name=source_name, - version=project_version)) - - -def create_lib_cpp_sample(project_name, version): - lowercase_token = re.sub(r'[^a-z0-9]', '_', project_name.lower()) - uppercase_token = lowercase_token.upper() - class_name = uppercase_token[0] + lowercase_token[1:] - namespace = lowercase_token - lib_hpp_name = lowercase_token + '.hpp' - lib_cpp_name = lowercase_token + '.cpp' - test_cpp_name = lowercase_token + '_test.cpp' - kwargs = {'utoken': uppercase_token, - 'ltoken': lowercase_token, - 'header_dir': lowercase_token, - 'class_name': class_name, - 'namespace': namespace, - 'header_file': lib_hpp_name, - 'source_file': lib_cpp_name, - 'test_source_file': test_cpp_name, - 'test_exe_name': lowercase_token, - 'project_name': project_name, - 'lib_name': lowercase_token, - 'test_name': lowercase_token, - 'version': version, - } - open(lib_hpp_name, 'w').write(lib_hpp_template.format(**kwargs)) - open(lib_cpp_name, 'w').write(lib_cpp_template.format(**kwargs)) - open(test_cpp_name, 'w').write(lib_cpp_test_template.format(**kwargs)) - open('meson.build', 'w').write(lib_cpp_meson_template.format(**kwargs)) diff -Nru meson-0.53.2/mesonbuild/templates/ctemplates.py meson-0.52.1/mesonbuild/templates/ctemplates.py --- meson-0.53.2/mesonbuild/templates/ctemplates.py 2019-12-04 18:45:50.000000000 +0000 +++ meson-0.52.1/mesonbuild/templates/ctemplates.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,156 +0,0 @@ -# Copyright 2019 The Meson development team - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import re - - -lib_h_template = '''#pragma once -#if defined _WIN32 || defined __CYGWIN__ - #ifdef BUILDING_{utoken} - #define {utoken}_PUBLIC __declspec(dllexport) - #else - #define {utoken}_PUBLIC __declspec(dllimport) - #endif -#else - #ifdef BUILDING_{utoken} - #define {utoken}_PUBLIC __attribute__ ((visibility ("default"))) - #else - #define {utoken}_PUBLIC - #endif -#endif - -int {utoken}_PUBLIC {function_name}(); - -''' - -lib_c_template = '''#include <{header_file}> - -/* This function will not be exported and is not - * directly callable by users of this library. - */ -int internal_function() {{ - return 0; -}} - -int {function_name}() {{ - return internal_function(); -}} -''' - -lib_c_test_template = '''#include <{header_file}> -#include - -int main(int argc, char **argv) {{ - if(argc != 1) {{ - printf("%s takes no arguments.\\n", argv[0]); - return 1; - }} - return {function_name}(); -}} -''' - -lib_c_meson_template = '''project('{project_name}', 'c', - version : '{version}', - default_options : ['warning_level=3']) - -# These arguments are only used to build the shared library -# not the executables that use the library. -lib_args = ['-DBUILDING_{utoken}'] - -shlib = shared_library('{lib_name}', '{source_file}', - install : true, - c_args : lib_args, - gnu_symbol_visibility : 'hidden', -) - -test_exe = executable('{test_exe_name}', '{test_source_file}', - link_with : shlib) -test('{test_name}', test_exe) - -# Make this library usable as a Meson subproject. -{ltoken}_dep = declare_dependency( - include_directories: include_directories('.'), - link_with : shlib) - -# Make this library usable from the system's -# package manager. -install_headers('{header_file}', subdir : '{header_dir}') - -pkg_mod = import('pkgconfig') -pkg_mod.generate( - name : '{project_name}', - filebase : '{ltoken}', - description : 'Meson sample project.', - subdirs : '{header_dir}', - libraries : shlib, - version : '{version}', -) -''' - -hello_c_template = '''#include - -#define PROJECT_NAME "{project_name}" - -int main(int argc, char **argv) {{ - if(argc != 1) {{ - printf("%s takes no arguments.\\n", argv[0]); - return 1; - }} - printf("This is project %s.\\n", PROJECT_NAME); - return 0; -}} -''' - -hello_c_meson_template = '''project('{project_name}', 'c', - version : '{version}', - default_options : ['warning_level=3']) - -exe = executable('{exe_name}', '{source_name}', - install : true) - -test('basic', exe) -''' - -def create_exe_c_sample(project_name, project_version): - lowercase_token = re.sub(r'[^a-z0-9]', '_', project_name.lower()) - source_name = lowercase_token + '.c' - open(source_name, 'w').write(hello_c_template.format(project_name=project_name)) - open('meson.build', 'w').write(hello_c_meson_template.format(project_name=project_name, - exe_name=lowercase_token, - source_name=source_name, - version=project_version)) - -def create_lib_c_sample(project_name, version): - lowercase_token = re.sub(r'[^a-z0-9]', '_', project_name.lower()) - uppercase_token = lowercase_token.upper() - function_name = lowercase_token[0:3] + '_func' - lib_h_name = lowercase_token + '.h' - lib_c_name = lowercase_token + '.c' - test_c_name = lowercase_token + '_test.c' - kwargs = {'utoken': uppercase_token, - 'ltoken': lowercase_token, - 'header_dir': lowercase_token, - 'function_name': function_name, - 'header_file': lib_h_name, - 'source_file': lib_c_name, - 'test_source_file': test_c_name, - 'test_exe_name': lowercase_token, - 'project_name': project_name, - 'lib_name': lowercase_token, - 'test_name': lowercase_token, - 'version': version, - } - open(lib_h_name, 'w').write(lib_h_template.format(**kwargs)) - open(lib_c_name, 'w').write(lib_c_template.format(**kwargs)) - open(test_c_name, 'w').write(lib_c_test_template.format(**kwargs)) - open('meson.build', 'w').write(lib_c_meson_template.format(**kwargs)) diff -Nru meson-0.53.2/mesonbuild/templates/dlangtemplates.py meson-0.52.1/mesonbuild/templates/dlangtemplates.py --- meson-0.53.2/mesonbuild/templates/dlangtemplates.py 2020-01-07 19:29:59.000000000 +0000 +++ meson-0.52.1/mesonbuild/templates/dlangtemplates.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,134 +0,0 @@ -# Copyright 2019 The Meson development team - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import re - - -hello_d_template = '''module main; -import std.stdio; - -enum PROJECT_NAME = "{project_name}"; - -int main(string[] args) {{ - if (args.length != 1){{ - writefln("%s takes no arguments.\\n", args[0]); - return 1; - }} - writefln("This is project %s.\\n", PROJECT_NAME); - return 0; -}} -''' - -hello_d_meson_template = '''project('{project_name}', 'd', - version : '{version}', - default_options: ['warning_level=3']) - -exe = executable('{exe_name}', '{source_name}', - install : true) - -test('basic', exe) -''' - -lib_d_template = '''module {module_file}; - -/* This function will not be exported and is not - * directly callable by users of this library. - */ -int internal_function() {{ - return 0; -}} - -int {function_name}() {{ - return internal_function(); -}} -''' - -lib_d_test_template = '''module {module_file}_test; -import std.stdio; -import {module_file}; - - -int main(string[] args) {{ - if (args.length != 1){{ - writefln("%s takes no arguments.\\n", args[0]); - return 1; - }} - return {function_name}(); -}} -''' - -lib_d_meson_template = '''project('{project_name}', 'd', - version : '{version}', - default_options : ['warning_level=3']) - -stlib = static_library('{lib_name}', '{source_file}', - install : true, - gnu_symbol_visibility : 'hidden', -) - -test_exe = executable('{test_exe_name}', '{test_source_file}', - link_with : stlib) -test('{test_name}', test_exe) - -# Make this library usable as a Meson subproject. -{ltoken}_dep = declare_dependency( - include_directories: include_directories('.'), - link_with : stlib) - -# Make this library usable from the Dlang -# build system. -dlang_mod = import('dlang') -if find_program('dub', required: false).found() - dlang_mod.generate_dub_file(meson.project_name().to_lower(), meson.source_root(), - name : meson.project_name(), - license: meson.project_license(), - sourceFiles : '{source_file}', - description : 'Meson sample project.', - version : '{version}', - ) -endif -''' - -def create_exe_d_sample(project_name, project_version): - lowercase_token = re.sub(r'[^a-z0-9]', '_', project_name.lower()) - source_name = lowercase_token + '.d' - open(source_name, 'w').write(hello_d_template.format(project_name=project_name)) - open('meson.build', 'w').write(hello_d_meson_template.format(project_name=project_name, - exe_name=lowercase_token, - source_name=source_name, - version=project_version)) - - -def create_lib_d_sample(project_name, version): - lowercase_token = re.sub(r'[^a-z0-9]', '_', project_name.lower()) - uppercase_token = lowercase_token.upper() - function_name = lowercase_token[0:3] + '_func' - lib_m_name = lowercase_token - lib_d_name = lowercase_token + '.d' - test_d_name = lowercase_token + '_test.d' - kwargs = {'utoken': uppercase_token, - 'ltoken': lowercase_token, - 'header_dir': lowercase_token, - 'function_name': function_name, - 'module_file': lib_m_name, - 'source_file': lib_d_name, - 'test_source_file': test_d_name, - 'test_exe_name': lowercase_token, - 'project_name': project_name, - 'lib_name': lowercase_token, - 'test_name': lowercase_token, - 'version': version, - } - open(lib_d_name, 'w').write(lib_d_template.format(**kwargs)) - open(test_d_name, 'w').write(lib_d_test_template.format(**kwargs)) - open('meson.build', 'w').write(lib_d_meson_template.format(**kwargs)) diff -Nru meson-0.53.2/mesonbuild/templates/fortrantemplates.py meson-0.52.1/mesonbuild/templates/fortrantemplates.py --- meson-0.53.2/mesonbuild/templates/fortrantemplates.py 2019-12-04 18:45:50.000000000 +0000 +++ meson-0.52.1/mesonbuild/templates/fortrantemplates.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,130 +0,0 @@ -# Copyright 2019 The Meson development team - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import re - -lib_fortran_template = ''' -! This procedure will not be exported and is not -! directly callable by users of this library. - -module modfoo - -implicit none -private -public :: {function_name} - -contains - -integer function internal_function() - internal_function = 0 -end function internal_function - -integer function {function_name}() - {function_name} = internal_function() -end function {function_name} - -end module modfoo -''' - -lib_fortran_test_template = ''' -use modfoo - -print *,{function_name}() - -end program -''' - -lib_fortran_meson_template = '''project('{project_name}', 'fortran', - version : '{version}', - default_options : ['warning_level=3']) - -# These arguments are only used to build the shared library -# not the executables that use the library. -lib_args = ['-DBUILDING_{utoken}'] - -shlib = shared_library('{lib_name}', '{source_file}', - install : true, - fortran_args : lib_args, - gnu_symbol_visibility : 'hidden', -) - -test_exe = executable('{test_exe_name}', '{test_source_file}', - link_with : shlib) -test('{test_name}', test_exe) - -# Make this library usable as a Meson subproject. -{ltoken}_dep = declare_dependency( - include_directories: include_directories('.'), - link_with : shlib) - -pkg_mod = import('pkgconfig') -pkg_mod.generate( - name : '{project_name}', - filebase : '{ltoken}', - description : 'Meson sample project.', - subdirs : '{header_dir}', - libraries : shlib, - version : '{version}', -) -''' - -hello_fortran_template = ''' -implicit none - -character(len=*), parameter :: PROJECT_NAME = "{project_name}" - -print *,"This is project ", PROJECT_NAME - -end program -''' - -hello_fortran_meson_template = '''project('{project_name}', 'fortran', - version : '{version}', - default_options : ['warning_level=3']) - -exe = executable('{exe_name}', '{source_name}', - install : true) - -test('basic', exe) -''' - -def create_exe_fortran_sample(project_name, project_version): - lowercase_token = re.sub(r'[^a-z0-9]', '_', project_name.lower()) - source_name = lowercase_token + '.f90' - open(source_name, 'w').write(hello_fortran_template.format(project_name=project_name)) - open('meson.build', 'w').write(hello_fortran_meson_template.format(project_name=project_name, - exe_name=lowercase_token, - source_name=source_name, - version=project_version)) - -def create_lib_fortran_sample(project_name, version): - lowercase_token = re.sub(r'[^a-z0-9]', '_', project_name.lower()) - uppercase_token = lowercase_token.upper() - function_name = lowercase_token[0:3] + '_func' - lib_fortran_name = lowercase_token + '.f90' - test_fortran_name = lowercase_token + '_test.f90' - kwargs = {'utoken': uppercase_token, - 'ltoken': lowercase_token, - 'header_dir': lowercase_token, - 'function_name': function_name, - 'source_file': lib_fortran_name, - 'test_source_file': test_fortran_name, - 'test_exe_name': lowercase_token, - 'project_name': project_name, - 'lib_name': lowercase_token, - 'test_name': lowercase_token, - 'version': version, - } - open(lib_fortran_name, 'w').write(lib_fortran_template.format(**kwargs)) - open(test_fortran_name, 'w').write(lib_fortran_test_template.format(**kwargs)) - open('meson.build', 'w').write(lib_fortran_meson_template.format(**kwargs)) diff -Nru meson-0.53.2/mesonbuild/templates/objctemplates.py meson-0.52.1/mesonbuild/templates/objctemplates.py --- meson-0.53.2/mesonbuild/templates/objctemplates.py 2019-12-04 18:45:50.000000000 +0000 +++ meson-0.52.1/mesonbuild/templates/objctemplates.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,156 +0,0 @@ -# Copyright 2019 The Meson development team - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import re - - -lib_h_template = '''#pragma once -#if defined _WIN32 || defined __CYGWIN__ - #ifdef BUILDING_{utoken} - #define {utoken}_PUBLIC __declspec(dllexport) - #else - #define {utoken}_PUBLIC __declspec(dllimport) - #endif -#else - #ifdef BUILDING_{utoken} - #define {utoken}_PUBLIC __attribute__ ((visibility ("default"))) - #else - #define {utoken}_PUBLIC - #endif -#endif - -int {utoken}_PUBLIC {function_name}(); - -''' - -lib_objc_template = '''#import <{header_file}> - -/* This function will not be exported and is not - * directly callable by users of this library. - */ -int internal_function() {{ - return 0; -}} - -int {function_name}() {{ - return internal_function(); -}} -''' - -lib_objc_test_template = '''#import <{header_file}> -#import - -int main(int argc, char **argv) {{ - if(argc != 1) {{ - printf("%s takes no arguments.\\n", argv[0]); - return 1; - }} - return {function_name}(); -}} -''' - -lib_objc_meson_template = '''project('{project_name}', 'objc', - version : '{version}', - default_options : ['warning_level=3']) - -# These arguments are only used to build the shared library -# not the executables that use the library. -lib_args = ['-DBUILDING_{utoken}'] - -shlib = shared_library('{lib_name}', '{source_file}', - install : true, - objc_args : lib_args, - gnu_symbol_visibility : 'hidden', -) - -test_exe = executable('{test_exe_name}', '{test_source_file}', - link_with : shlib) -test('{test_name}', test_exe) - -# Make this library usable as a Meson subproject. -{ltoken}_dep = declare_dependency( - include_directories: include_directories('.'), - link_with : shlib) - -# Make this library usable from the system's -# package manager. -install_headers('{header_file}', subdir : '{header_dir}') - -pkg_mod = import('pkgconfig') -pkg_mod.generate( - name : '{project_name}', - filebase : '{ltoken}', - description : 'Meson sample project.', - subdirs : '{header_dir}', - libraries : shlib, - version : '{version}', -) -''' - -hello_objc_template = '''#import - -#define PROJECT_NAME "{project_name}" - -int main(int argc, char **argv) {{ - if(argc != 1) {{ - printf("%s takes no arguments.\\n", argv[0]); - return 1; - }} - printf("This is project %s.\\n", PROJECT_NAME); - return 0; -}} -''' - -hello_objc_meson_template = '''project('{project_name}', 'objc', - version : '{version}', - default_options : ['warning_level=3']) - -exe = executable('{exe_name}', '{source_name}', - install : true) - -test('basic', exe) -''' - -def create_exe_objc_sample(project_name, project_version): - lowercase_token = re.sub(r'[^a-z0-9]', '_', project_name.lower()) - source_name = lowercase_token + '.m' - open(source_name, 'w').write(hello_objc_template.format(project_name=project_name)) - open('meson.build', 'w').write(hello_objc_meson_template.format(project_name=project_name, - exe_name=lowercase_token, - source_name=source_name, - version=project_version)) - -def create_lib_objc_sample(project_name, version): - lowercase_token = re.sub(r'[^a-z0-9]', '_', project_name.lower()) - uppercase_token = lowercase_token.upper() - function_name = lowercase_token[0:3] + '_func' - lib_h_name = lowercase_token + '.h' - lib_objc_name = lowercase_token + '.m' - test_objc_name = lowercase_token + '_test.m' - kwargs = {'utoken': uppercase_token, - 'ltoken': lowercase_token, - 'header_dir': lowercase_token, - 'function_name': function_name, - 'header_file': lib_h_name, - 'source_file': lib_objc_name, - 'test_source_file': test_objc_name, - 'test_exe_name': lowercase_token, - 'project_name': project_name, - 'lib_name': lowercase_token, - 'test_name': lowercase_token, - 'version': version, - } - open(lib_h_name, 'w').write(lib_h_template.format(**kwargs)) - open(lib_objc_name, 'w').write(lib_objc_template.format(**kwargs)) - open(test_objc_name, 'w').write(lib_objc_test_template.format(**kwargs)) - open('meson.build', 'w').write(lib_objc_meson_template.format(**kwargs)) diff -Nru meson-0.53.2/mesonbuild/templates/rusttemplates.py meson-0.52.1/mesonbuild/templates/rusttemplates.py --- meson-0.53.2/mesonbuild/templates/rusttemplates.py 2019-12-04 18:45:50.000000000 +0000 +++ meson-0.52.1/mesonbuild/templates/rusttemplates.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,103 +0,0 @@ -# Copyright 2019 The Meson development team - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import re - - -lib_rust_template = '''#![crate_name = "{crate_file}"] - -/* This function will not be exported and is not - * directly callable by users of this library. - */ -fn internal_function() -> i32 {{ - return 0; -}} - -pub fn {function_name}() -> i32 {{ - return internal_function(); -}} -''' - -lib_rust_test_template = '''extern crate {crate_file}; - -fn main() {{ - println!("printing: {{}}", {crate_file}::{function_name}()); -}} -''' - - -lib_rust_meson_template = '''project('{project_name}', 'rust', - version : '{version}', - default_options : ['warning_level=3']) - -shlib = static_library('{lib_name}', '{source_file}', install : true) - -test_exe = executable('{test_exe_name}', '{test_source_file}', - link_with : shlib) -test('{test_name}', test_exe) - -# Make this library usable as a Meson subproject. -{ltoken}_dep = declare_dependency( - include_directories: include_directories('.'), - link_with : shlib) -''' - -hello_rust_template = ''' -fn main() {{ - let project_name = "{project_name}"; - println!("This is project {{}}.\\n", project_name); -}} -''' - -hello_rust_meson_template = '''project('{project_name}', 'rust', - version : '{version}', - default_options : ['warning_level=3']) - -exe = executable('{exe_name}', '{source_name}', - install : true) - -test('basic', exe) -''' - -def create_exe_rust_sample(project_name, project_version): - lowercase_token = re.sub(r'[^a-z0-9]', '_', project_name.lower()) - source_name = lowercase_token + '.rs' - open(source_name, 'w').write(hello_rust_template.format(project_name=project_name)) - open('meson.build', 'w').write(hello_rust_meson_template.format(project_name=project_name, - exe_name=lowercase_token, - source_name=source_name, - version=project_version)) - -def create_lib_rust_sample(project_name, version): - lowercase_token = re.sub(r'[^a-z0-9]', '_', project_name.lower()) - uppercase_token = lowercase_token.upper() - function_name = lowercase_token[0:3] + '_func' - lib_crate_name = lowercase_token - lib_rs_name = lowercase_token + '.rs' - test_rs_name = lowercase_token + '_test.rs' - kwargs = {'utoken': uppercase_token, - 'ltoken': lowercase_token, - 'header_dir': lowercase_token, - 'function_name': function_name, - 'crate_file': lib_crate_name, - 'source_file': lib_rs_name, - 'test_source_file': test_rs_name, - 'test_exe_name': lowercase_token, - 'project_name': project_name, - 'lib_name': lowercase_token, - 'test_name': lowercase_token, - 'version': version, - } - open(lib_rs_name, 'w').write(lib_rust_template.format(**kwargs)) - open(test_rs_name, 'w').write(lib_rust_test_template.format(**kwargs)) - open('meson.build', 'w').write(lib_rust_meson_template.format(**kwargs)) diff -Nru meson-0.53.2/mesonbuild/wrap/__init__.py meson-0.52.1/mesonbuild/wrap/__init__.py --- meson-0.53.2/mesonbuild/wrap/__init__.py 2019-12-04 18:45:50.000000000 +0000 +++ meson-0.52.1/mesonbuild/wrap/__init__.py 2019-11-28 17:37:44.000000000 +0000 @@ -48,10 +48,10 @@ nodownload = 3 forcefallback = 4 - def __str__(self) -> str: + def __str__(self): return self.name @staticmethod - def from_string(mode_name: str): + def from_string(mode_name): g = string_to_value[mode_name] return WrapMode(g) diff -Nru meson-0.53.2/mesonbuild/wrap/wrap.py meson-0.52.1/mesonbuild/wrap/wrap.py --- meson-0.53.2/mesonbuild/wrap/wrap.py 2020-02-25 18:00:46.000000000 +0000 +++ meson-0.52.1/mesonbuild/wrap/wrap.py 2019-11-28 17:37:44.000000000 +0000 @@ -14,84 +14,62 @@ from .. import mlog import contextlib -import urllib.request -import urllib.error -import urllib.parse -import os -import hashlib -import shutil -import tempfile -import stat +import urllib.request, os, hashlib, shutil, tempfile, stat import subprocess import sys import configparser -import typing as T from . import WrapMode -from ..mesonlib import git, GIT, ProgressBar, MesonException - -if T.TYPE_CHECKING: - import http.client +from ..mesonlib import ProgressBar, MesonException try: - # Importing is just done to check if SSL exists, so all warnings - # regarding 'imported but unused' can be safely ignored - import ssl # noqa + import ssl has_ssl = True API_ROOT = 'https://wrapdb.mesonbuild.com/v1/' except ImportError: has_ssl = False API_ROOT = 'http://wrapdb.mesonbuild.com/v1/' -REQ_TIMEOUT = 600.0 -SSL_WARNING_PRINTED = False -WHITELIST_SUBDOMAIN = 'wrapdb.mesonbuild.com' - -def quiet_git(cmd: T.List[str], workingdir: str) -> T.Tuple[bool, str]: - if not GIT: - return False, 'Git program not found.' - pc = git(cmd, workingdir, universal_newlines=True, - stdout=subprocess.PIPE, stderr=subprocess.PIPE) - if pc.returncode != 0: - return False, pc.stderr - return True, pc.stdout +req_timeout = 600.0 +ssl_warning_printed = False -def verbose_git(cmd: T.List[str], workingdir: str, check: bool = False) -> bool: - if not GIT: - return False - return git(cmd, workingdir, check=check).returncode == 0 - -def whitelist_wrapdb(urlstr: str) -> urllib.parse.ParseResult: - """ raises WrapException if not whitelisted subdomain """ - url = urllib.parse.urlparse(urlstr) - if not url.hostname: - raise WrapException('{} is not a valid URL'.format(urlstr)) - if not url.hostname.endswith(WHITELIST_SUBDOMAIN): - raise WrapException('{} is not a whitelisted WrapDB URL'.format(urlstr)) - if has_ssl and not url.scheme == 'https': - raise WrapException('WrapDB did not have expected SSL https url, instead got {}'.format(urlstr)) - return url +def build_ssl_context(): + ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23) + ctx.options |= ssl.OP_NO_SSLv2 + ctx.options |= ssl.OP_NO_SSLv3 + ctx.verify_mode = ssl.CERT_REQUIRED + ctx.load_default_certs() + return ctx -def open_wrapdburl(urlstring: str) -> 'http.client.HTTPResponse': - global SSL_WARNING_PRINTED +def quiet_git(cmd, workingdir): + try: + pc = subprocess.Popen(['git', '-C', workingdir] + cmd, stdin=subprocess.DEVNULL, + stdout=subprocess.PIPE, stderr=subprocess.PIPE) + except FileNotFoundError as e: + return False, str(e) + out, err = pc.communicate() + if pc.returncode != 0: + return False, err + return True, out - url = whitelist_wrapdb(urlstring) +def open_wrapdburl(urlstring): + global ssl_warning_printed if has_ssl: try: - return urllib.request.urlopen(urllib.parse.urlunparse(url), timeout=REQ_TIMEOUT) - except urllib.error.URLError as excp: - raise WrapException('WrapDB connection failed to {} with error {}'.format(urlstring, excp)) - - # following code is only for those without Python SSL - nossl_url = url._replace(scheme='http') - if not SSL_WARNING_PRINTED: - mlog.warning('SSL module not available in {}: WrapDB traffic not authenticated.'.format(sys.executable)) - SSL_WARNING_PRINTED = True - try: - return urllib.request.urlopen(urllib.parse.urlunparse(nossl_url), timeout=REQ_TIMEOUT) - except urllib.error.URLError as excp: - raise WrapException('WrapDB connection failed to {} with error {}'.format(urlstring, excp)) - + return urllib.request.urlopen(urlstring, timeout=req_timeout)# , context=build_ssl_context()) + except urllib.error.URLError: + if not ssl_warning_printed: + print('SSL connection failed. Falling back to unencrypted connections.') + ssl_warning_printed = True + if not ssl_warning_printed: + print('Warning: SSL not available, traffic not authenticated.', + file=sys.stderr) + ssl_warning_printed = True + # Trying to open SSL connection to wrapdb fails because the + # certificate is not known. + if urlstring.startswith('https'): + urlstring = 'http' + urlstring[5:] + return urllib.request.urlopen(urlstring, timeout=req_timeout) class WrapException(MesonException): pass @@ -100,7 +78,7 @@ pass class PackageDefinition: - def __init__(self, fname: str): + def __init__(self, fname): self.filename = fname self.basename = os.path.basename(fname) self.name = self.basename[:-5] @@ -118,42 +96,32 @@ self.type = self.wrap_section[5:] self.values = dict(self.config[self.wrap_section]) - def get(self, key: str) -> str: + def get(self, key): try: return self.values[key] except KeyError: m = 'Missing key {!r} in {}' raise WrapException(m.format(key, self.basename)) - def has_patch(self) -> bool: + def has_patch(self): return 'patch_url' in self.values -def load_wrap(subdir_root: str, packagename: str) -> PackageDefinition: - fname = os.path.join(subdir_root, packagename + '.wrap') - if os.path.isfile(fname): - return PackageDefinition(fname) - return None - -def get_directory(subdir_root: str, packagename: str): - directory = packagename - # We always have to load the wrap file, if it exists, because it could - # override the default directory name. - wrap = load_wrap(subdir_root, packagename) - if wrap and 'directory' in wrap.values: - directory = wrap.get('directory') - if os.path.dirname(directory): - raise WrapException('Directory key must be a name and not a path') - return wrap, directory - class Resolver: - def __init__(self, subdir_root: str, wrap_mode=WrapMode.default): + def __init__(self, subdir_root, wrap_mode=WrapMode.default): self.wrap_mode = wrap_mode self.subdir_root = subdir_root self.cachedir = os.path.join(self.subdir_root, 'packagecache') - def resolve(self, packagename: str, method: str) -> str: + def resolve(self, packagename: str, method: str): self.packagename = packagename - self.wrap, self.directory = get_directory(self.subdir_root, self.packagename) + self.directory = packagename + # We always have to load the wrap file, if it exists, because it could + # override the default directory name. + self.wrap = self.load_wrap() + if self.wrap and 'directory' in self.wrap.values: + self.directory = self.wrap.get('directory') + if os.path.dirname(self.directory): + raise WrapException('Directory key must be a name and not a path') self.dirname = os.path.join(self.subdir_root, self.directory) meson_file = os.path.join(self.dirname, 'meson.build') cmake_file = os.path.join(self.dirname, 'CMakeLists.txt') @@ -200,16 +168,20 @@ return self.directory - def check_can_download(self) -> None: + def load_wrap(self): + fname = os.path.join(self.subdir_root, self.packagename + '.wrap') + if os.path.isfile(fname): + return PackageDefinition(fname) + return None + + def check_can_download(self): # Don't download subproject data based on wrap file if requested. # Git submodules are ok (see above)! if self.wrap_mode is WrapMode.nodownload: m = 'Automatic wrap-based subproject downloading is disabled' raise WrapException(m) - def resolve_git_submodule(self) -> bool: - if not GIT: - raise WrapException('Git program not found.') + def resolve_git_submodule(self): # Are we in a git repository? ret, out = quiet_git(['rev-parse'], self.subdir_root) if not ret: @@ -219,29 +191,29 @@ if not ret: return False # Submodule has not been added, add it - if out.startswith('+'): + if out.startswith(b'+'): mlog.warning('git submodule might be out of date') return True - elif out.startswith('U'): + elif out.startswith(b'U'): raise WrapException('git submodule has merge conflicts') # Submodule exists, but is deinitialized or wasn't initialized - elif out.startswith('-'): - if verbose_git(['submodule', 'update', '--init', self.dirname], self.subdir_root): + elif out.startswith(b'-'): + if subprocess.call(['git', '-C', self.subdir_root, 'submodule', 'update', '--init', self.dirname]) == 0: return True raise WrapException('git submodule failed to init') # Submodule looks fine, but maybe it wasn't populated properly. Do a checkout. - elif out.startswith(' '): - verbose_git(['checkout', '.'], self.dirname) + elif out.startswith(b' '): + subprocess.call(['git', 'checkout', '.'], cwd=self.dirname) # Even if checkout failed, try building it anyway and let the user # handle any problems manually. return True - elif out == '': + elif out == b'': # It is not a submodule, just a folder that exists in the main repository. return False m = 'Unknown git submodule output: {!r}' raise WrapException(m.format(out)) - def get_file(self) -> None: + def get_file(self): path = self.get_file_internal('source') extract_dir = self.subdir_root # Some upstreams ship packages that do not have a leading directory. @@ -253,12 +225,10 @@ if self.wrap.has_patch(): self.apply_patch() - def get_git(self) -> None: - if not GIT: - raise WrapException('Git program not found.') + def get_git(self): revno = self.wrap.get('revision') is_shallow = False - depth_option = [] # type: T.List[str] + depth_option = [] # type: typing.List[str] if self.wrap.values.get('depth', '') != '': is_shallow = True depth_option = ['--depth', self.wrap.values.get('depth')] @@ -266,73 +236,72 @@ if is_shallow and self.is_git_full_commit_id(revno): # git doesn't support directly cloning shallowly for commits, # so we follow https://stackoverflow.com/a/43136160 - verbose_git(['init', self.directory], self.subdir_root, check=True) - verbose_git(['remote', 'add', 'origin', self.wrap.get('url')], self.dirname, check=True) + subprocess.check_call(['git', 'init', self.directory], cwd=self.subdir_root) + subprocess.check_call(['git', 'remote', 'add', 'origin', self.wrap.get('url')], + cwd=self.dirname) revno = self.wrap.get('revision') - verbose_git(['fetch', *depth_option, 'origin', revno], self.dirname, check=True) - verbose_git(['checkout', revno], self.dirname, check=True) + subprocess.check_call(['git', 'fetch', *depth_option, 'origin', revno], + cwd=self.dirname) + subprocess.check_call(['git', 'checkout', revno], cwd=self.dirname) if self.wrap.values.get('clone-recursive', '').lower() == 'true': - verbose_git(['submodule', 'update', '--init', '--checkout', - '--recursive', *depth_option], self.dirname, check=True) + subprocess.check_call(['git', 'submodule', 'update', + '--init', '--checkout', '--recursive', *depth_option], + cwd=self.dirname) push_url = self.wrap.values.get('push-url') if push_url: - verbose_git(['remote', 'set-url', '--push', 'origin', push_url], self.dirname, check=True) + subprocess.check_call(['git', 'remote', 'set-url', + '--push', 'origin', push_url], + cwd=self.dirname) else: if not is_shallow: - verbose_git(['clone', self.wrap.get('url'), self.directory], self.subdir_root, check=True) + subprocess.check_call(['git', 'clone', self.wrap.get('url'), + self.directory], cwd=self.subdir_root) if revno.lower() != 'head': - if not verbose_git(['checkout', revno], self.dirname): - verbose_git(['fetch', self.wrap.get('url'), revno], self.dirname, check=True) - verbose_git(['checkout', revno], self.dirname, check=True) + if subprocess.call(['git', 'checkout', revno], cwd=self.dirname) != 0: + subprocess.check_call(['git', 'fetch', self.wrap.get('url'), revno], cwd=self.dirname) + subprocess.check_call(['git', 'checkout', revno], cwd=self.dirname) else: - verbose_git(['clone', *depth_option, '--branch', revno, self.wrap.get('url'), - self.directory], self.subdir_root, check=True) + subprocess.check_call(['git', 'clone', *depth_option, + '--branch', revno, + self.wrap.get('url'), + self.directory], cwd=self.subdir_root) if self.wrap.values.get('clone-recursive', '').lower() == 'true': - verbose_git(['submodule', 'update', '--init', '--checkout', '--recursive', *depth_option], - self.dirname, check=True) + subprocess.check_call(['git', 'submodule', 'update', + '--init', '--checkout', '--recursive', *depth_option], + cwd=self.dirname) push_url = self.wrap.values.get('push-url') if push_url: - verbose_git(['remote', 'set-url', '--push', 'origin', push_url], self.dirname, check=True) + subprocess.check_call(['git', 'remote', 'set-url', + '--push', 'origin', push_url], + cwd=self.dirname) - def is_git_full_commit_id(self, revno: str) -> bool: + def is_git_full_commit_id(self, revno): result = False if len(revno) in (40, 64): # 40 for sha1, 64 for upcoming sha256 result = all((ch in '0123456789AaBbCcDdEeFf' for ch in revno)) return result - def get_hg(self) -> None: + def get_hg(self): revno = self.wrap.get('revision') - hg = shutil.which('hg') - if not hg: - raise WrapException('Mercurial program not found.') - subprocess.check_call([hg, 'clone', self.wrap.get('url'), + subprocess.check_call(['hg', 'clone', self.wrap.get('url'), self.directory], cwd=self.subdir_root) if revno.lower() != 'tip': - subprocess.check_call([hg, 'checkout', revno], + subprocess.check_call(['hg', 'checkout', revno], cwd=self.dirname) - def get_svn(self) -> None: + def get_svn(self): revno = self.wrap.get('revision') - svn = shutil.which('svn') - if not svn: - raise WrapException('SVN program not found.') - subprocess.check_call([svn, 'checkout', '-r', revno, self.wrap.get('url'), + subprocess.check_call(['svn', 'checkout', '-r', revno, self.wrap.get('url'), self.directory], cwd=self.subdir_root) - def get_data(self, urlstring: str) -> T.Tuple[str, str]: + def get_data(self, url): blocksize = 10 * 1024 h = hashlib.sha256() tmpfile = tempfile.NamedTemporaryFile(mode='wb', dir=self.cachedir, delete=False) - url = urllib.parse.urlparse(urlstring) - if url.hostname and url.hostname.endswith(WHITELIST_SUBDOMAIN): - resp = open_wrapdburl(urlstring) - elif WHITELIST_SUBDOMAIN in urlstring: - raise WrapException('{} may be a WrapDB-impersonating URL'.format(urlstring)) + if url.startswith('https://wrapdb.mesonbuild.com'): + resp = open_wrapdburl(url) else: - try: - resp = urllib.request.urlopen(urlstring, timeout=REQ_TIMEOUT) - except urllib.error.URLError: - raise WrapException('could not get {} is the internet available?'.format(urlstring)) + resp = urllib.request.urlopen(url, timeout=req_timeout) with contextlib.closing(resp) as resp: try: dlsize = int(resp.info()['Content-Length']) @@ -362,16 +331,16 @@ hashvalue = h.hexdigest() return hashvalue, tmpfile.name - def check_hash(self, what: str, path: str) -> None: + def check_hash(self, what, path): expected = self.wrap.get(what + '_hash') h = hashlib.sha256() with open(path, 'rb') as f: h.update(f.read()) dhash = h.hexdigest() if dhash != expected: - raise WrapException('Incorrect hash for {}:\n {} expected\n {} actual.'.format(what, expected, dhash)) + raise WrapException('Incorrect hash for %s:\n %s expected\n %s actual.' % (what, expected, dhash)) - def download(self, what: str, ofname: str) -> None: + def download(self, what, ofname): self.check_can_download() srcurl = self.wrap.get(what + '_url') mlog.log('Downloading', mlog.bold(self.packagename), what, 'from', mlog.bold(srcurl)) @@ -379,10 +348,10 @@ expected = self.wrap.get(what + '_hash') if dhash != expected: os.remove(tmpfile) - raise WrapException('Incorrect hash for {}:\n {} expected\n {} actual.'.format(what, expected, dhash)) + raise WrapException('Incorrect hash for %s:\n %s expected\n %s actual.' % (what, expected, dhash)) os.rename(tmpfile, ofname) - def get_file_internal(self, what: str) -> str: + def get_file_internal(self, what): filename = self.wrap.get(what + '_filename') cache_path = os.path.join(self.cachedir, filename) @@ -396,7 +365,7 @@ self.download(what, cache_path) return cache_path - def apply_patch(self) -> None: + def apply_patch(self): path = self.get_file_internal('patch') try: shutil.unpack_archive(path, self.subdir_root) @@ -405,7 +374,7 @@ shutil.unpack_archive(path, workdir) self.copy_tree(workdir, self.subdir_root) - def copy_tree(self, root_src_dir: str, root_dst_dir: str) -> None: + def copy_tree(self, root_src_dir, root_dst_dir): """ Copy directory tree. Overwrites also read only files. """ diff -Nru meson-0.53.2/mesonbuild/wrap/wraptool.py meson-0.52.1/mesonbuild/wrap/wraptool.py --- meson-0.53.2/mesonbuild/wrap/wraptool.py 2019-12-29 22:47:27.000000000 +0000 +++ meson-0.52.1/mesonbuild/wrap/wraptool.py 2019-11-28 17:37:44.000000000 +0000 @@ -58,8 +58,9 @@ data = u.read().decode('utf-8') jd = json.loads(data) if jd['output'] != 'ok': - print('Got bad output from server.', file=sys.stderr) - raise SystemExit(data) + print('Got bad output from server.') + print(data) + sys.exit(1) return jd def get_projectlist(): @@ -78,7 +79,7 @@ for p in jd['projects']: print(p) -def get_latest_version(name: str) -> tuple: +def get_latest_version(name): jd = get_result(API_ROOT + 'query/get_latest/' + name) branch = jd['branch'] revision = jd['revision'] @@ -87,14 +88,17 @@ def install(options): name = options.name if not os.path.isdir('subprojects'): - raise SystemExit('Subprojects dir not found. Run this script in your source root directory.') + print('Subprojects dir not found. Run this script in your source root directory.') + sys.exit(1) if os.path.isdir(os.path.join('subprojects', name)): - raise SystemExit('Subproject directory for this project already exists.') + print('Subproject directory for this project already exists.') + sys.exit(1) wrapfile = os.path.join('subprojects', name + '.wrap') if os.path.exists(wrapfile): - raise SystemExit('Wrap file already exists.') + print('Wrap file already exists.') + sys.exit(1) (branch, revision) = get_latest_version(name) - u = open_wrapdburl(API_ROOT + 'projects/{}/{}/{}/get_wrap'.format(name, branch, revision)) + u = open_wrapdburl(API_ROOT + 'projects/%s/%s/%s/get_wrap' % (name, branch, revision)) data = u.read() with open(wrapfile, 'wb') as f: f.write(data) @@ -113,7 +117,7 @@ return branch, revision, cp['directory'], cp['source_filename'], cp['patch_filename'] def update_wrap_file(wrapfile, name, new_branch, new_revision): - u = open_wrapdburl(API_ROOT + 'projects/{}/{}/{}/get_wrap'.format(name, new_branch, new_revision)) + u = open_wrapdburl(API_ROOT + 'projects/%s/%s/%d/get_wrap' % (name, new_branch, new_revision)) data = u.read() with open(wrapfile, 'wb') as f: f.write(data) @@ -121,15 +125,17 @@ def update(options): name = options.name if not os.path.isdir('subprojects'): - raise SystemExit('Subprojects dir not found. Run this command in your source root directory.') + print('Subprojects dir not found. Run this command in your source root directory.') + sys.exit(1) wrapfile = os.path.join('subprojects', name + '.wrap') if not os.path.exists(wrapfile): - raise SystemExit('Project ' + name + ' is not in use.') + print('Project', name, 'is not in use.') + sys.exit(1) (branch, revision, subdir, src_file, patch_file) = get_current_version(wrapfile) (new_branch, new_revision) = get_latest_version(name) if new_branch == branch and new_revision == revision: - print('Project ' + name + ' is already up to date.') - raise SystemExit + print('Project', name, 'is already up to date.') + sys.exit(0) update_wrap_file(wrapfile, name, new_branch, new_revision) shutil.rmtree(os.path.join('subprojects', subdir), ignore_errors=True) try: @@ -147,8 +153,9 @@ jd = get_result(API_ROOT + 'projects/' + name) versions = jd['versions'] if not versions: - raise SystemExit('No available versions of' + name) - print('Available versions of {}:'.format(name)) + print('No available versions of', name) + sys.exit(0) + print('Available versions of %s:' % name) for v in versions: print(' ', v['branch'], v['revision']) @@ -160,7 +167,7 @@ sproj_name = os.path.basename(from_path) outputdir = os.path.join(spdir_name, sproj_name) if os.path.exists(outputdir): - raise SystemExit('Output dir {} already exists. Will not overwrite.'.format(outputdir)) + sys.exit('Output dir %s already exists. Will not overwrite.' % outputdir) shutil.copytree(from_path, outputdir, ignore=shutil.ignore_patterns('subprojects')) def promote(options): @@ -177,13 +184,13 @@ # otherwise the argument is just a subproject basename which must be unambiguous if argument not in sprojs: - raise SystemExit('Subproject {} not found in directory tree.'.format(argument)) + sys.exit('Subproject %s not found in directory tree.' % argument) matches = sprojs[argument] if len(matches) > 1: - print('There is more than one version of {} in tree. Please specify which one to promote:\n'.format(argument), file=sys.stderr) + print('There is more than one version of %s in tree. Please specify which one to promote:\n' % argument) for s in matches: - print(s, file=sys.stderr) - raise SystemExit(1) + print(s) + sys.exit(1) do_promotion(matches[0], spdir_name) def status(options): @@ -193,17 +200,17 @@ try: (latest_branch, latest_revision) = get_latest_version(name) except Exception: - print('', name, 'not available in wrapdb.', file=sys.stderr) + print('', name, 'not available in wrapdb.') continue try: (current_branch, current_revision, _, _, _) = get_current_version(w) except Exception: - print('Wrap file not from wrapdb.', file=sys.stderr) + print('Wrap file not from wrapdb.') continue if current_branch == latest_branch and current_revision == latest_revision: - print('', name, 'up to date. Branch {}, revision {}.'.format(current_branch, current_revision)) + print('', name, 'up to date. Branch %s, revision %d.' % (current_branch, current_revision)) else: - print('', name, 'not up to date. Have {} {}, but {} {} is available.'.format(current_branch, current_revision, latest_branch, latest_revision)) + print('', name, 'not up to date. Have %s %d, but %s %d is available.' % (current_branch, current_revision, latest_branch, latest_revision)) def run(options): options.wrap_func(options) diff -Nru meson-0.53.2/meson.egg-info/PKG-INFO meson-0.52.1/meson.egg-info/PKG-INFO --- meson-0.53.2/meson.egg-info/PKG-INFO 2020-02-25 16:01:43.000000000 +0000 +++ meson-0.52.1/meson.egg-info/PKG-INFO 2019-11-29 13:50:59.000000000 +0000 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: meson -Version: 0.53.2 +Version: 0.52.1 Summary: A high performance build system Home-page: https://mesonbuild.com Author: Jussi Pakkanen diff -Nru meson-0.53.2/meson.egg-info/SOURCES.txt meson-0.52.1/meson.egg-info/SOURCES.txt --- meson-0.53.2/meson.egg-info/SOURCES.txt 2020-02-25 16:01:43.000000000 +0000 +++ meson-0.52.1/meson.egg-info/SOURCES.txt 2019-11-29 13:51:00.000000000 +0000 @@ -4,7 +4,6 @@ __main__.py ghwt.py meson.py -pyproject.toml run_cross_test.py run_meson_command_tests.py run_project_tests.py @@ -44,10 +43,6 @@ manual tests/10 svn wrap/meson.build manual tests/10 svn wrap/prog.c manual tests/10 svn wrap/subprojects/samplesubproject.wrap -manual tests/11 wrap imposter/meson.build -manual tests/11 wrap imposter/subprojects/zlib.wrap -manual tests/12 wrap mirror/meson.build -manual tests/12 wrap mirror/subprojects/zlib.wrap manual tests/2 multiwrap/meson.build manual tests/2 multiwrap/prog.c manual tests/2 multiwrap/subprojects/libpng.wrap @@ -136,11 +131,9 @@ mesonbuild/cmake/client.py mesonbuild/cmake/common.py mesonbuild/cmake/executor.py -mesonbuild/cmake/fileapi.py mesonbuild/cmake/generator.py mesonbuild/cmake/interpreter.py mesonbuild/cmake/traceparser.py -mesonbuild/cmake/data/preload.cmake mesonbuild/cmake/data/run_ctgt.py mesonbuild/compilers/__init__.py mesonbuild/compilers/c.py @@ -163,7 +156,6 @@ mesonbuild/compilers/mixins/clang.py mesonbuild/compilers/mixins/clike.py mesonbuild/compilers/mixins/elbrus.py -mesonbuild/compilers/mixins/emscripten.py mesonbuild/compilers/mixins/gnu.py mesonbuild/compilers/mixins/intel.py mesonbuild/compilers/mixins/islinker.py @@ -172,14 +164,9 @@ mesonbuild/dependencies/__init__.py mesonbuild/dependencies/base.py mesonbuild/dependencies/boost.py -mesonbuild/dependencies/coarrays.py -mesonbuild/dependencies/cuda.py mesonbuild/dependencies/dev.py -mesonbuild/dependencies/hdf5.py mesonbuild/dependencies/misc.py -mesonbuild/dependencies/mpi.py mesonbuild/dependencies/platform.py -mesonbuild/dependencies/scalapack.py mesonbuild/dependencies/ui.py mesonbuild/dependencies/data/CMakeLists.txt mesonbuild/dependencies/data/CMakeListsLLVM.txt @@ -187,7 +174,6 @@ mesonbuild/modules/__init__.py mesonbuild/modules/cmake.py mesonbuild/modules/dlang.py -mesonbuild/modules/fs.py mesonbuild/modules/gnome.py mesonbuild/modules/hotdoc.py mesonbuild/modules/i18n.py @@ -222,17 +208,9 @@ mesonbuild/scripts/regen_checker.py mesonbuild/scripts/scanbuild.py mesonbuild/scripts/symbolextractor.py -mesonbuild/scripts/tags.py mesonbuild/scripts/uninstall.py mesonbuild/scripts/vcstagger.py mesonbuild/scripts/yelphelper.py -mesonbuild/templates/__init__.py -mesonbuild/templates/cpptemplates.py -mesonbuild/templates/ctemplates.py -mesonbuild/templates/dlangtemplates.py -mesonbuild/templates/fortrantemplates.py -mesonbuild/templates/objctemplates.py -mesonbuild/templates/rusttemplates.py mesonbuild/wrap/__init__.py mesonbuild/wrap/wrap.py mesonbuild/wrap/wraptool.py @@ -257,23 +235,6 @@ test cases/cmake/13 system includes/subprojects/cmMod/cmMod.cpp test cases/cmake/13 system includes/subprojects/cmMod/cmMod.hpp test cases/cmake/13 system includes/subprojects/cmMod/sysInc/triggerWarn.hpp -test cases/cmake/14 fortran threads/meson.build -test cases/cmake/15 object library advanced/main.cpp -test cases/cmake/15 object library advanced/meson.build -test cases/cmake/15 object library advanced/subprojects/cmObjLib/CMakeLists.txt -test cases/cmake/15 object library advanced/subprojects/cmObjLib/genC.cpp -test cases/cmake/15 object library advanced/subprojects/cmObjLib/libA.cpp -test cases/cmake/15 object library advanced/subprojects/cmObjLib/libA.hpp -test cases/cmake/15 object library advanced/subprojects/cmObjLib/libB.cpp -test cases/cmake/15 object library advanced/subprojects/cmObjLib/libB.hpp -test cases/cmake/16 threads/main.cpp -test cases/cmake/16 threads/meson.build -test cases/cmake/16 threads/meson_options.txt -test cases/cmake/16 threads/test_matrix.json -test cases/cmake/16 threads/subprojects/cmMod/CMakeLists.txt -test cases/cmake/16 threads/subprojects/cmMod/cmMod.cpp -test cases/cmake/16 threads/subprojects/cmMod/cmMod.hpp -test cases/cmake/16 threads/subprojects/cmMod/main.cpp test cases/cmake/2 advanced/installed_files.txt test cases/cmake/2 advanced/main.cpp test cases/cmake/2 advanced/meson.build @@ -314,22 +275,12 @@ test cases/cmake/8 custom command/main.cpp test cases/cmake/8 custom command/meson.build test cases/cmake/8 custom command/subprojects/cmMod/CMakeLists.txt -test cases/cmake/8 custom command/subprojects/cmMod/args_test.cpp test cases/cmake/8 custom command/subprojects/cmMod/cmMod.cpp test cases/cmake/8 custom command/subprojects/cmMod/cmMod.hpp test cases/cmake/8 custom command/subprojects/cmMod/cp.cpp test cases/cmake/8 custom command/subprojects/cmMod/cpyBase.cpp.am test cases/cmake/8 custom command/subprojects/cmMod/cpyBase.hpp.am -test cases/cmake/8 custom command/subprojects/cmMod/cpyNext.cpp.am -test cases/cmake/8 custom command/subprojects/cmMod/cpyNext.hpp.am -test cases/cmake/8 custom command/subprojects/cmMod/cpyTest.cpp -test cases/cmake/8 custom command/subprojects/cmMod/macro_name.cpp test cases/cmake/8 custom command/subprojects/cmMod/main.cpp -test cases/cmake/8 custom command/subprojects/cmMod/cpyTest/CMakeLists.txt -test cases/cmake/8 custom command/subprojects/cmMod/cpyTest/cpyTest.hpp -test cases/cmake/8 custom command/subprojects/cmMod/cpyTest/cpyTest2.hpp -test cases/cmake/8 custom command/subprojects/cmMod/cpyTest/cpyTest3.hpp -test cases/cmake/8 custom command/subprojects/cmMod/cpyTest/cpyTest4.hpp test cases/cmake/9 disabled subproject/meson.build test cases/common/1 trivial/meson.build test cases/common/1 trivial/trivial.c @@ -985,7 +936,6 @@ test cases/common/214 warning level 0/main.cpp test cases/common/214 warning level 0/meson.build test cases/common/215 link custom/custom_stlib.py -test cases/common/215 link custom/lib.c test cases/common/215 link custom/meson.build test cases/common/215 link custom/prog.c test cases/common/216 link custom_i single from multiple/generate_conflicting_stlibs.py @@ -1058,14 +1008,6 @@ test cases/common/225 include_dir dot/src/rone.c test cases/common/226 include_type dependency/meson.build test cases/common/226 include_type dependency/subprojects/subDep/meson.build -test cases/common/227 fs module/a_symlink -test cases/common/227 fs module/meson.build -test cases/common/227 fs module/subdir/meson.build -test cases/common/227 fs module/subdir/subdirfile.txt -test cases/common/227 fs module/subprojects/subbie/meson.build -test cases/common/227 fs module/subprojects/subbie/subprojectfile.txt -test cases/common/227 fs module/subprojects/subbie/subsub/meson.build -test cases/common/227 fs module/subprojects/subbie/subsub/subsubfile.txt test cases/common/23 object extraction/lib.c test cases/common/23 object extraction/lib2.c test cases/common/23 object extraction/main.c @@ -1099,7 +1041,6 @@ test cases/common/28 find program/print-version-with-prefix.py test cases/common/28 find program/print-version.py test cases/common/28 find program/source.in -test cases/common/28 find program/scripts/test_subdir.py test cases/common/29 multiline string/meson.build test cases/common/3 static/libfile.c test cases/common/3 static/libfile2.c @@ -1272,7 +1213,7 @@ test cases/common/62 install subdir/installed_files.txt test cases/common/62 install subdir/meson.build test cases/common/62 install subdir/nested_elided/sub/eighth.dat -test cases/common/62 install subdir/nested_elided/sub/dircheck/ninth.dat +test cases/common/62 install subdir/nested_elided/sub/dircheck/nineth.dat test cases/common/62 install subdir/sub/sub1/third.dat test cases/common/62 install subdir/sub1/second.dat test cases/common/62 install subdir/sub2/excluded-three.dat @@ -1474,23 +1415,6 @@ test cases/csharp/4 external dep/prog.cs test cases/cuda/1 simple/meson.build test cases/cuda/1 simple/prog.cu -test cases/cuda/10 cuda dependency/meson.build -test cases/cuda/10 cuda dependency/c/meson.build -test cases/cuda/10 cuda dependency/c/prog.c -test cases/cuda/10 cuda dependency/cpp/meson.build -test cases/cuda/10 cuda dependency/cpp/prog.cc -test cases/cuda/10 cuda dependency/modules/meson.build -test cases/cuda/10 cuda dependency/modules/prog.cc -test cases/cuda/10 cuda dependency/version_reqs/meson.build -test cases/cuda/10 cuda dependency/version_reqs/prog.cc -test cases/cuda/11 cuda dependency (nvcc)/meson.build -test cases/cuda/11 cuda dependency (nvcc)/modules/meson.build -test cases/cuda/11 cuda dependency (nvcc)/modules/prog.cu -test cases/cuda/11 cuda dependency (nvcc)/version_reqs/meson.build -test cases/cuda/11 cuda dependency (nvcc)/version_reqs/prog.cu -test cases/cuda/12 cuda dependency (mixed)/kernel.cu -test cases/cuda/12 cuda dependency (mixed)/meson.build -test cases/cuda/12 cuda dependency (mixed)/prog.cpp test cases/cuda/2 split/lib.cu test cases/cuda/2 split/main.cpp test cases/cuda/2 split/meson.build @@ -1574,12 +1498,6 @@ test cases/failing build/3 pch disabled/c/prog.c test cases/failing build/3 pch disabled/c/pch/prog.h test cases/failing build/3 pch disabled/c/pch/prog_pch.c -test cases/failing build/4 cmake subproject isolation/main.cpp -test cases/failing build/4 cmake subproject isolation/meson.build -test cases/failing build/4 cmake subproject isolation/incDir/fileA.hpp -test cases/failing build/4 cmake subproject isolation/subprojects/cmMod/CMakeLists.txt -test cases/failing build/4 cmake subproject isolation/subprojects/cmMod/cmMod.cpp -test cases/failing build/4 cmake subproject isolation/subprojects/cmMod/cmMod.hpp test cases/failing test/1 trivial/main.c test cases/failing test/1 trivial/meson.build test cases/failing test/2 signal/main.c @@ -1778,8 +1696,6 @@ test cases/failing/96 custom target install data/Info.plist.cpp test cases/failing/96 custom target install data/meson.build test cases/failing/96 custom target install data/preproc.py -test cases/failing/97 add dict non string key/meson.build -test cases/failing/98 add dict duplicate keys/meson.build test cases/fortran/1 basic/meson.build test cases/fortran/1 basic/simple.f90 test cases/fortran/10 find library/gzip.f90 @@ -1807,20 +1723,10 @@ test cases/fortran/15 include/timestwo.f90 test cases/fortran/16 openmp/main.f90 test cases/fortran/16 openmp/meson.build -test cases/fortran/17 add_languages/meson.build -test cases/fortran/18 first_arg/meson.build -test cases/fortran/19 fortran_std/legacy.f -test cases/fortran/19 fortran_std/meson.build -test cases/fortran/19 fortran_std/std2003.f90 -test cases/fortran/19 fortran_std/std2008.f90 -test cases/fortran/19 fortran_std/std2018.f90 -test cases/fortran/19 fortran_std/std95.f90 test cases/fortran/2 modules/comment_mod.f90 test cases/fortran/2 modules/meson.build test cases/fortran/2 modules/mymod.f90 test cases/fortran/2 modules/prog.f90 -test cases/fortran/20 buildtype/main.f90 -test cases/fortran/20 buildtype/meson.build test cases/fortran/3 module procedure/meson.build test cases/fortran/3 module procedure/use_syntax.f90 test cases/fortran/4 self dependency/meson.build @@ -1964,10 +1870,6 @@ test cases/frameworks/29 blocks/meson.build test cases/frameworks/3 gmock/gmocktest.cc test cases/frameworks/3 gmock/meson.build -test cases/frameworks/30 scalapack/main.c -test cases/frameworks/30 scalapack/main.f90 -test cases/frameworks/30 scalapack/meson.build -test cases/frameworks/30 scalapack/cmake/FindSCALAPACK.cmake test cases/frameworks/4 qt/main.cpp test cases/frameworks/4 qt/mainWindow.cpp test cases/frameworks/4 qt/mainWindow.h @@ -2155,7 +2057,6 @@ test cases/linuxlike/14 static dynamic linkage/main.c test cases/linuxlike/14 static dynamic linkage/meson.build test cases/linuxlike/14 static dynamic linkage/verify_static.py -test cases/linuxlike/15 ld binary/meson.build test cases/linuxlike/2 external library/meson.build test cases/linuxlike/2 external library/prog.c test cases/linuxlike/3 linker script/bob.c @@ -2231,8 +2132,6 @@ test cases/osx/7 bitcode/libfoo.m test cases/osx/7 bitcode/meson.build test cases/osx/7 bitcode/vis.h -test cases/osx/8 pie/main.c -test cases/osx/8 pie/meson.build test cases/python/1 basic/meson.build test cases/python/1 basic/prog.py test cases/python/1 basic/gluon/__init__.py @@ -2678,15 +2577,6 @@ test cases/unit/70 clang-tidy/.clang-tidy test cases/unit/70 clang-tidy/cttest.cpp test cases/unit/70 clang-tidy/meson.build -test cases/unit/71 cross/crossfile.in -test cases/unit/71 cross/meson.build -test cases/unit/71 cross/meson_options.txt -test cases/unit/73 wrap file url/meson.build -test cases/unit/73 wrap file url/subprojects/foo-patch.tar.xz -test cases/unit/73 wrap file url/subprojects/foo.tar.xz -test cases/unit/74 summary/meson.build -test cases/unit/74 summary/subprojects/sub/meson.build -test cases/unit/74 summary/subprojects/sub2/meson.build test cases/unit/8 -L -l order/first.pc test cases/unit/8 -L -l order/meson.build test cases/unit/8 -L -l order/prog.c diff -Nru meson-0.53.2/PKG-INFO meson-0.52.1/PKG-INFO --- meson-0.53.2/PKG-INFO 2020-02-25 16:02:10.000000000 +0000 +++ meson-0.52.1/PKG-INFO 2019-11-29 13:51:14.000000000 +0000 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: meson -Version: 0.53.2 +Version: 0.52.1 Summary: A high performance build system Home-page: https://mesonbuild.com Author: Jussi Pakkanen diff -Nru meson-0.53.2/pyproject.toml meson-0.52.1/pyproject.toml --- meson-0.53.2/pyproject.toml 2019-12-04 18:45:50.000000000 +0000 +++ meson-0.52.1/pyproject.toml 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -[build-system] -requires = ["setuptools", "wheel"] diff -Nru meson-0.53.2/README.md meson-0.52.1/README.md --- meson-0.53.2/README.md 2019-12-04 18:45:50.000000000 +0000 +++ meson-0.52.1/README.md 2019-11-28 17:37:44.000000000 +0000 @@ -22,11 +22,8 @@ You can run Meson directly from a revision control checkout or an extracted tarball. If you wish you can install it locally with the -standard Python command - -```sh -python3 -m pip install meson -``` +standard Python distutils command `python3 setup.py install `. Meson is also available from [PyPi](https://pypi.python.org/pypi/meson), so it can be installed @@ -35,12 +32,6 @@ type to install with Pip can vary between systems, be sure to use the Python 3 version of Pip. -For builds using Ninja, Ninja can be [downloaded directly](https://github.com/ninja-build/ninja/releases) or via - -```sh -python3 -m pip install ninja -``` - #### Running Meson requires that you have a source directory and a build directory diff -Nru meson-0.53.2/run_project_tests.py meson-0.52.1/run_project_tests.py --- meson-0.53.2/run_project_tests.py 2020-02-25 18:00:46.000000000 +0000 +++ meson-0.52.1/run_project_tests.py 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -# Copyright 2012-2019 The Meson development team +# Copyright 2012-2016 The Meson development team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,14 +14,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -import typing as T +import typing import itertools import os import subprocess import shutil import sys import signal -import shlex from io import StringIO from ast import literal_eval from enum import Enum @@ -47,12 +46,6 @@ from run_tests import ensure_backend_detects_changes from run_tests import guess_backend -ALL_TESTS = ['cmake', 'common', 'warning-meson', 'failing-meson', 'failing-build', 'failing-test', - 'kconfig', 'platform-osx', 'platform-windows', 'platform-linux', - 'java', 'C#', 'vala', 'rust', 'd', 'objective c', 'objective c++', - 'fortran', 'swift', 'cuda', 'python3', 'python', 'fpga', 'frameworks', 'nasm', 'wasm' - ] - class BuildStep(Enum): configure = 1 @@ -64,33 +57,17 @@ class TestResult: - def __init__(self, msg, step, stdo, stde, mlog, cicmds, conftime=0, buildtime=0, testtime=0): + def __init__(self, msg, step, stdo, stde, mlog, conftime=0, buildtime=0, testtime=0): self.msg = msg self.step = step self.stdo = stdo self.stde = stde self.mlog = mlog - self.cicmds = cicmds self.conftime = conftime self.buildtime = buildtime self.testtime = testtime -class TestDef: - def __init__(self, path: Path, name: T.Optional[str], args: T.List[str], skip: bool = False): - self.path = path - self.name = name - self.args = args - self.skip = skip - - def __repr__(self) -> str: - return '<{}: {:<48} [{}: {}] -- {}>'.format(type(self).__name__, str(self.path), self.name, self.args, self.skip) - - def display_name(self) -> str: - if self.name: - return '{} ({})'.format(self.path.as_posix(), self.name) - return self.path.as_posix() - class AutoDeletedDir: def __init__(self, d): self.dir = d @@ -109,7 +86,6 @@ failing_logs = [] print_debug = 'MESON_PRINT_TEST_OUTPUT' in os.environ under_ci = 'CI' in os.environ -under_old_os_ci = 'OLD_OS_CI' in os.environ do_debug = under_ci or print_debug no_meson_log_msg = 'No meson-log.txt found.' @@ -133,7 +109,7 @@ compile_commands, clean_commands, test_commands, install_commands, \ uninstall_commands = get_backend_commands(backend, do_debug) -def get_relative_files_list_from_dir(fromdir: Path) -> T.List[Path]: +def get_relative_files_list_from_dir(fromdir: Path) -> typing.List[Path]: return [file.relative_to(fromdir) for file in fromdir.rglob('*') if file.is_file()] def platform_fix_name(fname: str, compiler, env) -> str: @@ -223,7 +199,7 @@ installdir = Path(installdir) # If this exists, the test does not install any other files noinst_file = Path('usr/no-installed-files') - expected = {} # type: T.Dict[Path, bool] + expected = {} # type: typing.Dict[Path, bool] ret_msg = '' # Generate list of expected files if (installdir / noinst_file).is_file(): @@ -295,32 +271,6 @@ return mlog.yellow(text).get_text(mlog.colorize_console) -def _run_ci_include(args: T.List[str]) -> str: - if not args: - return 'At least one parameter required' - try: - file_path = Path(args[0]) - data = file_path.open(errors='ignore', encoding='utf-8').read() - return 'Included file {}:\n{}\n'.format(args[0], data) - except Exception: - return 'Failed to open {} ({})'.format(args[0]) - -ci_commands = { - 'ci_include': _run_ci_include -} - -def run_ci_commands(raw_log: str) -> T.List[str]: - res = [] - for l in raw_log.splitlines(): - if not l.startswith('!meson_ci!/'): - continue - cmd = shlex.split(l[11:]) - if not cmd or cmd[0] not in ci_commands: - continue - res += ['CI COMMAND {}:\n{}\n'.format(cmd[0], ci_commands[cmd[0]](cmd[1:]))] - return res - - def run_test_inprocess(testdir): old_stdout = sys.stdout sys.stdout = mystdout = StringIO() @@ -358,19 +308,17 @@ # Build directory name must be the same so Ccache works over # consecutive invocations. -def create_deterministic_builddir(src_dir, name): +def create_deterministic_builddir(src_dir): import hashlib - if name: - src_dir += name rel_dirname = 'b ' + hashlib.sha256(src_dir.encode(errors='ignore')).hexdigest()[0:10] os.mkdir(rel_dirname) abs_pathname = os.path.join(os.getcwd(), rel_dirname) return abs_pathname -def run_test(skipped, testdir, name, extra_args, compiler, backend, flags, commands, should_fail): +def run_test(skipped, testdir, extra_args, compiler, backend, flags, commands, should_fail): if skipped: return None - with AutoDeletedDir(create_deterministic_builddir(testdir, name)) as build_dir: + with AutoDeletedDir(create_deterministic_builddir(testdir)) as build_dir: with AutoDeletedDir(tempfile.mkdtemp(prefix='i ', dir=os.getcwd())) as install_dir: try: return _run_test(testdir, build_dir, install_dir, extra_args, compiler, backend, flags, commands, should_fail) @@ -424,17 +372,16 @@ mesonlog = logfile.open(errors='ignore', encoding='utf-8').read() except Exception: mesonlog = no_meson_log_msg - cicmds = run_ci_commands(mesonlog) gen_time = time.time() - gen_start if should_fail == 'meson': if returncode == 1: - return TestResult('', BuildStep.configure, stdo, stde, mesonlog, cicmds, gen_time) + return TestResult('', BuildStep.configure, stdo, stde, mesonlog, gen_time) elif returncode != 0: - return TestResult('Test exited with unexpected status {}'.format(returncode), BuildStep.configure, stdo, stde, mesonlog, cicmds, gen_time) + return TestResult('Test exited with unexpected status {}'.format(returncode), BuildStep.configure, stdo, stde, mesonlog, gen_time) else: - return TestResult('Test that should have failed succeeded', BuildStep.configure, stdo, stde, mesonlog, cicmds, gen_time) + return TestResult('Test that should have failed succeeded', BuildStep.configure, stdo, stde, mesonlog, gen_time) if returncode != 0: - return TestResult('Generating the build system failed.', BuildStep.configure, stdo, stde, mesonlog, cicmds, gen_time) + return TestResult('Generating the build system failed.', BuildStep.configure, stdo, stde, mesonlog, gen_time) builddata = build.load(test_build_dir) # Touch the meson.build file to force a regenerate so we can test that # regeneration works before a build is run. @@ -449,10 +396,10 @@ stde += e if should_fail == 'build': if pc.returncode != 0: - return TestResult('', BuildStep.build, stdo, stde, mesonlog, cicmds, gen_time) - return TestResult('Test that should have failed to build succeeded', BuildStep.build, stdo, stde, mesonlog, cicmds, gen_time) + return TestResult('', BuildStep.build, stdo, stde, mesonlog, gen_time) + return TestResult('Test that should have failed to build succeeded', BuildStep.build, stdo, stde, mesonlog, gen_time) if pc.returncode != 0: - return TestResult('Compiling source code failed.', BuildStep.build, stdo, stde, mesonlog, cicmds, gen_time, build_time) + return TestResult('Compiling source code failed.', BuildStep.build, stdo, stde, mesonlog, gen_time, build_time) # Touch the meson.build file to force a regenerate so we can test that # regeneration works after a build is complete. ensure_backend_detects_changes(backend) @@ -466,10 +413,10 @@ mesonlog += test_log if should_fail == 'test': if returncode != 0: - return TestResult('', BuildStep.test, stdo, stde, mesonlog, cicmds, gen_time) - return TestResult('Test that should have failed to run unit tests succeeded', BuildStep.test, stdo, stde, mesonlog, cicmds, gen_time) + return TestResult('', BuildStep.test, stdo, stde, mesonlog, gen_time) + return TestResult('Test that should have failed to run unit tests succeeded', BuildStep.test, stdo, stde, mesonlog, gen_time) if returncode != 0: - return TestResult('Running unit tests failed.', BuildStep.test, stdo, stde, mesonlog, cicmds, gen_time, build_time, test_time) + return TestResult('Running unit tests failed.', BuildStep.test, stdo, stde, mesonlog, gen_time, build_time, test_time) # Do installation, if the backend supports it if install_commands: env = os.environ.copy() @@ -479,69 +426,26 @@ stdo += o stde += e if pi.returncode != 0: - return TestResult('Running install failed.', BuildStep.install, stdo, stde, mesonlog, cicmds, gen_time, build_time, test_time) + return TestResult('Running install failed.', BuildStep.install, stdo, stde, mesonlog, gen_time, build_time, test_time) # Clean with subprocess env = os.environ.copy() pi, o, e = Popen_safe(clean_commands + dir_args, cwd=test_build_dir, env=env) stdo += o stde += e if pi.returncode != 0: - return TestResult('Running clean failed.', BuildStep.clean, stdo, stde, mesonlog, cicmds, gen_time, build_time, test_time) + return TestResult('Running clean failed.', BuildStep.clean, stdo, stde, mesonlog, gen_time, build_time, test_time) if not install_commands: - return TestResult('', BuildStep.install, '', '', mesonlog, cicmds, gen_time, build_time, test_time) + return TestResult('', BuildStep.install, '', '', mesonlog, gen_time, build_time, test_time) return TestResult(validate_install(testdir, install_dir, compiler, builddata.environment), - BuildStep.validate, stdo, stde, mesonlog, cicmds, gen_time, build_time, test_time) + BuildStep.validate, stdo, stde, mesonlog, gen_time, build_time, test_time) -def gather_tests(testdir: Path) -> T.List[TestDef]: - tests = [t.name for t in testdir.glob('*') if t.is_dir()] - tests = [t for t in tests if not t.startswith('.')] # Filter non-tests files (dot files, etc) - tests = [TestDef(testdir / t, None, []) for t in tests] - all_tests = [] - for t in tests: - matrix_file = t.path / 'test_matrix.json' - if not matrix_file.is_file(): - all_tests += [t] - continue - - # Build multiple tests from matrix definition - opt_list = [] # type: T.List[T.List[T.Tuple[str, bool]]] - matrix = json.loads(matrix_file.read_text()) - assert "options" in matrix - for key, val in matrix["options"].items(): - assert isinstance(val, list) - tmp_opts = [] # type: T.List[T.Tuple[str, bool]] - for i in val: - assert isinstance(i, dict) - assert "val" in i - skip = False - - # Skip the matrix entry if environment variable is present - if 'skip_on_env' in i: - for env in i['skip_on_env']: - if env in os.environ: - skip = True - - tmp_opts += [('{}={}'.format(key, i['val']), skip)] - - if opt_list: - new_opt_list = [] # type: T.List[T.List[T.Tuple[str, bool]]] - for i in opt_list: - for j in tmp_opts: - new_opt_list += [[*i, j]] - opt_list = new_opt_list - else: - opt_list = [[x] for x in tmp_opts] - - for i in opt_list: - name = ' '.join([x[0] for x in i]) - opts = ['-D' + x[0] for x in i] - skip = any([x[1] for x in i]) - all_tests += [TestDef(t.path, name, opts, skip)] - - all_tests = [(int(t.path.name.split()[0]), t.name or '', t) for t in all_tests] - all_tests.sort() - all_tests = [t[2] for t in all_tests] - return all_tests +def gather_tests(testdir: Path) -> typing.List[Path]: + test_names = [t.name for t in testdir.glob('*') if t.is_dir()] + test_names = [t for t in test_names if not t.startswith('.')] # Filter non-tests files (dot files, etc) + test_nums = [(int(t.split()[0]), t) for t in test_names] + test_nums.sort() + tests = [testdir / t[1] for t in test_nums] + return tests def have_d_compiler(): if shutil.which("ldc2"): @@ -600,8 +504,7 @@ return False def skippable(suite, test): - # Everything is optional when not running on CI, or on Ubuntu 16.04 CI - if not under_ci or under_old_os_ci: + if not under_ci: return True if not suite.endswith('frameworks'): @@ -612,7 +515,7 @@ if test.endswith('10 gtk-doc'): return True - # NetCDF is not in the CI Docker image + # NetCDF is not in the CI image if test.endswith('netcdf'): return True @@ -643,7 +546,7 @@ # Other framework tests are allowed to be skipped on other platforms return True -def skip_csharp(backend) -> bool: +def skip_csharp(backend): if backend is not Backend.ninja: return True if not shutil.which('resgen'): @@ -683,16 +586,17 @@ mesonlib.windows_proof_rmtree(dirname) return pc.returncode != 0 -def should_skip_rust(backend: Backend) -> bool: +def should_skip_rust() -> bool: if not shutil.which('rustc'): return True if backend is not Backend.ninja: return True - if mesonlib.is_windows() and has_broken_rustc(): - return True + if mesonlib.is_windows(): + if has_broken_rustc(): + return True return False -def detect_tests_to_run(only: T.List[str]) -> T.List[T.Tuple[str, T.List[TestDef], bool]]: +def detect_tests_to_run(only: typing.List[str]) -> typing.List[typing.Tuple[str, typing.List[Path], bool]]: """ Parameters ---------- @@ -701,14 +605,12 @@ Returns ------- - gathered_tests: list of tuple of str, list of TestDef, bool + gathered_tests: list of tuple of str, list of pathlib.Path, bool tests to run """ - skip_fortran = not(shutil.which('gfortran') or - shutil.which('flang') or - shutil.which('pgfortran') or - shutil.which('ifort')) + skip_fortran = not(shutil.which('gfortran') or shutil.which('flang') or + shutil.which('pgfortran') or shutil.which('ifort')) # Name, subdirectory, skip condition. all_tests = [ @@ -726,14 +628,13 @@ ('java', 'java', backend is not Backend.ninja or mesonlib.is_osx() or not have_java()), ('C#', 'csharp', skip_csharp(backend)), - ('vala', 'vala', backend is not Backend.ninja or not shutil.which(os.environ.get('VALAC', 'valac'))), - ('rust', 'rust', should_skip_rust(backend)), + ('vala', 'vala', backend is not Backend.ninja or not shutil.which('valac')), + ('rust', 'rust', should_skip_rust()), ('d', 'd', backend is not Backend.ninja or not have_d_compiler()), ('objective c', 'objc', backend not in (Backend.ninja, Backend.xcode) or not have_objc_compiler()), ('objective c++', 'objcpp', backend not in (Backend.ninja, Backend.xcode) or not have_objcpp_compiler()), ('fortran', 'fortran', skip_fortran or backend != Backend.ninja), ('swift', 'swift', backend not in (Backend.ninja, Backend.xcode) or not shutil.which('swiftc')), - # CUDA tests on Windows: use Ninja backend: python run_project_tests.py --only cuda --backend ninja ('cuda', 'cuda', backend not in (Backend.ninja, Backend.xcode) or not shutil.which('nvcc')), ('python3', 'python3', backend is not Backend.ninja), ('python', 'python', backend is not Backend.ninja), @@ -743,26 +644,21 @@ ('wasm', 'wasm', shutil.which('emcc') is None or backend is not Backend.ninja), ] - names = [t[0] for t in all_tests] - assert names == ALL_TESTS, 'argparse("--only", choices=ALL_TESTS) need to be updated to match all_tests names' if only: + names = [t[0] for t in all_tests] ind = [names.index(o) for o in only] all_tests = [all_tests[i] for i in ind] gathered_tests = [(name, gather_tests(Path('test cases', subdir)), skip) for name, subdir, skip in all_tests] return gathered_tests -def run_tests(all_tests: T.List[T.Tuple[str, T.List[TestDef], bool]], - log_name_base: str, failfast: bool, - extra_args: T.List[str]) -> T.Tuple[int, int, int]: +def run_tests(all_tests, log_name_base, failfast: bool, extra_args): global logfile txtname = log_name_base + '.txt' with open(txtname, 'w', encoding='utf-8', errors='ignore') as lf: logfile = lf return _run_tests(all_tests, log_name_base, failfast, extra_args) -def _run_tests(all_tests: T.List[T.Tuple[str, T.List[TestDef], bool]], - log_name_base: str, failfast: bool, - extra_args: T.List[str]) -> T.Tuple[int, int, int]: +def _run_tests(all_tests, log_name_base, failfast: bool, extra_args): global stop, executor, futures, system_compiler xmlname = log_name_base + '.xml' junit_root = ET.Element('testsuites') @@ -802,10 +698,8 @@ for t in test_cases: # Jenkins screws us over by automatically sorting test cases by name # and getting it wrong by not doing logical number sorting. - (testnum, testbase) = t.path.name.split(' ', 1) + (testnum, testbase) = t.name.split(' ', 1) testname = '%.3d %s' % (int(testnum), testbase) - if t.name: - testname += ' ({})'.format(t.name) should_fail = False suite_args = [] if name.startswith('failing'): @@ -813,8 +707,7 @@ if name.startswith('warning'): suite_args = ['--fatal-meson-warnings'] should_fail = name.split('warning-')[1] - - result = executor.submit(run_test, skipped or t.skip, t.path.as_posix(), t.name, extra_args + suite_args + t.args, + result = executor.submit(run_test, skipped, t.as_posix(), extra_args + suite_args, system_compiler, backend, backend_flags, commands, should_fail) futures.append((testname, t, result)) for (testname, t, result) in futures: @@ -823,8 +716,8 @@ result = result.result() except CancelledError: continue - if (result is None) or (('MESON_SKIP_TEST' in result.stdo) and (skippable(name, t.path.as_posix()))): - print(yellow('Skipping:'), t.display_name()) + if (result is None) or (('MESON_SKIP_TEST' in result.stdo) and (skippable(name, t.as_posix()))): + print(yellow('Skipping:'), t.as_posix()) current_test = ET.SubElement(current_suite, 'testcase', {'name': testname, 'classname': name}) ET.SubElement(current_test, 'skipped', {}) @@ -832,7 +725,7 @@ else: without_install = "" if len(install_commands) > 0 else " (without install)" if result.msg != '': - print(red('Failed test{} during {}: {!r}'.format(without_install, result.step.name, t.display_name()))) + print(red('Failed test{} during {}: {!r}'.format(without_install, result.step.name, t.as_posix()))) print('Reason:', result.msg) failing_tests += 1 if result.step == BuildStep.configure and result.mlog != no_meson_log_msg: @@ -848,21 +741,19 @@ failing_logs.append(result.stdo) else: failing_logs.append(result.stdo) - for cmd_res in result.cicmds: - failing_logs.append(cmd_res) failing_logs.append(result.stde) if failfast: print("Cancelling the rest of the tests") for (_, _, res) in futures: res.cancel() else: - print('Succeeded test%s: %s' % (without_install, t.display_name())) + print('Succeeded test%s: %s' % (without_install, t.as_posix())) passing_tests += 1 conf_time += result.conftime build_time += result.buildtime test_time += result.testtime total_time = conf_time + build_time + test_time - log_text_file(logfile, t.path, result.stdo, result.stde) + log_text_file(logfile, t, result.stdo, result.stde) current_test = ET.SubElement(current_suite, 'testcase', {'name': testname, 'classname': name, 'time': '%.3f' % total_time}) @@ -976,53 +867,21 @@ raise RuntimeError("Could not find C compiler.") print() -def print_tool_versions(): - tools = [ - { - 'tool': 'cmake', - 'args': ['--version'], - 'regex': re.compile(r'^cmake version ([0-9]+(\.[0-9]+)*)$'), - 'match_group': 1, - }, - ] - - def get_version(t: dict) -> str: - exe = shutil.which(t['tool']) - if not exe: - return 'not found' - - args = [t['tool']] + t['args'] - pc, o, e = Popen_safe(args) - if pc.returncode != 0: - return '{} (invalid {} executable)'.format(exe, t['tool']) - for i in o.split('\n'): - i = i.strip('\n\r\t ') - m = t['regex'].match(i) - if m is not None: - return '{} ({})'.format(exe, m.group(t['match_group'])) - - return '{} (unknown)'.format(exe) - - max_width = max([len(x['tool']) for x in tools] + [7]) - for tool in tools: - print('{0:<{2}}: {1}'.format(tool['tool'], get_version(tool), max_width)) - print() - if __name__ == '__main__': parser = argparse.ArgumentParser(description="Run the test suite of Meson.") parser.add_argument('extra_args', nargs='*', help='arguments that are passed directly to Meson (remember to have -- before these).') - parser.add_argument('--backend', dest='backend', choices=backendlist) + parser.add_argument('--backend', default=None, dest='backend', + choices=backendlist) parser.add_argument('--failfast', action='store_true', help='Stop running if test case fails') parser.add_argument('--no-unittests', action='store_true', help='Not used, only here to simplify run_tests.py') - parser.add_argument('--only', help='name of test(s) to run', nargs='+', choices=ALL_TESTS) + parser.add_argument('--only', help='name of test(s) to run', nargs='+') options = parser.parse_args() setup_commands(options.backend) detect_system_compiler() - print_tool_versions() script_dir = os.path.split(__file__)[0] if script_dir != '': os.chdir(script_dir) @@ -1044,7 +903,7 @@ except UnicodeError: print(l.encode('ascii', errors='replace').decode(), '\n') for name, dirs, _ in all_tests: - dir_names = list(set(x.path.name for x in dirs)) + dir_names = (x.name for x in dirs) for k, g in itertools.groupby(dir_names, key=lambda x: x.split()[0]): tests = list(g) if len(tests) != 1: diff -Nru meson-0.53.2/run_tests.py meson-0.52.1/run_tests.py --- meson-0.53.2/run_tests.py 2020-02-25 18:00:46.000000000 +0000 +++ meson-0.52.1/run_tests.py 2019-11-28 17:37:44.000000000 +0000 @@ -26,8 +26,7 @@ from enum import Enum from glob import glob from pathlib import Path -from mesonbuild import compilers -from mesonbuild import dependencies +import mesonbuild from mesonbuild import mesonlib from mesonbuild import mesonmain from mesonbuild import mtest @@ -96,6 +95,7 @@ self.value = [] def get_fake_options(prefix=''): + import argparse opts = argparse.Namespace() opts.native_file = [] opts.cross_file = None @@ -116,6 +116,7 @@ Backend = Enum('Backend', 'ninja vs xcode') if 'MESON_EXE' in os.environ: + import shlex meson_exe = mesonlib.split_args(os.environ['MESON_EXE']) else: meson_exe = None @@ -135,7 +136,7 @@ running in-process (which is the default). ''' # Is there a meson.py next to the mesonbuild currently in use? - mesonbuild_dir = Path(mesonmain.__file__).resolve().parent.parent + mesonbuild_dir = Path(mesonbuild.__file__).resolve().parent.parent meson_script = mesonbuild_dir / 'meson.py' if meson_script.is_file(): return str(meson_script) @@ -211,8 +212,8 @@ if v == '1.9': NINJA_1_9_OR_NEWER = True else: - mlog.warning('Found ninja <1.9, tests will run slower', once=True) - if 'CI' in os.environ and 'OLD_OS_CI' not in os.environ: + print('Found ninja <1.9, tests will run slower') + if 'CI' in os.environ: raise RuntimeError('Require ninja >= 1.9 when running on Meson CI') break cmd = [ninja_cmd, '-w', 'dupbuild=err', '-d', 'explain'] @@ -238,12 +239,12 @@ # XXX: Upgrade Travis image to Apple FS when that becomes available # TODO: Detect HFS+ vs APFS if mesonlib.is_osx(): - mlog.warning('Running on HFS+, enabling timestamp resolution workaround', once=True) + print('Running on HFS+, enabling timestamp resolution workaround') need_workaround = True # We're using ninja >= 1.9 which has QuLogic's patch for sub-1s resolution # timestamps if not NINJA_1_9_OR_NEWER: - mlog.warning('Don\'t have ninja >= 1.9, enabling timestamp resolution workaround', once=True) + print('Don\'t have ninja >= 1.9, enabling timestamp resolution workaround') need_workaround = True # Increase the difference between build.ninja's timestamp and the timestamp # of whatever you changed: https://github.com/ninja-build/ninja/issues/371 @@ -263,12 +264,12 @@ return returncode, mystdout.getvalue(), mystderr.getvalue() def clear_meson_configure_class_caches(): - compilers.CCompiler.library_dirs_cache = {} - compilers.CCompiler.program_dirs_cache = {} - compilers.CCompiler.find_library_cache = {} - compilers.CCompiler.find_framework_cache = {} - dependencies.PkgConfigDependency.pkgbin_cache = {} - dependencies.PkgConfigDependency.class_pkgbin = mesonlib.PerMachine(None, None) + mesonbuild.compilers.CCompiler.library_dirs_cache = {} + mesonbuild.compilers.CCompiler.program_dirs_cache = {} + mesonbuild.compilers.CCompiler.find_library_cache = {} + mesonbuild.compilers.CCompiler.find_framework_cache = {} + mesonbuild.dependencies.PkgConfigDependency.pkgbin_cache = {} + mesonbuild.dependencies.PkgConfigDependency.class_pkgbin = mesonlib.PerMachine(None, None) def run_configure_inprocess(commandlist, env=None): old_stdout = sys.stdout diff -Nru meson-0.53.2/run_unittests.py meson-0.52.1/run_unittests.py --- meson-0.53.2/run_unittests.py 2020-02-25 18:00:47.000000000 +0000 +++ meson-0.52.1/run_unittests.py 2019-11-28 17:37:44.000000000 +0000 @@ -31,8 +31,6 @@ import threading import urllib.error import urllib.request -import zipfile -import hashlib from itertools import chain from unittest import mock from configparser import ConfigParser @@ -44,7 +42,6 @@ import mesonbuild.mlog import mesonbuild.depfile import mesonbuild.compilers -import mesonbuild.envconfig import mesonbuild.environment import mesonbuild.mesonlib import mesonbuild.coredata @@ -60,7 +57,6 @@ from mesonbuild.environment import detect_ninja from mesonbuild.mesonlib import MesonException, EnvironmentException from mesonbuild.dependencies import PkgConfigDependency, ExternalProgram -import mesonbuild.dependencies.base from mesonbuild.build import Target import mesonbuild.modules.pkgconfig @@ -294,6 +290,26 @@ shutil.which = old_which ExternalProgram._search = old_search +class PatchModule: + ''' + Fancy monkey-patching! Whee! Can't use mock.patch because it only + patches in the local namespace. + ''' + + def __init__(self, func, name, impl): + self.func = func + assert(isinstance(name, str)) + self.func_name = name + self.old_impl = None + self.new_impl = impl + + def __enter__(self): + self.old_impl = self.func + exec('{} = self.new_impl'.format(self.func_name)) + + def __exit__(self, *args): + exec('{} = self.old_impl'.format(self.func_name)) + class InternalTests(unittest.TestCase): @@ -343,15 +359,19 @@ def test_compiler_args_class(self): cargsfunc = mesonbuild.compilers.CompilerArgs - cc = mesonbuild.compilers.CCompiler([], 'fake', False, MachineChoice.HOST, mock.Mock()) + cc = mesonbuild.compilers.CCompiler([], 'fake', False, MachineChoice.HOST) + # Test that bad initialization fails + self.assertRaises(TypeError, cargsfunc, []) + self.assertRaises(TypeError, cargsfunc, [], []) + self.assertRaises(TypeError, cargsfunc, cc, [], []) # Test that empty initialization works a = cargsfunc(cc) self.assertEqual(a, []) # Test that list initialization works - a = cargsfunc(cc, ['-I.', '-I..']) + a = cargsfunc(['-I.', '-I..'], cc) self.assertEqual(a, ['-I.', '-I..']) # Test that there is no de-dup on initialization - self.assertEqual(cargsfunc(cc, ['-I.', '-I.']), ['-I.', '-I.']) + self.assertEqual(cargsfunc(['-I.', '-I.'], cc), ['-I.', '-I.']) ## Test that appending works a.append('-I..') @@ -425,8 +445,8 @@ def test_compiler_args_class_gnuld(self): cargsfunc = mesonbuild.compilers.CompilerArgs ## Test --start/end-group - linker = mesonbuild.linkers.GnuDynamicLinker([], MachineChoice.HOST, 'fake', '-Wl,', []) - gcc = mesonbuild.compilers.GnuCCompiler([], 'fake', False, MachineChoice.HOST, mock.Mock(), linker=linker) + linker = mesonbuild.linkers.GnuDynamicLinker([], MachineChoice.HOST, 'fake', '-Wl,') + gcc = mesonbuild.compilers.GnuCCompiler([], 'fake', mesonbuild.compilers.CompilerType.GCC_STANDARD, False, MachineChoice.HOST, linker=linker) ## Ensure that the fake compiler is never called by overriding the relevant function gcc.get_default_include_dirs = lambda: ['/usr/include', '/usr/share/include', '/usr/local/include'] ## Test that 'direct' append and extend works @@ -454,8 +474,8 @@ def test_compiler_args_remove_system(self): cargsfunc = mesonbuild.compilers.CompilerArgs ## Test --start/end-group - linker = mesonbuild.linkers.GnuDynamicLinker([], MachineChoice.HOST, 'fake', '-Wl,', []) - gcc = mesonbuild.compilers.GnuCCompiler([], 'fake', False, MachineChoice.HOST, mock.Mock(), linker=linker) + linker = mesonbuild.linkers.GnuDynamicLinker([], MachineChoice.HOST, 'fake', '-Wl,') + gcc = mesonbuild.compilers.GnuCCompiler([], 'fake', mesonbuild.compilers.CompilerType.GCC_STANDARD, False, MachineChoice.HOST, linker=linker) ## Ensure that the fake compiler is never called by overriding the relevant function gcc.get_default_include_dirs = lambda: ['/usr/include', '/usr/share/include', '/usr/local/include'] ## Test that 'direct' append and extend works @@ -1144,54 +1164,6 @@ deps = d.get_all_dependencies(target) self.assertEqual(deps, expdeps) - def test_log_once(self): - f = io.StringIO() - with mock.patch('mesonbuild.mlog.log_file', f), \ - mock.patch('mesonbuild.mlog._logged_once', set()): - mesonbuild.mlog.log_once('foo') - mesonbuild.mlog.log_once('foo') - actual = f.getvalue().strip() - self.assertEqual(actual, 'foo', actual) - - def test_log_once_ansi(self): - f = io.StringIO() - with mock.patch('mesonbuild.mlog.log_file', f), \ - mock.patch('mesonbuild.mlog._logged_once', set()): - mesonbuild.mlog.log_once(mesonbuild.mlog.bold('foo')) - mesonbuild.mlog.log_once(mesonbuild.mlog.bold('foo')) - actual = f.getvalue().strip() - self.assertEqual(actual.count('foo'), 1, actual) - - mesonbuild.mlog.log_once('foo') - actual = f.getvalue().strip() - self.assertEqual(actual.count('foo'), 1, actual) - - f.truncate() - - mesonbuild.mlog.warning('bar', once=True) - mesonbuild.mlog.warning('bar', once=True) - actual = f.getvalue().strip() - self.assertEqual(actual.count('bar'), 1, actual) - - def test_sort_libpaths(self): - sort_libpaths = mesonbuild.dependencies.base.sort_libpaths - self.assertEqual(sort_libpaths( - ['/home/mesonuser/.local/lib', '/usr/local/lib', '/usr/lib'], - ['/home/mesonuser/.local/lib/pkgconfig', '/usr/local/lib/pkgconfig']), - ['/home/mesonuser/.local/lib', '/usr/local/lib', '/usr/lib']) - self.assertEqual(sort_libpaths( - ['/usr/local/lib', '/home/mesonuser/.local/lib', '/usr/lib'], - ['/home/mesonuser/.local/lib/pkgconfig', '/usr/local/lib/pkgconfig']), - ['/home/mesonuser/.local/lib', '/usr/local/lib', '/usr/lib']) - self.assertEqual(sort_libpaths( - ['/usr/lib', '/usr/local/lib', '/home/mesonuser/.local/lib'], - ['/home/mesonuser/.local/lib/pkgconfig', '/usr/local/lib/pkgconfig']), - ['/home/mesonuser/.local/lib', '/usr/local/lib', '/usr/lib']) - self.assertEqual(sort_libpaths( - ['/usr/lib', '/usr/local/lib', '/home/mesonuser/.local/lib'], - ['/home/mesonuser/.local/lib/pkgconfig', '/usr/local/libdata/pkgconfig']), - ['/home/mesonuser/.local/lib', '/usr/local/lib', '/usr/lib']) - @unittest.skipIf(is_tarball(), 'Skipping because this is a tarball release') class DataTests(unittest.TestCase): @@ -1229,7 +1201,7 @@ platform on the CI. ''' md = None - with open('docs/markdown/Builtin-options.md', encoding='utf-8') as f: + with open('docs/markdown/Builtin-options.md') as f: md = f.read() self.assertIsNotNone(md) env = get_fake_env() @@ -1249,7 +1221,7 @@ Builtin-Options.md. ''' md = None - with open('docs/markdown/Builtin-options.md', encoding='utf-8') as f: + with open('docs/markdown/Builtin-options.md') as f: md = f.read() self.assertIsNotNone(md) @@ -1283,7 +1255,7 @@ ])) def test_cpu_families_documented(self): - with open("docs/markdown/Reference-tables.md", encoding='utf-8') as f: + with open("docs/markdown/Reference-tables.md") as f: md = f.read() self.assertIsNotNone(md) @@ -1302,7 +1274,7 @@ ''' Test that each markdown files in docs/markdown is referenced in sitemap.txt ''' - with open("docs/sitemap.txt", encoding='utf-8') as f: + with open("docs/sitemap.txt") as f: md = f.read() self.assertIsNotNone(md) toc = list(m.group(1) for m in re.finditer(r"^\s*(\w.*)$", md, re.MULTILINE)) @@ -1374,7 +1346,6 @@ class BasePlatformTests(unittest.TestCase): def setUp(self): super().setUp() - self.maxDiff = None src_root = os.path.dirname(__file__) src_root = os.path.join(os.getcwd(), src_root) self.src_root = src_root @@ -1817,14 +1788,8 @@ # N.B. We don't check 'libdir' as it's platform dependent, see # default_libdir(): } - - if mesonbuild.mesonlib.default_prefix() == '/usr/local': - expected[None] = expected['/usr/local'] - for prefix in expected: - args = [] - if prefix: - args += ['--prefix', prefix] + args = ['--prefix', prefix] self.init(testdir, extra_args=args, default_args=False) opts = self.introspect('--buildoptions') for opt in opts: @@ -1996,7 +1961,7 @@ https://github.com/mesonbuild/meson/pull/4555 Reverted to the first file only because of https://github.com/mesonbuild/meson/pull/4547#discussion_r244173438 - TODO Change the format to a list officially in a followup PR + TODO Change the format to a list officialy in a followup PR ''' if self.backend is not Backend.ninja: raise unittest.SkipTest('{!r} backend can\'t install files'.format(self.backend.name)) @@ -2010,33 +1975,6 @@ self.assertPathListEqual(intro[2]['install_filename'], ['/usr/include/first.h', None]) self.assertPathListEqual(intro[3]['install_filename'], [None, '/usr/bin/second.sh']) - def test_install_log_content(self): - ''' - Tests that the install-log.txt is consistent with the installed files and directories. - Specifically checks that the log file only contains one entry per file/directory. - https://github.com/mesonbuild/meson/issues/4499 - ''' - testdir = os.path.join(self.common_test_dir, '62 install subdir') - self.init(testdir) - self.install() - installpath = Path(self.installdir) - # Find installed files and directories - expected = {installpath: 0} - for name in installpath.rglob('*'): - expected[name] = 0 - # Find logged files and directories - with Path(self.builddir, 'meson-logs', 'install-log.txt').open() as f: - logged = list(map(lambda l: Path(l.strip()), - filter(lambda l: not l.startswith('#'), - f.readlines()))) - for name in logged: - self.assertTrue(name in expected, 'Log contains extra entry {}'.format(name)) - expected[name] += 1 - - for name, count in expected.items(): - self.assertGreater(count, 0, 'Log is missing entry for {}'.format(name)) - self.assertLess(count, 2, 'Log has multiple entries for {}'.format(name)) - def test_uninstall(self): exename = os.path.join(self.installdir, 'usr/bin/prog' + exe_suffix) testdir = os.path.join(self.common_test_dir, '8 install') @@ -2294,7 +2232,7 @@ ar = mesonbuild.linkers.ArLinker lib = mesonbuild.linkers.VisualStudioLinker langs = [('c', 'CC'), ('cpp', 'CXX')] - if not is_windows() and platform.machine().lower() != 'e2k': + if not is_windows(): langs += [('objc', 'OBJC'), ('objcpp', 'OBJCXX')] testdir = os.path.join(self.unit_test_dir, '5 compiler detection') env = get_fake_env(testdir, self.builddir, self.prefix) @@ -2336,35 +2274,35 @@ if isinstance(cc, gnu): self.assertIsInstance(linker, ar) if is_osx(): - self.assertIsInstance(cc.linker, mesonbuild.linkers.AppleDynamicLinker) + self.assertEqual(cc.compiler_type, mesonbuild.compilers.CompilerType.GCC_OSX) + elif is_windows(): + self.assertEqual(cc.compiler_type, mesonbuild.compilers.CompilerType.GCC_MINGW) + elif is_cygwin(): + self.assertEqual(cc.compiler_type, mesonbuild.compilers.CompilerType.GCC_CYGWIN) else: - self.assertIsInstance(cc.linker, mesonbuild.linkers.GnuLikeDynamicLinkerMixin) - if isinstance(cc, clangcl): - self.assertIsInstance(linker, lib) - self.assertIsInstance(cc.linker, mesonbuild.linkers.ClangClDynamicLinker) + self.assertEqual(cc.compiler_type, mesonbuild.compilers.CompilerType.GCC_STANDARD) if isinstance(cc, clang): self.assertIsInstance(linker, ar) if is_osx(): - self.assertIsInstance(cc.linker, mesonbuild.linkers.AppleDynamicLinker) + self.assertEqual(cc.compiler_type, mesonbuild.compilers.CompilerType.CLANG_OSX) elif is_windows(): - # This is clang, not clang-cl - self.assertIsInstance(cc.linker, mesonbuild.linkers.MSVCDynamicLinker) + # Not implemented yet + self.assertEqual(cc.compiler_type, mesonbuild.compilers.CompilerType.CLANG_MINGW) else: - self.assertIsInstance(cc.linker, mesonbuild.linkers.GnuLikeDynamicLinkerMixin) + self.assertEqual(cc.compiler_type, mesonbuild.compilers.CompilerType.CLANG_STANDARD) if isinstance(cc, intel): self.assertIsInstance(linker, ar) if is_osx(): - self.assertIsInstance(cc.linker, mesonbuild.linkers.AppleDynamicLinker) + self.assertEqual(cc.compiler_type, mesonbuild.compilers.CompilerType.ICC_OSX) elif is_windows(): - self.assertIsInstance(cc.linker, mesonbuild.linkers.XilinkDynamicLinker) + self.assertEqual(cc.compiler_type, mesonbuild.compilers.CompilerType.ICC_WIN) else: - self.assertIsInstance(cc.linker, mesonbuild.linkers.GnuDynamicLinker) + self.assertEqual(cc.compiler_type, mesonbuild.compilers.CompilerType.ICC_STANDARD) if isinstance(cc, msvc): self.assertTrue(is_windows()) self.assertIsInstance(linker, lib) self.assertEqual(cc.id, 'msvc') self.assertTrue(hasattr(cc, 'is_64')) - self.assertIsInstance(cc.linker, mesonbuild.linkers.MSVCDynamicLinker) # If we're on Windows CI, we know what the compiler will be if 'arch' in os.environ: if os.environ['arch'] == 'x64': @@ -2559,8 +2497,6 @@ def test_dist_git(self): if not shutil.which('git'): raise unittest.SkipTest('Git not found') - if self.backend is not Backend.ninja: - raise unittest.SkipTest('Dist is only supported with Ninja') try: self.dist_impl(_git_init) @@ -2585,7 +2521,7 @@ subprocess.check_call(['hg', 'commit', '-m', 'I am a project'], cwd=project_dir) try: - self.dist_impl(hg_init, include_subprojects=False) + self.dist_impl(hg_init) except PermissionError: # When run under Windows CI, something (virus scanner?) # holds on to the hg files so cleaning up the dir @@ -2595,8 +2531,6 @@ def test_dist_git_script(self): if not shutil.which('git'): raise unittest.SkipTest('Git not found') - if self.backend is not Backend.ninja: - raise unittest.SkipTest('Dist is only supported with Ninja') try: with tempfile.TemporaryDirectory() as tmpdir: @@ -2612,14 +2546,7 @@ # fails sometimes. pass - def create_dummy_subproject(self, project_dir, name): - path = os.path.join(project_dir, 'subprojects', name) - os.makedirs(path) - with open(os.path.join(path, 'meson.build'), 'w') as ofile: - ofile.write("project('{}')".format(name)) - return path - - def dist_impl(self, vcs_init, include_subprojects=True): + def dist_impl(self, vcs_init): # Create this on the fly because having rogue .git directories inside # the source tree leads to all kinds of trouble. with tempfile.TemporaryDirectory() as project_dir: @@ -2627,8 +2554,6 @@ ofile.write('''project('disttest', 'c', version : '1.4.3') e = executable('distexe', 'distexe.c') test('dist test', e) -subproject('vcssub', required : false) -subproject('tarballsub', required : false) ''') with open(os.path.join(project_dir, 'distexe.c'), 'w') as ofile: ofile.write('''#include @@ -2643,10 +2568,6 @@ zip_distfile = os.path.join(self.distdir, 'disttest-1.4.3.zip') zip_checksumfile = zip_distfile + '.sha256sum' vcs_init(project_dir) - if include_subprojects: - vcs_init(self.create_dummy_subproject(project_dir, 'vcssub')) - self.create_dummy_subproject(project_dir, 'tarballsub') - self.create_dummy_subproject(project_dir, 'unusedsub') self.init(project_dir) self.build('dist') self.assertPathExists(xz_distfile) @@ -2658,26 +2579,6 @@ self.assertPathExists(zip_distfile) self.assertPathExists(zip_checksumfile) - if include_subprojects: - z = zipfile.ZipFile(zip_distfile) - self.assertEqual(sorted(['disttest-1.4.3/', - 'disttest-1.4.3/meson.build', - 'disttest-1.4.3/distexe.c']), - sorted(z.namelist())) - - self._run(self.meson_command + ['dist', '--formats', 'zip', '--include-subprojects'], - workdir=self.builddir) - z = zipfile.ZipFile(zip_distfile) - self.assertEqual(sorted(['disttest-1.4.3/', - 'disttest-1.4.3/subprojects/', - 'disttest-1.4.3/meson.build', - 'disttest-1.4.3/distexe.c', - 'disttest-1.4.3/subprojects/tarballsub/', - 'disttest-1.4.3/subprojects/vcssub/', - 'disttest-1.4.3/subprojects/tarballsub/meson.build', - 'disttest-1.4.3/subprojects/vcssub/meson.build']), - sorted(z.namelist())) - def test_rpath_uses_ORIGIN(self): ''' Test that built targets use $ORIGIN in rpath, which ensures that they @@ -2816,7 +2717,8 @@ '/NOLOGO', '/DLL', '/DEBUG', '/IMPLIB:' + impfile, '/OUT:' + outfile, objectfile] else: - if not (compiler.info.is_windows() or compiler.info.is_cygwin() or compiler.info.is_darwin()): + if not (compiler.compiler_type.is_windows_compiler or + compiler.compiler_type.is_osx_compiler): extra_args += ['-fPIC'] link_cmd = compiler.get_exelist() + ['-shared', '-o', outfile, objectfile] if not mesonbuild.mesonlib.is_osx(): @@ -3077,35 +2979,8 @@ ninja = detect_ninja() if ninja is None: raise unittest.SkipTest('This test currently requires ninja. Fix this once "meson build" works.') - langs = ['c'] - env = get_fake_env() - try: - env.detect_cpp_compiler(MachineChoice.HOST) - langs.append('cpp') - except EnvironmentException: - pass - try: - env.detect_d_compiler(MachineChoice.HOST) - langs.append('d') - except EnvironmentException: - pass - try: - env.detect_fortran_compiler(MachineChoice.HOST) - if is_windows() or platform.machine().lower() != 'e2k': - # Elbrus Fortran compiler can't generate debug information - langs.append('fortran') - except EnvironmentException: - pass - try: - env.detect_objc_compiler(MachineChoice.HOST) - langs.append('objc') - except EnvironmentException: - pass - # FIXME: omitting rust as Windows AppVeyor CI finds Rust but doesn't link correctly - - for lang in langs: + for lang in ('c', 'cpp'): for target_type in ('executable', 'library'): - # test empty directory with tempfile.TemporaryDirectory() as tmpdir: self._run(self.meson_command + ['init', '--language', lang, '--type', target_type], workdir=tmpdir) @@ -3113,12 +2988,10 @@ workdir=tmpdir) self._run(ninja, workdir=os.path.join(tmpdir, 'builddir')) - # test directory with existing code file - if lang in ('c', 'cpp'): - with tempfile.TemporaryDirectory() as tmpdir: - with open(os.path.join(tmpdir, 'foo.' + lang), 'w') as f: - f.write('int main(void) {}') - self._run(self.meson_command + ['init', '-b'], workdir=tmpdir) + with tempfile.TemporaryDirectory() as tmpdir: + with open(os.path.join(tmpdir, 'foo.' + lang), 'w') as f: + f.write('int main() {}') + self._run(self.meson_command + ['init', '-b'], workdir=tmpdir) # The test uses mocking and thus requires that # the current process is the one to run the Meson steps. @@ -3259,7 +3132,7 @@ env = get_fake_env(testdirlib, self.builddir, self.prefix) if env.detect_c_compiler(MachineChoice.HOST).get_id() in {'msvc', 'clang-cl', 'intel-cl'}: # msvc-like compiler, also test it with msvc-specific flags - libdir_flags += ['/LIBPATH:', '-LIBPATH:'] + libdir_flags += ['/LIBPATH:'] else: # static libraries are not linkable with -l with msvc because meson installs them # as .a files which unix_args_to_native will not know as it expects libraries to use @@ -3273,7 +3146,6 @@ for libdir_flag in libdir_flags: # build library - self.new_builddir() self.init(testdirlib, extra_args=extra_args) self.build() self.install() @@ -3283,7 +3155,7 @@ # build user of library self.new_builddir() - # replace is needed because meson mangles platform paths passed via LDFLAGS + # replace is needed because meson mangles platform pathes passed via LDFLAGS self.init(os.path.join(testdirbase, 'exe'), override_envvars={"LDFLAGS": '{}{}'.format(libdir_flag, libdir.replace('\\', '/'))}) self.build() @@ -3308,6 +3180,7 @@ self.installdir = initial_builddir self.builddir = initial_installdir + def test_conflicting_d_dash_option(self): testdir = os.path.join(self.unit_test_dir, '37 mixed command line args') with self.assertRaises(subprocess.CalledProcessError) as e: @@ -3452,11 +3325,6 @@ self.assertEqual(obj.compiler_options.host['c_args'].value, ['foo bar', 'one', 'two']) self.wipe() - self.init(testdir, extra_args=['-Dset_percent_opt=myoption%']) - obj = mesonbuild.coredata.load(self.builddir) - self.assertEqual(obj.user_options['set_percent_opt'].value, 'myoption%') - self.wipe() - # Setting a 2nd time the same option should override the first value try: self.init(testdir, extra_args=['--bindir=foo', '--bindir=bar', @@ -3515,12 +3383,12 @@ testdir = os.path.join(self.unit_test_dir, '41 featurenew subprojects') out = self.init(testdir) # Parent project warns correctly - self.assertRegex(out, "WARNING: Project targeting '>=0.45'.*'0.47.0': dict") + self.assertRegex(out, "WARNING: Project targetting '>=0.45'.*'0.47.0': dict") # Subprojects warn correctly - self.assertRegex(out, r"\|WARNING: Project targeting '>=0.40'.*'0.44.0': disabler") - self.assertRegex(out, r"\|WARNING: Project targeting '!=0.40'.*'0.44.0': disabler") + self.assertRegex(out, r"\|WARNING: Project targetting '>=0.40'.*'0.44.0': disabler") + self.assertRegex(out, r"\|WARNING: Project targetting '!=0.40'.*'0.44.0': disabler") # Subproject has a new-enough meson_version, no warning - self.assertNotRegex(out, "WARNING: Project targeting.*Python") + self.assertNotRegex(out, "WARNING: Project targetting.*Python") # Ensure a summary is printed in the subproject and the outer project self.assertRegex(out, r"\|WARNING: Project specifies a minimum meson_version '>=0.40'") self.assertRegex(out, r"\| \* 0.44.0: {'disabler'}") @@ -3820,16 +3688,6 @@ out = self.run_target('clang-tidy') self.assertIn('cttest.cpp:4:20', out) - def test_identity_cross(self): - testdir = os.path.join(self.unit_test_dir, '71 cross') - # Do a build to generate a cross file where the host is this target - self.init(testdir, extra_args=['-Dgenerate=true']) - self.meson_cross_file = os.path.join(self.builddir, "crossfile") - self.assertTrue(os.path.exists(self.meson_cross_file)) - # Now verify that this is detected as cross - self.new_builddir() - self.init(testdir) - def test_introspect_buildoptions_without_configured_build(self): testdir = os.path.join(self.unit_test_dir, '59 introspect buildoptions') testfile = os.path.join(testdir, 'meson.build') @@ -3872,7 +3730,6 @@ ('timeout', int), ('suite', list), ('is_parallel', bool), - ('protocol', str), ] buildoptions_keylist = [ @@ -3896,7 +3753,6 @@ dependencies_typelist = [ ('name', str), - ('version', str), ('compile_args', list), ('link_args', list), ] @@ -4103,35 +3959,30 @@ { 'name': 'threads', 'required': True, - 'version': [], 'has_fallback': False, 'conditional': False }, { 'name': 'zlib', 'required': False, - 'version': [], 'has_fallback': False, 'conditional': False }, { 'name': 'bugDep1', - 'required': True, - 'version': [], + 'required': False, 'has_fallback': False, 'conditional': False }, { 'name': 'somethingthatdoesnotexist', 'required': True, - 'version': ['>=1.2.3'], 'has_fallback': False, 'conditional': True }, { 'name': 'look_i_have_a_fallback', 'required': True, - 'version': ['>=1.0.0', '<=99.9.9'], 'has_fallback': True, 'conditional': True } @@ -4168,50 +4019,6 @@ self.assertPathExists(os.path.join(self.builddir, 'prog' + exe_suffix)) self.assertPathExists(os.path.join(self.builddir, 'hello.txt')) - def test_configure(self): - testdir = os.path.join(self.common_test_dir, '2 cpp') - self.init(testdir) - self._run(self.mconf_command + [self.builddir]) - - def test_summary(self): - testdir = os.path.join(self.unit_test_dir, '74 summary') - out = self.init(testdir) - expected = textwrap.dedent(r''' - Some Subproject 2.0 - - string: bar - integer: 1 - boolean: True - - My Project 1.0 - - Configuration - Some boolean: False - Another boolean: True - Some string: Hello World - A list: string - 1 - True - empty list: - A number: 1 - yes: YES - no: NO - - Subprojects - sub: YES - sub2: NO - ''') - expected_lines = expected.split('\n')[1:] - out_start = out.find(expected_lines[0]) - out_lines = out[out_start:].split('\n')[:len(expected_lines)] - if sys.version_info < (3, 7, 0): - # Dictionary order is not stable in Python <3.7, so sort the lines - # while comparing - self.assertEqual(sorted(expected_lines), sorted(out_lines)) - else: - self.assertEqual(expected_lines, out_lines) - - class FailureTests(BasePlatformTests): ''' Tests that test failure conditions. Build files here should be dynamically @@ -4459,18 +4266,18 @@ def test_using_too_recent_feature(self): # Here we use a dict, which was introduced in 0.47.0 self.assertMesonOutputs("dict = {}", - ".*WARNING.*Project targeting.*but.*", + ".*WARNING.*Project targetting.*but.*", meson_version='>= 0.46.0') def test_using_recent_feature(self): # Same as above, except the meson version is now appropriate self.assertMesonDoesNotOutput("dict = {}", - ".*WARNING.*Project targeting.*but.*", + ".*WARNING.*Project targetting.*but.*", meson_version='>= 0.47') def test_using_too_recent_feature_dependency(self): self.assertMesonOutputs("dependency('pcap', required: false)", - ".*WARNING.*Project targeting.*but.*", + ".*WARNING.*Project targetting.*but.*", meson_version='>= 0.41.0') def test_vcs_tag_featurenew_build_always_stale(self): @@ -4501,12 +4308,6 @@ match = 'Meson version is.*but project requires >=2000' self.assertMesonRaises("", match, meson_version='>=2000', options=options) - def test_assert_default_message(self): - self.assertMesonRaises("k1 = 'a'\n" + - "assert({\n" + - " k1: 1,\n" + - "}['a'] == 2)\n", - r"Assert failed: {k1 : 1}\['a'\] == 2") @unittest.skipUnless(is_windows() or is_cygwin(), "requires Windows (or Windows via Cygwin)") class WindowsTests(BasePlatformTests): @@ -4556,14 +4357,6 @@ self.assertTrue(prog.found(), msg='test-script-ext.py not found in PATH') self.assertPathEqual(prog.get_command()[0], python_command[0]) self.assertPathBasenameEqual(prog.get_path(), 'test-script-ext.py') - # Ensure that WindowsApps gets removed from PATH - path = os.environ['PATH'] - if 'WindowsApps' not in path: - username = os.environ['USERNAME'] - appstore_dir = r'C:\Users\{}\AppData\Local\Microsoft\WindowsApps'.format(username) - path = os.pathsep + appstore_dir - path = ExternalProgram._windows_sanitize_path(path) - self.assertNotIn('WindowsApps', path) def test_ignore_libs(self): ''' @@ -4631,72 +4424,6 @@ return self.build() - def test_install_pdb_introspection(self): - testdir = os.path.join(self.platform_test_dir, '1 basic') - - env = get_fake_env(testdir, self.builddir, self.prefix) - cc = env.detect_c_compiler(MachineChoice.HOST) - if cc.get_argument_syntax() != 'msvc': - raise unittest.SkipTest('Test only applies to MSVC-like compilers') - - self.init(testdir) - installed = self.introspect('--installed') - files = [os.path.basename(path) for path in installed.values()] - - self.assertTrue('prog.pdb' in files) - - def _check_ld(self, name: str, lang: str, expected: str) -> None: - if not shutil.which(name): - raise unittest.SkipTest('Could not find {}.'.format(name)) - envvar = mesonbuild.envconfig.BinaryTable.evarMap['{}_ld'.format(lang)] - with mock.patch.dict(os.environ, {envvar: name}): - env = get_fake_env() - try: - comp = getattr(env, 'detect_{}_compiler'.format(lang))(MachineChoice.HOST) - except EnvironmentException: - raise unittest.SkipTest('Could not find a compiler for {}'.format(lang)) - self.assertEqual(comp.linker.id, expected) - - def test_link_environment_variable_lld_link(self): - self._check_ld('lld-link', 'c', 'lld-link') - - def test_link_environment_variable_link(self): - self._check_ld('link', 'c', 'link') - - def test_link_environment_variable_optlink(self): - self._check_ld('optlink', 'c', 'optlink') - - def test_link_environment_variable_rust(self): - self._check_ld('link', 'rust', 'link') - - def test_pefile_checksum(self): - try: - import pefile - except ImportError: - if is_ci(): - raise - raise unittest.SkipTest('pefile module not found') - testdir = os.path.join(self.common_test_dir, '6 linkshared') - self.init(testdir) - self.build() - # Test that binaries have a non-zero checksum - env = get_fake_env() - cc = env.detect_c_compiler(MachineChoice.HOST) - cc_id = cc.get_id() - ld_id = cc.get_linker_id() - dll = glob(os.path.join(self.builddir, '*mycpplib.dll'))[0] - exe = os.path.join(self.builddir, 'cppprog.exe') - for f in (dll, exe): - pe = pefile.PE(f) - msg = 'PE file: {!r}, compiler: {!r}, linker: {!r}'.format(f, cc_id, ld_id) - if cc_id == 'clang-cl': - # Latest clang-cl tested (7.0) does not write checksums out - self.assertFalse(pe.verify_checksum(), msg=msg) - else: - # Verify that a valid checksum was written by all other compilers - self.assertTrue(pe.verify_checksum(), msg=msg) - - @unittest.skipUnless(is_osx(), "requires Darwin") class DarwinTests(BasePlatformTests): ''' @@ -4796,11 +4523,6 @@ self.build() self.install() - def test_removing_unused_linker_args(self): - testdir = os.path.join(self.common_test_dir, '108 has arg') - env = {'CFLAGS': '-L/tmp -L /var/tmp -headerpad_max_install_names -Wl,-export_dynamic'} - self.init(testdir, override_envvars=env) - @unittest.skipUnless(not is_windows(), "requires something Unix-like") class LinuxlikeTests(BasePlatformTests): @@ -4888,10 +4610,7 @@ privatedir2 = self.privatedir os.environ - env = { - 'PKG_CONFIG_LIBDIR': os.pathsep.join([privatedir1, privatedir2]), - 'PKG_CONFIG_SYSTEM_LIBRARY_PATH': '/usr/lib', - } + env = {'PKG_CONFIG_LIBDIR': os.pathsep.join([privatedir1, privatedir2])} self._run(['pkg-config', 'dependency-test', '--validate'], override_envvars=env) # pkg-config strips some duplicated flags so we have to parse the @@ -5885,7 +5604,6 @@ # Assert that self.assertEqual(len(line.split(lib)), 2, msg=(lib, line)) - @skipIfNoPkgconfig def test_noncross_options(self): # C_std defined in project options must be in effect also when native compiling. testdir = os.path.join(self.unit_test_dir, '51 noncross options') @@ -5908,7 +5626,6 @@ # TODO should someday be explicit about build platform only here self.init(testdir, override_envvars=env) - @skipIfNoPkgconfig def test_static_link(self): if is_cygwin(): raise unittest.SkipTest("Cygwin doesn't support LD_LIBRARY_PATH.") @@ -5932,80 +5649,6 @@ self.build() self.run_tests() - def _check_ld(self, check: str, name: str, lang: str, expected: str) -> None: - if is_sunos(): - raise unittest.SkipTest('Solaris currently cannot override the linker.') - if not shutil.which(check): - raise unittest.SkipTest('Could not find {}.'.format(check)) - envvar = mesonbuild.envconfig.BinaryTable.evarMap['{}_ld'.format(lang)] - with mock.patch.dict(os.environ, {envvar: name}): - env = get_fake_env() - comp = getattr(env, 'detect_{}_compiler'.format(lang))(MachineChoice.HOST) - if lang != 'rust' and comp.use_linker_args('foo') == []: - raise unittest.SkipTest( - 'Compiler {} does not support using alternative linkers'.format(comp.id)) - self.assertEqual(comp.linker.id, expected) - - def test_ld_environment_variable_bfd(self): - self._check_ld('ld.bfd', 'bfd', 'c', 'ld.bfd') - - def test_ld_environment_variable_gold(self): - self._check_ld('ld.gold', 'gold', 'c', 'ld.gold') - - def test_ld_environment_variable_lld(self): - self._check_ld('ld.lld', 'lld', 'c', 'ld.lld') - - @skipIfNoExecutable('rustc') - def test_ld_environment_variable_rust(self): - self._check_ld('ld.gold', 'gold', 'rust', 'ld.gold') - - def test_ld_environment_variable_cpp(self): - self._check_ld('ld.gold', 'gold', 'cpp', 'ld.gold') - - def test_ld_environment_variable_objc(self): - self._check_ld('ld.gold', 'gold', 'objc', 'ld.gold') - - def test_ld_environment_variable_objcpp(self): - self._check_ld('ld.gold', 'gold', 'objcpp', 'ld.gold') - - @skipIfNoExecutable('gfortran') - def test_ld_environment_variable_fortran(self): - self._check_ld('ld.gold', 'gold', 'fortran', 'ld.gold') - - def compute_sha256(self, filename): - with open(filename, 'rb') as f: - return hashlib.sha256(f.read()).hexdigest() - - def test_wrap_with_file_url(self): - testdir = os.path.join(self.unit_test_dir, '73 wrap file url') - source_filename = os.path.join(testdir, 'subprojects', 'foo.tar.xz') - patch_filename = os.path.join(testdir, 'subprojects', 'foo-patch.tar.xz') - wrap_filename = os.path.join(testdir, 'subprojects', 'foo.wrap') - source_hash = self.compute_sha256(source_filename) - patch_hash = self.compute_sha256(patch_filename) - wrap = textwrap.dedent("""\ - [wrap-file] - directory = foo - - source_url = file://{} - source_filename = foo.tar.xz - source_hash = {} - - patch_url = file://{} - patch_filename = foo-patch.tar.xz - patch_hash = {} - """.format(source_filename, source_hash, patch_filename, patch_hash)) - with open(wrap_filename, 'w') as f: - f.write(wrap) - self.init(testdir) - self.build() - self.run_tests() - - windows_proof_rmtree(os.path.join(testdir, 'subprojects', 'packagecache')) - windows_proof_rmtree(os.path.join(testdir, 'subprojects', 'foo')) - os.unlink(wrap_filename) - - def should_run_cross_arm_tests(): return shutil.which('arm-linux-gnueabihf-gcc') and not platform.machine().lower().startswith('arm') @@ -7216,8 +6859,7 @@ at_least: bool Clang is at least the specified version """ - if isinstance(compiler, (mesonbuild.compilers.AppleClangCCompiler, - mesonbuild.compilers.AppleClangCPPCompiler)): + if compiler.compiler_type == mesonbuild.compilers.CompilerType.CLANG_OSX: return version_compare(compiler.version, apple_minver) return version_compare(compiler.version, minver) @@ -7252,8 +6894,6 @@ import pytest # noqa: F401 # Need pytest-xdist for `-n` arg import xdist # noqa: F401 - if sys.version_info.major <= 3 and sys.version_info.minor <= 5: - raise ImportError('pytest with python <= 3.5 is causing issues on the CI') pytest_args = ['-n', 'auto', './run_unittests.py'] pytest_args += convert_args(sys.argv[1:]) return subprocess.run(python_command + ['-m', 'pytest'] + pytest_args).returncode @@ -7271,4 +6911,4 @@ return unittest.main(defaultTest=cases, buffer=True) if __name__ == '__main__': - raise SystemExit(main()) + sys.exit(main()) diff -Nru meson-0.53.2/setup.cfg meson-0.52.1/setup.cfg --- meson-0.53.2/setup.cfg 2020-02-25 16:02:10.000000000 +0000 +++ meson-0.52.1/setup.cfg 2019-11-29 13:51:14.000000000 +0000 @@ -31,13 +31,6 @@ [options] python_requires = >= 3.5.2 -[options.extras_require] -progress = - tqdm - -[tool:pytest] -python_classes = - [egg_info] tag_build = tag_date = 0 diff -Nru meson-0.53.2/setup.py meson-0.52.1/setup.py --- meson-0.53.2/setup.py 2020-02-25 18:00:47.000000000 +0000 +++ meson-0.52.1/setup.py 2019-11-28 17:37:44.000000000 +0000 @@ -35,11 +35,10 @@ 'mesonbuild.dependencies', 'mesonbuild.modules', 'mesonbuild.scripts', - 'mesonbuild.templates', 'mesonbuild.wrap'] package_data = { 'mesonbuild.dependencies': ['data/CMakeLists.txt', 'data/CMakeListsLLVM.txt', 'data/CMakePathInfo.txt'], - 'mesonbuild.cmake': ['data/run_ctgt.py', 'data/preload.cmake'], + 'mesonbuild.cmake': ['data/run_ctgt.py'], } data_files = [] if sys.platform != 'win32': @@ -50,6 +49,7 @@ if __name__ == '__main__': setup(name='meson', version=version, + extras_require={'progress': ['tqdm']}, packages=packages, package_data=package_data, entry_points=entries, diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/10 header only/main.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/10 header only/main.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/10 header only/main.cpp" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/10 header only/main.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -3,7 +3,7 @@ using namespace std; -int main(void) { +int main() { cmModClass obj("Hello"); cout << obj.getStr() << endl; return 0; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/12 generator expressions/main.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/12 generator expressions/main.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/12 generator expressions/main.cpp" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/12 generator expressions/main.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -3,7 +3,7 @@ using namespace std; -int main(void) { +int main() { cmModClass obj("Hello"); cout << obj.getStr() << endl; return 0; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/13 system includes/main.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/13 system includes/main.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/13 system includes/main.cpp" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/13 system includes/main.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -3,7 +3,7 @@ using namespace std; -int main(void) { +int main() { cmModClass obj("Hello"); cout << obj.getStr() << endl; return 0; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/13 system includes/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/13 system includes/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/13 system includes/meson.build" 2020-01-07 21:06:04.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/13 system includes/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -2,14 +2,10 @@ 'meson_cmake_system_include_bug', ['c', 'cpp'], default_options: [ 'warning_level=3', - 'werror=true', + #'werror=true', # TODO implement system includes ], ) -if meson.get_compiler('cpp').get_argument_syntax() == 'msvc' - error('MESON_SKIP_TEST: Skipp with msvc due to missing -system support') -endif - cm = import('cmake') sub_pro = cm.subproject('cmMod') sub_dep = sub_pro.dependency('cmModLib') diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/14 fortran threads/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/14 fortran threads/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/14 fortran threads/meson.build" 2020-01-07 21:06:01.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/14 fortran threads/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -project('FortranThreads') - -if not add_languages('fortran', required: false) - error('MESON_SKIP_TEST: Fortran language not available.') -endif - -# want to be sure that CMake can find dependencies where even if the -# project isn't C, the C language is required to find the library. -threads = dependency('threads', method: 'cmake', required: false) -if not threads.found() - error('MESON_SKIP_TEST: CMake backend not working for Fortran / threads') -endif diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/15 object library advanced/main.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/15 object library advanced/main.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/15 object library advanced/main.cpp" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/15 object library advanced/main.cpp" 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -#include -#include "libA.hpp" -#include "libB.hpp" - -using namespace std; - -int main(void) { - cout << getLibStr() << endl; - cout << getZlibVers() << endl; - return EXIT_SUCCESS; -} diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/15 object library advanced/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/15 object library advanced/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/15 object library advanced/meson.build" 2020-01-07 21:06:08.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/15 object library advanced/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -project('cmake_object_lib_test', 'cpp', default_options: ['cpp_std=c++11']) - -cm = import('cmake') - -sub_pro = cm.subproject('cmObjLib') -sub_sha = sub_pro.dependency('lib_sha') -sub_sta = sub_pro.dependency('lib_sta') - -exe_sha = executable('shared', ['main.cpp'], dependencies: [sub_sha]) -exe_sta = executable('static', ['main.cpp'], dependencies: [sub_sta]) - -test('test1', exe_sha) -test('test1', exe_sta) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/15 object library advanced/subprojects/cmObjLib/CMakeLists.txt" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/15 object library advanced/subprojects/cmObjLib/CMakeLists.txt" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/15 object library advanced/subprojects/cmObjLib/CMakeLists.txt" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/15 object library advanced/subprojects/cmObjLib/CMakeLists.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -cmake_minimum_required(VERSION 3.7) -project(cmObject CXX) - -add_executable(genC genC.cpp) - -add_custom_command( - OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libC.cpp" "${CMAKE_CURRENT_BINARY_DIR}/libC.hpp" - COMMAND genC - WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" -) - -include_directories("${CMAKE_CURRENT_BINARY_DIR}") - -add_library(lib_obj OBJECT libA.cpp libB.cpp "${CMAKE_CURRENT_BINARY_DIR}/libC.cpp" "${CMAKE_CURRENT_BINARY_DIR}/libC.hpp") -add_library(lib_sha SHARED $) -add_library(lib_sta STATIC $) - -target_compile_definitions(lib_obj PRIVATE "-DBUILD_AS_OBJ=1") diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/15 object library advanced/subprojects/cmObjLib/genC.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/15 object library advanced/subprojects/cmObjLib/genC.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/15 object library advanced/subprojects/cmObjLib/genC.cpp" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/15 object library advanced/subprojects/cmObjLib/genC.cpp" 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -#include -#include - -using namespace std; - -int main() { - ofstream hpp("libC.hpp"); - ofstream cpp("libC.cpp"); - if (!hpp.is_open() || !cpp.is_open()) { - cerr << "Failed to open 'libC.hpp' or 'libC.cpp' for writing" << endl; - return 1; - } - - hpp << R"cpp( -#pragma once - -#include - -std::string getGenStr(); -)cpp"; - - cpp << R"cpp( -#include "libC.hpp" - -std::string getGenStr(void) { - return "GEN STR"; -} -)cpp"; - - return 0; -} \ No newline at end of file diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/15 object library advanced/subprojects/cmObjLib/libA.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/15 object library advanced/subprojects/cmObjLib/libA.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/15 object library advanced/subprojects/cmObjLib/libA.cpp" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/15 object library advanced/subprojects/cmObjLib/libA.cpp" 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -#include "libA.hpp" - -#if not BUILD_AS_OBJ -#error "BUILD_AS_OBJ was not defined" -#endif - -std::string getLibStr(void) { - return "Hello World"; -} diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/15 object library advanced/subprojects/cmObjLib/libA.hpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/15 object library advanced/subprojects/cmObjLib/libA.hpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/15 object library advanced/subprojects/cmObjLib/libA.hpp" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/15 object library advanced/subprojects/cmObjLib/libA.hpp" 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -#pragma once - -#include - -#if defined _WIN32 || defined __CYGWIN__ - #define DLL_PUBLIC __declspec(dllexport) -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif - -std::string DLL_PUBLIC getLibStr(); diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/15 object library advanced/subprojects/cmObjLib/libB.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/15 object library advanced/subprojects/cmObjLib/libB.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/15 object library advanced/subprojects/cmObjLib/libB.cpp" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/15 object library advanced/subprojects/cmObjLib/libB.cpp" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#include "libB.hpp" -#include "libC.hpp" - -std::string getZlibVers(void) { - return getGenStr(); -} diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/15 object library advanced/subprojects/cmObjLib/libB.hpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/15 object library advanced/subprojects/cmObjLib/libB.hpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/15 object library advanced/subprojects/cmObjLib/libB.hpp" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/15 object library advanced/subprojects/cmObjLib/libB.hpp" 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -#pragma once - -#include - -#if defined _WIN32 || defined __CYGWIN__ - #define DLL_PUBLIC __declspec(dllexport) -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif - -std::string DLL_PUBLIC getZlibVers(); diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/16 threads/main.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/16 threads/main.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/16 threads/main.cpp" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/16 threads/main.cpp" 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -#include "cmMod.hpp" - -#include - -int main() { - CmMod cc; - cc.asyncIncrement(); - return cc.getNum() == 1 ? EXIT_SUCCESS : EXIT_FAILURE; -} diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/16 threads/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/16 threads/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/16 threads/meson.build" 2020-02-25 18:00:47.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/16 threads/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -project('cmMod', ['c', 'cpp']) - -cm = import('cmake') -cmOpts = ['-DUSE_PTHREAD=@0@'.format(get_option('use_pthread'))] -cmMod = cm.subproject('cmMod', cmake_options: cmOpts) -cmModDep1 = cmMod.dependency('cmModLib') -cmModDep2 = cmMod.dependency('cmModLib_shared') - -exe1 = executable('exe1', ['main.cpp'], dependencies: [cmModDep1]) -exe2 = executable('exe2', ['main.cpp'], dependencies: [cmModDep2]) -test('exe1_OK', exe1) -test('exe2_OK', exe2) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/16 threads/meson_options.txt" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/16 threads/meson_options.txt" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/16 threads/meson_options.txt" 2020-02-25 18:00:47.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/16 threads/meson_options.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -option('use_pthread', type: 'combo', choices: ['ON', 'OFF', 'NOT_SET'], value: 'ON') diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/16 threads/subprojects/cmMod/CMakeLists.txt" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/16 threads/subprojects/cmMod/CMakeLists.txt" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/16 threads/subprojects/cmMod/CMakeLists.txt" 2020-02-25 18:00:47.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/16 threads/subprojects/cmMod/CMakeLists.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -cmake_minimum_required(VERSION 3.5) - -project(cmMod CXX) -set (CMAKE_CXX_STANDARD 14) - -if(NOT USE_PTHREAD STREQUAL NOT_SET) - set(THREADS_PREFER_PTHREAD_FLAG ${USE_PTHREAD}) -endif() -find_package(Threads) - -add_library(cmModLib STATIC cmMod.cpp) -target_link_libraries(cmModLib PRIVATE Threads::Threads) - -add_library(cmModLib_shared SHARED cmMod.cpp) -target_link_libraries(cmModLib_shared PUBLIC Threads::Threads) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/16 threads/subprojects/cmMod/cmMod.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/16 threads/subprojects/cmMod/cmMod.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/16 threads/subprojects/cmMod/cmMod.cpp" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/16 threads/subprojects/cmMod/cmMod.cpp" 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -#include "cmMod.hpp" - -#include -#include - -using namespace std::chrono_literals; - -void CmMod::asyncIncrement() { - std::thread t1([this]() { - std::this_thread::sleep_for(100ms); - num += 1; - }); - - t1.join(); -} diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/16 threads/subprojects/cmMod/cmMod.hpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/16 threads/subprojects/cmMod/cmMod.hpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/16 threads/subprojects/cmMod/cmMod.hpp" 2020-02-25 18:00:47.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/16 threads/subprojects/cmMod/cmMod.hpp" 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -#pragma once - -#if defined _WIN32 || defined __CYGWIN__ -#define DLL_PUBLIC __declspec(dllexport) -#else -#if defined __GNUC__ -#define DLL_PUBLIC __attribute__((visibility("default"))) -#else -#pragma message("Compiler does not support symbol visibility.") -#define DLL_PUBLIC -#endif -#endif - -class DLL_PUBLIC CmMod { -private: - int num = 0; - -public: - inline int getNum() const { return num; } - void asyncIncrement(); -}; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/16 threads/subprojects/cmMod/main.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/16 threads/subprojects/cmMod/main.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/16 threads/subprojects/cmMod/main.cpp" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/16 threads/subprojects/cmMod/main.cpp" 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -#include "cmMod.hpp" - -#include - -int main() { - CmMod cc; - cc.asyncIncrement(); - return cc.getNum() == 1 ? EXIT_SUCCESS : EXIT_FAILURE; -} diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/16 threads/test_matrix.json" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/16 threads/test_matrix.json" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/16 threads/test_matrix.json" 2020-02-25 18:00:47.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/16 threads/test_matrix.json" 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -{ - "options": { - "use_pthread": [ - { "val": "ON" }, - { "val": "OFF" }, - { "val": "NOT_SET" } - ] - } -} diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/1 basic/main.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/1 basic/main.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/1 basic/main.cpp" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/1 basic/main.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -3,7 +3,7 @@ using namespace std; -int main(void) { +int main() { cmModClass obj("Hello"); cout << obj.getStr() << endl; return 0; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/1 basic/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/1 basic/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/1 basic/meson.build" 2020-02-25 18:00:47.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/1 basic/meson.build" 2019-08-16 20:33:41.000000000 +0000 @@ -3,11 +3,10 @@ cm = import('cmake') sub_pro = cm.subproject('cmMod') -sub_dep = sub_pro.dependency('cmModLib++') +sub_dep = sub_pro.dependency('cmModLib') -assert(sub_pro.found(), 'found() method reports not found, but should be found') -assert(sub_pro.target_list() == ['cmModLib++'], 'There should be exactly one target') -assert(sub_pro.target_type('cmModLib++') == 'shared_library', 'Target type should be shared_library') +assert(sub_pro.target_list() == ['cmModLib'], 'There should be exactly one target') +assert(sub_pro.target_type('cmModLib') == 'shared_library', 'Target type should be shared_library') exe1 = executable('main', ['main.cpp'], dependencies: [sub_dep]) test('test1', exe1) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/1 basic/subprojects/cmMod/CMakeLists.txt" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/1 basic/subprojects/cmMod/CMakeLists.txt" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/1 basic/subprojects/cmMod/CMakeLists.txt" 2020-02-25 18:00:47.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/1 basic/subprojects/cmMod/CMakeLists.txt" 2019-08-28 17:15:39.000000000 +0000 @@ -7,6 +7,6 @@ add_definitions("-DDO_NOTHING_JUST_A_FLAG=1") -add_library(cmModLib++ SHARED cmMod.cpp) +add_library(cmModLib SHARED cmMod.cpp) include(GenerateExportHeader) -generate_export_header(cmModLib++) +generate_export_header(cmModLib) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/1 basic/subprojects/cmMod/cmMod.hpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/1 basic/subprojects/cmMod/cmMod.hpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/1 basic/subprojects/cmMod/cmMod.hpp" 2020-02-25 18:00:47.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/1 basic/subprojects/cmMod/cmMod.hpp" 2019-06-16 18:54:18.000000000 +0000 @@ -1,14 +1,13 @@ #pragma once -#include "cmmodlib++_export.h" #include +#include "cmmodlib_export.h" -class CMMODLIB___EXPORT cmModClass { -private: - std::string str; +class CMMODLIB_EXPORT cmModClass { + private: + std::string str; + public: + cmModClass(std::string foo); -public: - cmModClass(std::string foo); - - std::string getStr() const; + std::string getStr() const; }; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/2 advanced/installed_files.txt" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/2 advanced/installed_files.txt" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/2 advanced/installed_files.txt" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/2 advanced/installed_files.txt" 2019-11-28 17:37:44.000000000 +0000 @@ -1,4 +1,4 @@ -usr/?lib/libcm_cmModLib?so -?cygwin:usr/lib/libcm_cmModLib?implib -?!cygwin:usr/bin/libcm_cmModLib?implib -usr/bin/cm_testEXE?exe +usr/?lib/libcmModLib?so +?cygwin:usr/lib/libcmModLib?implib +?!cygwin:usr/bin/libcmModLib?implib +usr/bin/testEXE?exe \ No newline at end of file diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/2 advanced/main.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/2 advanced/main.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/2 advanced/main.cpp" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/2 advanced/main.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -8,7 +8,7 @@ using namespace std; -int main(void) { +int main() { cmModClass obj("Hello"); cout << obj.getStr() << endl; return 0; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/2 advanced/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/2 advanced/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/2 advanced/meson.build" 2020-01-07 21:05:21.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/2 advanced/meson.build" 2019-08-16 20:33:41.000000000 +0000 @@ -10,14 +10,11 @@ # Test the "normal" subproject call sub_pro = cm.subproject('cmMod') sub_dep = sub_pro.dependency('cmModLib') -sub_sta = sub_pro.dependency('cmModLibStatic') # Build some files exe1 = executable('main1', ['main.cpp'], dependencies: [sub_dep]) -exe2 = executable('main2', ['main.cpp'], dependencies: [sub_sta]) test('test1', exe1) -test('test2', exe2) # Test if we can also extract executables assert(sub_pro.target_type('testEXE') == 'executable', 'The type must be executable for obvious reasons') -test('test3', sub_pro.target('testEXE')) +test('test2', sub_pro.target('testEXE')) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/2 advanced/subprojects/cmMod/CMakeLists.txt" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/2 advanced/subprojects/cmMod/CMakeLists.txt" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/2 advanced/subprojects/cmMod/CMakeLists.txt" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/2 advanced/subprojects/cmMod/CMakeLists.txt" 2019-10-06 17:01:35.000000000 +0000 @@ -10,8 +10,7 @@ set(CONFIG_OPT 42) configure_file("config.h.in" "${CMAKE_CURRENT_BINARY_DIR}/config.h" @ONLY) -add_library(cmModLib SHARED lib/cmMod.cpp) -add_library(cmModLibStatic STATIC lib/cmMod.cpp) +add_library(cmModLib SHARED lib/cmMod.cpp) include(GenerateExportHeader) generate_export_header(cmModLib) @@ -19,10 +18,7 @@ add_executable(testEXE main.cpp) -target_link_libraries(cmModLib ZLIB::ZLIB) -target_link_libraries(cmModLibStatic ZLIB::ZLIB) +target_link_libraries(cmModLib ZLIB::ZLIB) target_link_libraries(testEXE cmModLib) -target_compile_definitions(cmModLibStatic PUBLIC CMMODLIB_STATIC_DEFINE) - install(TARGETS cmModLib testEXE LIBRARY DESTINATION lib RUNTIME DESTINATION bin) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/2 advanced/subprojects/cmMod/main.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/2 advanced/subprojects/cmMod/main.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/2 advanced/subprojects/cmMod/main.cpp" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/2 advanced/subprojects/cmMod/main.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -4,7 +4,7 @@ using namespace std; -int main(void) { +int main() { cmModClass obj("Hello (LIB TEST)"); cout << obj.getStr() << " ZLIB: " << zlibVersion() << endl; return 0; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/3 advanced no dep/installed_files.txt" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/3 advanced no dep/installed_files.txt" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/3 advanced no dep/installed_files.txt" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/3 advanced no dep/installed_files.txt" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ -usr/?lib/libcm_cmModLib?so -?cygwin:usr/lib/libcm_cmModLib?implib -?!cygwin:usr/bin/libcm_cmModLib?implib -?msvc:usr/bin/cm_cmModLib.pdb -?msvc:usr/bin/cm_testEXE.pdb -usr/bin/cm_testEXE?exe \ No newline at end of file +usr/?lib/libcmModLib?so +?cygwin:usr/lib/libcmModLib?implib +?!cygwin:usr/bin/libcmModLib?implib +?msvc:usr/bin/cmModLib.pdb +?msvc:usr/bin/testEXE.pdb +usr/bin/testEXE?exe \ No newline at end of file diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/3 advanced no dep/main.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/3 advanced no dep/main.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/3 advanced no dep/main.cpp" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/3 advanced no dep/main.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -8,7 +8,7 @@ using namespace std; -int main(void) { +int main() { cmModClass obj("Hello"); cout << obj.getStr() << endl; return 0; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/3 advanced no dep/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/3 advanced no dep/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/3 advanced no dep/meson.build" 2020-01-07 21:05:20.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/3 advanced no dep/meson.build" 2019-08-16 20:33:41.000000000 +0000 @@ -5,14 +5,11 @@ # Test the "normal" subproject call sub_pro = cm.subproject('cmMod') sub_dep = sub_pro.dependency('cmModLib') -sub_sta = sub_pro.dependency('cmModLibStatic') # Build some files exe1 = executable('main1', ['main.cpp'], dependencies: [sub_dep]) -exe2 = executable('main2', ['main.cpp'], dependencies: [sub_sta]) test('test1', exe1) -test('test2', exe2) # Test if we can also extract executables assert(sub_pro.target_type('testEXE') == 'executable', 'The type must be executable for obvious reasons') -test('test3', sub_pro.target('testEXE')) +test('test2', sub_pro.target('testEXE')) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/3 advanced no dep/subprojects/cmMod/CMakeLists.txt" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/3 advanced no dep/subprojects/cmMod/CMakeLists.txt" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/3 advanced no dep/subprojects/cmMod/CMakeLists.txt" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/3 advanced no dep/subprojects/cmMod/CMakeLists.txt" 2019-10-06 17:01:35.000000000 +0000 @@ -8,8 +8,7 @@ set(CONFIG_OPT 42) configure_file("config.h.in" "${CMAKE_CURRENT_BINARY_DIR}/config.h" @ONLY) -add_library(cmModLib SHARED lib/cmMod.cpp) -add_library(cmModLibStatic STATIC lib/cmMod.cpp) +add_library(cmModLib SHARED lib/cmMod.cpp) include(GenerateExportHeader) generate_export_header(cmModLib) @@ -19,6 +18,4 @@ target_link_libraries(testEXE cmModLib) -target_compile_definitions(cmModLibStatic PUBLIC CMMODLIB_STATIC_DEFINE) - install(TARGETS cmModLib testEXE LIBRARY DESTINATION lib RUNTIME DESTINATION bin) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/3 advanced no dep/subprojects/cmMod/main.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/3 advanced no dep/subprojects/cmMod/main.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/3 advanced no dep/subprojects/cmMod/main.cpp" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/3 advanced no dep/subprojects/cmMod/main.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -3,7 +3,7 @@ using namespace std; -int main(void) { +int main() { cmModClass obj("Hello (LIB TEST)"); cout << obj.getStr() << endl; return 0; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/4 code gen/main.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/4 code gen/main.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/4 code gen/main.cpp" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/4 code gen/main.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -3,6 +3,6 @@ using namespace std; -int main(void) { +int main() { cout << getStr() << endl; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/5 object library/main.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/5 object library/main.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/5 object library/main.cpp" 2020-01-23 21:41:11.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/5 object library/main.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -1,11 +1,9 @@ -#include #include #include "libA.hpp" #include "libB.hpp" using namespace std; -int main(void) { +int main() { cout << getLibStr() << " -- " << getZlibVers() << endl; - return EXIT_SUCCESS; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/5 object library/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/5 object library/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/5 object library/meson.build" 2020-01-07 21:05:30.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/5 object library/meson.build" 2019-08-16 20:33:58.000000000 +0000 @@ -5,6 +5,10 @@ error('MESON_SKIP_TEST: zlib is not installed') endif +if build_machine.system() == 'windows' + error('MESON_SKIP_TEST: Windows is not supported because of symbol export problems') +endif + cm = import('cmake') sub_pro = cm.subproject('cmObjLib') diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/5 object library/subprojects/cmObjLib/CMakeLists.txt" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/5 object library/subprojects/cmObjLib/CMakeLists.txt" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/5 object library/subprojects/cmObjLib/CMakeLists.txt" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/5 object library/subprojects/cmObjLib/CMakeLists.txt" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,4 @@ cmake_minimum_required(VERSION 3.7) -project(cmObject CXX) find_package(ZLIB REQUIRED) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/5 object library/subprojects/cmObjLib/libA.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/5 object library/subprojects/cmObjLib/libA.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/5 object library/subprojects/cmObjLib/libA.cpp" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/5 object library/subprojects/cmObjLib/libA.cpp" 2019-06-16 18:54:18.000000000 +0000 @@ -1,5 +1,5 @@ #include "libA.hpp" -std::string getLibStr(void) { +std::string getLibStr() { return "Hello World"; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/5 object library/subprojects/cmObjLib/libA.hpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/5 object library/subprojects/cmObjLib/libA.hpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/5 object library/subprojects/cmObjLib/libA.hpp" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/5 object library/subprojects/cmObjLib/libA.hpp" 2019-06-16 18:54:18.000000000 +0000 @@ -2,15 +2,4 @@ #include -#if defined _WIN32 || defined __CYGWIN__ - #define DLL_PUBLIC __declspec(dllexport) -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif - -std::string DLL_PUBLIC getLibStr(); +std::string getLibStr(); diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/5 object library/subprojects/cmObjLib/libB.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/5 object library/subprojects/cmObjLib/libB.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/5 object library/subprojects/cmObjLib/libB.cpp" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/5 object library/subprojects/cmObjLib/libB.cpp" 2019-06-16 18:54:18.000000000 +0000 @@ -1,6 +1,6 @@ #include "libB.hpp" #include -std::string getZlibVers(void) { +std::string getZlibVers() { return zlibVersion(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/5 object library/subprojects/cmObjLib/libB.hpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/5 object library/subprojects/cmObjLib/libB.hpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/5 object library/subprojects/cmObjLib/libB.hpp" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/5 object library/subprojects/cmObjLib/libB.hpp" 2019-06-16 18:54:18.000000000 +0000 @@ -2,15 +2,4 @@ #include -#if defined _WIN32 || defined __CYGWIN__ - #define DLL_PUBLIC __declspec(dllexport) -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif - -std::string DLL_PUBLIC getZlibVers(); +std::string getZlibVers(); diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/6 object library no dep/main.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/6 object library no dep/main.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/6 object library no dep/main.cpp" 2020-01-23 21:41:11.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/6 object library no dep/main.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -1,11 +1,9 @@ -#include #include #include "libA.hpp" #include "libB.hpp" using namespace std; -int main(void) { +int main() { cout << getLibStr() << " -- " << getZlibVers() << endl; - return EXIT_SUCCESS; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/6 object library no dep/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/6 object library no dep/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/6 object library no dep/meson.build" 2020-01-07 21:05:31.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/6 object library no dep/meson.build" 2019-08-16 20:33:58.000000000 +0000 @@ -1,4 +1,8 @@ -project('cmake_object_lib_test', 'cpp') +project('cmake_object_lib_test', ['c', 'cpp']) + +if build_machine.system() == 'windows' + error('MESON_SKIP_TEST: Windows is not supported because of symbol export problems') +endif cm = import('cmake') diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/6 object library no dep/subprojects/cmObjLib/CMakeLists.txt" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/6 object library no dep/subprojects/cmObjLib/CMakeLists.txt" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/6 object library no dep/subprojects/cmObjLib/CMakeLists.txt" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/6 object library no dep/subprojects/cmObjLib/CMakeLists.txt" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,4 @@ cmake_minimum_required(VERSION 3.7) -project(cmObject CXX) add_library(lib_obj OBJECT libA.cpp libB.cpp) add_library(lib_sha SHARED $) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/6 object library no dep/subprojects/cmObjLib/libA.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/6 object library no dep/subprojects/cmObjLib/libA.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/6 object library no dep/subprojects/cmObjLib/libA.cpp" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/6 object library no dep/subprojects/cmObjLib/libA.cpp" 2019-06-16 18:54:18.000000000 +0000 @@ -1,5 +1,5 @@ #include "libA.hpp" -std::string getLibStr(void) { +std::string getLibStr() { return "Hello World"; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/6 object library no dep/subprojects/cmObjLib/libA.hpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/6 object library no dep/subprojects/cmObjLib/libA.hpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/6 object library no dep/subprojects/cmObjLib/libA.hpp" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/6 object library no dep/subprojects/cmObjLib/libA.hpp" 2019-06-16 18:54:18.000000000 +0000 @@ -2,15 +2,4 @@ #include -#if defined _WIN32 || defined __CYGWIN__ - #define DLL_PUBLIC __declspec(dllexport) -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif - -std::string DLL_PUBLIC getLibStr(); +std::string getLibStr(); diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/6 object library no dep/subprojects/cmObjLib/libB.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/6 object library no dep/subprojects/cmObjLib/libB.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/6 object library no dep/subprojects/cmObjLib/libB.cpp" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/6 object library no dep/subprojects/cmObjLib/libB.cpp" 2019-06-16 18:54:18.000000000 +0000 @@ -1,5 +1,5 @@ #include "libB.hpp" -std::string getZlibVers(void) { +std::string getZlibVers() { return "STUB"; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/6 object library no dep/subprojects/cmObjLib/libB.hpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/6 object library no dep/subprojects/cmObjLib/libB.hpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/6 object library no dep/subprojects/cmObjLib/libB.hpp" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/6 object library no dep/subprojects/cmObjLib/libB.hpp" 2019-06-16 18:54:18.000000000 +0000 @@ -2,15 +2,4 @@ #include -#if defined _WIN32 || defined __CYGWIN__ - #define DLL_PUBLIC __declspec(dllexport) -#else - #if defined __GNUC__ - #define DLL_PUBLIC __attribute__ ((visibility("default"))) - #else - #pragma message ("Compiler does not support symbol visibility.") - #define DLL_PUBLIC - #endif -#endif - -std::string DLL_PUBLIC getZlibVers(); +std::string getZlibVers(); diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/8 custom command/main.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/8 custom command/main.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/8 custom command/main.cpp" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/8 custom command/main.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -3,7 +3,7 @@ using namespace std; -int main(void) { +int main() { cmModClass obj("Hello"); cout << obj.getStr() << endl; cout << obj.getOther() << endl; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/8 custom command/subprojects/cmMod/args_test.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/8 custom command/subprojects/cmMod/args_test.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/8 custom command/subprojects/cmMod/args_test.cpp" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/8 custom command/subprojects/cmMod/args_test.cpp" 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -#include -#include - -using namespace std; - -int main(int argc, const char *argv[]) { - if(argc != 3 || string(argv[1]) != "arg1" || string(argv[2]) != "arg2") { - cerr << argv[0] << " requires 2 args" << endl; - return 1; - } - - ifstream in1("macro_name.txt"); - ofstream out1("cmModLib.hpp"); - out1 << "#define " << in1.rdbuf() << " = \"plop\""; - - - return 0; -} diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/8 custom command/subprojects/cmMod/CMakeLists.txt" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/8 custom command/subprojects/cmMod/CMakeLists.txt" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/8 custom command/subprojects/cmMod/CMakeLists.txt" 2020-02-25 18:00:47.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/8 custom command/subprojects/cmMod/CMakeLists.txt" 2019-11-28 17:37:44.000000000 +0000 @@ -2,7 +2,6 @@ project(cmMod) set (CMAKE_CXX_STANDARD 14) -set (CMAKE_CXX_STANDARD_REQUIRED ON) include_directories(${CMAKE_CURRENT_BINARY_DIR}) add_definitions("-DDO_NOTHING_JUST_A_FLAG=1") @@ -10,7 +9,6 @@ add_executable(gen main.cpp) add_executable(mycpy cp.cpp) -# cpyBase add_custom_command( OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/genTest.cpp" "${CMAKE_CURRENT_BINARY_DIR}/genTest.hpp" COMMAND gen ARGS genTest @@ -22,7 +20,7 @@ COMMAND mycpy cpyBase.cpp.in cpyBase.cpp.something COMMAND mycpy cpyBase.cpp.something cpyBase.cpp.IAmRunningOutOfIdeas COMMAND mycpy cpyBase.cpp.IAmRunningOutOfIdeas cpyBase.cpp - DEPENDS cpyBase.cpp.am;gen + DEPENDS cpyBase.cpp.am gen ) add_custom_command( @@ -43,87 +41,6 @@ DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/cpyBase.hpp.something" ) -# cpyNext (out of order is on purpose) -# -- first copy round -add_custom_command( - OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/s1_a_hpp/file.txt" - COMMAND mycpy "${CMAKE_CURRENT_SOURCE_DIR}/cpyNext.hpp.am" file.txt - DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/cpyNext.hpp.am" - WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/s1_a_hpp" -) - -add_custom_command( - OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/s1_b_cpp/file.txt" - COMMAND mycpy "${CMAKE_CURRENT_SOURCE_DIR}/cpyNext.cpp.am" file.txt - DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/cpyNext.cpp.am" - WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/s1_b_cpp" -) - -# -- final cpy round -add_custom_command( - OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/cpyNext.hpp" - COMMAND mycpy "${CMAKE_CURRENT_BINARY_DIR}/s2_b_hpp/file.txt" cpyNext.hpp - DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/s2_b_hpp/file.txt" - WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" -) - -add_custom_command( - OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/cpyNext.cpp" - COMMAND mycpy "${CMAKE_CURRENT_BINARY_DIR}/s2_a_cpp/file.txt" cpyNext.cpp - DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/s2_a_cpp/file.txt" - WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" -) - -# -- second copy round -add_custom_command( - OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/s2_b_hpp/file.txt" - COMMAND mycpy "${CMAKE_CURRENT_BINARY_DIR}/s1_a_hpp/file.txt" file.txt - DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/s1_a_hpp/file.txt" - WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/s2_b_hpp" -) - -add_custom_command( - OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/s2_a_cpp/file.txt" - COMMAND mycpy "${CMAKE_CURRENT_BINARY_DIR}/s1_b_cpp/file.txt" file.txt - DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/s1_b_cpp/file.txt" - WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/s2_a_cpp" -) - -# cpyTest (copy file without renaming) -add_custom_command( - OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/cpyTest.hpp" - COMMAND mycpy "${CMAKE_CURRENT_SOURCE_DIR}/cpyTest/cpyTest.hpp" "${CMAKE_CURRENT_BINARY_DIR}/cpyTest.hpp" - DEPENDS "cpyTest/cpyTest.hpp" -) - -add_custom_command( - OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/cpyTest2.hpp" - COMMAND mycpy "${CMAKE_CURRENT_SOURCE_DIR}/cpyTest/cpyTest2.hpp" "${CMAKE_CURRENT_BINARY_DIR}/cpyTest2.hpp" - DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/cpyTest/cpyTest2.hpp" -) - -add_custom_command( - OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/cpyTest3.hpp" - COMMAND mycpy cpyTest3.hpp "${CMAKE_CURRENT_BINARY_DIR}/cpyTest3.hpp" - DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/cpyTest/cpyTest3.hpp" - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/cpyTest" -) - -add_subdirectory(cpyTest ccppyyTTeesstt) - -add_library(cmModLib SHARED cmMod.cpp genTest.cpp cpyBase.cpp cpyBase.hpp cpyNext.cpp cpyNext.hpp cpyTest.cpp cpyTest.hpp cpyTest2.hpp cpyTest3.hpp) +add_library(cmModLib SHARED cmMod.cpp genTest.cpp cpyBase.cpp cpyBase.hpp) include(GenerateExportHeader) generate_export_header(cmModLib) - -set(ARGS_TEST arg1) -set(ARGS_TEST ${ARGS_TEST} arg2) - -add_executable(macro_name macro_name.cpp) -add_executable(args_test args_test.cpp) -add_custom_target(args_test_cmd - COMMAND args_test ${ARGS_TEST} -) -add_custom_target(macro_name_cmd COMMAND macro_name) - -add_dependencies(cmModLib args_test_cmd tgtCpyTest4) -add_dependencies(args_test_cmd macro_name_cmd;gen;mycpy) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/8 custom command/subprojects/cmMod/cmMod.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/8 custom command/subprojects/cmMod/cmMod.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/8 custom command/subprojects/cmMod/cmMod.cpp" 2020-02-25 18:00:47.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/8 custom command/subprojects/cmMod/cmMod.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -1,13 +1,6 @@ #include "cmMod.hpp" #include "genTest.hpp" #include "cpyBase.hpp" -#include "cpyNext.hpp" -#include "cpyTest.hpp" -#include "cmModLib.hpp" - -#ifndef FOO -#error FOO not declared -#endif using namespace std; @@ -20,5 +13,5 @@ } string cmModClass::getOther() const { - return "Srings:\n - " + getStrCpy() + "\n - " + getStrNext() + "\n - " + getStrCpyTest(); + return getStr() + " -- " + getStrCpy(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/8 custom command/subprojects/cmMod/cp.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/8 custom command/subprojects/cmMod/cp.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/8 custom command/subprojects/cmMod/cp.cpp" 2019-12-04 18:45:59.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/8 custom command/subprojects/cmMod/cp.cpp" 2019-08-28 17:15:39.000000000 +0000 @@ -12,11 +12,6 @@ ifstream src(argv[1]); ofstream dst(argv[2]); - if(!src.is_open()) { - cerr << "Failed to open " << argv[1] << endl; - return 2; - } - dst << src.rdbuf(); return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/8 custom command/subprojects/cmMod/cpyNext.cpp.am" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/8 custom command/subprojects/cmMod/cpyNext.cpp.am" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/8 custom command/subprojects/cmMod/cpyNext.cpp.am" 2019-12-04 18:45:59.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/8 custom command/subprojects/cmMod/cpyNext.cpp.am" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#include "cpyNext.hpp" - -std::string getStrNext() { - return "Hello Copied File -- now even more convoluted!"; -} diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/8 custom command/subprojects/cmMod/cpyNext.hpp.am" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/8 custom command/subprojects/cmMod/cpyNext.hpp.am" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/8 custom command/subprojects/cmMod/cpyNext.hpp.am" 2019-12-04 18:45:59.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/8 custom command/subprojects/cmMod/cpyNext.hpp.am" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#pragma once - -#include - -std::string getStrNext(); diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/8 custom command/subprojects/cmMod/cpyTest/CMakeLists.txt" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/8 custom command/subprojects/cmMod/cpyTest/CMakeLists.txt" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/8 custom command/subprojects/cmMod/cpyTest/CMakeLists.txt" 2020-02-25 18:00:47.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/8 custom command/subprojects/cmMod/cpyTest/CMakeLists.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -add_custom_command( - OUTPUT cpyTest4.hpp - COMMAND mycpy "${CMAKE_CURRENT_SOURCE_DIR}/cpyTest4.hpp" cpyTest4.hpp - DEPENDS cpyTest4.hpp -) - -add_custom_target(tgtCpyTest4 DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/cpyTest4.hpp") diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/8 custom command/subprojects/cmMod/cpyTest/cpyTest2.hpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/8 custom command/subprojects/cmMod/cpyTest/cpyTest2.hpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/8 custom command/subprojects/cmMod/cpyTest/cpyTest2.hpp" 2020-02-25 18:00:47.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/8 custom command/subprojects/cmMod/cpyTest/cpyTest2.hpp" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -#pragma once - -#define CPY_TEST_STR_2 "Hello " diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/8 custom command/subprojects/cmMod/cpyTest/cpyTest3.hpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/8 custom command/subprojects/cmMod/cpyTest/cpyTest3.hpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/8 custom command/subprojects/cmMod/cpyTest/cpyTest3.hpp" 2020-02-25 18:00:47.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/8 custom command/subprojects/cmMod/cpyTest/cpyTest3.hpp" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -#pragma once - -#define CPY_TEST_STR_3 "CopyFile" diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/8 custom command/subprojects/cmMod/cpyTest/cpyTest4.hpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/8 custom command/subprojects/cmMod/cpyTest/cpyTest4.hpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/8 custom command/subprojects/cmMod/cpyTest/cpyTest4.hpp" 2020-02-25 18:00:47.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/8 custom command/subprojects/cmMod/cpyTest/cpyTest4.hpp" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -#pragma once - -#define CPY_TEST_STR_4 " test" diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/8 custom command/subprojects/cmMod/cpyTest/cpyTest.hpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/8 custom command/subprojects/cmMod/cpyTest/cpyTest.hpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/8 custom command/subprojects/cmMod/cpyTest/cpyTest.hpp" 2020-02-25 18:00:47.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/8 custom command/subprojects/cmMod/cpyTest/cpyTest.hpp" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#pragma once - -#include - -std::string getStrCpyTest(); diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/8 custom command/subprojects/cmMod/cpyTest.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/8 custom command/subprojects/cmMod/cpyTest.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/8 custom command/subprojects/cmMod/cpyTest.cpp" 2020-02-25 18:00:47.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/8 custom command/subprojects/cmMod/cpyTest.cpp" 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -#include "cpyTest.hpp" -#include "cpyTest2.hpp" -#include "cpyTest3.hpp" -#include "ccppyyTTeesstt/cpyTest4.hpp" - -std::string getStrCpyTest() { - return CPY_TEST_STR_2 CPY_TEST_STR_3 CPY_TEST_STR_4; -} diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/8 custom command/subprojects/cmMod/macro_name.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/8 custom command/subprojects/cmMod/macro_name.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/8 custom command/subprojects/cmMod/macro_name.cpp" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/8 custom command/subprojects/cmMod/macro_name.cpp" 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -#include -#include -#include -#include - -using namespace std; - -int main() { - this_thread::sleep_for(chrono::seconds(1)); - ofstream out1("macro_name.txt"); - out1 << "FOO"; - - return 0; -} diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/9 disabled subproject/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/9 disabled subproject/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cmake/9 disabled subproject/meson.build" 2020-02-25 18:00:47.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cmake/9 disabled subproject/meson.build" 2019-08-25 19:17:02.000000000 +0000 @@ -2,5 +2,4 @@ cm = import('cmake') -sub_pro = cm.subproject('nothinig', required: false) -assert(not sub_pro.found(), 'subproject found() reports wrong value') +sub_pro = cm.subproject('nothinig', required: false) \ No newline at end of file diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/100 stringdef/stringdef.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/100 stringdef/stringdef.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/100 stringdef/stringdef.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/100 stringdef/stringdef.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,7 +1,7 @@ #include #include -int main(void) { +int main(int argc, char **argv) { if(strcmp(FOO, "bar")) { printf("FOO is misquoted: %s\n", FOO); return 1; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/102 subproject subdir/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/102 subproject subdir/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/102 subproject subdir/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/102 subproject subdir/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ #include -int main(void) { +int main() { return sub(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/102 subproject subdir/subprojects/sub/lib/sub.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/102 subproject subdir/subprojects/sub/lib/sub.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/102 subproject subdir/subprojects/sub/lib/sub.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/102 subproject subdir/subprojects/sub/lib/sub.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ #include "sub.h" -int sub(void) { +int sub() { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/102 subproject subdir/subprojects/sub/lib/sub.h" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/102 subproject subdir/subprojects/sub/lib/sub.h" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/102 subproject subdir/subprojects/sub/lib/sub.h" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/102 subproject subdir/subprojects/sub/lib/sub.h" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #ifndef SUB_H #define SUB_H -int sub(void); +int sub(); #endif diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/103 postconf/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/103 postconf/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/103 postconf/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/103 postconf/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ #include"generated.h" -int main(void) { +int main(int argc, char **argv) { return THE_NUMBER != 9; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/104 postconf with args/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/104 postconf with args/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/104 postconf with args/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/104 postconf with args/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ #include"generated.h" -int main(void) { +int main(int argc, char **argv) { return THE_NUMBER != 9 || THE_ARG1 != 5 || THE_ARG2 != 33; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/106 extract same name/lib.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/106 extract same name/lib.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/106 extract same name/lib.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/106 extract same name/lib.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int func1(void) { +int func1() { return 23; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/106 extract same name/main.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/106 extract same name/main.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/106 extract same name/main.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/106 extract same name/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ -int func1(void); -int func2(void); +int func1(); +int func2(); -int main(void) { +int main(int argc, char **argv) { return !(func1() == 23 && func2() == 42); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/106 extract same name/src/lib.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/106 extract same name/src/lib.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/106 extract same name/src/lib.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/106 extract same name/src/lib.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int func2(void) { +int func2() { return 42; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/109 generatorcustom/main.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/109 generatorcustom/main.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/109 generatorcustom/main.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/109 generatorcustom/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -2,6 +2,6 @@ #include"alltogether.h" -int main(void) { +int main(int argc, char **argv) { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/111 spaces backslash/comparer.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/111 spaces backslash/comparer.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/111 spaces backslash/comparer.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/111 spaces backslash/comparer.c" 2019-11-28 17:37:44.000000000 +0000 @@ -6,7 +6,7 @@ #define COMPARE_WITH "foo\\bar" /* This is the literal `foo\bar` */ -int main(void) { +int main (int argc, char **argv) { if (strcmp (DEF_WITH_BACKSLASH, COMPARE_WITH)) { printf ("Arg string is quoted incorrectly: %s instead of %s\n", DEF_WITH_BACKSLASH, COMPARE_WITH); diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/111 spaces backslash/comparer-end.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/111 spaces backslash/comparer-end.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/111 spaces backslash/comparer-end.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/111 spaces backslash/comparer-end.c" 2019-11-28 17:37:44.000000000 +0000 @@ -6,7 +6,7 @@ #define COMPARE_WITH "foo\\bar\\" /* This is `foo\bar\` */ -int main(void) { +int main (int argc, char **argv) { if (strcmp (DEF_WITH_BACKSLASH, COMPARE_WITH)) { printf ("Arg string is quoted incorrectly: %s vs %s\n", DEF_WITH_BACKSLASH, COMPARE_WITH); diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/111 spaces backslash/comparer-end-notstring.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/111 spaces backslash/comparer-end-notstring.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/111 spaces backslash/comparer-end-notstring.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/111 spaces backslash/comparer-end-notstring.c" 2019-11-28 17:37:44.000000000 +0000 @@ -10,7 +10,7 @@ #define COMPARE_WITH "foo\\bar\\" /* This is the literal `foo\bar\` */ -int main(void) { +int main(int argc, char **argv) { if(strcmp(QUOTE(DEF_WITH_BACKSLASH), COMPARE_WITH)) { printf("Arg string is quoted incorrectly: %s instead of %s\n", QUOTE(DEF_WITH_BACKSLASH), COMPARE_WITH); diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/114 allgenerate/foobar.cpp.in" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/114 allgenerate/foobar.cpp.in" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/114 allgenerate/foobar.cpp.in" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/114 allgenerate/foobar.cpp.in" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #include -int main(void) { +int main(int argc, char **argv) { printf("I am a program.\n"); return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/116 subdir subproject/prog/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/116 subdir subproject/prog/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/116 subdir subproject/prog/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/116 subdir subproject/prog/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ #include -int main(void) { +int main() { return sub(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/116 subdir subproject/subprojects/sub/sub.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/116 subdir subproject/subprojects/sub/sub.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/116 subdir subproject/subprojects/sub/sub.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/116 subdir subproject/subprojects/sub/sub.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ #include "sub.h" -int sub(void) { +int sub() { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/116 subdir subproject/subprojects/sub/sub.h" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/116 subdir subproject/subprojects/sub/sub.h" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/116 subdir subproject/subprojects/sub/sub.h" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/116 subdir subproject/subprojects/sub/sub.h" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #ifndef SUB_H #define SUB_H -int sub(void); +int sub(); #endif diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/119 subproject project arguments/exe.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/119 subproject project arguments/exe.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/119 subproject project arguments/exe.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/119 subproject project arguments/exe.c" 2019-11-28 17:37:44.000000000 +0000 @@ -22,6 +22,6 @@ #error #endif -int main(void) { +int main(int argc, char **argv) { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/119 subproject project arguments/exe.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/119 subproject project arguments/exe.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/119 subproject project arguments/exe.cpp" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/119 subproject project arguments/exe.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -22,7 +22,7 @@ #error #endif -int main(void) { +int main(int argc, char **argv) { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/119 subproject project arguments/subprojects/subexe/subexe.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/119 subproject project arguments/subprojects/subexe/subexe.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/119 subproject project arguments/subprojects/subexe/subexe.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/119 subproject project arguments/subprojects/subexe/subexe.c" 2019-11-28 17:37:44.000000000 +0000 @@ -22,6 +22,6 @@ #error #endif -int main(void) { +int main(int argc, char **argv) { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/11 subdir/subdir/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/11 subdir/subdir/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/11 subdir/subdir/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/11 subdir/subdir/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1 +1 @@ -int main(void) { return 0; } +int main(int argc, char **argv) { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/120 test skip/test_skip.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/120 test skip/test_skip.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/120 test skip/test_skip.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/120 test skip/test_skip.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int main(void) { +int main(int argc, char *argv[]) { return 77; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/121 shared module/module.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/121 shared module/module.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/121 shared module/module.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/121 shared module/module.c" 2019-11-28 17:37:44.000000000 +0000 @@ -51,7 +51,7 @@ snapshot = CreateToolhelp32Snapshot (TH32CS_SNAPMODULE, 0); if (snapshot == (HANDLE) -1) { - wchar_t *msg = win32_get_last_error(); + wchar_t *msg = win32_get_last_error (); printf("Could not get snapshot: %S\n", msg); return 0; } @@ -71,7 +71,7 @@ } #endif -int DLL_PUBLIC func(void) { +int DLL_PUBLIC func() { fptr f; f = find_any_f ("func_from_language_runtime"); @@ -88,7 +88,7 @@ * dlopens it. We need to make sure that this works, i.e. that we do * not pass -Wl,--no-undefined when linking modules. */ -int func_from_language_runtime(void); +int func_from_language_runtime(); int DLL_PUBLIC func(void) { return func_from_language_runtime(); diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/121 shared module/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/121 shared module/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/121 shared module/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/121 shared module/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -21,13 +21,13 @@ return msg; } -int main(int argc, char **argv) +int +main (int argc, char **argv) { HINSTANCE handle; fptr importedfunc; int expected, actual; int ret = 1; - if(argc==0) {}; handle = LoadLibraryA (argv[1]); if (!handle) { @@ -68,7 +68,6 @@ int expected, actual; char *error; int ret = 1; - if(argc==0) {}; dlerror(); dl = dlopen(argv[1], RTLD_LAZY); diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/122 llvm ir and assembly/main.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/122 llvm ir and assembly/main.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/122 llvm ir and assembly/main.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/122 llvm ir and assembly/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -2,7 +2,8 @@ unsigned square_unsigned (unsigned a); -int main(void) +int +main (int argc, char * argv[]) { unsigned int ret = square_unsigned (2); if (ret != 4) { diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/122 llvm ir and assembly/main.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/122 llvm ir and assembly/main.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/122 llvm ir and assembly/main.cpp" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/122 llvm ir and assembly/main.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -4,7 +4,8 @@ unsigned square_unsigned (unsigned a); } -int main (void) +int +main (int argc, char * argv[]) { unsigned int ret = square_unsigned (2); if (ret != 4) { diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/123 cpp and asm/trivial.cc" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/123 cpp and asm/trivial.cc" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/123 cpp and asm/trivial.cc" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/123 cpp and asm/trivial.cc" 2019-11-28 17:37:44.000000000 +0000 @@ -4,7 +4,7 @@ int get_retval(void); } -int main(void) { +int main(int argc, char **argv) { std::cout << "C++ seems to be working." << std::endl; #if defined(USE_ASM) return get_retval(); diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/124 extract all shared library/extractor.h" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/124 extract all shared library/extractor.h" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/124 extract all shared library/extractor.h" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/124 extract all shared library/extractor.h" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #pragma once -int func1(void); -int func2(void); -int func3(void); -int func4(void); +int func1(); +int func2(); +int func3(); +int func4(); diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/124 extract all shared library/four.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/124 extract all shared library/four.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/124 extract all shared library/four.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/124 extract all shared library/four.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ #include"extractor.h" -int func4(void) { +int func4() { return 4; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/124 extract all shared library/one.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/124 extract all shared library/one.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/124 extract all shared library/one.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/124 extract all shared library/one.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ #include"extractor.h" -int func1(void) { +int func1() { return 1; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/124 extract all shared library/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/124 extract all shared library/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/124 extract all shared library/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/124 extract all shared library/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,7 +1,7 @@ #include"extractor.h" #include -int main(void) { +int main(int argc, char **argv) { if((1+2+3+4) != (func1() + func2() + func3() + func4())) { printf("Arithmetic is fail.\n"); return 1; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/124 extract all shared library/three.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/124 extract all shared library/three.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/124 extract all shared library/three.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/124 extract all shared library/three.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ #include"extractor.h" -int func3(void) { +int func3() { return 3; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/124 extract all shared library/two.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/124 extract all shared library/two.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/124 extract all shared library/two.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/124 extract all shared library/two.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ #include"extractor.h" -int func2(void) { +int func2() { return 2; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/125 object only target/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/125 object only target/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/125 object only target/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/125 object only target/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,7 +1,7 @@ -int func1_in_obj(void); -int func2_in_obj(void); -int func3_in_obj(void); +int func1_in_obj(); +int func2_in_obj(); +int func3_in_obj(); -int main(void) { +int main(int argc, char **argv) { return func1_in_obj() + func2_in_obj() + func3_in_obj(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/125 object only target/source2.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/125 object only target/source2.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/125 object only target/source2.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/125 object only target/source2.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int func2_in_obj(void) { +int func2_in_obj() { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/125 object only target/source3.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/125 object only target/source3.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/125 object only target/source3.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/125 object only target/source3.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int func3_in_obj(void) { +int func3_in_obj() { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/125 object only target/source.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/125 object only target/source.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/125 object only target/source.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/125 object only target/source.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int func1_in_obj(void) { +int func1_in_obj() { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/126 no buildincdir/include/header.h" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/126 no buildincdir/include/header.h" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/126 no buildincdir/include/header.h" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/126 no buildincdir/include/header.h" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ #pragma once -int foobar(void); +int foobar(); diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/126 no buildincdir/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/126 no buildincdir/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/126 no buildincdir/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/126 no buildincdir/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ #include"header.h" -int main(void) { +int main(int argc, char **argv) { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/128 dependency file generation/main .c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/128 dependency file generation/main .c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/128 dependency file generation/main .c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/128 dependency file generation/main .c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int main(void) { +int main(int argc, char *argv[]) { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/129 configure file in generator/src/main.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/129 configure file in generator/src/main.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/129 configure file in generator/src/main.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/129 configure file in generator/src/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -12,6 +12,6 @@ #error Source RESULT is not defined correctly #endif -int main(void) { +int main(int argc, char **argv) { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/130 generated llvm ir/main.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/130 generated llvm ir/main.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/130 generated llvm ir/main.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/130 generated llvm ir/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -2,7 +2,8 @@ unsigned square_unsigned (unsigned a); -int main(void) +int +main (int argc, char * argv[]) { unsigned int ret = square_unsigned (2); if (ret != 4) { diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/131 generated assembly/main.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/131 generated assembly/main.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/131 generated assembly/main.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/131 generated assembly/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -5,7 +5,8 @@ #endif unsigned square_unsigned (unsigned a); -int main(void) +int +main (int argc, char * argv[]) { unsigned int ret = square_unsigned (2); if (ret != 4) { diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/132 build by default targets in tests/main.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/132 build by default targets in tests/main.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/132 build by default targets in tests/main.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/132 build by default targets in tests/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int main(void) { +int main (int argc, char *argv[]) { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/133 build by default/foo.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/133 build by default/foo.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/133 build by default/foo.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/133 build by default/foo.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #include -int main(void) { +int main(int argc, char **argv) { printf("Existentialism.\n"); return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/134 include order/ordertest.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/134 include order/ordertest.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/134 include order/ordertest.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/134 include order/ordertest.c" 2019-11-28 17:37:44.000000000 +0000 @@ -4,7 +4,8 @@ #error "Should have picked up hdr.h from inc1/hdr.h" #endif -int main(void) +int +main (int c, char ** argv) { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/134 include order/sub4/main.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/134 include order/sub4/main.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/134 include order/sub4/main.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/134 include order/sub4/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,7 +1,7 @@ /* Use the <> include notation to force searching in include directories */ #include -int main(void) { +int main(int argc, char *argv[]) { if (somefunc() == 1984) return 0; return 1; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/135 override options/four.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/135 override options/four.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/135 override options/four.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/135 override options/four.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,9 +1,9 @@ -int func(void); +int func(); -static int duplicate_func(void) { +static int duplicate_func() { return -4; } -int main(void) { +int main(int argc, char **argv) { return duplicate_func() + func(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/135 override options/one.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/135 override options/one.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/135 override options/one.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/135 override options/one.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -static int hidden_func(void) { +static int hidden_func() { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/135 override options/three.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/135 override options/three.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/135 override options/three.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/135 override options/three.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,7 +1,7 @@ -static int duplicate_func(void) { +static int duplicate_func() { return 4; } -int func(void) { +int func() { return duplicate_func(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/135 override options/two.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/135 override options/two.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/135 override options/two.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/135 override options/two.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ /* * Requires a Unity build. Otherwise hidden_func is not specified. */ -int main(void) { +int main(int argc, char **argv) { return hidden_func(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/137 c cpp and asm/main.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/137 c cpp and asm/main.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/137 c cpp and asm/main.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/137 c cpp and asm/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -2,7 +2,7 @@ int get_retval(void); -int main(void) { +int main(int argc, char **argv) { printf("C seems to be working.\n"); return get_retval(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/137 c cpp and asm/main.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/137 c cpp and asm/main.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/137 c cpp and asm/main.cpp" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/137 c cpp and asm/main.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -5,7 +5,7 @@ int get_cval(void); } -int main(void) { +int main(int argc, char **argv) { std::cout << "C++ seems to be working." << std::endl; return get_retval(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/138 compute int/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/138 compute int/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/138 compute int/meson.build" 2020-01-07 21:08:30.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/138 compute int/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -10,9 +10,6 @@ maxint = cc.compute_int('INT_MAX', prefix: '#include ') minint = cc.compute_int('INT_MIN', prefix: '#include ') -# Regression test for the special case -1 that used to fail when cross compiling -assert(cc.compute_int('-1') == -1, 'compute_int(-1) failed') - cd = configuration_data() cd.set('INTSIZE', intsize) cd.set('FOOBAR', foobar) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/138 compute int/prog.c.in" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/138 compute int/prog.c.in" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/138 compute int/prog.c.in" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/138 compute int/prog.c.in" 2019-11-28 17:37:44.000000000 +0000 @@ -4,7 +4,7 @@ #include #include "foobar.h" -int main(void) { +int main(int argc, char **argv) { if(INTSIZE != sizeof(int)) { fprintf(stderr, "Mismatch: computed int size %d, actual size %d.\n", INTSIZE, (int)sizeof(int)); return 1; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/139 custom target object output/objdir/source.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/139 custom target object output/objdir/source.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/139 custom target object output/objdir/source.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/139 custom target object output/objdir/source.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int func1_in_obj(void) { +int func1_in_obj() { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/139 custom target object output/progdir/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/139 custom target object output/progdir/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/139 custom target object output/progdir/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/139 custom target object output/progdir/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ -int func1_in_obj(void); +int func1_in_obj(); -int main(void) { +int main(int argc, char **argv) { return func1_in_obj(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/13 pch/c/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/13 pch/c/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/13 pch/c/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/13 pch/c/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,10 +1,10 @@ // No includes here, they need to come from the PCH -void func(void) { +void func() { fprintf(stdout, "This is a function that fails if stdio is not #included.\n"); } -int main(void) { +int main(int argc, char **argv) { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/13 pch/cpp/prog.cc" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/13 pch/cpp/prog.cc" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/13 pch/cpp/prog.cc" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/13 pch/cpp/prog.cc" 2019-11-28 17:37:44.000000000 +0000 @@ -1,11 +1,11 @@ // Note: if using PGI compilers, you will need to add #include "prog.hh" // even though you're using precompiled headers. -void func(void) { +void func() { std::cout << "This is a function that fails to compile if iostream is not included." << std::endl; } -int main(void) { +int main(int argc, char **argv) { func(); return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/13 pch/generated/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/13 pch/generated/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/13 pch/generated/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/13 pch/generated/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ // No includes here, they need to come from the PCH -int main(void) { +int main(int argc, char **argv) { return FOO + BAR; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/13 pch/mixed/func.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/13 pch/mixed/func.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/13 pch/mixed/func.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/13 pch/mixed/func.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,7 +1,7 @@ -void tmp_func(void) { +void tmp_func() { fprintf(stdout, "This is a function that fails if stdio is not #included.\n"); } -int cfunc(void) { +int cfunc() { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/13 pch/mixed/main.cc" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/13 pch/mixed/main.cc" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/13 pch/mixed/main.cc" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/13 pch/mixed/main.cc" 2019-11-28 17:37:44.000000000 +0000 @@ -1,10 +1,10 @@ extern "C" int cfunc(); -void func(void) { +void func() { std::cout << "This is a function that fails to compile if iostream is not included." << std::endl; } -int main(void) { +int main(int argc, char **argv) { return cfunc(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/13 pch/userDefined/pch/pch.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/13 pch/userDefined/pch/pch.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/13 pch/userDefined/pch/pch.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/13 pch/userDefined/pch/pch.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ #include "pch.h" -int foo(void) { +int foo() { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/13 pch/userDefined/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/13 pch/userDefined/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/13 pch/userDefined/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/13 pch/userDefined/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ // No includes here, they need to come from the PCH -int main(void) { +int main(int argc, char **argv) { // Method is implemented in pch.c. // This makes sure that we can properly handle user defined // pch implementation files and not only auto-generated ones. diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/13 pch/withIncludeDirectories/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/13 pch/withIncludeDirectories/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/13 pch/withIncludeDirectories/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/13 pch/withIncludeDirectories/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,10 +1,10 @@ // No includes here, they need to come from the PCH -void func(void) { +void func() { fprintf(stdout, "This is a function that fails if stdio is not #included.\n"); } -int main(void) { +int main(int argc, char **argv) { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/141 whole archive/func1.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/141 whole archive/func1.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/141 whole archive/func1.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/141 whole archive/func1.c" 2019-11-28 17:37:44.000000000 +0000 @@ -2,6 +2,6 @@ #include -int func1(void) { +int func1() { return 42; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/141 whole archive/func2.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/141 whole archive/func2.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/141 whole archive/func2.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/141 whole archive/func2.c" 2019-11-28 17:37:44.000000000 +0000 @@ -2,6 +2,6 @@ #include -int func2(void) { +int func2() { return 42; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/141 whole archive/mylib.h" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/141 whole archive/mylib.h" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/141 whole archive/mylib.h" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/141 whole archive/mylib.h" 2019-11-28 17:37:44.000000000 +0000 @@ -17,5 +17,5 @@ #endif #endif -int DLL_PUBLIC func1(void); -int DLL_PUBLIC func2(void); +int DLL_PUBLIC func1(); +int DLL_PUBLIC func2(); diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/141 whole archive/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/141 whole archive/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/141 whole archive/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/141 whole archive/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ #include -int main(void) { +int main(int argc, char **argv) { return func1() - func2(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/146 nested links/xephyr.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/146 nested links/xephyr.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/146 nested links/xephyr.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/146 nested links/xephyr.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int main(void) { +int main() { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/148 link depends custom target/foo.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/148 link depends custom target/foo.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/148 link depends custom target/foo.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/148 link depends custom target/foo.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #include -int main(void) { +int main() { const char *fn = DEPFILE; FILE *f = fopen(fn, "r"); if (!f) { diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/149 recursive linking/3rdorderdeps/main.c.in" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/149 recursive linking/3rdorderdeps/main.c.in" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/149 recursive linking/3rdorderdeps/main.c.in" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/149 recursive linking/3rdorderdeps/main.c.in" 2019-11-28 17:37:44.000000000 +0000 @@ -4,7 +4,7 @@ SYMBOL_IMPORT int get_@LIBTYPE@@DEPENDENCY@dep_value (void); -int main(void) { +int main(int argc, char *argv[]) { int val; val = get_@LIBTYPE@@DEPENDENCY@dep_value (); diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/149 recursive linking/circular/main.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/149 recursive linking/circular/main.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/149 recursive linking/circular/main.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/149 recursive linking/circular/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -6,7 +6,7 @@ int get_st2_value (void); int get_st3_value (void); -int main(void) { +int main(int argc, char *argv[]) { int val; val = get_st1_value (); diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/149 recursive linking/edge-cases/shstmain.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/149 recursive linking/edge-cases/shstmain.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/149 recursive linking/edge-cases/shstmain.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/149 recursive linking/edge-cases/shstmain.c" 2019-11-28 17:37:44.000000000 +0000 @@ -4,7 +4,7 @@ int get_stshdep_value (void); -int main(void) { +int main(int argc, char *argv[]) { int val; val = get_stshdep_value (); diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/149 recursive linking/edge-cases/stomain.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/149 recursive linking/edge-cases/stomain.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/149 recursive linking/edge-cases/stomain.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/149 recursive linking/edge-cases/stomain.c" 2019-11-28 17:37:44.000000000 +0000 @@ -4,7 +4,7 @@ int get_stodep_value (void); -int main(void) { +int main(int argc, char *argv[]) { int val; val = get_stodep_value (); diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/149 recursive linking/main.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/149 recursive linking/main.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/149 recursive linking/main.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/149 recursive linking/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -9,7 +9,7 @@ SYMBOL_IMPORT int get_shshdep_value (void); SYMBOL_IMPORT int get_shstdep_value (void); -int main(void) { +int main(int argc, char *argv[]) { int val; val = get_shnodep_value (); diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/14 configure file/check_file.py" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/14 configure file/check_file.py" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/14 configure file/check_file.py" 2020-02-25 18:00:47.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/14 configure file/check_file.py" 2018-10-31 09:31:20.000000000 +0000 @@ -6,15 +6,9 @@ if len(sys.argv) == 2: assert(os.path.exists(sys.argv[1])) elif len(sys.argv) == 3: - f1 = sys.argv[1] - f2 = sys.argv[2] - m1 = os.stat(f1).st_mtime_ns - m2 = os.stat(f2).st_mtime_ns - # Compare only os.stat() - if m1 != m2: - raise RuntimeError('mtime of {!r} () != mtime of {!r} ()'.format(f1, m1, f2, m2)) - import filecmp - if not filecmp.cmp(f1, f2): + f1 = open(sys.argv[1], 'rb').read() + f2 = open(sys.argv[2], 'rb').read() + if f1 != f2: raise RuntimeError('{!r} != {!r}'.format(f1, f2)) else: raise AssertionError diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/14 configure file/dumpprog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/14 configure file/dumpprog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/14 configure file/dumpprog.c" 2019-12-04 18:45:59.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/14 configure file/dumpprog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -15,7 +15,7 @@ #define stringify(s) str(s) #define str(s) #s -int main(void) { +int main(int argc, char **argv) { #if !(SHOULD_BE_UNQUOTED_STRING == string) printf("String token (unquoted) defined wrong.\n"); return 1; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/14 configure file/prog2.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/14 configure file/prog2.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/14 configure file/prog2.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/14 configure file/prog2.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ #include -int main(void) { +int main(int argc, char **argv) { return ZERO_RESULT; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/14 configure file/prog4.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/14 configure file/prog4.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/14 configure file/prog4.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/14 configure file/prog4.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #include #include -int main(void) { +int main(int argc, char **argv) { return RESULTA + RESULTB; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/14 configure file/prog5.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/14 configure file/prog5.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/14 configure file/prog5.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/14 configure file/prog5.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #include #include -int main(void) { +int main(int argc, char **argv) { return strcmp(MESSAGE, "@var2@"); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/14 configure file/prog6.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/14 configure file/prog6.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/14 configure file/prog6.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/14 configure file/prog6.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,7 +1,7 @@ #include #include -int main(void) { +int main(int argc, char **argv) { return strcmp(MESSAGE1, "foo") || strcmp(MESSAGE2, "@var1@") || strcmp(MESSAGE3, "\\foo") diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/14 configure file/prog7.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/14 configure file/prog7.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/14 configure file/prog7.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/14 configure file/prog7.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,7 +1,7 @@ #include #include -int main(void) { +int main(int argc, char **argv) { return strcmp(MESSAGE1, "foo") || strcmp(MESSAGE2, "${var1}") || strcmp(MESSAGE3, "\\foo") diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/14 configure file/prog9.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/14 configure file/prog9.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/14 configure file/prog9.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/14 configure file/prog9.c" 2019-11-28 17:37:44.000000000 +0000 @@ -10,7 +10,7 @@ #error "Should be defined" #endif -int main(void) { +int main(int argc, char **argv) { return strcmp(A_STRING, "foo") || strcmp(B_STRING, "foo") || A_INT != 42 diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/14 configure file/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/14 configure file/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/14 configure file/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/14 configure file/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -8,7 +8,7 @@ #error "FAIL!" #endif -int main(void) { +int main(int argc, char **argv) { #ifndef BE_TRUE return 1; #else diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/150 library at root/main/main.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/150 library at root/main/main.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/150 library at root/main/main.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/150 library at root/main/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ extern int fn(void); -int main(void) { +int main() { return 1 + fn(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/151 simd/simd_avx2.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/151 simd/simd_avx2.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/151 simd/simd_avx2.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/151 simd/simd_avx2.c" 2019-11-28 17:37:44.000000000 +0000 @@ -8,7 +8,7 @@ #ifdef _MSC_VER #include -int avx2_available(void) { +int avx2_available() { return 0; } #else @@ -16,9 +16,9 @@ #include #if defined(__APPLE__) -int avx2_available(void) { return 0; } +int avx2_available() { return 0; } #else -int avx2_available(void) { +int avx2_available() { return __builtin_cpu_supports("avx2"); } #endif diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/151 simd/simd_avx.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/151 simd/simd_avx.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/151 simd/simd_avx.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/151 simd/simd_avx.c" 2019-11-28 17:37:44.000000000 +0000 @@ -10,7 +10,7 @@ #ifdef _MSC_VER #include -int avx_available(void) { +int avx_available() { return 1; } #else @@ -23,10 +23,10 @@ * some machines in the CI farm seem to be too * old to have AVX so just always return 0 here. */ -int avx_available(void) { return 0; } +int avx_available() { return 0; } #else -int avx_available(void) { +int avx_available() { return __builtin_cpu_supports("avx"); } #endif diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/151 simd/simdchecker.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/151 simd/simdchecker.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/151 simd/simdchecker.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/151 simd/simdchecker.c" 2019-11-28 17:37:44.000000000 +0000 @@ -23,7 +23,7 @@ return rv; } -int main(void) { +int main(int argc, char **argv) { static const float four_initial[4] = {2.0, 3.0, 4.0, 5.0}; ALIGN_16 float four[4]; const float expected[4] = {3.0, 4.0, 5.0, 6.0}; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/151 simd/simdfuncs.h" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/151 simd/simdfuncs.h" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/151 simd/simdfuncs.h" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/151 simd/simdfuncs.h" 2019-11-28 17:37:44.000000000 +0000 @@ -18,57 +18,57 @@ void increment_fallback(float arr[4]); #if HAVE_MMX -int mmx_available(void); +int mmx_available(); void increment_mmx(float arr[4]); #endif #if HAVE_SSE -int sse_available(void); +int sse_available(); void increment_sse(float arr[4]); #endif #if HAVE_SSE2 -int sse2_available(void); +int sse2_available(); void increment_sse2(float arr[4]); #endif #if HAVE_SSE3 -int sse3_available(void); +int sse3_available(); void increment_sse3(float arr[4]); #endif #if HAVE_SSSE3 -int ssse3_available(void); +int ssse3_available(); void increment_ssse3(float arr[4]); #endif #if HAVE_SSE41 -int sse41_available(void); +int sse41_available(); void increment_sse41(float arr[4]); #endif #if HAVE_SSE42 -int sse42_available(void); +int sse42_available(); void increment_sse42(float arr[4]); #endif #if HAVE_AVX -int avx_available(void); +int avx_available(); void increment_avx(float arr[4]); #endif #if HAVE_AVX2 -int avx2_available(void); +int avx2_available(); void increment_avx2(float arr[4]); #endif #if HAVE_NEON -int neon_available(void); +int neon_available(); void increment_neon(float arr[4]); #endif #if HAVE_ALTIVEC -int altivec_available(void); +int altivec_available(); void increment_altivec(float arr[4]); #endif diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/151 simd/simd_mmx.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/151 simd/simd_mmx.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/151 simd/simd_mmx.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/151 simd/simd_mmx.c" 2019-11-28 17:37:44.000000000 +0000 @@ -5,7 +5,7 @@ #ifdef _MSC_VER #include -int mmx_available(void) { +int mmx_available() { return 1; } /* Contrary to MSDN documentation, MMX intrinsics @@ -18,7 +18,7 @@ arr[3]++; } #elif defined(__MINGW32__) -int mmx_available(void) { +int mmx_available() { return 1; } /* MinGW does not seem to ship with MMX or it is broken. @@ -34,9 +34,9 @@ #include #if defined(__APPLE__) -int mmx_available(void) { return 1; } +int mmx_available() { return 1; } #else -int mmx_available(void) { +int mmx_available() { return __builtin_cpu_supports("mmx"); } #endif diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/151 simd/simd_neon.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/151 simd/simd_neon.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/151 simd/simd_neon.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/151 simd/simd_neon.c" 2019-11-28 17:37:44.000000000 +0000 @@ -4,7 +4,7 @@ #include #include -int neon_available(void) { +int neon_available() { return 1; /* Incorrect, but I don't know how to check this properly. */ } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/151 simd/simd_sse2.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/151 simd/simd_sse2.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/151 simd/simd_sse2.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/151 simd/simd_sse2.c" 2019-11-28 17:37:44.000000000 +0000 @@ -3,7 +3,7 @@ #include #ifdef _MSC_VER -int sse2_available(void) { +int sse2_available() { return 1; } @@ -12,9 +12,9 @@ #include #if defined(__APPLE__) -int sse2_available(void) { return 1; } +int sse2_available() { return 1; } #else -int sse2_available(void) { +int sse2_available() { return __builtin_cpu_supports("sse2"); } #endif diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/151 simd/simd_sse3.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/151 simd/simd_sse3.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/151 simd/simd_sse3.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/151 simd/simd_sse3.c" 2019-11-28 17:37:44.000000000 +0000 @@ -3,7 +3,7 @@ #ifdef _MSC_VER #include -int sse3_available(void) { +int sse3_available() { return 1; } #else @@ -13,9 +13,9 @@ #include #if defined(__APPLE__) -int sse3_available(void) { return 1; } +int sse3_available() { return 1; } #else -int sse3_available(void) { +int sse3_available() { return __builtin_cpu_supports("sse3"); } #endif diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/151 simd/simd_sse41.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/151 simd/simd_sse41.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/151 simd/simd_sse41.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/151 simd/simd_sse41.c" 2019-11-28 17:37:44.000000000 +0000 @@ -6,7 +6,7 @@ #ifdef _MSC_VER #include -int sse41_available(void) { +int sse41_available() { return 1; } @@ -15,9 +15,9 @@ #include #if defined(__APPLE__) -int sse41_available(void) { return 1; } +int sse41_available() { return 1; } #else -int sse41_available(void) { +int sse41_available() { return __builtin_cpu_supports("sse4.1"); } #endif diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/151 simd/simd_sse42.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/151 simd/simd_sse42.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/151 simd/simd_sse42.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/151 simd/simd_sse42.c" 2019-11-28 17:37:44.000000000 +0000 @@ -5,7 +5,7 @@ #ifdef _MSC_VER #include -int sse42_available(void) { +int sse42_available() { return 1; } @@ -15,11 +15,11 @@ #include #ifdef __APPLE__ -int sse42_available(void) { +int sse42_available() { return 1; } #else -int sse42_available(void) { +int sse42_available() { return __builtin_cpu_supports("sse4.2"); } #endif diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/151 simd/simd_sse.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/151 simd/simd_sse.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/151 simd/simd_sse.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/151 simd/simd_sse.c" 2019-11-28 17:37:44.000000000 +0000 @@ -3,7 +3,7 @@ #ifdef _MSC_VER #include -int sse_available(void) { +int sse_available() { return 1; } #else @@ -13,9 +13,9 @@ #include #if defined(__APPLE__) -int sse_available(void) { return 1; } +int sse_available() { return 1; } #else -int sse_available(void) { +int sse_available() { return __builtin_cpu_supports("sse"); } #endif diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/151 simd/simd_ssse3.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/151 simd/simd_ssse3.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/151 simd/simd_ssse3.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/151 simd/simd_ssse3.c" 2019-11-28 17:37:44.000000000 +0000 @@ -7,7 +7,7 @@ #ifdef _MSC_VER #include -int ssse3_available(void) { +int ssse3_available() { return 1; } @@ -16,7 +16,7 @@ #include #include -int ssse3_available(void) { +int ssse3_available() { #ifdef __APPLE__ return 1; #elif defined(__clang__) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/152 shared module resolving symbol in executable/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/152 shared module resolving symbol in executable/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/152 shared module resolving symbol in executable/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/152 shared module resolving symbol in executable/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -25,13 +25,12 @@ return 42; } -int main(int argc, char **argv) +int +main (int argc, char **argv) { int expected, actual; fptr importedfunc; - if (argc=0) {}; // noop - #ifdef _WIN32 HMODULE h = LoadLibraryA(argv[1]); #else diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/153 dotinclude/dotproc.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/153 dotinclude/dotproc.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/153 dotinclude/dotproc.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/153 dotinclude/dotproc.c" 2019-11-28 17:37:44.000000000 +0000 @@ -4,7 +4,7 @@ #error The wrapper stdio.h was not included. #endif -int main(void) { +int main(int argc, char **argv) { printf("Eventually I got printed.\n"); return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/154 reserved targets/test.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/154 reserved targets/test.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/154 reserved targets/test.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/154 reserved targets/test.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int main(void) { +int main(int argc, char *argv[]) { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/155 duplicate source names/dir1/file.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/155 duplicate source names/dir1/file.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/155 duplicate source names/dir1/file.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/155 duplicate source names/dir1/file.c" 2019-11-28 17:37:44.000000000 +0000 @@ -3,7 +3,7 @@ extern int dir3; extern int dir3_dir1; -int main(void) { +int main() { if (dir2 != 20) return 1; if (dir2_dir1 != 21) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/157 wrap file should not failed/src/subprojects/foo/prog2.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/157 wrap file should not failed/src/subprojects/foo/prog2.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/157 wrap file should not failed/src/subprojects/foo/prog2.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/157 wrap file should not failed/src/subprojects/foo/prog2.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #include -int main(void) { +int main(int argc, char **argv) { printf("Do not have a file layout like this in your own projects.\n"); printf("This is only to test that this works.\n"); return 0; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/157 wrap file should not failed/src/subprojects/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/157 wrap file should not failed/src/subprojects/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/157 wrap file should not failed/src/subprojects/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/157 wrap file should not failed/src/subprojects/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #include -int main(void) { +int main(int argc, char **argv) { printf("Do not have a file layout like this in your own projects.\n"); printf("This is only to test that this works.\n"); return 0; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/157 wrap file should not failed/subprojects/foo-1.0/foo.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/157 wrap file should not failed/subprojects/foo-1.0/foo.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/157 wrap file should not failed/subprojects/foo-1.0/foo.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/157 wrap file should not failed/subprojects/foo-1.0/foo.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int dummy_func(void) { +int dummy_func() { return 42; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/157 wrap file should not failed/subprojects/zlib-1.2.8/foo.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/157 wrap file should not failed/subprojects/zlib-1.2.8/foo.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/157 wrap file should not failed/subprojects/zlib-1.2.8/foo.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/157 wrap file should not failed/subprojects/zlib-1.2.8/foo.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int dummy_func(void) { +int dummy_func() { return 42; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/158 includedir subproj/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/158 includedir subproj/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/158 includedir subproj/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/158 includedir subproj/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,4 @@ -int main(void) { + +int main(int argc, char **argv) { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/159 subproject dir name collision/a.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/159 subproject dir name collision/a.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/159 subproject dir name collision/a.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/159 subproject dir name collision/a.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,8 +1,8 @@ #include -char func_b(void); -char func_c(void); +char func_b(); +char func_c(); -int main(void) { +int main(int argc, char **argv) { if(func_b() != 'b') { return 1; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/159 subproject dir name collision/custom_subproject_dir/B/b.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/159 subproject dir name collision/custom_subproject_dir/B/b.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/159 subproject dir name collision/custom_subproject_dir/B/b.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/159 subproject dir name collision/custom_subproject_dir/B/b.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ #include -char func_c(void); +char func_c(); #if defined _WIN32 || defined __CYGWIN__ #define DLL_PUBLIC __declspec(dllexport) @@ -12,7 +12,7 @@ #endif #endif -char DLL_PUBLIC func_b(void) { +char DLL_PUBLIC func_b() { if(func_c() != 'c') { exit(3); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/159 subproject dir name collision/custom_subproject_dir/C/c.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/159 subproject dir name collision/custom_subproject_dir/C/c.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/159 subproject dir name collision/custom_subproject_dir/C/c.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/159 subproject dir name collision/custom_subproject_dir/C/c.c" 2019-11-28 17:37:44.000000000 +0000 @@ -9,6 +9,6 @@ #endif #endif -char DLL_PUBLIC func_c(void) { +char DLL_PUBLIC func_c() { return 'c'; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/159 subproject dir name collision/other_subdir/custom_subproject_dir/other.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/159 subproject dir name collision/other_subdir/custom_subproject_dir/other.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/159 subproject dir name collision/other_subdir/custom_subproject_dir/other.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/159 subproject dir name collision/other_subdir/custom_subproject_dir/other.c" 2019-11-28 17:37:44.000000000 +0000 @@ -11,7 +11,7 @@ #endif #endif -char DLL_PUBLIC func_b(void) { +char DLL_PUBLIC func_b() { if('c' != 'c') { exit(3); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/15 if/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/15 if/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/15 if/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/15 if/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1 +1 @@ -int main(void) { return 0; } +int main(int argc, char **argv) { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/161 custom target subdir depend files/subdir/foo.c.in" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/161 custom target subdir depend files/subdir/foo.c.in" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/161 custom target subdir depend files/subdir/foo.c.in" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/161 custom target subdir depend files/subdir/foo.c.in" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #include -int main(void) { +int main() { printf("foo is working.\n"); return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/165 custom target template substitution/foo.c.in" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/165 custom target template substitution/foo.c.in" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/165 custom target template substitution/foo.c.in" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/165 custom target template substitution/foo.c.in" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #include -int main(void) { +int main() { printf("foo is working.\n"); return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/166 not-found dependency/subprojects/trivial/trivial.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/166 not-found dependency/subprojects/trivial/trivial.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/166 not-found dependency/subprojects/trivial/trivial.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/166 not-found dependency/subprojects/trivial/trivial.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int subfunc(void) { +int subfunc() { return 42; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/16 else/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/16 else/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/16 else/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/16 else/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1 +1 @@ -int main(void) { return 0; } +int main(int argc, char **argv) { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/170 get project license/bar.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/170 get project license/bar.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/170 get project license/bar.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/170 get project license/bar.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #include -int main(void) { +int main(int argc, char **argv) { printf("I'm a main project bar.\n"); return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/172 subproject nested subproject dirs/contrib/subprojects/alpha/a.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/172 subproject nested subproject dirs/contrib/subprojects/alpha/a.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/172 subproject nested subproject dirs/contrib/subprojects/alpha/a.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/172 subproject nested subproject dirs/contrib/subprojects/alpha/a.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,4 +1,4 @@ -int func2(void); +int func2(); #if defined _WIN32 || defined __CYGWIN__ #define DLL_PUBLIC __declspec(dllexport) @@ -11,5 +11,5 @@ #endif #endif -int DLL_PUBLIC func(void) { return func2(); } +int DLL_PUBLIC func() { return func2(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/172 subproject nested subproject dirs/contrib/subprojects/beta/b.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/172 subproject nested subproject dirs/contrib/subprojects/beta/b.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/172 subproject nested subproject dirs/contrib/subprojects/beta/b.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/172 subproject nested subproject dirs/contrib/subprojects/beta/b.c" 2019-11-28 17:37:44.000000000 +0000 @@ -9,6 +9,6 @@ #endif #endif -int DLL_PUBLIC func2(void) { +int DLL_PUBLIC func2() { return 42; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/172 subproject nested subproject dirs/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/172 subproject nested subproject dirs/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/172 subproject nested subproject dirs/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/172 subproject nested subproject dirs/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ -int func(void); +int func(); -int main(void) { +int main(int argc, char **argv) { return func() == 42 ? 0 : 1; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/173 preserve gendir/genprog.py" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/173 preserve gendir/genprog.py" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/173 preserve gendir/genprog.py" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/173 preserve gendir/genprog.py" 2019-11-28 17:37:44.000000000 +0000 @@ -4,12 +4,12 @@ h_templ = '''#pragma once -int %s(void); +int %s(); ''' c_templ = '''#include"%s.h" -int %s(void) { +int %s() { return 0; } ''' diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/173 preserve gendir/testprog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/173 preserve gendir/testprog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/173 preserve gendir/testprog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/173 preserve gendir/testprog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #include"base.h" #include"com/mesonbuild/subbie.h" -int main(void) { +int main(int argc, char **argv) { return base() + subbie(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/174 source in dep/bar.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/174 source in dep/bar.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/174 source in dep/bar.cpp" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/174 source in dep/bar.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ -extern "C" int foo(void); +extern "C" int foo(); -int main(void) { +int main(int, char**) { return foo() != 42; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/174 source in dep/foo.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/174 source in dep/foo.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/174 source in dep/foo.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/174 source in dep/foo.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int foo(void) { +int foo() { return 42; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/174 source in dep/generated/genheader.py" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/174 source in dep/generated/genheader.py" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/174 source in dep/generated/genheader.py" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/174 source in dep/generated/genheader.py" 2019-11-28 17:37:44.000000000 +0000 @@ -7,7 +7,7 @@ templ = '''#pragma once -int %s(void) { +int %s() { return 42; } ''' diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/174 source in dep/generated/main.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/174 source in dep/generated/main.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/174 source in dep/generated/main.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/174 source in dep/generated/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ #include"funheader.h" -int main(void) { +int main(int argc, char **argv) { return my_wonderful_function() != 42; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/175 generator link whole/generator.py" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/175 generator link whole/generator.py" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/175 generator link whole/generator.py" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/175 generator link whole/generator.py" 2019-11-28 17:37:44.000000000 +0000 @@ -15,12 +15,12 @@ hfile.write(''' #pragma once #include "export.h" -int DLL_PUBLIC {name}(void); +int DLL_PUBLIC {name}(); '''.format(name=name)) with open(cname, 'w') as cfile: cfile.write(''' #include "{name}.h" -int {name}(void) {{ +int {name}() {{ return {size}; }} '''.format(name=name, size=len(name))) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/175 generator link whole/main.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/175 generator link whole/main.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/175 generator link whole/main.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/175 generator link whole/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -2,7 +2,7 @@ #include -int main(void) { +int main() { if (meson_test_function() != 19) { printf("Bad meson_test_function()\n"); return 1; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/175 generator link whole/pull_meson_test_function.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/175 generator link whole/pull_meson_test_function.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/175 generator link whole/pull_meson_test_function.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/175 generator link whole/pull_meson_test_function.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #include "export.h" #include "meson_test_function.h" -int DLL_PUBLIC function_puller(void) { +int DLL_PUBLIC function_puller() { return meson_test_function(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/178 as-needed/main.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/178 as-needed/main.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/178 as-needed/main.cpp" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/178 as-needed/main.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -2,6 +2,6 @@ #include "libA.h" -int main(void) { +int main() { return !meson_test_as_needed::linked ? EXIT_SUCCESS : EXIT_FAILURE; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/17 comparison/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/17 comparison/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/17 comparison/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/17 comparison/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1 +1 @@ -int main(void) { return 0; } +int main(int argc, char **argv) { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/183 bothlibraries/libfile.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/183 bothlibraries/libfile.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/183 bothlibraries/libfile.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/183 bothlibraries/libfile.c" 2019-11-28 17:37:44.000000000 +0000 @@ -2,6 +2,6 @@ DO_EXPORT int retval = 42; -DO_EXPORT int func(void) { +DO_EXPORT int func() { return retval; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/183 bothlibraries/main.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/183 bothlibraries/main.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/183 bothlibraries/main.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/183 bothlibraries/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,8 +1,8 @@ #include "mylib.h" -DO_IMPORT int func(void); +DO_IMPORT int func(); DO_IMPORT int retval; -int main(void) { +int main(int argc, char **arg) { return func() == retval ? 0 : 1; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/184 escape and unicode/file.c.in" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/184 escape and unicode/file.c.in" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/184 escape and unicode/file.c.in" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/184 escape and unicode/file.c.in" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ #include -const char* does_it_work(void) { +const char* does_it_work() { printf("{NAME}\n"); return "yes it does"; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/184 escape and unicode/fun.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/184 escape and unicode/fun.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/184 escape and unicode/fun.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/184 escape and unicode/fun.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int a_fun(void) { +int a_fun() { return 1; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/184 escape and unicode/main.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/184 escape and unicode/main.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/184 escape and unicode/main.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/184 escape and unicode/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,10 +1,10 @@ #include -const char* does_it_work(void); +const char* does_it_work(); -int a_fun(void); +int a_fun(); -int main(void) { +int main() { if(strcmp(does_it_work(), "yes it does") != 0) { return -a_fun(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/187 find override/otherdir/main2.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/187 find override/otherdir/main2.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/187 find override/otherdir/main2.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/187 find override/otherdir/main2.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ -int number_returner(void); +int number_returner(); -int main(void) { +int main(int argc, char **argv) { return number_returner() == 100 ? 0 : 1; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/187 find override/otherdir/main.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/187 find override/otherdir/main.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/187 find override/otherdir/main.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/187 find override/otherdir/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ -int be_seeing_you(void); +int be_seeing_you(); -int main(void) { +int main(int argc, char **argv) { return be_seeing_you() == 6 ? 0 : 1; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/187 find override/otherdir/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/187 find override/otherdir/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/187 find override/otherdir/meson.build" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/187 find override/otherdir/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -10,7 +10,7 @@ test('six', e) -# The same again, but this time with a program that was generated +# The same again, but this time with a program that was genererated # with configure_file. gen = find_program('gencodegen') diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/187 find override/subdir/converter.py" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/187 find override/subdir/converter.py" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/187 find override/subdir/converter.py" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/187 find override/subdir/converter.py" 2019-11-28 17:37:44.000000000 +0000 @@ -5,7 +5,7 @@ [ifilename, ofilename] = sys.argv[1:3] -ftempl = '''int %s(void) { +ftempl = '''int %s() { return 6; } ''' diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/187 find override/subdir/gencodegen.py.in" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/187 find override/subdir/gencodegen.py.in" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/187 find override/subdir/gencodegen.py.in" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/187 find override/subdir/gencodegen.py.in" 2019-11-28 17:37:44.000000000 +0000 @@ -5,7 +5,7 @@ [ifilename, ofilename] = sys.argv[1:3] -ftempl = '''int %s(void) { +ftempl = '''int %s() { return @NUMBER@; } ''' diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/188 partial dependency/declare_dependency/main.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/188 partial dependency/declare_dependency/main.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/188 partial dependency/declare_dependency/main.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/188 partial dependency/declare_dependency/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -15,7 +15,7 @@ #include "foo.h" -int main(void) { +int main() { int a = foo(); if (a == 1) { return 0; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/18 array/func.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/18 array/func.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/18 array/func.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/18 array/func.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1 +1 @@ -int func(void) { return 0; } +int func() { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/18 array/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/18 array/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/18 array/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/18 array/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -extern int func(void); +extern int func(); -int main(void) { return func(); } +int main(int argc, char **argv) { return func(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/190 same target name/file.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/190 same target name/file.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/190 same target name/file.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/190 same target name/file.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int func(void) { +int func() { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/190 same target name/sub/file2.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/190 same target name/sub/file2.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/190 same target name/sub/file2.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/190 same target name/sub/file2.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int func(void) { +int func() { return 5; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/193 dict/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/193 dict/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/193 dict/meson.build" 2020-01-07 21:09:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/193 dict/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -33,39 +33,3 @@ d3 += {'e' : 'f'} assert(d3 == {'a' : 'b2', 'c' : 'd', 'e' : 'f'}, 'dict plusassign is not working') assert(d2 == {'a' : 'b2', 'c' : 'd'}, 'dict should be immutable') - -dict1 = {} - -# A variable to be used as a key -testkey1 = 'myKey1' -testkey2 = 'myKey2' - -# Add new entry using the variable -dict1 += {testkey1 : 'myValue'} -dict1 += {testkey2 : 42} - -# Test that the stored values are correct -assert(dict1[testkey1] == 'myValue', - 'Incorrect string value retrieved from dictionary - variable key') -assert(dict1['myKey1'] == 'myValue', - 'Incorrect string value retrieved from dictionary - literal key') -assert(dict1[testkey2] == 42, - 'Incorrect int value retrieved from dictionary - variable key') -assert(dict1['myKey2'] == 42, - 'Incorrect int value retrieved from dictionary - literal key') - -d = {testkey1 : 1} -assert(d[testkey1] == 1, - 'Incorrect int value retrieved from dictionary - variable key') -assert(d['myKey1'] == 1, - 'Incorrect int value retrieved from dictionary - literal key') - -d = {'1' / '2' : 1, join_paths('a', 'b') : 2} -k1 = '1' / '2' -k2 = join_paths('a', 'b') -assert(d[k1] == 1, 'Incorrect expression evaluation in dictionary key') -assert(d[k2] == 2, 'Incorrect expression evaluation in dictionary key') - -d = {'a' + 'b' : 1} -assert(d['a' + 'b'] == 1, 'Incorrect expression evaluation in dictionary key') -assert(d['ab'] == 1, 'Incorrect expression evaluation in dictionary key') diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/194 check header/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/194 check header/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/194 check header/meson.build" 2020-01-07 21:09:28.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/194 check header/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -2,11 +2,11 @@ host_system = host_machine.system() -non_existent_header = 'ouagadougou.h' +non_existant_header = 'ouagadougou.h' # Copy it into the builddir to ensure that it isn't found even if it's there -configure_file(input : non_existent_header, - output : non_existent_header, +configure_file(input : non_existant_header, + output : non_existant_header, copy: true) fallback = '' @@ -43,6 +43,6 @@ # This header exists in the source and the builddir, but we still must not # find it since we are looking in the system directories. - assert(not comp.check_header(non_existent_header, prefix : fallback), - 'Found non-existent header.') + assert(not comp.check_header(non_existant_header, prefix : fallback), + 'Found non-existant header.') endforeach diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/195 install_mode/stat.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/195 install_mode/stat.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/195 install_mode/stat.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/195 install_mode/stat.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1 +1 @@ -int func(void) { return 933; } +int func() { return 933; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/195 install_mode/trivial.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/195 install_mode/trivial.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/195 install_mode/trivial.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/195 install_mode/trivial.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #include -int main(void) { +int main(int argc, char **argv) { printf("Trivial test is working.\n"); return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/19 includedir/include/func.h" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/19 includedir/include/func.h" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/19 includedir/include/func.h" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/19 includedir/include/func.h" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #ifndef FUNC_H__ #define FUNC_H__ -int func(void); +int func(); #endif diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/19 includedir/src/func.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/19 includedir/src/func.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/19 includedir/src/func.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/19 includedir/src/func.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ #include "func.h" -int func(void) { +int func() { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/19 includedir/src/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/19 includedir/src/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/19 includedir/src/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/19 includedir/src/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ #include "func.h" -int main(void) { +int main(int argc, char **argv) { return func(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/1 trivial/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/1 trivial/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/1 trivial/meson.build" 2020-01-07 21:06:11.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/1 trivial/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -2,7 +2,7 @@ project('trivial test', # Comment inside a function call + array for language list ['c'], - meson_version : '>=0.52.0') + meson_version : '>=0.27.0') #this is a comment sources = 'trivial.c' diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/1 trivial/trivial.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/1 trivial/trivial.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/1 trivial/trivial.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/1 trivial/trivial.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #include -int main(void) { +int main(int argc, char **argv) { printf("Trivial test is working.\n"); return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/200 generator in subdir/com/mesonbuild/genprog.py" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/200 generator in subdir/com/mesonbuild/genprog.py" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/200 generator in subdir/com/mesonbuild/genprog.py" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/200 generator in subdir/com/mesonbuild/genprog.py" 2019-11-28 17:37:44.000000000 +0000 @@ -4,12 +4,12 @@ h_templ = '''#pragma once -int %s(void); +int %s(); ''' c_templ = '''#include"%s.h" -int %s(void) { +int %s() { return 0; } ''' diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/200 generator in subdir/com/mesonbuild/testprog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/200 generator in subdir/com/mesonbuild/testprog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/200 generator in subdir/com/mesonbuild/testprog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/200 generator in subdir/com/mesonbuild/testprog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ #include"subbie.h" -int main(void) { +int main(int argc, char **argv) { return subbie(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/201 override with exe/subprojects/sub/foobar.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/201 override with exe/subprojects/sub/foobar.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/201 override with exe/subprojects/sub/foobar.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/201 override with exe/subprojects/sub/foobar.c" 2019-11-28 17:37:44.000000000 +0000 @@ -2,7 +2,6 @@ #include int main(int argc, char* argv[]) { - assert(argc == 2); FILE *f = fopen(argv[1], "w"); const char msg[] = "int main(void) {return 0;}\n"; size_t w = fwrite(msg, 1, sizeof(msg) - 1, f); diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/202 subproject with features/nothing.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/202 subproject with features/nothing.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/202 subproject with features/nothing.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/202 subproject with features/nothing.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,4 +1,4 @@ -int main(void) +int main(int argc, char const *argv[]) { return 0; -} +} \ No newline at end of file diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/202 subproject with features/subprojects/disabled_sub/lib/sub.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/202 subproject with features/subprojects/disabled_sub/lib/sub.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/202 subproject with features/subprojects/disabled_sub/lib/sub.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/202 subproject with features/subprojects/disabled_sub/lib/sub.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ #include "sub.h" -int sub(void) { +int sub() { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/202 subproject with features/subprojects/sub/lib/sub.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/202 subproject with features/subprojects/sub/lib/sub.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/202 subproject with features/subprojects/sub/lib/sub.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/202 subproject with features/subprojects/sub/lib/sub.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ #include "sub.h" -int sub(void) { +int sub() { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/202 subproject with features/subprojects/sub/lib/sub.h" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/202 subproject with features/subprojects/sub/lib/sub.h" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/202 subproject with features/subprojects/sub/lib/sub.h" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/202 subproject with features/subprojects/sub/lib/sub.h" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #ifndef SUB_H #define SUB_H -int sub(void); +int sub(); #endif diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/203 function attributes/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/203 function attributes/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/203 function attributes/meson.build" 2020-01-07 21:09:40.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/203 function attributes/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -20,7 +20,7 @@ cpp = meson.get_compiler('cpp') if c.get_id() == 'pgi' - error('MESON_SKIP_TEST: PGI supports its own set of features, will need a separate list for PGI to test it.') + error('MESON_SKIP_TEST: PGI supports its own set of features, will need a seperate list for PGI to test it.') endif expected_result = not ['msvc', 'clang-cl', 'intel-cl'].contains(c.get_id()) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/206 install name_prefix name_suffix/installed_files.txt" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/206 install name_prefix name_suffix/installed_files.txt" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/206 install name_prefix name_suffix/installed_files.txt" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/206 install name_prefix name_suffix/installed_files.txt" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,9 @@ ?msvc:usr/bin/baz.pdb ?msvc:usr/bin/bowcorge.pdb ?msvc:usr/bin/foo.pdb +?msvc:usr/lib/baz.pdb +?msvc:usr/lib/bowcorge.pdb +?msvc:usr/lib/foo.pdb usr/?lib/bowcorge.stern usr/lib/?libbaz.cheese usr/lib/bar.a diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/206 install name_prefix name_suffix/libfile.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/206 install name_prefix name_suffix/libfile.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/206 install name_prefix name_suffix/libfile.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/206 install name_prefix name_suffix/libfile.c" 2019-11-28 17:37:44.000000000 +0000 @@ -9,6 +9,6 @@ #endif #endif -int DLL_PUBLIC func(void) { +int DLL_PUBLIC func() { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/207 kwarg entry/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/207 kwarg entry/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/207 kwarg entry/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/207 kwarg entry/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,7 +1,7 @@ #include #include -int main(void) { +int main(int argc, char **argv) { printf(MESSAGE); return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/20 header in file list/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/20 header in file list/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/20 header in file list/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/20 header in file list/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ #include "header.h" -int main(void) { return 0; } +int main(int argc, char **argv) { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/212 native file path override/main.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/212 native file path override/main.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/212 native file path override/main.cpp" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/212 native file path override/main.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ #include -int main(void) { +int main() { std::cout << "Hello world!" << std::endl; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/215 link custom/custom_stlib.py" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/215 link custom/custom_stlib.py" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/215 link custom/custom_stlib.py" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/215 link custom/custom_stlib.py" 2019-11-28 17:37:44.000000000 +0000 @@ -1,7 +1,6 @@ #!/usr/bin/env python3 import shutil, sys, subprocess, argparse, pathlib -import platform parser = argparse.ArgumentParser() @@ -11,17 +10,11 @@ contents = '''#include -void flob(void) { +void flob() { printf("Now flobbing.\\n"); } ''' -def get_pic_args(): - platname = platform.system().lower() - if platname in ['windows', 'mingw', 'darwin'] or platname.startswith('cygwin'): - return [] - return ['-fPIC'] - def generate_lib_gnulike(outfile, c_file, private_dir, compiler_array): if shutil.which('ar'): static_linker = 'ar' @@ -33,7 +26,6 @@ sys.exit('Could not detect a static linker.') o_file = c_file.with_suffix('.o') compile_cmd = compiler_array + ['-c', '-g', '-O2', '-o', str(o_file), str(c_file)] - compile_cmd += get_pic_args() subprocess.check_call(compile_cmd) out_file = pathlib.Path(outfile) if out_file.exists(): diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/215 link custom/lib.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/215 link custom/lib.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/215 link custom/lib.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/215 link custom/lib.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -void flob(void); - -int foo(void) -{ - flob(); - return 0; -} diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/215 link custom/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/215 link custom/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/215 link custom/meson.build" 2020-01-07 21:09:48.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/215 link custom/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -46,8 +46,6 @@ exe2_i = executable('prog2_i', 'prog.c', dependencies: d_i) test('linkcustom2_i', exe2_i) -shared_library('lib1', 'lib.c', link_whole: clib) - # Link whole tests exe3_i = executable('prog3_i', 'prog.c', link_whole: clib[0]) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/215 link custom/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/215 link custom/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/215 link custom/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/215 link custom/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ -void flob(void); +void flob(); -int main(void) { +int main(int argc, char **argv) { flob(); return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/216 link custom_i single from multiple/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/216 link custom_i single from multiple/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/216 link custom_i single from multiple/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/216 link custom_i single from multiple/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ -int flob(void); +int flob(); -int main(void) { +int main(int argc, char **argv) { return (flob() == 1 ? 0 : 1); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/217 link custom_i multiple from multiple/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/217 link custom_i multiple from multiple/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/217 link custom_i multiple from multiple/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/217 link custom_i multiple from multiple/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,7 +1,7 @@ -void flob_1(void); -void flob_2(void); +void flob_1(); +void flob_2(); -int main(void) { +int main(int argc, char **argv) { flob_1(); flob_2(); return 0; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/218 dependency get_variable method/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/218 dependency get_variable method/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/218 dependency get_variable method/meson.build" 2020-01-07 21:09:53.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/218 dependency get_variable method/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -8,7 +8,7 @@ dep = dependency('zlib', method: 'pkg-config', required : false) if not dep.found() - warning('Skipping pkg-config tests as zlib is not available or is not pkg-config') + warning('Skipping pkg-config tests as zlib is not avialable or is not pkg-config') else # Test for regular pkg-config # We don't know what the value will be, but we know it should be the same @@ -16,9 +16,9 @@ assert(dep.get_pkgconfig_variable('prefix') == dep.get_variable(pkgconfig : 'prefix'), 'Got different values from get_pkgconfig_variable and get_variable(pkgconfig: )') assert(dep.get_variable(pkgconfig : default, default_value : default) == default, - 'pkg-config didn\'t get default when we should have.') + 'pkg-config didnt get default when we should have.') assert(dep.get_variable(pkgconfig : 'prefix', default_value : default) != default, - 'pkg-config got default when we shouldn\'t have.') + 'pkg-config got default when we shouldnt have.') endif dep_ct = dependency('llvm', method : 'config-tool', required : false) @@ -28,9 +28,9 @@ assert(dep_ct.get_configtool_variable('has-rtti') == dep_ct.get_variable(configtool : 'has-rtti'), 'Got different values from get_configtool_variable and get_variable(configtool: )') assert(dep_ct.get_variable(configtool : default, default_value : default) == default, - 'config-tool didn\'t get default when we should have.') + 'config-tool didnt get default when we should have.') assert(dep_ct.get_variable(configtool : 'has-rtti', default_value : default) != default, - 'config-tool got default when we shouldn\'t have.') + 'config-tool got default when we shouldnt have.') endif dep_cm = dependency('llvm', method : 'cmake', required : false) @@ -42,9 +42,9 @@ 'RTTI information for cmake and config tools disagree') endif assert(dep_cm.get_variable(cmake : default, default_value : default) == default, - 'cmake didn\'t get default when we should have.') + 'cmake didnt get default when we should have.') assert(dep_cm.get_variable(cmake : 'LLVM_ENABLE_RTTI', default_value : default) != default, - 'cmake config-tool got default when we shouldn\'t have.') + 'cmake config-tool got default when we shouldnt have.') endif idep = declare_dependency() diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/21 global arg/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/21 global arg/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/21 global arg/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/21 global arg/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -38,6 +38,6 @@ #endif #endif -int main(void) { +int main(int argc, char **argv) { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/21 global arg/prog.cc" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/21 global arg/prog.cc" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/21 global arg/prog.cc" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/21 global arg/prog.cc" 2019-11-28 17:37:44.000000000 +0000 @@ -10,6 +10,6 @@ #error "Global argument not set" #endif -int main(void) { +int main(int argc, char **argv) { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/222 source set realistic example/main.cc" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/222 source set realistic example/main.cc" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/222 source set realistic example/main.cc" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/222 source set realistic example/main.cc" 2019-11-28 17:37:44.000000000 +0000 @@ -15,7 +15,7 @@ Dependency::Dependency() { this->next = deps; deps = this; } Dependency::~Dependency() {} -int main(void) +int main() { some_random_function(); for (auto d = deps; d; d = d->next) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/222 source set realistic example/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/222 source set realistic example/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/222 source set realistic example/meson.build" 2020-01-23 21:41:11.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/222 source set realistic example/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -1,7 +1,7 @@ # a sort-of realistic example that combines the sourceset and kconfig # modules, inspired by QEMU's build system -project('sourceset-example', 'cpp', default_options: ['cpp_std=c++11']) +project('sourceset-example', 'cpp') cppid = meson.get_compiler('cpp').get_id() if cppid == 'pgi' diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/223 custom target input extracted objects/libdir/source.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/223 custom target input extracted objects/libdir/source.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/223 custom target input extracted objects/libdir/source.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/223 custom target input extracted objects/libdir/source.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int func1_in_obj(void) { +int func1_in_obj() { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/225 include_dir dot/src/main.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/225 include_dir dot/src/main.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/225 include_dir dot/src/main.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/225 include_dir dot/src/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ #include "rone.h" -int main(void) { +int main() { return rOne(); -} +} \ No newline at end of file diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/227 fs module/a_symlink" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/227 fs module/a_symlink" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/227 fs module/a_symlink" 2020-01-07 21:10:02.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/227 fs module/a_symlink" 1970-01-01 00:00:00.000000000 +0000 @@ -1,87 +0,0 @@ -project('fs module test') - -is_windows = build_machine.system() == 'windows' - -fs = import('fs') - -assert(fs.exists('meson.build'), 'Existing file reported as missing.') -assert(not fs.exists('nonexisting'), 'Nonexisting file was found.') - -# When one creates a source release with sdist, Python -# does not store symlinks in the archive as native symlinks. -# Thus the extracted archive does not contain them either. -# Sadly this means that we can only execute the symlink test when -# running from a git checkout because otherwise we'd need to -# do postprocessing on the generated archive before actual release. -# That is both nonstandard an error prone and having symlinks in -# the archive would probably break on Windows anyway. -is_git_checkout = fs.exists('../../../.git') - -if not is_windows and build_machine.system() != 'cygwin' and is_git_checkout - assert(fs.is_symlink('a_symlink'), 'Symlink not detected.') - assert(not fs.is_symlink('meson.build'), 'Regular file detected as symlink.') -endif - -assert(fs.is_file('meson.build'), 'File not detected as a file.') -assert(not fs.is_file('subprojects'), 'Directory detected as a file.') -assert(not fs.is_file('nonexisting'), 'Bad path detected as a file.') - -assert(fs.is_dir('subprojects'), 'Dir not detected correctly.') -assert(not fs.is_dir('meson.build'), 'File detected as a dir.') -assert(not fs.is_dir('nonexisting'), 'Bad path detected as a dir.') - -assert(fs.is_dir('~'), 'expanduser not working') -assert(not fs.is_file('~'), 'expanduser not working') - -original = 'foo.txt' -new = fs.replace_suffix(original, '.ini') -assert(new == 'foo.ini', 'replace_suffix failed') - -original = 'foo' -new = fs.replace_suffix(original, '.ini') -assert(new == 'foo.ini', 'replace_suffix did not add suffix to suffixless file') - -original = 'foo.dll.a' -new = fs.replace_suffix(original, '.so') -assert(new == 'foo.dll.so', 'replace_suffix did not only modify last suffix') - -original = 'foo.dll' -new = fs.replace_suffix(original, '') -assert(new == 'foo', 'replace_suffix did not only delete last suffix') - -# `/` on windows is interpreted like `.drive` which in general may not be `c:/` -# the files need not exist for fs.replace_suffix() -original = is_windows ? 'j:/foo/bar.txt' : '/foo/bar.txt' -new_check = is_windows ? 'j:\\foo\\bar.ini' : '/foo/bar.ini' - -new = fs.replace_suffix(original, '.ini') -assert(new == new_check, 'absolute path replace_suffix failed') - -# -- hash - -md5 = fs.hash('subdir/subdirfile.txt', 'md5') -sha256 = fs.hash('subdir/subdirfile.txt', 'sha256') -assert(md5 == 'd0795db41614d25affdd548314b30b3b', 'md5sum did not match') -assert(sha256 == 'be2170b0dae535b73f6775694fffa3fd726a43b5fabea11b7342f0605917a42a', 'sha256sum did not match') - -# -- size - -size = fs.size('subdir/subdirfile.txt') -assert(size == 19, 'file size not found correctly') - -# -- are filenames referring to the same file? -f1 = 'meson.build' -f2 = 'subdir/../meson.build' -assert(fs.is_samepath(f1, f2), 'is_samepath not detercting same files') -assert(fs.is_samepath(meson.source_root(), 'subdir/..'), 'is_samepath not detecting same directory') -assert(not fs.is_samepath(f1, 'subdir/subdirfile.txt'), 'is_samepath known bad comparison') -assert(not fs.is_samepath('not-a-path', f2), 'is_samepath should not error if path(s) do not exist') - -if not is_windows and build_machine.system() != 'cygwin' and is_git_checkout - assert(fs.is_samepath('a_symlink', 'meson.build'), 'symlink is_samepath fail') -endif - -assert(fs.parent('foo/bar') == 'foo', 'failed to get dirname') -assert(fs.name('foo/bar') == 'bar', 'failed to get basename') - -subdir('subdir') diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/227 fs module/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/227 fs module/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/227 fs module/meson.build" 2020-01-07 21:10:02.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/227 fs module/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,87 +0,0 @@ -project('fs module test') - -is_windows = build_machine.system() == 'windows' - -fs = import('fs') - -assert(fs.exists('meson.build'), 'Existing file reported as missing.') -assert(not fs.exists('nonexisting'), 'Nonexisting file was found.') - -# When one creates a source release with sdist, Python -# does not store symlinks in the archive as native symlinks. -# Thus the extracted archive does not contain them either. -# Sadly this means that we can only execute the symlink test when -# running from a git checkout because otherwise we'd need to -# do postprocessing on the generated archive before actual release. -# That is both nonstandard an error prone and having symlinks in -# the archive would probably break on Windows anyway. -is_git_checkout = fs.exists('../../../.git') - -if not is_windows and build_machine.system() != 'cygwin' and is_git_checkout - assert(fs.is_symlink('a_symlink'), 'Symlink not detected.') - assert(not fs.is_symlink('meson.build'), 'Regular file detected as symlink.') -endif - -assert(fs.is_file('meson.build'), 'File not detected as a file.') -assert(not fs.is_file('subprojects'), 'Directory detected as a file.') -assert(not fs.is_file('nonexisting'), 'Bad path detected as a file.') - -assert(fs.is_dir('subprojects'), 'Dir not detected correctly.') -assert(not fs.is_dir('meson.build'), 'File detected as a dir.') -assert(not fs.is_dir('nonexisting'), 'Bad path detected as a dir.') - -assert(fs.is_dir('~'), 'expanduser not working') -assert(not fs.is_file('~'), 'expanduser not working') - -original = 'foo.txt' -new = fs.replace_suffix(original, '.ini') -assert(new == 'foo.ini', 'replace_suffix failed') - -original = 'foo' -new = fs.replace_suffix(original, '.ini') -assert(new == 'foo.ini', 'replace_suffix did not add suffix to suffixless file') - -original = 'foo.dll.a' -new = fs.replace_suffix(original, '.so') -assert(new == 'foo.dll.so', 'replace_suffix did not only modify last suffix') - -original = 'foo.dll' -new = fs.replace_suffix(original, '') -assert(new == 'foo', 'replace_suffix did not only delete last suffix') - -# `/` on windows is interpreted like `.drive` which in general may not be `c:/` -# the files need not exist for fs.replace_suffix() -original = is_windows ? 'j:/foo/bar.txt' : '/foo/bar.txt' -new_check = is_windows ? 'j:\\foo\\bar.ini' : '/foo/bar.ini' - -new = fs.replace_suffix(original, '.ini') -assert(new == new_check, 'absolute path replace_suffix failed') - -# -- hash - -md5 = fs.hash('subdir/subdirfile.txt', 'md5') -sha256 = fs.hash('subdir/subdirfile.txt', 'sha256') -assert(md5 == 'd0795db41614d25affdd548314b30b3b', 'md5sum did not match') -assert(sha256 == 'be2170b0dae535b73f6775694fffa3fd726a43b5fabea11b7342f0605917a42a', 'sha256sum did not match') - -# -- size - -size = fs.size('subdir/subdirfile.txt') -assert(size == 19, 'file size not found correctly') - -# -- are filenames referring to the same file? -f1 = 'meson.build' -f2 = 'subdir/../meson.build' -assert(fs.is_samepath(f1, f2), 'is_samepath not detercting same files') -assert(fs.is_samepath(meson.source_root(), 'subdir/..'), 'is_samepath not detecting same directory') -assert(not fs.is_samepath(f1, 'subdir/subdirfile.txt'), 'is_samepath known bad comparison') -assert(not fs.is_samepath('not-a-path', f2), 'is_samepath should not error if path(s) do not exist') - -if not is_windows and build_machine.system() != 'cygwin' and is_git_checkout - assert(fs.is_samepath('a_symlink', 'meson.build'), 'symlink is_samepath fail') -endif - -assert(fs.parent('foo/bar') == 'foo', 'failed to get dirname') -assert(fs.name('foo/bar') == 'bar', 'failed to get basename') - -subdir('subdir') diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/227 fs module/subdir/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/227 fs module/subdir/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/227 fs module/subdir/meson.build" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/227 fs module/subdir/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -assert(fs.exists('subdirfile.txt'), 'Subdir file lookup is broken.') diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/227 fs module/subdir/subdirfile.txt" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/227 fs module/subdir/subdirfile.txt" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/227 fs module/subdir/subdirfile.txt" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/227 fs module/subdir/subdirfile.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -I have no content. diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/227 fs module/subprojects/subbie/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/227 fs module/subprojects/subbie/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/227 fs module/subprojects/subbie/meson.build" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/227 fs module/subprojects/subbie/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -project('subbie') - -fs = import('fs') - -assert(fs.exists('subprojectfile.txt'), 'Subproject root file not found.') - -subdir('subsub') - -subproject('subbie') diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/227 fs module/subprojects/subbie/subprojectfile.txt" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/227 fs module/subprojects/subbie/subprojectfile.txt" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/227 fs module/subprojects/subbie/subprojectfile.txt" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/227 fs module/subprojects/subbie/subprojectfile.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -I'm not empty. So there's at least that. diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/227 fs module/subprojects/subbie/subsub/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/227 fs module/subprojects/subbie/subsub/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/227 fs module/subprojects/subbie/subsub/meson.build" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/227 fs module/subprojects/subbie/subsub/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -assert(fs.exists('subsubfile.txt'), 'Subproject subdir lookup failed.') diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/227 fs module/subprojects/subbie/subsub/subsubfile.txt" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/227 fs module/subprojects/subbie/subsub/subsubfile.txt" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/227 fs module/subprojects/subbie/subsub/subsubfile.txt" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/227 fs module/subprojects/subbie/subsub/subsubfile.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Thank you for looking inside me. diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/22 target arg/func2.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/22 target arg/func2.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/22 target arg/func2.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/22 target arg/func2.c" 2019-11-28 17:37:44.000000000 +0000 @@ -6,4 +6,4 @@ #error "Local CPP argument set in wrong target" #endif -int func(void) { return 0; } +int func() { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/22 target arg/func.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/22 target arg/func.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/22 target arg/func.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/22 target arg/func.c" 2019-11-28 17:37:44.000000000 +0000 @@ -6,4 +6,4 @@ #error "Wrong local argument set" #endif -int func(void) { return 0; } +int func() { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/22 target arg/prog2.cc" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/22 target arg/prog2.cc" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/22 target arg/prog2.cc" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/22 target arg/prog2.cc" 2019-11-28 17:37:44.000000000 +0000 @@ -8,6 +8,6 @@ extern "C" int func(); -int main(void) { +int main(int argc, char **argv) { return func(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/22 target arg/prog.cc" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/22 target arg/prog.cc" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/22 target arg/prog.cc" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/22 target arg/prog.cc" 2019-11-28 17:37:44.000000000 +0000 @@ -8,6 +8,6 @@ extern "C" int func(); -int main(void) { +int main(int argc, char **argv) { return func(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/23 object extraction/lib2.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/23 object extraction/lib2.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/23 object extraction/lib2.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/23 object extraction/lib2.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int retval(void) { +int retval() { return 43; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/23 object extraction/lib.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/23 object extraction/lib.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/23 object extraction/lib.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/23 object extraction/lib.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int func(void) { +int func() { return 42; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/23 object extraction/main.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/23 object extraction/main.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/23 object extraction/main.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/23 object extraction/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ -int func(void); +int func(); -int main(void) { +int main(int argc, char **argv) { return func() == 42 ? 0 : 1; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/23 object extraction/src/lib.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/23 object extraction/src/lib.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/23 object extraction/src/lib.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/23 object extraction/src/lib.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int func(void) { +int func() { return 42; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/24 endian/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/24 endian/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/24 endian/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/24 endian/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -8,7 +8,7 @@ } -int main(void) { +int main(int argc, char **argv) { int is_be_check = is_big_endian(); int is_be; #ifdef IS_BE diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/25 library versions/lib.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/25 library versions/lib.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/25 library versions/lib.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/25 library versions/lib.c" 2019-11-28 17:37:44.000000000 +0000 @@ -9,6 +9,6 @@ #endif #endif -int DLL_PUBLIC myFunc(void) { +int DLL_PUBLIC myFunc() { return 55; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/26 config subdir/src/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/26 config subdir/src/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/26 config subdir/src/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/26 config subdir/src/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ #include "config.h" -int main(void) { +int main(int argc, char **argv) { return RETURN_VALUE; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/27 pipeline/depends/filecopier.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/27 pipeline/depends/filecopier.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/27 pipeline/depends/filecopier.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/27 pipeline/depends/filecopier.c" 2019-11-28 17:37:44.000000000 +0000 @@ -9,7 +9,6 @@ size_t num_written; FILE *fin = fopen(argv[1], "rb"); FILE *fout; - assert(argc>0); assert(fin); num_read = fread(buffer, 1, BUFSIZE, fin); assert(num_read > 0); diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/27 pipeline/depends/libsrc.c.in" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/27 pipeline/depends/libsrc.c.in" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/27 pipeline/depends/libsrc.c.in" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/27 pipeline/depends/libsrc.c.in" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int func(void) { +int func() { return 42; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/27 pipeline/depends/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/27 pipeline/depends/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/27 pipeline/depends/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/27 pipeline/depends/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ -int func(void); +int func(); -int main(void) { +int main(int argc, char **argv) { return func() != 42; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/27 pipeline/input_src.dat" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/27 pipeline/input_src.dat" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/27 pipeline/input_src.dat" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/27 pipeline/input_src.dat" 2019-11-28 17:37:44.000000000 +0000 @@ -1 +1 @@ -int func(void) { return 0; } +int func() { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/27 pipeline/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/27 pipeline/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/27 pipeline/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/27 pipeline/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ -int func(void); +int func(); -int main(void) { +int main(int argc, char **argv) { return func(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/27 pipeline/src/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/27 pipeline/src/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/27 pipeline/src/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/27 pipeline/src/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #include"input_src.h" -int main(void) { +int main(int argc, char **argv) { void *foo = printf; if(foo) { return 0; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/28 find program/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/28 find program/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/28 find program/meson.build" 2020-01-07 21:06:36.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/28 find program/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -27,9 +27,3 @@ prog = find_program('print-version-with-prefix.py', version : '>=1.0') assert(prog.found(), 'Program version should match') - -prog = find_program('test_subdir.py', required : false) -assert(not prog.found(), 'Program should not be found') - -prog = find_program('test_subdir.py', dirs : ['/donotexist', meson.current_source_dir() / 'scripts']) -assert(prog.found(), 'Program should be found') diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/28 find program/scripts/test_subdir.py" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/28 find program/scripts/test_subdir.py" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/28 find program/scripts/test_subdir.py" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/28 find program/scripts/test_subdir.py" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -#!/usr/bin/env python3 - -exit(0) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/28 find program/source.in" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/28 find program/source.in" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/28 find program/source.in" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/28 find program/source.in" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int main(void) { +int main(int argc, char **argv) { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/29 multiline string/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/29 multiline string/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/29 multiline string/meson.build" 2020-01-07 21:06:37.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/29 multiline string/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -26,7 +26,7 @@ cc = meson.get_compiler('c') prog = ''' -int main(void) { +int main(int argc, char **argv) { int num = 1; printf("%d\n", num); return 0; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/2 cpp/trivial.cc" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/2 cpp/trivial.cc" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/2 cpp/trivial.cc" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/2 cpp/trivial.cc" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #include -int main(void) { +int main(int argc, char **argv) { std::cout << "C++ seems to be working." << std::endl; return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/30 try compile/invalid.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/30 try compile/invalid.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/30 try compile/invalid.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/30 try compile/invalid.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,2 +1,2 @@ #include -void func(void) { printf("This won't work.\n"); } +void func() { printf("This won't work.\n"); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/30 try compile/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/30 try compile/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/30 try compile/meson.build" 2020-01-07 21:06:38.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/30 try compile/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -1,11 +1,11 @@ project('try compile', 'c', 'cpp') code = '''#include -void func(void) { printf("Something.\n"); } +void func() { printf("Something.\n"); } ''' breakcode = '''#include -void func(void) { printf("This won't work.\n"); } +void func() { printf("This won't work.\n"); } ''' foreach compiler : [meson.get_compiler('c'), meson.get_compiler('cpp')] diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/30 try compile/valid.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/30 try compile/valid.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/30 try compile/valid.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/30 try compile/valid.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,2 +1,2 @@ #include -void func(void) { printf("Something.\n"); } +void func() { printf("Something.\n"); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/31 compiler id/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/31 compiler id/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/31 compiler id/meson.build" 2020-01-07 21:06:39.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/31 compiler id/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -1,15 +1,7 @@ -project('compiler_id') +project('compiler id', 'c') -foreach lang : ['c', 'cpp', 'fortran', 'objc', 'objcpp'] +comp = meson.get_compiler('c') +str = comp.get_id() - if not add_languages(lang, required: false) - continue - endif - - comp = meson.get_compiler(lang) - - message(lang + ' compiler name is: ' + comp.get_id()) - - message(lang + ' linker name is: ' + comp.get_linker_id()) - -endforeach \ No newline at end of file +message('Compiler name is:') +message(str) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/32 sizeof/prog.c.in" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/32 sizeof/prog.c.in" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/32 sizeof/prog.c.in" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/32 sizeof/prog.c.in" 2019-11-28 17:37:44.000000000 +0000 @@ -2,7 +2,7 @@ #include #include -int main(void) { +int main(int argc, char **argv) { if(INTSIZE != sizeof(int)) { fprintf(stderr, "Mismatch: detected int size %d, actual size %d.\n", INTSIZE, (int)sizeof(int)); return 1; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/33 define10/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/33 define10/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/33 define10/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/33 define10/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,7 +1,7 @@ #include #include"config.h" -int main(void) { +int main(int argc, char **argv) { if(ONE != 1) { fprintf(stderr, "ONE is not 1.\n"); return 1; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/34 has header/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/34 has header/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/34 has header/meson.build" 2020-01-07 21:06:42.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/34 has header/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -2,11 +2,11 @@ host_system = host_machine.system() -non_existent_header = 'ouagadougou.h' +non_existant_header = 'ouagadougou.h' # Copy it into the builddir to ensure that it isn't found even if it's there -configure_file(input : non_existent_header, - output : non_existent_header, +configure_file(input : non_existant_header, + output : non_existant_header, configuration : configuration_data()) # Test that the fallback to __has_include also works on all compilers @@ -48,7 +48,7 @@ # This header exists in the source and the builddir, but we still must not # find it since we are looking in the system directories. - assert(not comp.has_header(non_existent_header, prefix : fallback), - 'Found non-existent header.') + assert(not comp.has_header(non_existant_header, prefix : fallback), + 'Found non-existant header.') endforeach endforeach diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/36 tryrun/error.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/36 tryrun/error.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/36 tryrun/error.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/36 tryrun/error.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int main(void) { +int main(int argc, char **argv) { return 1; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/36 tryrun/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/36 tryrun/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/36 tryrun/meson.build" 2020-01-07 21:06:46.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/36 tryrun/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -12,19 +12,19 @@ endif ok_code = '''#include -int main(void) { +int main(int argc, char **argv) { printf("%s\n", "stdout"); fprintf(stderr, "%s\n", "stderr"); return 0; } ''' -error_code = '''int main(void) { +error_code = '''int main(int argc, char **argv) { return 1; } ''' -no_compile_code = '''int main(void) { +no_compile_code = '''int main(int argc, char **argv) { ''' INPUTS = [ diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/36 tryrun/no_compile.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/36 tryrun/no_compile.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/36 tryrun/no_compile.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/36 tryrun/no_compile.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1 +1 @@ -int main(void) { +int main(int argc, char **argv) { diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/36 tryrun/ok.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/36 tryrun/ok.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/36 tryrun/ok.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/36 tryrun/ok.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,5 @@ #include - -int main(void) { +int main(int argc, char **argv) { printf("%s\n", "stdout"); fprintf(stderr, "%s\n", "stderr"); return 0; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/3 static/libfile2.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/3 static/libfile2.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/3 static/libfile2.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/3 static/libfile2.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int libfunc2(void) { +int libfunc2() { return 4; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/3 static/libfile.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/3 static/libfile.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/3 static/libfile.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/3 static/libfile.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int libfunc(void) { +int libfunc() { return 3; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/42 library chain/main.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/42 library chain/main.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/42 library chain/main.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/42 library chain/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ -int libfun(void); +int libfun(); -int main(void) { +int main() { return libfun(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/42 library chain/subdir/lib1.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/42 library chain/subdir/lib1.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/42 library chain/subdir/lib1.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/42 library chain/subdir/lib1.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ -int lib2fun(void); -int lib3fun(void); +int lib2fun(); +int lib3fun(); #if defined _WIN32 || defined __CYGWIN__ #define DLL_PUBLIC __declspec(dllexport) @@ -12,6 +12,6 @@ #endif #endif -int DLL_PUBLIC libfun(void) { +int DLL_PUBLIC libfun() { return lib2fun() + lib3fun(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/42 library chain/subdir/subdir2/lib2.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/42 library chain/subdir/subdir2/lib2.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/42 library chain/subdir/subdir2/lib2.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/42 library chain/subdir/subdir2/lib2.c" 2019-11-28 17:37:44.000000000 +0000 @@ -9,6 +9,6 @@ #endif #endif -int DLL_PUBLIC lib2fun(void) { +int DLL_PUBLIC lib2fun() { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/42 library chain/subdir/subdir3/lib3.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/42 library chain/subdir/subdir3/lib3.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/42 library chain/subdir/subdir3/lib3.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/42 library chain/subdir/subdir3/lib3.c" 2019-11-28 17:37:44.000000000 +0000 @@ -9,6 +9,6 @@ #endif #endif -int DLL_PUBLIC lib3fun(void) { +int DLL_PUBLIC lib3fun() { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/44 test args/env2vars.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/44 test args/env2vars.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/44 test args/env2vars.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/44 test args/env2vars.c" 2019-11-28 17:37:44.000000000 +0000 @@ -2,7 +2,7 @@ #include #include -int main(void) { +int main(int argc, char **argv) { if(strcmp(getenv("first"), "something-else") != 0) { fprintf(stderr, "First envvar is wrong. %s\n", getenv("first")); return 1; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/44 test args/envvars.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/44 test args/envvars.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/44 test args/envvars.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/44 test args/envvars.c" 2019-11-28 17:37:44.000000000 +0000 @@ -2,7 +2,7 @@ #include #include -int main(void) { +int main(int argc, char **argv) { if(strcmp(getenv("first"), "val1") != 0) { fprintf(stderr, "First envvar is wrong. %s\n", getenv("first")); return 1; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/45 subproject/subprojects/sublib/include/subdefs.h" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/45 subproject/subprojects/sublib/include/subdefs.h" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/45 subproject/subprojects/sublib/include/subdefs.h" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/45 subproject/subprojects/sublib/include/subdefs.h" 2019-11-28 17:37:44.000000000 +0000 @@ -16,6 +16,6 @@ #endif #endif -int DLL_PUBLIC subfunc(void); +int DLL_PUBLIC subfunc(); #endif diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/45 subproject/subprojects/sublib/simpletest.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/45 subproject/subprojects/sublib/simpletest.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/45 subproject/subprojects/sublib/simpletest.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/45 subproject/subprojects/sublib/simpletest.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ #include -int main(void) { +int main(int argc, char **argv) { return subfunc() == 42 ? 0 : 1; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/45 subproject/subprojects/sublib/sublib.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/45 subproject/subprojects/sublib/sublib.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/45 subproject/subprojects/sublib/sublib.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/45 subproject/subprojects/sublib/sublib.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ #include -int DLL_PUBLIC subfunc(void) { +int DLL_PUBLIC subfunc() { return 42; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/45 subproject/user.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/45 subproject/user.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/45 subproject/user.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/45 subproject/user.c" 2019-11-28 17:37:44.000000000 +0000 @@ -2,7 +2,7 @@ #include -int main(void) { +int main(int argc, char **argv) { int res; printf("Calling into sublib now.\n"); res = subfunc(); diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/47 pkgconfig-gen/dependencies/custom.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/47 pkgconfig-gen/dependencies/custom.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/47 pkgconfig-gen/dependencies/custom.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/47 pkgconfig-gen/dependencies/custom.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int custom_function(void) { +int custom_function() { return 42; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/47 pkgconfig-gen/dependencies/exposed.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/47 pkgconfig-gen/dependencies/exposed.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/47 pkgconfig-gen/dependencies/exposed.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/47 pkgconfig-gen/dependencies/exposed.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int exposed_function(void) { +int exposed_function() { return 42; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/47 pkgconfig-gen/dependencies/internal.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/47 pkgconfig-gen/dependencies/internal.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/47 pkgconfig-gen/dependencies/internal.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/47 pkgconfig-gen/dependencies/internal.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int internal_function(void) { +int internal_function() { return 42; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/47 pkgconfig-gen/simple.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/47 pkgconfig-gen/simple.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/47 pkgconfig-gen/simple.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/47 pkgconfig-gen/simple.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ #include"simple.h" -int simple_function(void) { +int simple_function() { return 42; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/47 pkgconfig-gen/simple.h" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/47 pkgconfig-gen/simple.h" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/47 pkgconfig-gen/simple.h" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/47 pkgconfig-gen/simple.h" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #ifndef SIMPLE_H_ #define SIMPLE_H_ -int simple_function(void); +int simple_function(); #endif diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/48 custom install dirs/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/48 custom install dirs/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/48 custom install dirs/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/48 custom install dirs/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int main(void) { +int main(int argc, char **arv) { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/49 subproject subproject/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/49 subproject subproject/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/49 subproject subproject/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/49 subproject subproject/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ -int func(void); +int func(); -int main(void) { +int main(int argc, char **argv) { return func() == 42 ? 0 : 1; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/49 subproject subproject/subprojects/a/a.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/49 subproject subproject/subprojects/a/a.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/49 subproject subproject/subprojects/a/a.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/49 subproject subproject/subprojects/a/a.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,4 +1,4 @@ -int func2(void); +int func2(); #if defined _WIN32 || defined __CYGWIN__ #define DLL_PUBLIC __declspec(dllexport) @@ -11,5 +11,5 @@ #endif #endif -int DLL_PUBLIC func(void) { return func2(); } +int DLL_PUBLIC func() { return func2(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/49 subproject subproject/subprojects/b/b.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/49 subproject subproject/subprojects/b/b.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/49 subproject subproject/subprojects/b/b.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/49 subproject subproject/subprojects/b/b.c" 2019-11-28 17:37:44.000000000 +0000 @@ -9,6 +9,6 @@ #endif #endif -int DLL_PUBLIC func2(void) { +int DLL_PUBLIC func2() { return 42; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/4 shared/libfile.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/4 shared/libfile.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/4 shared/libfile.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/4 shared/libfile.c" 2019-11-28 17:37:44.000000000 +0000 @@ -9,6 +9,6 @@ #endif #endif -int DLL_PUBLIC libfunc(void) { +int DLL_PUBLIC libfunc() { return 3; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/50 same file name/d1/file.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/50 same file name/d1/file.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/50 same file name/d1/file.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/50 same file name/d1/file.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1 +1 @@ -int func1(void) { return 42; } +int func1() { return 42; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/50 same file name/d2/file.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/50 same file name/d2/file.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/50 same file name/d2/file.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/50 same file name/d2/file.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1 +1 @@ -int func2(void) { return 42; } +int func2() { return 42; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/50 same file name/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/50 same file name/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/50 same file name/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/50 same file name/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ -int func1(void); -int func2(void); +int func1(); +int func2(); -int main(void) { +int main(int argc, char **argv) { return func1() - func2(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/51 file grabber/a.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/51 file grabber/a.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/51 file grabber/a.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/51 file grabber/a.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1 +1 @@ -int funca(void) { return 0; } +int funca() { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/51 file grabber/b.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/51 file grabber/b.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/51 file grabber/b.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/51 file grabber/b.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1 +1 @@ -int funcb(void) { return 0; } +int funcb() { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/51 file grabber/c.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/51 file grabber/c.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/51 file grabber/c.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/51 file grabber/c.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1 +1 @@ -int funcc(void) { return 0; } +int funcc() { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/51 file grabber/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/51 file grabber/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/51 file grabber/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/51 file grabber/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,7 +1,7 @@ -int funca(void); -int funcb(void); -int funcc(void); +int funca(); +int funcb(); +int funcc(); -int main(void) { +int main(int argc, char **argv) { return funca() + funcb() + funcc(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/51 file grabber/subdir/suba.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/51 file grabber/subdir/suba.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/51 file grabber/subdir/suba.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/51 file grabber/subdir/suba.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1 +1 @@ -int funca(void) { return 0; } +int funca() { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/51 file grabber/subdir/subb.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/51 file grabber/subdir/subb.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/51 file grabber/subdir/subb.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/51 file grabber/subdir/subb.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1 +1 @@ -int funcb(void) { return 0; } +int funcb() { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/51 file grabber/subdir/subc.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/51 file grabber/subdir/subc.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/51 file grabber/subdir/subc.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/51 file grabber/subdir/subc.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1 +1 @@ -int funcc(void) { return 0; } +int funcc() { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/51 file grabber/subdir/subprog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/51 file grabber/subdir/subprog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/51 file grabber/subdir/subprog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/51 file grabber/subdir/subprog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,7 +1,7 @@ -int funca(void); -int funcb(void); -int funcc(void); +int funca(); +int funcb(); +int funcc(); -int main(void) { +int main(int argc, char **argv) { return funca() + funcb() + funcc(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/52 custom target/depfile/dep.py" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/52 custom target/depfile/dep.py" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/52 custom target/depfile/dep.py" 2020-01-23 12:51:19.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/52 custom target/depfile/dep.py" 2019-08-28 17:15:39.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python import sys, os from glob import glob diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/53 custom target chain/my_compiler2.py" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/53 custom target chain/my_compiler2.py" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/53 custom target chain/my_compiler2.py" 2020-01-23 12:51:19.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/53 custom target chain/my_compiler2.py" 2019-08-28 17:15:39.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python import sys diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/53 custom target chain/my_compiler.py" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/53 custom target chain/my_compiler.py" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/53 custom target chain/my_compiler.py" 2020-01-23 12:51:19.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/53 custom target chain/my_compiler.py" 2019-08-28 17:15:39.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python import sys diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/53 custom target chain/usetarget/myexe.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/53 custom target chain/usetarget/myexe.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/53 custom target chain/usetarget/myexe.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/53 custom target chain/usetarget/myexe.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #include -int main(void) { +int main(int argc, char **argv) { printf("I am myexe.\n"); return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/53 custom target chain/usetarget/subcomp.py" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/53 custom target chain/usetarget/subcomp.py" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/53 custom target chain/usetarget/subcomp.py" 2020-01-23 12:51:19.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/53 custom target chain/usetarget/subcomp.py" 2019-08-28 17:15:39.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python import sys diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/54 run target/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/54 run target/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/54 run target/meson.build" 2020-01-07 21:07:03.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/54 run target/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -65,10 +65,3 @@ run_target('configure_script', command : conf ) - -# Target names that clash with potential builtin functionality. -run_target('ctags', - command : converter) - -run_target('clang-format', - command : converter) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/55 object generator/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/55 object generator/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/55 object generator/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/55 object generator/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,7 +1,7 @@ -int func1_in_obj(void); -int func2_in_obj(void); -int func3_in_obj(void); +int func1_in_obj(); +int func2_in_obj(); +int func3_in_obj(); -int main(void) { +int main(int argc, char **argv) { return func1_in_obj() + func2_in_obj() + func3_in_obj(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/55 object generator/source2.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/55 object generator/source2.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/55 object generator/source2.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/55 object generator/source2.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int func2_in_obj(void) { +int func2_in_obj() { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/55 object generator/source3.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/55 object generator/source3.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/55 object generator/source3.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/55 object generator/source3.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int func3_in_obj(void) { +int func3_in_obj() { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/55 object generator/source.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/55 object generator/source.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/55 object generator/source.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/55 object generator/source.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int func1_in_obj(void) { +int func1_in_obj() { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/56 install script/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/56 install script/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/56 install script/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/56 install script/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #include -int main(void) { +int main(int argc, char **argv) { printf("This is text.\n"); return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/57 custom target source output/generator.py" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/57 custom target source output/generator.py" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/57 custom target source output/generator.py" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/57 custom target source output/generator.py" 2019-11-28 17:37:44.000000000 +0000 @@ -8,9 +8,9 @@ odir = sys.argv[1] with open(os.path.join(odir, 'mylib.h'), 'w') as f: - f.write('int func(void);\n') + f.write('int func();\n') with open(os.path.join(odir, 'mylib.c'), 'w') as f: - f.write('''int func(void) { + f.write('''int func() { return 0; } ''') diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/57 custom target source output/main.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/57 custom target source output/main.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/57 custom target source output/main.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/57 custom target source output/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ #include"mylib.h" -int main(void) { +int main(int argc, char **argv) { return func(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/58 exe static shared/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/58 exe static shared/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/58 exe static shared/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/58 exe static shared/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,7 +1,7 @@ -int shlibfunc2(void); -int statlibfunc(void); +int shlibfunc2(); +int statlibfunc(); -int main(void) { +int main(int argc, char **argv) { if (statlibfunc() != 42) return 1; if (shlibfunc2() != 24) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/58 exe static shared/stat2.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/58 exe static shared/stat2.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/58 exe static shared/stat2.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/58 exe static shared/stat2.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int statlibfunc2(void) { +int statlibfunc2() { return 18; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/58 exe static shared/stat.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/58 exe static shared/stat.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/58 exe static shared/stat.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/58 exe static shared/stat.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,7 +1,7 @@ #include "subdir/exports.h" -int shlibfunc(void); +int shlibfunc(); -int DLL_PUBLIC statlibfunc(void) { +int DLL_PUBLIC statlibfunc() { return shlibfunc(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/58 exe static shared/subdir/shlib.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/58 exe static shared/subdir/shlib.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/58 exe static shared/subdir/shlib.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/58 exe static shared/subdir/shlib.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ #include "exports.h" -int DLL_PUBLIC shlibfunc(void) { +int DLL_PUBLIC shlibfunc() { return 42; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/5 linkstatic/libfile2.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/5 linkstatic/libfile2.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/5 linkstatic/libfile2.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/5 linkstatic/libfile2.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int func2(void) { +int func2() { return 2; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/5 linkstatic/libfile3.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/5 linkstatic/libfile3.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/5 linkstatic/libfile3.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/5 linkstatic/libfile3.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int func3(void) { +int func3() { return 3; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/5 linkstatic/libfile4.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/5 linkstatic/libfile4.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/5 linkstatic/libfile4.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/5 linkstatic/libfile4.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int func4(void) { +int func4() { return 4; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/5 linkstatic/libfile.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/5 linkstatic/libfile.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/5 linkstatic/libfile.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/5 linkstatic/libfile.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int func(void) { +int func() { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/5 linkstatic/main.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/5 linkstatic/main.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/5 linkstatic/main.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/5 linkstatic/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ -int func(void); +int func(); -int main(void) { +int main(int argc, char **arg) { return func(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/60 custom header generator/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/60 custom header generator/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/60 custom header generator/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/60 custom header generator/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ #include"myheader.lh" -int main(void) { +int main(int argc, char **argv) { return RET_VAL; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/61 multiple generators/main.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/61 multiple generators/main.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/61 multiple generators/main.cpp" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/61 multiple generators/main.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #include"source1.h" #include"source2.h" -int main(void) { +int main(int argc, char **argv) { return func1() + func2(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/62 install subdir/installed_files.txt" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/62 install subdir/installed_files.txt" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/62 install subdir/installed_files.txt" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/62 install subdir/installed_files.txt" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ usr/share/dircheck/fifth.dat usr/share/dircheck/seventh.dat -usr/share/dircheck/ninth.dat +usr/share/dircheck/nineth.dat usr/share/eighth.dat usr/share/fourth.dat usr/share/sixth.dat diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/62 install subdir/nested_elided/sub/dircheck/nineth.dat" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/62 install subdir/nested_elided/sub/dircheck/nineth.dat" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/62 install subdir/nested_elided/sub/dircheck/nineth.dat" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/62 install subdir/nested_elided/sub/dircheck/nineth.dat" 2019-11-28 17:37:44.000000000 +0000 @@ -0,0 +1 @@ +Nested file under nested elided directory. diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/62 install subdir/nested_elided/sub/dircheck/ninth.dat" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/62 install subdir/nested_elided/sub/dircheck/ninth.dat" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/62 install subdir/nested_elided/sub/dircheck/ninth.dat" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/62 install subdir/nested_elided/sub/dircheck/ninth.dat" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Nested file under nested elided directory. diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/63 foreach/prog1.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/63 foreach/prog1.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/63 foreach/prog1.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/63 foreach/prog1.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #include -int main(void) { +int main(int argc, char **argv) { printf("This is test #1.\n"); return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/63 foreach/prog2.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/63 foreach/prog2.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/63 foreach/prog2.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/63 foreach/prog2.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #include -int main(void) { +int main(int argc, char **argv) { printf("This is test #2.\n"); return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/63 foreach/prog3.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/63 foreach/prog3.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/63 foreach/prog3.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/63 foreach/prog3.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #include -int main(void) { +int main(int argc, char **argv) { printf("This is test #3.\n"); return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/68 build always/main.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/68 build always/main.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/68 build always/main.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/68 build always/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,7 +1,7 @@ #include #include"version.h" -int main(void) { +int main(int argc, char **argv) { printf("Version is %s.\n", version_string); return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/69 vcstag/tagprog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/69 vcstag/tagprog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/69 vcstag/tagprog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/69 vcstag/tagprog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -2,7 +2,7 @@ const char *vcstag; -int main(void) { +int main(int argc, char **argv) { printf("Version is %s\n", vcstag); return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/6 linkshared/cpplib.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/6 linkshared/cpplib.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/6 linkshared/cpplib.cpp" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/6 linkshared/cpplib.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -4,6 +4,6 @@ #define DLL_PUBLIC __attribute__ ((visibility ("default"))) #endif -int DLL_PUBLIC cppfunc(void) { +int DLL_PUBLIC cppfunc() { return 42; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/6 linkshared/cppmain.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/6 linkshared/cppmain.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/6 linkshared/cppmain.cpp" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/6 linkshared/cppmain.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ -int cppfunc(void); +int cppfunc(); -int main(void) { +int main(int argc, char **argv) { return cppfunc() != 42; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/6 linkshared/libfile.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/6 linkshared/libfile.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/6 linkshared/libfile.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/6 linkshared/libfile.c" 2019-11-28 17:37:44.000000000 +0000 @@ -9,6 +9,6 @@ #endif #endif -int DLL_PUBLIC func(void) { +int DLL_PUBLIC func() { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/6 linkshared/main.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/6 linkshared/main.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/6 linkshared/main.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/6 linkshared/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -4,8 +4,8 @@ #define DLL_IMPORT #endif -int DLL_IMPORT func(void); +int DLL_IMPORT func(); -int main(void) { +int main(int argc, char **arg) { return func(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/71 should fail/failing.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/71 should fail/failing.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/71 should fail/failing.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/71 should fail/failing.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int main(void) { +int main(int argc, char **argv) { return 1; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/75 shared subproject/a.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/75 shared subproject/a.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/75 shared subproject/a.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/75 shared subproject/a.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,8 +1,8 @@ #include -char func_b(void); -char func_c(void); +char func_b(); +char func_c(); -int main(void) { +int main(int argc, char **argv) { if(func_b() != 'b') { return 1; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/75 shared subproject/subprojects/B/b.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/75 shared subproject/subprojects/B/b.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/75 shared subproject/subprojects/B/b.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/75 shared subproject/subprojects/B/b.c" 2019-11-28 17:37:44.000000000 +0000 @@ -11,9 +11,9 @@ #endif -char func_c(void); +char func_c(); -char DLL_PUBLIC func_b(void) { +char DLL_PUBLIC func_b() { if(func_c() != 'c') { exit(3); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/75 shared subproject/subprojects/C/c.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/75 shared subproject/subprojects/C/c.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/75 shared subproject/subprojects/C/c.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/75 shared subproject/subprojects/C/c.c" 2019-11-28 17:37:44.000000000 +0000 @@ -9,6 +9,6 @@ #endif #endif -char DLL_PUBLIC func_c(void) { +char DLL_PUBLIC func_c() { return 'c'; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/76 shared subproject 2/a.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/76 shared subproject 2/a.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/76 shared subproject 2/a.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/76 shared subproject 2/a.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,8 +1,8 @@ #include -char func_b(void); -char func_c(void); +char func_b(); +char func_c(); -int main(void) { +int main(int argc, char **argv) { if(func_b() != 'b') { return 1; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/76 shared subproject 2/subprojects/B/b.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/76 shared subproject 2/subprojects/B/b.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/76 shared subproject 2/subprojects/B/b.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/76 shared subproject 2/subprojects/B/b.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ #include -char func_c(void); +char func_c(); #if defined _WIN32 || defined __CYGWIN__ #define DLL_PUBLIC __declspec(dllexport) @@ -12,7 +12,7 @@ #endif #endif -char DLL_PUBLIC func_b(void) { +char DLL_PUBLIC func_b() { if(func_c() != 'c') { exit(3); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/76 shared subproject 2/subprojects/C/c.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/76 shared subproject 2/subprojects/C/c.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/76 shared subproject 2/subprojects/C/c.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/76 shared subproject 2/subprojects/C/c.c" 2019-11-28 17:37:44.000000000 +0000 @@ -9,6 +9,6 @@ #endif #endif -char DLL_PUBLIC func_c(void) { +char DLL_PUBLIC func_c() { return 'c'; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/77 file object/lib.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/77 file object/lib.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/77 file object/lib.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/77 file object/lib.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int func(void) { +int func() { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/77 file object/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/77 file object/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/77 file object/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/77 file object/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,8 +1,8 @@ #include -int func(void); /* Files in different subdirs return different values. */ +int func(); /* Files in different subdirs return different values. */ -int main(void) { +int main(int argc, char **argv) { if(func() == 0) { printf("Iz success.\n"); } else { diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/77 file object/subdir1/lib.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/77 file object/subdir1/lib.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/77 file object/subdir1/lib.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/77 file object/subdir1/lib.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int func(void) { +int func() { return 1; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/77 file object/subdir1/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/77 file object/subdir1/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/77 file object/subdir1/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/77 file object/subdir1/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,8 +1,8 @@ #include -int func(void); +int func(); -int main(void) { +int main(int argc, char **argv) { if(func() == 1) { printf("Iz success.\n"); } else { diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/77 file object/subdir2/lib.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/77 file object/subdir2/lib.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/77 file object/subdir2/lib.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/77 file object/subdir2/lib.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int func(void) { +int func() { return 2; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/77 file object/subdir2/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/77 file object/subdir2/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/77 file object/subdir2/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/77 file object/subdir2/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,8 +1,8 @@ #include -int func(void); +int func(); -int main(void) { +int main(int argc, char **argv) { if(func() == 2) { printf("Iz success.\n"); } else { diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/78 custom subproject dir/a.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/78 custom subproject dir/a.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/78 custom subproject dir/a.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/78 custom subproject dir/a.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,8 +1,8 @@ #include -char func_b(void); -char func_c(void); +char func_b(); +char func_c(); -int main(void) { +int main(int argc, char **argv) { if(func_b() != 'b') { return 1; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/78 custom subproject dir/custom_subproject_dir/B/b.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/78 custom subproject dir/custom_subproject_dir/B/b.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/78 custom subproject dir/custom_subproject_dir/B/b.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/78 custom subproject dir/custom_subproject_dir/B/b.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ #include -char func_c(void); +char func_c(); #if defined _WIN32 || defined __CYGWIN__ #define DLL_PUBLIC __declspec(dllexport) @@ -12,7 +12,7 @@ #endif #endif -char DLL_PUBLIC func_b(void) { +char DLL_PUBLIC func_b() { if(func_c() != 'c') { exit(3); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/78 custom subproject dir/custom_subproject_dir/C/c.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/78 custom subproject dir/custom_subproject_dir/C/c.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/78 custom subproject dir/custom_subproject_dir/C/c.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/78 custom subproject dir/custom_subproject_dir/C/c.c" 2019-11-28 17:37:44.000000000 +0000 @@ -9,6 +9,6 @@ #endif #endif -char DLL_PUBLIC func_c(void) { +char DLL_PUBLIC func_c() { return 'c'; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/7 mixed/func.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/7 mixed/func.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/7 mixed/func.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/7 mixed/func.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,4 +1,4 @@ -int func(void) { +int func() { int class = 0; return class; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/7 mixed/main.cc" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/7 mixed/main.cc" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/7 mixed/main.cc" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/7 mixed/main.cc" 2019-11-28 17:37:44.000000000 +0000 @@ -2,6 +2,6 @@ class BreakPlainCCompiler; -int main(void) { +int main(int argc, char **argv) { return func(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/80 extract from nested subdir/src/first/lib_first.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/80 extract from nested subdir/src/first/lib_first.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/80 extract from nested subdir/src/first/lib_first.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/80 extract from nested subdir/src/first/lib_first.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int first(void) { +int first() { return 1001; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/80 extract from nested subdir/tst/first/exe_first.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/80 extract from nested subdir/tst/first/exe_first.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/80 extract from nested subdir/tst/first/exe_first.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/80 extract from nested subdir/tst/first/exe_first.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ int first(void); -int main(void) { +int main() { return first() - 1001; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/81 internal dependency/proj1/include/proj1.h" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/81 internal dependency/proj1/include/proj1.h" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/81 internal dependency/proj1/include/proj1.h" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/81 internal dependency/proj1/include/proj1.h" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ #pragma once -void proj1_func1(void); -void proj1_func2(void); -void proj1_func3(void); +void proj1_func1(); +void proj1_func2(); +void proj1_func3(); diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/81 internal dependency/proj1/proj1f1.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/81 internal dependency/proj1/proj1f1.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/81 internal dependency/proj1/proj1f1.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/81 internal dependency/proj1/proj1f1.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #include #include -void proj1_func1(void) { +void proj1_func1() { printf("In proj1_func1.\n"); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/81 internal dependency/proj1/proj1f2.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/81 internal dependency/proj1/proj1f2.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/81 internal dependency/proj1/proj1f2.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/81 internal dependency/proj1/proj1f2.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #include #include -void proj1_func2(void) { +void proj1_func2() { printf("In proj1_func2.\n"); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/81 internal dependency/proj1/proj1f3.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/81 internal dependency/proj1/proj1f3.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/81 internal dependency/proj1/proj1f3.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/81 internal dependency/proj1/proj1f3.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #include #include -void proj1_func3(void) { +void proj1_func3() { printf("In proj1_func3.\n"); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/81 internal dependency/src/main.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/81 internal dependency/src/main.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/81 internal dependency/src/main.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/81 internal dependency/src/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,7 +1,7 @@ #include #include -int main(void) { +int main(int argc, char **argv) { printf("Now calling into library.\n"); proj1_func1(); proj1_func2(); diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/82 same basename/exe1.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/82 same basename/exe1.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/82 same basename/exe1.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/82 same basename/exe1.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ -int func(void); +int func(); -int main(void) { +int main(int argc, char **argv) { return func(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/82 same basename/exe2.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/82 same basename/exe2.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/82 same basename/exe2.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/82 same basename/exe2.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ -int func(void); +int func(); -int main(void) { +int main(int argc, char **argv) { return func() == 1 ? 0 : 1; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/82 same basename/lib.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/82 same basename/lib.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/82 same basename/lib.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/82 same basename/lib.c" 2019-11-28 17:37:44.000000000 +0000 @@ -10,11 +10,11 @@ #endif #if defined SHAR -int DLL_PUBLIC func(void) { +int DLL_PUBLIC func() { return 1; } #elif defined STAT -int func(void) { +int func() { return 0; } #else diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/83 declare dep/entity/entity1.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/83 declare dep/entity/entity1.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/83 declare dep/entity/entity1.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/83 declare dep/entity/entity1.c" 2019-11-28 17:37:44.000000000 +0000 @@ -4,6 +4,6 @@ #error "Entity use flag leaked into entity compilation." #endif -int entity_func1(void) { +int entity_func1() { return 5; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/83 declare dep/entity/entity2.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/83 declare dep/entity/entity2.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/83 declare dep/entity/entity2.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/83 declare dep/entity/entity2.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ #include -int entity_func2(void) { +int entity_func2() { return 9; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/83 declare dep/entity/entity.h" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/83 declare dep/entity/entity.h" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/83 declare dep/entity/entity.h" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/83 declare dep/entity/entity.h" 2019-11-28 17:37:44.000000000 +0000 @@ -1,4 +1,4 @@ #pragma once -int entity_func1(void); -int entity_func2(void); +int entity_func1(); +int entity_func2(); diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/83 declare dep/main.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/83 declare dep/main.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/83 declare dep/main.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/83 declare dep/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -5,7 +5,7 @@ #error "Entity use flag not used for compilation." #endif -int main(void) { +int main(int argc, char **argv) { if(entity_func1() != 5) { printf("Error in func1.\n"); return 1; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/84 extract all/extractor.h" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/84 extract all/extractor.h" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/84 extract all/extractor.h" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/84 extract all/extractor.h" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #pragma once -int func1(void); -int func2(void); -int func3(void); -int func4(void); +int func1(); +int func2(); +int func3(); +int func4(); diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/84 extract all/four.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/84 extract all/four.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/84 extract all/four.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/84 extract all/four.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ #include"extractor.h" -int func4(void) { +int func4() { return 4; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/84 extract all/one.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/84 extract all/one.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/84 extract all/one.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/84 extract all/one.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ #include"extractor.h" -int func1(void) { +int func1() { return 1; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/84 extract all/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/84 extract all/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/84 extract all/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/84 extract all/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,7 +1,7 @@ #include"extractor.h" #include -int main(void) { +int main(int argc, char **argv) { if((1+2+3+4) != (func1() + func2() + func3() + func4())) { printf("Arithmetic is fail.\n"); return 1; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/84 extract all/three.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/84 extract all/three.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/84 extract all/three.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/84 extract all/three.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ #include"extractor.h" -int func3(void) { +int func3() { return 3; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/84 extract all/two.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/84 extract all/two.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/84 extract all/two.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/84 extract all/two.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ #include"extractor.h" -int func2(void) { +int func2() { return 2; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/85 add language/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/85 add language/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/85 add language/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/85 add language/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #include -int main(void) { +int main(int argc, char **argv) { printf("I am plain C.\n"); return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/86 identical target name in subproject/bar.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/86 identical target name in subproject/bar.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/86 identical target name in subproject/bar.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/86 identical target name in subproject/bar.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #include -int main(void) { +int main(int argc, char **argv) { printf("I'm a main project bar.\n"); return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/86 identical target name in subproject/subprojects/foo/bar.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/86 identical target name in subproject/subprojects/foo/bar.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/86 identical target name in subproject/subprojects/foo/bar.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/86 identical target name in subproject/subprojects/foo/bar.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #include -int main(void) { +int main(int argc, char **argv) { printf("I'm a subproject bar.\n"); return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/89 private include/stlib/compiler.py" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/89 private include/stlib/compiler.py" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/89 private include/stlib/compiler.py" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/89 private include/stlib/compiler.py" 2019-11-28 17:37:44.000000000 +0000 @@ -5,12 +5,12 @@ assert(len(sys.argv) == 3) h_templ = '''#pragma once -unsigned int %s(void); +unsigned int %s(); ''' c_templ = '''#include"%s.h" -unsigned int %s(void) { +unsigned int %s() { return 0; } ''' diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/89 private include/user/libuser.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/89 private include/user/libuser.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/89 private include/user/libuser.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/89 private include/user/libuser.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #include"foo1.h" #include"foo2.h" -int main(void) { +int main(int argc, char **argv) { return foo1() + foo2(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/8 install/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/8 install/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/8 install/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/8 install/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int main(void) { +int main(int argc, char **argv) { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/8 install/stat.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/8 install/stat.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/8 install/stat.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/8 install/stat.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1 +1 @@ -int func(void) { return 933; } +int func() { return 933; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/91 dep fallback/subprojects/boblib/bob.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/91 dep fallback/subprojects/boblib/bob.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/91 dep fallback/subprojects/boblib/bob.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/91 dep fallback/subprojects/boblib/bob.c" 2019-11-28 17:37:44.000000000 +0000 @@ -3,6 +3,6 @@ #ifdef _MSC_VER __declspec(dllexport) #endif -const char* get_bob(void) { +const char* get_bob() { return "bob"; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/91 dep fallback/subprojects/boblib/bob.h" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/91 dep fallback/subprojects/boblib/bob.h" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/91 dep fallback/subprojects/boblib/bob.h" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/91 dep fallback/subprojects/boblib/bob.h" 2019-11-28 17:37:44.000000000 +0000 @@ -3,4 +3,4 @@ #ifdef _MSC_VER __declspec(dllimport) #endif -const char* get_bob(void); +const char* get_bob(); diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/91 dep fallback/tester.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/91 dep fallback/tester.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/91 dep fallback/tester.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/91 dep fallback/tester.c" 2019-11-28 17:37:44.000000000 +0000 @@ -3,7 +3,7 @@ #include #include -int main(void) { +int main(int argc, char **argv) { if(strcmp("bob", get_bob()) == 0) { printf("Bob is indeed bob.\n"); } else { diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/93 selfbuilt custom/mainprog.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/93 selfbuilt custom/mainprog.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/93 selfbuilt custom/mainprog.cpp" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/93 selfbuilt custom/mainprog.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ #include"data.h" -int main(void) { +int main(int, char **) { return generated_function() != 52; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/94 gen extra/name.l" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/94 gen extra/name.l" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/94 gen extra/name.l" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/94 gen extra/name.l" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int main(void) { +int main() { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/94 gen extra/plain.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/94 gen extra/plain.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/94 gen extra/plain.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/94 gen extra/plain.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ -int bob_mcbob(void); +int bob_mcbob(); -int main(void) { +int main(int argc, char **argv) { return bob_mcbob(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/94 gen extra/srcgen.py" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/94 gen extra/srcgen.py" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/94 gen extra/srcgen.py" 2020-01-07 21:01:29.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/94 gen extra/srcgen.py" 2019-11-28 17:37:44.000000000 +0000 @@ -11,7 +11,7 @@ parser.add_argument('--upper', dest='upper', action='store_true', default=False, help='Convert to upper case.') -c_templ = '''int %s(void) { +c_templ = '''int %s() { return 0; } ''' diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/94 gen extra/upper.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/94 gen extra/upper.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/94 gen extra/upper.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/94 gen extra/upper.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ -int BOB_MCBOB(void); +int BOB_MCBOB(); -int main(void) { +int main(int argc, char **argv) { return BOB_MCBOB(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/95 benchmark/delayer.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/95 benchmark/delayer.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/95 benchmark/delayer.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/95 benchmark/delayer.c" 2019-11-28 17:37:44.000000000 +0000 @@ -6,7 +6,7 @@ #include #endif -int main(void) { +int main(int argc, char **argv) { srand(time(NULL)); #if !defined(_WIN32) struct timespec t; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/96 test workdir/opener.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/96 test workdir/opener.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/96 test workdir/opener.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/96 test workdir/opener.c" 2019-11-28 17:37:44.000000000 +0000 @@ -2,7 +2,7 @@ #include -int main(void) { +int main(int arg, char **argv) { FILE *f = fopen("opener.c", "r"); if(f) { fclose(f); diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/97 suites/exe1.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/97 suites/exe1.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/97 suites/exe1.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/97 suites/exe1.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #include -int main(void) { +int main(int argc, char **argv) { printf("I am test exe1.\n"); return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/97 suites/exe2.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/97 suites/exe2.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/97 suites/exe2.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/97 suites/exe2.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #include -int main(void) { +int main(int argc, char **argv) { printf("I am test exe2.\n"); return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/97 suites/subprojects/sub/sub1.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/97 suites/subprojects/sub/sub1.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/97 suites/subprojects/sub/sub1.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/97 suites/subprojects/sub/sub1.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #include -int main(void) { +int main(int argc, char **argv) { printf("I am test sub1.\n"); return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/97 suites/subprojects/sub/sub2.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/97 suites/subprojects/sub/sub2.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/97 suites/subprojects/sub/sub2.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/97 suites/subprojects/sub/sub2.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #include -int main(void) { +int main(int argc, char **argv) { printf("I am test sub2.\n"); return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/98 threads/threadprog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/98 threads/threadprog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/98 threads/threadprog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/98 threads/threadprog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -3,12 +3,12 @@ #include #include -DWORD WINAPI thread_func(void) { +DWORD WINAPI thread_func(LPVOID ignored) { printf("Printing from a thread.\n"); return 0; } -int main(void) { +int main(int argc, char **argv) { DWORD id; HANDLE th; printf("Starting thread.\n"); @@ -22,12 +22,12 @@ #include #include -void* main_func(void) { +void* main_func(void* ignored) { printf("Printing from a thread.\n"); return NULL; } -int main(void) { +int main(int argc, char** argv) { pthread_t thread; int rc; printf("Starting thread.\n"); diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/98 threads/threadprog.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/98 threads/threadprog.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/98 threads/threadprog.cpp" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/98 threads/threadprog.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -14,7 +14,7 @@ return 0; } -int main(void) { +int main(int, char**) { printf("Starting thread.\n"); HANDLE th; DWORD id; @@ -28,11 +28,11 @@ #include #include -void main_func(void) { +void main_func() { printf("Printing from a thread.\n"); } -int main(void) { +int main(int, char**) { printf("Starting thread.\n"); std::thread th(main_func); th.join(); diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/99 manygen/depuser.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/99 manygen/depuser.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/99 manygen/depuser.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/99 manygen/depuser.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #include"gen_func.h" -int main(void) { +int main(int argc, char **argv) { unsigned int i = (unsigned int) gen_func_in_lib(); unsigned int j = (unsigned int) gen_func_in_obj(); unsigned int k = (unsigned int) gen_func_in_src(); diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/99 manygen/subdir/manygen.py" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/99 manygen/subdir/manygen.py" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/common/99 manygen/subdir/manygen.py" 2020-01-23 12:51:19.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/common/99 manygen/subdir/manygen.py" 2019-11-28 17:37:44.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python from __future__ import print_function @@ -43,20 +43,20 @@ with open(outc, 'w') as f: f.write('''#include"%s.h" -int %s_in_src(void) { +int %s_in_src() { return 0; } ''' % (funcname, funcname)) with open(outh, 'w') as f: f.write('''#pragma once -int %s_in_lib(void); -int %s_in_obj(void); -int %s_in_src(void); +int %s_in_lib(); +int %s_in_obj(); +int %s_in_src(); ''' % (funcname, funcname, funcname)) with open(tmpc, 'w') as f: - f.write('''int %s_in_obj(void) { + f.write('''int %s_in_obj() { return 0; } ''' % funcname) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/10 cuda dependency/c/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/10 cuda dependency/c/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/10 cuda dependency/c/meson.build" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/10 cuda dependency/c/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -exe = executable('prog', 'prog.c', dependencies: dependency('cuda')) -test('cudatest', exe) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/10 cuda dependency/c/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/10 cuda dependency/c/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/10 cuda dependency/c/prog.c" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/10 cuda dependency/c/prog.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -#include -#include - -int cuda_devices(void) { - int result = 0; - cudaGetDeviceCount(&result); - return result; -} - -int main(void) { - int n = cuda_devices(); - if (n == 0) { - printf("No CUDA hardware found. Exiting.\n"); - return 0; - } - - printf("Found %i CUDA devices.\n", n); - return 0; -} diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/10 cuda dependency/cpp/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/10 cuda dependency/cpp/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/10 cuda dependency/cpp/meson.build" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/10 cuda dependency/cpp/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -exe = executable('prog', 'prog.cc', dependencies: dependency('cuda')) -test('cudatest', exe) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/10 cuda dependency/cpp/prog.cc" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/10 cuda dependency/cpp/prog.cc" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/10 cuda dependency/cpp/prog.cc" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/10 cuda dependency/cpp/prog.cc" 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -#include -#include - -int cuda_devices(void) { - int result = 0; - cudaGetDeviceCount(&result); - return result; -} - -int main(void) { - int n = cuda_devices(); - if (n == 0) { - std::cout << "No CUDA hardware found. Exiting.\n"; - return 0; - } - - std::cout << "Found " << n << " CUDA devices.\n"; - return 0; -} diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/10 cuda dependency/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/10 cuda dependency/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/10 cuda dependency/meson.build" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/10 cuda dependency/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -project('cuda dependency', 'c', 'cpp') - -subdir('c') -subdir('cpp') -subdir('modules') -subdir('version_reqs') diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/10 cuda dependency/modules/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/10 cuda dependency/modules/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/10 cuda dependency/modules/meson.build" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/10 cuda dependency/modules/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -exe = executable('prog', 'prog.cc', dependencies: dependency('cuda', modules: ['cublas'])) -test('cudatest', exe) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/10 cuda dependency/modules/prog.cc" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/10 cuda dependency/modules/prog.cc" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/10 cuda dependency/modules/prog.cc" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/10 cuda dependency/modules/prog.cc" 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -#include -#include -#include - -int cuda_devices(void) { - int result = 0; - cudaGetDeviceCount(&result); - return result; -} - -int main(void) { - int n = cuda_devices(); - if (n == 0) { - std::cout << "No CUDA hardware found. Exiting.\n"; - return 0; - } - - std::cout << "Found " << n << " CUDA devices.\n"; - - cublasHandle_t handle; - if (cublasCreate(&handle) != CUBLAS_STATUS_SUCCESS) { - std::cout << "cuBLAS initialization failed. Exiting.\n"; - return -1; - } - - std::cout << "Initialized cuBLAS\n"; - if (cublasDestroy(handle) != CUBLAS_STATUS_SUCCESS) { - std::cout << "cuBLAS de-initialization failed. Exiting.\n"; - return -1; - } - - return 0; -} diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/10 cuda dependency/version_reqs/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/10 cuda dependency/version_reqs/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/10 cuda dependency/version_reqs/meson.build" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/10 cuda dependency/version_reqs/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -exe = executable('prog', 'prog.cc', dependencies: dependency('cuda', version: ['>=8.5', '<10'], required: false, disabler: true)) -test('cudatest', exe) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/10 cuda dependency/version_reqs/prog.cc" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/10 cuda dependency/version_reqs/prog.cc" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/10 cuda dependency/version_reqs/prog.cc" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/10 cuda dependency/version_reqs/prog.cc" 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -#include -#include - -int cuda_devices(void) { - int result = 0; - cudaGetDeviceCount(&result); - return result; -} - -int main(void) { - std::cout << "Compiled against CUDA version: " << CUDART_VERSION << "\n"; - int runtime_version = 0; - cudaError_t r = cudaRuntimeGetVersion(&runtime_version); - if (r != cudaSuccess) { - std::cout << "Couldn't obtain CUDA runtime version (error " << r << "). Exiting.\n"; - return -1; - } - std::cout << "CUDA runtime version: " << runtime_version << "\n"; - - int n = cuda_devices(); - if (n == 0) { - std::cout << "No CUDA hardware found. Exiting.\n"; - return 0; - } - - std::cout << "Found " << n << " CUDA devices.\n"; - return 0; -} diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/11 cuda dependency (nvcc)/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/11 cuda dependency (nvcc)/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/11 cuda dependency (nvcc)/meson.build" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/11 cuda dependency (nvcc)/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -project('cuda dependency', 'cuda') - -subdir('modules') -subdir('version_reqs') diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/11 cuda dependency (nvcc)/modules/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/11 cuda dependency (nvcc)/modules/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/11 cuda dependency (nvcc)/modules/meson.build" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/11 cuda dependency (nvcc)/modules/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -exe = executable('prog', 'prog.cu', dependencies: dependency('cuda', modules: ['cublas'])) -test('cudatest', exe) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/11 cuda dependency (nvcc)/modules/prog.cu" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/11 cuda dependency (nvcc)/modules/prog.cu" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/11 cuda dependency (nvcc)/modules/prog.cu" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/11 cuda dependency (nvcc)/modules/prog.cu" 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -#include -#include -#include - -int cuda_devices(void) { - int result = 0; - cudaGetDeviceCount(&result); - return result; -} - -int main(void) { - int n = cuda_devices(); - if (n == 0) { - std::cout << "No CUDA hardware found. Exiting.\n"; - return 0; - } - - std::cout << "Found " << n << " CUDA devices.\n"; - - cublasHandle_t handle; - if (cublasCreate(&handle) != CUBLAS_STATUS_SUCCESS) { - std::cout << "cuBLAS initialization failed. Exiting.\n"; - return -1; - } - - std::cout << "Initialized cuBLAS\n"; - if (cublasDestroy(handle) != CUBLAS_STATUS_SUCCESS) { - std::cout << "cuBLAS de-initialization failed. Exiting.\n"; - return -1; - } - - return 0; -} diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/11 cuda dependency (nvcc)/version_reqs/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/11 cuda dependency (nvcc)/version_reqs/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/11 cuda dependency (nvcc)/version_reqs/meson.build" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/11 cuda dependency (nvcc)/version_reqs/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -exe = executable('prog', 'prog.cu', dependencies: dependency('cuda', version: ['>=10.1'], required: false, disabler: true)) -test('cudatest', exe) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/11 cuda dependency (nvcc)/version_reqs/prog.cu" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/11 cuda dependency (nvcc)/version_reqs/prog.cu" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/11 cuda dependency (nvcc)/version_reqs/prog.cu" 2020-02-25 18:00:47.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/11 cuda dependency (nvcc)/version_reqs/prog.cu" 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -#include -#include - -int cuda_devices(void) { - int result = 0; - cudaGetDeviceCount(&result); - return result; -} - -int main(void) { - std::cout << "Compiled against CUDA version: " << CUDART_VERSION << "\n"; - - int runtime_version = 0; - switch (cudaError_t r = cudaRuntimeGetVersion(&runtime_version)) { - case cudaSuccess: - std::cout << "CUDA runtime version: " << runtime_version << "\n"; - break; - case cudaErrorNoDevice: - std::cout << "No CUDA hardware found. Exiting.\n"; - return 0; - default: - std::cout << "Couldn't obtain CUDA runtime version (error " << r << "). Exiting.\n"; - return -1; - } - - int n = cuda_devices(); - std::cout << "Found " << n << " CUDA devices.\n"; - return 0; -} diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/12 cuda dependency (mixed)/kernel.cu" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/12 cuda dependency (mixed)/kernel.cu" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/12 cuda dependency (mixed)/kernel.cu" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/12 cuda dependency (mixed)/kernel.cu" 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -#include - -__global__ void kernel (void){ -} - -void do_cuda_stuff(void) { - kernel<<<1,1>>>(); -} diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/12 cuda dependency (mixed)/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/12 cuda dependency (mixed)/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/12 cuda dependency (mixed)/meson.build" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/12 cuda dependency (mixed)/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -project('cuda dependency', 'cpp', 'cuda') - -exe = executable('prog', 'prog.cpp', 'kernel.cu', dependencies: dependency('cuda', modules: ['cublas'])) -test('cudatest', exe) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/12 cuda dependency (mixed)/prog.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/12 cuda dependency (mixed)/prog.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/12 cuda dependency (mixed)/prog.cpp" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/12 cuda dependency (mixed)/prog.cpp" 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -#include -#include -#include - -void do_cuda_stuff(void); - -int cuda_devices(void) { - int result = 0; - cudaGetDeviceCount(&result); - return result; -} - -int main(void) { - int n = cuda_devices(); - if (n == 0) { - std::cout << "No CUDA hardware found. Exiting.\n"; - return 0; - } - - std::cout << "Found " << n << " CUDA devices.\n"; - - do_cuda_stuff(); - - cublasHandle_t handle; - if (cublasCreate(&handle) != CUBLAS_STATUS_SUCCESS) { - std::cout << "cuBLAS initialization failed. Exiting.\n"; - return -1; - } - - std::cout << "Initialized cuBLAS\n"; - if (cublasDestroy(handle) != CUBLAS_STATUS_SUCCESS) { - std::cout << "cuBLAS de-initialization failed. Exiting.\n"; - return -1; - } - - return 0; -} diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/1 simple/prog.cu" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/1 simple/prog.cu" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/1 simple/prog.cu" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/1 simple/prog.cu" 2019-02-07 09:08:55.000000000 +0000 @@ -1,6 +1,6 @@ #include -int main(void) { +int main(int argc, char **argv) { int cuda_devices = 0; std::cout << "CUDA version: " << CUDART_VERSION << "\n"; cudaGetDeviceCount(&cuda_devices); diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/2 split/lib.cu" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/2 split/lib.cu" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/2 split/lib.cu" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/2 split/lib.cu" 2019-02-07 09:08:55.000000000 +0000 @@ -4,7 +4,7 @@ __global__ void kernel (void){ } -int do_cuda_stuff(void) { +int do_cuda_stuff() { kernel<<<1,1>>>(); printf("Hello, World!\n"); diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/2 split/main.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/2 split/main.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/2 split/main.cpp" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/2 split/main.cpp" 2019-02-07 09:08:55.000000000 +0000 @@ -1,7 +1,7 @@ #include -int do_cuda_stuff(void); +int do_cuda_stuff(); -int main(void) { +int main(int argc, char **argv) { return do_cuda_stuff(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/2 split/static/main_static.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/2 split/static/main_static.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/2 split/static/main_static.cpp" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/2 split/static/main_static.cpp" 2019-02-07 09:08:55.000000000 +0000 @@ -1,7 +1,7 @@ #include -int do_cuda_stuff(void); +int do_cuda_stuff(); -int main(void) { +int main(int argc, char **argv) { return do_cuda_stuff(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/3 cudamodule/prog.cu" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/3 cudamodule/prog.cu" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/3 cudamodule/prog.cu" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/3 cudamodule/prog.cu" 2019-02-07 09:08:59.000000000 +0000 @@ -1,6 +1,6 @@ #include -int main(void) { +int main(int argc, char **argv) { int cuda_devices = 0; std::cout << "CUDA version: " << CUDART_VERSION << "\n"; cudaGetDeviceCount(&cuda_devices); diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/4 shared/main.cu" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/4 shared/main.cu" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/4 shared/main.cu" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/4 shared/main.cu" 2019-02-28 20:43:18.000000000 +0000 @@ -3,7 +3,7 @@ #include "shared/kernels.h" -int main(void) { +int main(int argc, char **argv) { int cuda_devices = 0; cudaGetDeviceCount(&cuda_devices); if(cuda_devices == 0) { diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/5 threads/main.cu" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/5 threads/main.cu" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/5 threads/main.cu" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/5 threads/main.cu" 2019-02-28 20:43:18.000000000 +0000 @@ -3,7 +3,7 @@ #include "shared/kernels.h" -int main(void) { +int main(int argc, char **argv) { int cuda_devices = 0; cudaGetDeviceCount(&cuda_devices); if(cuda_devices == 0) { diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/6 std/main.cu" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/6 std/main.cu" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/6 std/main.cu" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/6 std/main.cu" 2019-09-28 23:52:33.000000000 +0000 @@ -1,14 +1,14 @@ #include #include -auto cuda_devices(void) { +auto cuda_devices() { int result = 0; cudaGetDeviceCount(&result); return result; } -int main(void) { +int main() { int n = cuda_devices(); if (n == 0) { std::cout << "No Cuda hardware found. Exiting.\n"; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/7 static vs runtime/main.cu" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/7 static vs runtime/main.cu" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/7 static vs runtime/main.cu" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/7 static vs runtime/main.cu" 2019-09-28 23:52:33.000000000 +0000 @@ -1,14 +1,14 @@ #include #include -int cuda_devices(void) { +int cuda_devices() { int result = 0; cudaGetDeviceCount(&result); return result; } -int main(void) { +int main() { int n = cuda_devices(); if (n == 0) { std::cout << "No Cuda hardware found. Exiting.\n"; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/8 release/main.cu" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/8 release/main.cu" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/8 release/main.cu" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/8 release/main.cu" 2019-09-28 23:52:33.000000000 +0000 @@ -1,14 +1,14 @@ #include #include -int cuda_devices(void) { +int cuda_devices() { int result = 0; cudaGetDeviceCount(&result); return result; } -int main(void) { +int main() { int n = cuda_devices(); if (n == 0) { std::cout << "No Cuda hardware found. Exiting.\n"; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/9 optimize for space/main.cu" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/9 optimize for space/main.cu" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/cuda/9 optimize for space/main.cu" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/cuda/9 optimize for space/main.cu" 2019-09-28 23:52:33.000000000 +0000 @@ -1,14 +1,14 @@ #include #include -int cuda_devices(void) { +int cuda_devices() { int result = 0; cudaGetDeviceCount(&result); return result; } -int main(void) { +int main() { int n = cuda_devices(); if (n == 0) { std::cout << "No Cuda hardware found. Exiting.\n"; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/d/5 mixed/installed_files.txt" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/d/5 mixed/installed_files.txt" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/d/5 mixed/installed_files.txt" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/d/5 mixed/installed_files.txt" 2019-11-28 17:37:44.000000000 +0000 @@ -5,3 +5,4 @@ ?msvc:usr/bin/stuff.dll ?msvc:usr/bin/stuff.pdb ?msvc:usr/lib/stuff.lib +?msvc:usr/lib/stuff.pdb diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/failing/16 extract from subproject/main.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/failing/16 extract from subproject/main.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/failing/16 extract from subproject/main.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/failing/16 extract from subproject/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ int sub_lib_method(void); -int main(void) { +int main() { return 1337 - sub_lib_method(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/failing/93 pch source different folder/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/failing/93 pch source different folder/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/failing/93 pch source different folder/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/failing/93 pch source different folder/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1 +1 @@ -int main(void) {} \ No newline at end of file +int main() {} \ No newline at end of file diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/failing/97 add dict non string key/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/failing/97 add dict non string key/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/failing/97 add dict non string key/meson.build" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/failing/97 add dict non string key/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -project('add dictionary entry using non-string key') - -dict = {} - -# An integer variable to be used as a key -key = 1 - -# Add new entry using integer variable as key should fail -dict += {key : 'myValue'} \ No newline at end of file diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/failing/98 add dict duplicate keys/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/failing/98 add dict duplicate keys/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/failing/98 add dict duplicate keys/meson.build" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/failing/98 add dict duplicate keys/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -project('add dictionary entries with duplicate keys') - -dict = {} - -# A variable to be used as a key -key = 'myKey' - -# Add two entries with duplicate keys should fail -dict += {key : 'myValue1', key : 'myValue2'} \ No newline at end of file diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/failing build/4 cmake subproject isolation/incDir/fileA.hpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/failing build/4 cmake subproject isolation/incDir/fileA.hpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/failing build/4 cmake subproject isolation/incDir/fileA.hpp" 2020-02-25 18:00:47.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/failing build/4 cmake subproject isolation/incDir/fileA.hpp" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -#pragma once - -#define SOME_DEFINE " World" diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/failing build/4 cmake subproject isolation/main.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/failing build/4 cmake subproject isolation/main.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/failing build/4 cmake subproject isolation/main.cpp" 2020-02-25 18:00:47.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/failing build/4 cmake subproject isolation/main.cpp" 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -#include -#include - -using namespace std; - -int main(void) { - cmModClass obj("Hello"); - cout << obj.getStr() << endl; - return 0; -} diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/failing build/4 cmake subproject isolation/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/failing build/4 cmake subproject isolation/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/failing build/4 cmake subproject isolation/meson.build" 2020-02-25 18:00:47.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/failing build/4 cmake subproject isolation/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -project('subproject isolation', ['c', 'cpp']) - -if not find_program('cmake', required: false).found() - error('MESON_SKIP_TEST CMake is not installed') -endif - -incdir = meson.source_root() / 'incDir' - -cm = import('cmake') - -# This should generate a warning and the include dir should be skipped. -sub_pro = cm.subproject('cmMod', cmake_options : [ '-DMESON_INC_DIR=' + incdir ]) -sub_dep = sub_pro.dependency('cmModLib++') - -# Since the include dir is skipped, the compilation of this project should fail. -exe1 = executable('main', ['main.cpp'], dependencies: [sub_dep]) -test('test1', exe1) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/failing build/4 cmake subproject isolation/subprojects/cmMod/CMakeLists.txt" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/failing build/4 cmake subproject isolation/subprojects/cmMod/CMakeLists.txt" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/failing build/4 cmake subproject isolation/subprojects/cmMod/CMakeLists.txt" 2020-02-25 18:00:47.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/failing build/4 cmake subproject isolation/subprojects/cmMod/CMakeLists.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.5) - -project(cmMod) -set (CMAKE_CXX_STANDARD 14) - -include_directories(${CMAKE_CURRENT_BINARY_DIR} ${MESON_INC_DIR}) - -add_library(cmModLib++ SHARED cmMod.cpp) -include(GenerateExportHeader) -generate_export_header(cmModLib++) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/failing build/4 cmake subproject isolation/subprojects/cmMod/cmMod.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/failing build/4 cmake subproject isolation/subprojects/cmMod/cmMod.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/failing build/4 cmake subproject isolation/subprojects/cmMod/cmMod.cpp" 2020-02-25 18:00:47.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/failing build/4 cmake subproject isolation/subprojects/cmMod/cmMod.cpp" 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -#include "cmMod.hpp" -#include "fileA.hpp" - -using namespace std; - -cmModClass::cmModClass(string foo) { - str = foo + SOME_DEFINE; -} - -string cmModClass::getStr() const { - return str; -} diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/failing build/4 cmake subproject isolation/subprojects/cmMod/cmMod.hpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/failing build/4 cmake subproject isolation/subprojects/cmMod/cmMod.hpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/failing build/4 cmake subproject isolation/subprojects/cmMod/cmMod.hpp" 2020-02-25 18:00:47.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/failing build/4 cmake subproject isolation/subprojects/cmMod/cmMod.hpp" 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -#pragma once - -#include "cmmodlib++_export.h" -#include - -class CMMODLIB___EXPORT cmModClass { -private: - std::string str; - -public: - cmModClass(std::string foo); - - std::string getStr() const; -}; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/fortran/12 submodule/a1.f90" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/fortran/12 submodule/a1.f90" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/fortran/12 submodule/a1.f90" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/fortran/12 submodule/a1.f90" 2019-11-28 17:37:44.000000000 +0000 @@ -15,7 +15,6 @@ program hierN use a1 -real :: tau, pi pi = get_pi() diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/fortran/12 submodule/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/fortran/12 submodule/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/fortran/12 submodule/meson.build" 2020-01-23 21:41:11.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/fortran/12 submodule/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -1,11 +1,6 @@ project('submodule single level', 'fortran', meson_version: '>= 0.50.0') -fortc = meson.get_compiler('fortran') -if fortc.get_id() == 'gcc' and fortc.version().version_compare('<6.0') - error('MESON_SKIP_TEST need gfortran >= 6.0 for submodule support') -endif - hier2 = executable('single', 'parent.f90', 'child.f90') test('single-level hierarchy', hier2) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/fortran/13 coarray/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/fortran/13 coarray/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/fortran/13 coarray/meson.build" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/fortran/13 coarray/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -2,9 +2,10 @@ meson_version: '>=0.50') fc = meson.get_compiler('fortran') +fcid = fc.get_id() -if ['pgi', 'flang'].contains(fc.get_id()) - error('MESON_SKIP_TEST: At least through PGI 19.10 and Flang 7.1 do not support Fortran Coarrays.') +if ['pgi', 'flang'].contains(fcid) + error('MESON_SKIP_TEST: At least through PGI 19.4 and Flang 7.1 do not support Fortran Coarrays.') endif # coarray is required because single-image fallback is an intrinsic feature @@ -14,11 +15,12 @@ # for example, conflicting library/compiler versions on PATH # this has to invoke a run of "sync all" to verify the MPI stack is functioning, # particularly for dynamic linking -if fc.run('sync all; end', dependencies: coarray, name: 'Coarray link & run').returncode() != 0 - error('MESON_SKIP_TEST: coarray stack (including MPI) did not link correctly so that a simple test could run.') +coarray_ok = fc.run('sync all; end', dependencies: coarray, name: 'Coarray link & run').returncode() == 0 +if not coarray_ok + error('MESON_SKIP_TEST: The coarray stack (including MPI) did not link correctly so that a simple test could run.') endif exe = executable('hello', 'main.f90', dependencies : coarray) -test('Coarray hello world', exe, timeout: 10) +test('Coarray hello world', exe) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/fortran/17 add_languages/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/fortran/17 add_languages/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/fortran/17 add_languages/meson.build" 2020-01-07 21:13:07.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/fortran/17 add_languages/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -project('add_lang_fortran') - -# catch bug where Fortran compiler is found with project('foo', 'fortran') but -# not by add_languages('fortran') -assert(add_languages('fortran'), 'these tests assume Fortran compiler can be found') \ No newline at end of file diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/fortran/18 first_arg/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/fortran/18 first_arg/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/fortran/18 first_arg/meson.build" 2020-01-07 21:13:11.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/fortran/18 first_arg/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -project('fortran_args', 'fortran') - -fc = meson.get_compiler('fortran') - -if fc.get_id() == 'intel-cl' - is_arg = '/O2' - useless = '/DFOO' -else - is_arg = '-O2' - useless = '-DFOO' -endif - -isnt_arg = '-fiambroken' - -assert(fc.has_argument(is_arg), 'Arg that should have worked does not work.') -assert(not fc.has_argument(isnt_arg), 'Arg that should be broken is not.') - -assert(fc.get_supported_arguments([is_arg, isnt_arg, useless]) == [is_arg, useless], 'Arg filtering returned different result.') - -# Have useless at the end to ensure that the search goes from front to back. -l1 = fc.first_supported_argument([isnt_arg, is_arg, isnt_arg, useless]) -l2 = fc.first_supported_argument(isnt_arg, isnt_arg, isnt_arg) - -assert(l1.length() == 1, 'First supported returned wrong result.') -assert(l1.get(0) == is_arg, 'First supported returned wrong argument.') -assert(l2.length() == 0, 'First supported did not return empty array.') diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/fortran/19 fortran_std/legacy.f" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/fortran/19 fortran_std/legacy.f" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/fortran/19 fortran_std/legacy.f" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/fortran/19 fortran_std/legacy.f" 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ - ! non-integer loop indices are deleted in Fortran 95 standard - real a - - do 10 a=0,0.5,0.1 -10 continue - - end program \ No newline at end of file diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/fortran/19 fortran_std/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/fortran/19 fortran_std/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/fortran/19 fortran_std/meson.build" 2020-01-07 21:13:11.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/fortran/19 fortran_std/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -project('FortranStd', 'fortran', - default_options: ['warning_level=0']) -# As with C and C++, each Fortran compiler + version has a subset of supported Fortran standards -# Additionally, a necessary option for non-standard Fortran projects is the "legacy" -# option, which allows non-standard syntax and behavior quirks. -# Thus "legacy" is a necessity for some old but important Fortran projects. -# By default, popular Fortran compilers disallow these quirks without "legacy" option. - -fc = meson.get_compiler('fortran') - -executable('stdnone', 'std95.f90') - -executable('std_legacy', 'legacy.f', override_options : ['fortran_std=legacy']) - -executable('std_95', 'std95.f90', override_options : ['fortran_std=f95']) - -executable('std_f2003', 'std2003.f90', override_options : ['fortran_std=f2003']) - -executable('std_f2008', 'std2008.f90', override_options : ['fortran_std=f2008']) - -if fc.get_id() == 'gcc' - if fc.version().version_compare('>=8.0') - executable('std_f2018', 'std2018.f90', override_options : ['fortran_std=f2018']) - endif -else - executable('std_f2018', 'std2018.f90', override_options : ['fortran_std=f2018']) -endif \ No newline at end of file diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/fortran/19 fortran_std/std2003.f90" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/fortran/19 fortran_std/std2003.f90" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/fortran/19 fortran_std/std2003.f90" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/fortran/19 fortran_std/std2003.f90" 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -use, intrinsic :: iso_fortran_env, only : error_unit -implicit none - -! http://fortranwiki.org/fortran/show/Real+precision -integer, parameter :: sp = selected_real_kind(6, 37) -integer, parameter :: dp = selected_real_kind(15, 307) - -real(sp) :: a32 -real(dp) :: a64 - -real(sp), parameter :: pi32 = 4*atan(1._sp) -real(dp), parameter :: pi64 = 4*atan(1._dp) - -if (pi32 == pi64) stop 1 - -call timestwo(a32) -call timestwo(a64) - -contains - -elemental subroutine timestwo(a) - -class(*), intent(inout) :: a - -select type (a) - type is (real(sp)) - a = 2*a - type is (real(dp)) - a = 2*a - type is (integer) - a = 2*a -end select - -end subroutine timestwo - -end program \ No newline at end of file diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/fortran/19 fortran_std/std2008.f90" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/fortran/19 fortran_std/std2008.f90" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/fortran/19 fortran_std/std2008.f90" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/fortran/19 fortran_std/std2008.f90" 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -use, intrinsic :: iso_fortran_env, only : error_unit, sp=>real32, dp=>real64 -implicit none - -real(sp) :: a32 -real(dp) :: a64 - -real(sp), parameter :: pi32 = 4*atan(1._sp) -real(dp), parameter :: pi64 = 4*atan(1._dp) - -if (pi32 == pi64) error stop 'real32 values generally do not exactly equal real64 values' - -call timestwo(a32) -call timestwo(a64) - -contains - -elemental subroutine timestwo(a) - -class(*), intent(inout) :: a - -select type (a) - type is (real(sp)) - a = 2*a - type is (real(dp)) - a = 2*a - type is (integer) - a = 2*a -end select - -end subroutine timestwo - -end program \ No newline at end of file diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/fortran/19 fortran_std/std2018.f90" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/fortran/19 fortran_std/std2018.f90" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/fortran/19 fortran_std/std2018.f90" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/fortran/19 fortran_std/std2018.f90" 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -use, intrinsic :: iso_fortran_env, only : error_unit, sp=>real32, dp=>real64 -implicit none - -real(sp) :: a32 -real(dp) :: a64 - -real(sp), parameter :: pi32 = 4*atan(1._sp) -real(dp), parameter :: pi64 = 4*atan(1._dp) - -if (pi32 == pi64) error stop 'real32 values generally do not exactly equal real64 values' - -call timestwo(a32) -call timestwo(a64) - -contains - -elemental subroutine timestwo(a) - -class(*), intent(inout) :: a - -select type (a) - type is (real(sp)) - a = 2*a - type is (real(dp)) - a = 2*a - type is (integer) - a = 2*a - class default - error stop 'requires real32, real64 or integer' -end select - -end subroutine timestwo - -end program \ No newline at end of file diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/fortran/19 fortran_std/std95.f90" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/fortran/19 fortran_std/std95.f90" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/fortran/19 fortran_std/std95.f90" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/fortran/19 fortran_std/std95.f90" 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -implicit none - -integer :: i, j -integer, parameter :: N=3 -real :: A(N,N) - -A = 0 - -forall (i=1:N, j=1:N) - A(i,j) = 1 -end forall - -end program \ No newline at end of file diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/fortran/1 basic/simple.f90" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/fortran/1 basic/simple.f90" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/fortran/1 basic/simple.f90" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/fortran/1 basic/simple.f90" 2019-11-28 17:37:44.000000000 +0000 @@ -1,2 +1,3 @@ -print *, "Fortran compilation is working." -end program +program prog + print *, "Fortran compilation is working." +end program prog diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/fortran/20 buildtype/main.f90" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/fortran/20 buildtype/main.f90" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/fortran/20 buildtype/main.f90" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/fortran/20 buildtype/main.f90" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -end program diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/fortran/20 buildtype/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/fortran/20 buildtype/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/fortran/20 buildtype/meson.build" 2020-01-07 21:13:11.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/fortran/20 buildtype/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -# checks for unexpected behavior on non-default buildtype and warning_level -project('build type Fortran', 'fortran', - default_options: ['buildtype=release', 'warning_level=3']) - -executable('main', 'main.f90') diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/fortran/9 cpp/main.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/fortran/9 cpp/main.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/fortran/9 cpp/main.cpp" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/fortran/9 cpp/main.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -2,7 +2,7 @@ extern "C" double fortran(); -int main(void) { +int main(int, char**) { std::cout << "FORTRAN gave us this number: " << fortran() << '\n'; return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/frameworks/17 mpi/main.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/frameworks/17 mpi/main.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/frameworks/17 mpi/main.cpp" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/frameworks/17 mpi/main.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,4 @@ #include -#include int main(int argc, char **argv) { diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/frameworks/17 mpi/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/frameworks/17 mpi/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/frameworks/17 mpi/meson.build" 2020-01-07 21:14:56.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/frameworks/17 mpi/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,11 @@ project('mpi', 'c', 'cpp', default_options: ['b_asneeded=false']) cc = meson.get_compiler('c') + +if build_machine.system() == 'windows' and cc.get_id() != 'msvc' + error('MESON_SKIP_TEST: MPI not available on Windows without MSVC.') +endif + mpic = dependency('mpi', language : 'c', required : false) if not mpic.found() error('MESON_SKIP_TEST: MPI not found, skipping.') @@ -9,41 +14,31 @@ 'main.c', dependencies : [mpic]) -test('MPI C', exec, timeout: 10) +test('MPI C', exec) +if build_machine.system() != 'windows' + # C++ MPI not supported by MS-MPI + mpicpp = dependency('mpi', language : 'cpp') + execpp = executable('execpp', + 'main.cpp', + dependencies : [mpicpp]) -# C++ MPI not supported by MS-MPI -cpp = meson.get_compiler('cpp') -mpicpp = dependency('mpi', language : 'cpp', required: false) -if not cpp.links(''' -#include -#include -int main(int argc, char **argv) {MPI::Init(argc, argv);} -''', dependencies: mpicpp, name: 'C++ MPI') - mpicpp = disabler() + test('MPI C++', execpp) endif -execpp = executable('execpp', - 'main.cpp', - dependencies : [mpicpp]) - -test('MPI C++', execpp, timeout: 10) +# One of few feasible ways to use MPI for Fortran on Windows is via Intel compilers. +if build_machine.system() != 'windows' or cc.get_id() == 'intel' + if add_languages('fortran', required : false) + mpifort = dependency('mpi', language : 'fortran') + + exef = executable('exef', + 'main.f90', + dependencies : [mpifort]) -if add_languages('fortran', required : false) - fc = meson.get_compiler('fortran') - mpif = dependency('mpi', language : 'fortran', required: false) - if not fc.links('use mpi; end', dependencies: mpif, name: 'Fortran MPI') - mpif = disabler() + test('MPI Fortran', exef) endif - - exef = executable('exef', - 'main.f90', - dependencies : mpif) - - test('MPI Fortran', exef, timeout: 10) endif - # Check we can apply a version constraint if mpic.version() != 'unknown' dependency('mpi', version: '>=@0@'.format(mpic.version())) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/frameworks/18 vulkan/vulkanprog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/frameworks/18 vulkan/vulkanprog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/frameworks/18 vulkan/vulkanprog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/frameworks/18 vulkan/vulkanprog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,7 +1,7 @@ #include #include -int main(void) +int main() { VkInstanceCreateInfo instance_create_info = { VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO, @@ -21,6 +21,6 @@ VkInstance instance; if(vkCreateInstance(&instance_create_info, NULL, &instance) == VK_SUCCESS) vkDestroyInstance(instance, NULL); - - return 0; + + return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/frameworks/1 boost/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/frameworks/1 boost/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/frameworks/1 boost/meson.build" 2020-01-23 21:41:11.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/frameworks/1 boost/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -1,4 +1,3 @@ -# this test requires the following on Ubuntu: libboost-{system,python,log,thread,test}-dev project('boosttest', 'cpp', default_options : ['cpp_std=c++11']) @@ -30,8 +29,8 @@ pymod = import('python') python2 = pymod.find_installation('python2', required: host_machine.system() == 'linux', disabler: true) python3 = pymod.find_installation('python3', required: host_machine.system() == 'linux', disabler: true) -python2dep = python2.dependency(required: host_machine.system() == 'linux', embed: true, disabler: true) -python3dep = python3.dependency(required: host_machine.system() == 'linux', embed: true, disabler: true) +python2dep = python2.dependency(required: host_machine.system() == 'linux', disabler: true) +python3dep = python3.dependency(required: host_machine.system() == 'linux', disabler: true) # compile python 2/3 modules only if we found a corresponding python version if(python2dep.found() and host_machine.system() == 'linux') @@ -40,10 +39,14 @@ # on the installed version of python (and hope that they match the version boost # was compiled against) py2version_string = ''.join(python2dep.version().split('.')) - bpython2dep = dependency('boost', modules : ['python' + py2version_string], required: false, disabler: true) + bpython2dep = dependency('boost', modules : ['python' + py2version_string]) else # if we have an older version of boost, we need to use the old module names - bpython2dep = dependency('boost', modules : ['python'], required: false, disabler: true) + bpython2dep = dependency('boost', modules : ['python']) + endif + + if not (bpython2dep.found()) + bpython2dep = disabler() endif else python2dep = disabler() @@ -53,9 +56,13 @@ if(python3dep.found() and host_machine.system() == 'linux') if(dep.version().version_compare('>=1.67')) py3version_string = ''.join(python3dep.version().split('.')) - bpython3dep = dependency('boost', modules : ['python' + py3version_string], required: false, disabler: true) + bpython3dep = dependency('boost', modules : ['python' + py3version_string]) else - bpython3dep = dependency('boost', modules : ['python3'], required: false, disabler: true) + bpython3dep = dependency('boost', modules : ['python3']) + endif + + if not (bpython3dep.found()) + bpython3dep = disabler() endif else python3dep = disabler() @@ -82,7 +89,7 @@ python2interpreter = find_program(python2.path(), required: false, disabler: true) test('Boost Python2', python2interpreter, args: ['./test_python_module.py', meson.current_build_dir()], workdir: meson.current_source_dir(), depends: python2module) python3interpreter = find_program(python3.path(), required: false, disabler: true) -test('Boost Python3', python3interpreter, args: ['./test_python_module.py', meson.current_build_dir()], workdir: meson.current_source_dir(), depends: python3module) +test('Boost Python3', python3interpreter, args: ['./test_python_module.py', meson.current_build_dir()], workdir: meson.current_source_dir(), depends: python2module) subdir('partial_dep') diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/frameworks/1 boost/partial_dep/main.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/frameworks/1 boost/partial_dep/main.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/frameworks/1 boost/partial_dep/main.cpp" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/frameworks/1 boost/partial_dep/main.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -18,7 +18,7 @@ #include "foo.hpp" -int main(void) { +int main() { auto foo = Foo(); vec v = foo.vector(); std::cout << boost::fusion::at_c<0>(v) << std::endl; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/frameworks/22 gir link order/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/frameworks/22 gir link order/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/frameworks/22 gir link order/meson.build" 2020-01-07 21:15:08.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/frameworks/22 gir link order/meson.build" 2019-08-16 20:44:17.000000000 +0000 @@ -1,6 +1,6 @@ project('gir link order', 'c') -if not dependency('glib-2.0', required : false).found() or not find_program('g-ir-scanner', required: false).found() +if not dependency('glib-2.0', required : false).found() error('MESON_SKIP_TEST glib not found.') endif diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/frameworks/25 hdf5/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/frameworks/25 hdf5/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/frameworks/25 hdf5/meson.build" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/frameworks/25 hdf5/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -1,27 +1,40 @@ -project('hdf5_framework', 'c') +project('hdf5_test', 'c', 'cpp') + +if build_machine.system() == 'darwin' + error('MESON_SKIP_TEST: HDF5 CI image not setup for OSX.') +endif + +if build_machine.system() == 'cygwin' + error('MESON_SKIP_TEST: HDF5 CI image not setup for Cygwin.') +endif -# NOTE: all HDF5 languages must have HDF5 C library working. # --- C tests h5c = dependency('hdf5', language : 'c', required : false) if not h5c.found() - error('MESON_SKIP_TEST: HDF5 C library not found.') + error('MESON_SKIP_TEST: HDF5 C library not found, skipping HDF5 framework tests.') endif exec = executable('exec', 'main.c', dependencies : h5c) -test('HDF5 C', exec, timeout: 30) + +test('HDF5 C', exec) # --- C++ tests -if add_languages('cpp', required: false) - h5cpp = dependency('hdf5', language : 'cpp', required : false, disabler: true) +h5cpp = dependency('hdf5', language : 'cpp', required : false) +if h5cpp.found() execpp = executable('execpp', 'main.cpp', dependencies : h5cpp) - test('HDF5 C++', execpp, timeout: 30) + test('HDF5 C++', execpp) endif # --- Fortran tests -if add_languages('fortran', required: false) - h5f = dependency('hdf5', language : 'fortran', required : false, disabler: true) - exef = executable('exef', 'main.f90', dependencies : h5f) - test('HDF5 Fortran', exef, timeout: 30) +if build_machine.system() != 'windows' + add_languages('fortran') + + h5f = dependency('hdf5', language : 'fortran', required : false) + if h5f.found() + exef = executable('exef', 'main.f90', dependencies : h5f) + + test('HDF5 Fortran', exef) + endif endif # Check we can apply a version constraint diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/frameworks/26 netcdf/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/frameworks/26 netcdf/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/frameworks/26 netcdf/meson.build" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/frameworks/26 netcdf/meson.build" 2019-02-28 20:43:18.000000000 +0000 @@ -1,32 +1,31 @@ -project('netcdf_test', 'c') +project('netcdf_test', 'c', 'cpp') -cc = meson.get_compiler('c') -c_code = '''#include -int main(void) { return 0; }''' -# --- C -nc_c = dependency('netcdf', language : 'c', required : false, disabler: true) -if not cc.links(c_code, dependencies: nc_c, name: 'NetCDF C') - nc_c = disabler() -endif + +# --- C tests +nc_c = dependency('netcdf', language : 'c', required : false) if not nc_c.found() error('MESON_SKIP_TEST: NetCDF C library not found, skipping NetCDF framework tests.') endif exec = executable('exec', 'main.c', dependencies : nc_c) -test('NetCDF C', exec, timeout: 15) -# --- C++ -if add_languages('cpp', required: false) - nc_cpp = dependency('netcdf', language : 'cpp', required : false, disabler: true) +test('NetCDF C', exec) + +# --- C++ tests +nc_cpp = dependency('netcdf', language : 'cpp', required : false) +if nc_cpp.found() execpp = executable('execpp', 'main.cpp', dependencies : nc_cpp) - test('NetCDF C++', execpp, timeout: 15) + test('NetCDF C++', execpp) endif -# --- Fortran -if build_machine.system() != 'windows' and build_machine.system() != 'darwin' - if add_languages('fortran', required: false) - nc_f = dependency('netcdf', language : 'fortran', required : false, disabler: true) +# --- Fortran tests +if build_machine.system() != 'windows' + add_languages('fortran') + + nc_f = dependency('netcdf', language : 'fortran', required : false) + if nc_f.found() exef = executable('exef', 'main.f90', dependencies : nc_f) - test('NetCDF Fortran', exef, timeout: 15) + + test('NetCDF Fortran', exef) endif endif diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/frameworks/28 gir link order 2/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/frameworks/28 gir link order 2/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/frameworks/28 gir link order 2/meson.build" 2020-01-07 21:15:09.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/frameworks/28 gir link order 2/meson.build" 2019-08-16 20:44:19.000000000 +0000 @@ -1,6 +1,6 @@ project('gir link order 2', 'c') -if not dependency('gobject-2.0', required : false).found() or not find_program('g-ir-scanner', required: false).found() +if not dependency('gobject-2.0', required : false).found() error('MESON_SKIP_TEST gobject not found.') endif diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/frameworks/2 gtest/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/frameworks/2 gtest/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/frameworks/2 gtest/meson.build" 2020-01-07 21:13:32.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/frameworks/2 gtest/meson.build" 2019-08-16 20:42:58.000000000 +0000 @@ -1,4 +1,3 @@ -# on Ubuntu this test requires libgtest-dev project('gtest', 'cpp') gtest = dependency('gtest', main : true, required : false) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/frameworks/30 scalapack/cmake/FindSCALAPACK.cmake" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/frameworks/30 scalapack/cmake/FindSCALAPACK.cmake" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/frameworks/30 scalapack/cmake/FindSCALAPACK.cmake" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/frameworks/30 scalapack/cmake/FindSCALAPACK.cmake" 1970-01-01 00:00:00.000000000 +0000 @@ -1,220 +0,0 @@ -# Distributed under the OSI-approved BSD 3-Clause License. See accompanying -# file Copyright.txt or https://cmake.org/licensing for details. - -#[=======================================================================[.rst: - -FindSCALAPACK -------------- - -* Michael Hirsch, Ph.D. www.scivision.dev - -Let Michael know if there are more MKL / Lapack / compiler combination you want. -Refer to https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor - -Finds SCALAPACK libraries for MKL, OpenMPI and MPICH. -Intel MKL relies on having environment variable MKLROOT set, typically by sourcing -mklvars.sh beforehand. - -Parameters -^^^^^^^^^^ - -``MKL`` - Intel MKL for MSVC, ICL, ICC, GCC and PGCC. Working with IntelMPI (default Window, Linux), MPICH (default Mac) or OpenMPI (Linux only). - -``IntelMPI`` - MKL BLACS IntelMPI - -``MKL64`` - MKL only: 64-bit integers (default is 32-bit integers) - -``OpenMPI`` - SCALAPACK + OpenMPI - -``MPICH`` - SCALAPACK + MPICH - - -Result Variables -^^^^^^^^^^^^^^^^ - -``SCALAPACK_FOUND`` - SCALapack libraries were found -``SCALAPACK__FOUND`` - SCALAPACK specified was found -``SCALAPACK_LIBRARIES`` - SCALapack library files -``SCALAPACK_INCLUDE_DIRS`` - SCALapack include directories - - -References -^^^^^^^^^^ - -* Pkg-Config and MKL: https://software.intel.com/en-us/articles/intel-math-kernel-library-intel-mkl-and-pkg-config-tool -* MKL for Windows: https://software.intel.com/en-us/mkl-windows-developer-guide-static-libraries-in-the-lib-intel64-win-directory -* MKL Windows directories: https://software.intel.com/en-us/mkl-windows-developer-guide-high-level-directory-structure -#]=======================================================================] - -#===== functions -function(mkl_scala) - -set(_mkl_libs ${ARGV}) - -foreach(s ${_mkl_libs}) - find_library(SCALAPACK_${s}_LIBRARY - NAMES ${s} - PATHS ENV MKLROOT ENV I_MPI_ROOT ENV TBBROOT - PATH_SUFFIXES - lib/intel64 lib/intel64_win - intel64/lib/release - lib/intel64/gcc4.7 ../tbb/lib/intel64/gcc4.7 - lib/intel64/vc_mt ../tbb/lib/intel64/vc_mt - ../compiler/lib/intel64 - HINTS ${MKL_LIBRARY_DIRS} ${MKL_LIBDIR} - NO_DEFAULT_PATH) - if(NOT SCALAPACK_${s}_LIBRARY) - message(WARNING "MKL component not found: " ${s}) - return() - endif() - - list(APPEND SCALAPACK_LIB ${SCALAPACK_${s}_LIBRARY}) -endforeach() - - -find_path(SCALAPACK_INCLUDE_DIR - NAMES mkl_scalapack.h - PATHS ENV MKLROOT ENV I_MPI_ROOT ENV TBBROOT - PATH_SUFFIXES - include - include/intel64/${_mkl_bitflag}lp64 - HINTS ${MKL_INCLUDE_DIRS}) - -if(NOT SCALAPACK_INCLUDE_DIR) - message(WARNING "MKL Include Dir not found") - return() -endif() - -list(APPEND SCALAPACK_INCLUDE_DIR - ${MKL_INCLUDE_DIRS}) - -set(SCALAPACK_LIBRARY ${SCALAPACK_LIB} PARENT_SCOPE) -set(SCALAPACK_INCLUDE_DIR ${SCALAPACK_INCLUDE_DIR} PARENT_SCOPE) - -endfunction(mkl_scala) - -#==== main program - -cmake_policy(VERSION 3.11) - -if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.12) - cmake_policy(SET CMP0074 NEW) - cmake_policy(SET CMP0075 NEW) -endif() - -if(NOT (OpenMPI IN_LIST SCALAPACK_FIND_COMPONENTS - OR MPICH IN_LIST SCALAPACK_FIND_COMPONENTS - OR MKL IN_LIST SCALAPACK_FIND_COMPONENTS)) - if(DEFINED ENV{MKLROOT}) - if(APPLE) - list(APPEND SCALAPACK_FIND_COMPONENTS MKL MPICH) - else() - list(APPEND SCALAPACK_FIND_COMPONENTS MKL IntelMPI) - endif() - else() - list(APPEND SCALAPACK_FIND_COMPONENTS OpenMPI) - endif() -endif() - -find_package(PkgConfig) - -if(NOT WIN32) - find_package(Threads) # not required--for example Flang -endif() - -if(MKL IN_LIST SCALAPACK_FIND_COMPONENTS) - - if(BUILD_SHARED_LIBS) - set(_mkltype dynamic) - else() - set(_mkltype static) - endif() - - if(MKL64 IN_LIST SCALAPACK_FIND_COMPONENTS) - set(_mkl_bitflag i) - else() - set(_mkl_bitflag) - endif() - - - if(WIN32) - set(_impi impi) - else() - unset(_impi) - endif() - - - pkg_check_modules(MKL mkl-${_mkltype}-${_mkl_bitflag}lp64-iomp) - - if(OpenMPI IN_LIST SCALAPACK_FIND_COMPONENTS) - mkl_scala(mkl_scalapack_${_mkl_bitflag}lp64 mkl_blacs_openmpi_${_mkl_bitflag}lp64) - if(SCALAPACK_LIBRARY) - set(SCALAPACK_OpenMPI_FOUND true) - endif() - elseif(MPICH IN_LIST SCALAPACK_FIND_COMPONENTS) - if(APPLE) - mkl_scala(mkl_scalapack_${_mkl_bitflag}lp64 mkl_blacs_mpich_${_mkl_bitflag}lp64) - elseif(WIN32) - mkl_scala(mkl_scalapack_${_mkl_bitflag}lp64 mkl_blacs_mpich2_${_mkl_bitflag}lp64.lib mpi.lib fmpich2.lib) - else() # linux, yes it's just like IntelMPI - mkl_scala(mkl_scalapack_${_mkl_bitflag}lp64 mkl_blacs_intelmpi_${_mkl_bitflag}lp64) - endif() - if(SCALAPACK_LIBRARY) - set(SCALAPACK_MPICH_FOUND true) - endif() - else() # IntelMPI - mkl_scala(mkl_scalapack_${_mkl_bitflag}lp64 mkl_blacs_intelmpi_${_mkl_bitflag}lp64 ${_impi}) - if(SCALAPACK_LIBRARY) - set(SCALAPACK_IntelMPI_FOUND true) - endif() - endif() - - if(SCALAPACK_LIBRARY) - set(SCALAPACK_MKL_FOUND true) - endif() - -elseif(OpenMPI IN_LIST SCALAPACK_FIND_COMPONENTS) - - pkg_check_modules(SCALAPACK scalapack-openmpi) - - find_library(SCALAPACK_LIBRARY - NAMES scalapack scalapack-openmpi - HINTS ${SCALAPACK_LIBRARY_DIRS} ${SCALAPACK_LIBDIR}) - - if(SCALAPACK_LIBRARY) - set(SCALAPACK_OpenMPI_FOUND true) - endif() - -elseif(MPICH IN_LIST SCALAPACK_FIND_COMPONENTS) - find_library(SCALAPACK_LIBRARY - NAMES scalapack-mpich scalapack-mpich2) - - if(SCALAPACK_LIBRARY) - set(SCALAPACK_MPICH_FOUND true) - endif() - -endif() - -# Finalize - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args( - SCALAPACK - REQUIRED_VARS SCALAPACK_LIBRARY - HANDLE_COMPONENTS) - -if(SCALAPACK_FOUND) - set(SCALAPACK_LIBRARIES ${SCALAPACK_LIBRARY}) - set(SCALAPACK_INCLUDE_DIRS ${SCALAPACK_INCLUDE_DIR}) -endif() - -mark_as_advanced(SCALAPACK_LIBRARY SCALAPACK_INCLUDE_DIR) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/frameworks/30 scalapack/main.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/frameworks/30 scalapack/main.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/frameworks/30 scalapack/main.c" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/frameworks/30 scalapack/main.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -#include - -// #include -// #include -// #include - -extern float pslamch_(const int *, const char *); -extern void blacs_pinfo_(int *, int *); -extern void blacs_get_(const int *, const int *, int *); -extern void blacs_gridinit_(int *, const char *, const int *, const int *); -extern void blacs_gridinfo_(const int *, int *, int *, int *, int *); -extern void blacs_gridexit_(const int *); -extern void blacs_exit_(const int *); - -int main(void){ - -int myid, nprocs, ictxt, mycol, myrow, npcol=2, nprow=2; -const int i0=0, i1=1, in1=-1; - -blacs_pinfo_(&myid, &nprocs); -blacs_get_(&in1, &i0, &ictxt); -blacs_gridinit_(&ictxt, "C", &nprocs, &i1); - -blacs_gridinfo_(&ictxt, &nprow, &npcol, &myrow, &mycol); - -float eps = pslamch_(&ictxt, "E"); - -if (myrow == mycol) printf("OK: Scalapack C: eps= %f\n", eps); - -blacs_gridexit_(&ictxt); -blacs_exit_(&i0); - -return 0; -} \ No newline at end of file diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/frameworks/30 scalapack/main.f90" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/frameworks/30 scalapack/main.f90" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/frameworks/30 scalapack/main.f90" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/frameworks/30 scalapack/main.f90" 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -! minimal Scalapack demo -implicit none - -integer :: ictxt, myid, nprocs, mycol, myrow, npcol, nprow -real :: eps -real, external :: pslamch - -! arbitrary test parameters -npcol = 2 -nprow = 2 - -call blacs_pinfo(myid, nprocs) -call blacs_get(-1, 0, ictxt) -call blacs_gridinit(ictxt, "C", nprocs, 1) - -call blacs_gridinfo(ictxt, nprow, npcol, myrow, mycol) - -eps = pslamch(ictxt, 'E') - -if(myrow == mycol) print '(A, F10.6)', "OK: Scalapack Fortran eps=", eps - -call blacs_gridexit(ictxt) -call blacs_exit(0) - -end program diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/frameworks/30 scalapack/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/frameworks/30 scalapack/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/frameworks/30 scalapack/meson.build" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/frameworks/30 scalapack/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -project('test scalapack', 'c') - -mpi_c = dependency('mpi', language: 'c', required: false) -if not mpi_c.found() - error('MESON_SKIP_TEST: MPI library not available') -endif - -scalapack = dependency('scalapack', required: false) -if not scalapack.found() - error('MESON_SKIP_TEST: scalapack library not available') -endif - -c_exe = executable('scalapack_c', 'main.c', - dependencies: [scalapack, mpi_c]) -test('scalapack_c', c_exe, timeout: 30) - -if add_languages('fortran', required: false) - mpi_f = dependency('mpi', language: 'fortran', required: false) - if not mpi_f.found() - error('MESON_SKIP_TEST: MPI Fortran library not available') - endif - - f_exe = executable('scalapack_fortran', 'main.f90', - dependencies: [scalapack, mpi_f]) - test('scalapack_fortran', f_exe, timeout: 30) -endif diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/frameworks/4 qt/main.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/frameworks/4 qt/main.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/frameworks/4 qt/main.cpp" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/frameworks/4 qt/main.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -3,10 +3,6 @@ #if QT_VERSION > 0x050000 // include some random private headers -// As you're not supposed to use it, your system may miss -// qobject_p.h. To locate it try one of these commands: -// - dnf provides */private/qobject_p.h -// - apt-file search qobject_p.h #include #endif diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/frameworks/4 qt/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/frameworks/4 qt/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/frameworks/4 qt/meson.build" 2020-01-23 12:51:19.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/frameworks/4 qt/meson.build" 2019-08-16 20:43:24.000000000 +0000 @@ -21,25 +21,19 @@ error('Invalid qt dep incorrectly found!') endif - # This test should be skipped if the required version of Qt isn't found - # - # (In the CI environment, the specified version of Qt is definitely present. - # An unexpected skip here is treated as a failure, so we are testing that the - # detection mechanism is able to find Qt.) - needed_qt = get_option('required').to_lower() - required = (qt == needed_qt) - if required + # This test should be skipped if qt5 isn't found + if qt == 'qt5' dep = dependency(qt, modules : ['Core'], required : false, method : get_option('method')) if not dep.found() - error('MESON_SKIP_TEST @0@ not found.'.format(needed_qt)) + error('MESON_SKIP_TEST qt5 not found.') endif endif # Ensure that the "no-Core-module-specified" code branch is hit - nocoredep = dependency(qt, modules : ['Gui'], required : required, method : get_option('method')) + nocoredep = dependency(qt, modules : ['Gui'], required : qt == 'qt5', method : get_option('method')) - # If 'qt' modules are found, test that. - qtdep = dependency(qt, modules : qt_modules, main : true, private_headers: true, required : required, method : get_option('method')) + # If qt4 modules are found, test that. qt5 is required. + qtdep = dependency(qt, modules : qt_modules, main : true, private_headers: true, required : qt == 'qt5', method : get_option('method')) if qtdep.found() qtmodule = import(qt) @@ -83,7 +77,6 @@ qtcore = dependency(qt, modules : 'Core', method : get_option('method')) qtcoreapp = executable(qt + 'core', 'q5core.cpp', - cpp_args: '-DQT="@0@"'.format(qt), dependencies : qtcore) test(qt + 'test', qtcoreapp) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/frameworks/4 qt/meson_options.txt" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/frameworks/4 qt/meson_options.txt" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/frameworks/4 qt/meson_options.txt" 2020-01-23 12:51:19.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/frameworks/4 qt/meson_options.txt" 2017-04-15 14:27:38.000000000 +0000 @@ -1,2 +1 @@ option('method', type : 'string', value : 'auto', description : 'The method to use to find Qt') -option('required', type : 'string', value : 'qt5', description : 'The version of Qt which is required to be present') diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/frameworks/4 qt/q5core.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/frameworks/4 qt/q5core.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/frameworks/4 qt/q5core.cpp" 2020-01-23 12:51:19.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/frameworks/4 qt/q5core.cpp" 2018-08-25 08:05:43.000000000 +0000 @@ -15,7 +15,7 @@ app.installTranslator(&qtTranslator); QTranslator myappTranslator; - if(!myappTranslator.load(QT "core_fr") ) + if(!myappTranslator.load("qt5core_fr") ) return 1; app.installTranslator(&myappTranslator); diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/frameworks/5 protocol buffers/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/frameworks/5 protocol buffers/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/frameworks/5 protocol buffers/meson.build" 2020-01-07 21:14:06.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/frameworks/5 protocol buffers/meson.build" 2019-08-16 20:43:23.000000000 +0000 @@ -1,4 +1,4 @@ -project('protocol buffer test', 'cpp', default_options: ['cpp_std=c++11']) +project('protocol buffer test', 'cpp') protoc = find_program('protoc', required : false) dep = dependency('protobuf', required : false) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/frameworks/6 gettext/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/frameworks/6 gettext/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/frameworks/6 gettext/meson.build" 2020-01-23 21:41:11.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/frameworks/6 gettext/meson.build" 2019-08-16 20:43:13.000000000 +0000 @@ -5,11 +5,6 @@ error('MESON_SKIP_TEST gettext not found.') endif -xgettext = find_program('xgettext', required: false) -if not xgettext.found() - error('MESON_SKIP_TEST xgettext not found.') -endif - if not meson.get_compiler('c').has_header('libintl.h') error('MESON_SKIP_TEST libintl.h not found.') endif diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/frameworks/7 gnome/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/frameworks/7 gnome/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/frameworks/7 gnome/meson.build" 2020-01-23 21:41:11.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/frameworks/7 gnome/meson.build" 2019-08-16 20:43:42.000000000 +0000 @@ -5,11 +5,6 @@ error('MESON_SKIP_TEST glib not found.') endif -gir = dependency('gobject-introspection-1.0', required: false) -if not gir.found() - error('MESON_SKIP_TEST gobject-introspection not found.') -endif - python3 = import('python3') py3 = python3.find_python() if run_command(py3, '-c', 'import gi;').returncode() != 0 diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/frameworks/9 wxwidgets/wxstc.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/frameworks/9 wxwidgets/wxstc.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/frameworks/9 wxwidgets/wxstc.cpp" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/frameworks/9 wxwidgets/wxstc.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #include -int main(void) { +int main() { wxStyledTextCtrl *canvas = new wxStyledTextCtrl(); delete canvas; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/11 runpath rpath ldlibrarypath/main.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/11 runpath rpath ldlibrarypath/main.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/11 runpath rpath ldlibrarypath/main.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/11 runpath rpath ldlibrarypath/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -2,7 +2,7 @@ int some_symbol (void); -int main () { +int main (int argc, char *argv[]) { int ret = some_symbol (); if (ret == 1) return 0; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/12 subprojects in subprojects/main.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/12 subprojects in subprojects/main.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/12 subprojects in subprojects/main.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/12 subprojects in subprojects/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -2,7 +2,7 @@ #include "a.h" #include "b.h" -int main(void) { +int main(int argc, char **argv) { int life = a_fun() + b_fun(); printf("%d\n", life); return 0; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/12 subprojects in subprojects/subprojects/a/a.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/12 subprojects in subprojects/subprojects/a/a.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/12 subprojects in subprojects/subprojects/a/a.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/12 subprojects in subprojects/subprojects/a/a.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ #include "c.h" -int a_fun(void) { +int a_fun() { return c_fun(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/12 subprojects in subprojects/subprojects/a/a.h" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/12 subprojects in subprojects/subprojects/a/a.h" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/12 subprojects in subprojects/subprojects/a/a.h" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/12 subprojects in subprojects/subprojects/a/a.h" 2019-11-28 17:37:44.000000000 +0000 @@ -1 +1 @@ -int a_fun(void); +int a_fun(); diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/12 subprojects in subprojects/subprojects/b/b.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/12 subprojects in subprojects/subprojects/b/b.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/12 subprojects in subprojects/subprojects/b/b.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/12 subprojects in subprojects/subprojects/b/b.c" 2019-11-28 17:37:44.000000000 +0000 @@ -2,7 +2,7 @@ #include "c.h" #endif -int b_fun(void){ +int b_fun(){ #if defined(WITH_C) return c_fun(); #else diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/12 subprojects in subprojects/subprojects/b/b.h" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/12 subprojects in subprojects/subprojects/b/b.h" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/12 subprojects in subprojects/subprojects/b/b.h" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/12 subprojects in subprojects/subprojects/b/b.h" 2019-11-28 17:37:44.000000000 +0000 @@ -1 +1 @@ -int b_fun(void); +int b_fun(); diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/12 subprojects in subprojects/subprojects/c/c.h" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/12 subprojects in subprojects/subprojects/c/c.h" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/12 subprojects in subprojects/subprojects/c/c.h" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/12 subprojects in subprojects/subprojects/c/c.h" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -static int c_fun(void){ +static int c_fun(){ return 3; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/13 cmake dependency/cmake/FindSomethingLikeZLIB.cmake" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/13 cmake dependency/cmake/FindSomethingLikeZLIB.cmake" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/13 cmake dependency/cmake/FindSomethingLikeZLIB.cmake" 2020-01-23 21:41:11.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/13 cmake dependency/cmake/FindSomethingLikeZLIB.cmake" 2019-08-28 17:15:39.000000000 +0000 @@ -1,43 +1,6 @@ find_package(ZLIB) include(CMakeFindDependencyMacro) -include(CheckCXXSourceRuns) -include(CheckCSourceRuns) - -check_cxx_source_runs( -" -#include - -using namespace std; - -int main(void) { - cout << \"Hello World\" << endl; - return 0; -} -" -CXX_CODE_RAN -) - -check_c_source_runs( -" -#include - -int main(void) { - printf(\"Hello World\"); - return 0; -} -" -C_CODE_RAN -) - -if(NOT CXX_CODE_RAN) - message(FATAL_ERROR "Running CXX source code failed") -endif() - -if(NOT C_CODE_RAN) - message(FATAL_ERROR "Running C source code failed") -endif() - find_dependency(Threads) if(ZLIB_FOUND OR ZLIB_Found) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/13 cmake dependency/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/13 cmake dependency/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/13 cmake dependency/meson.build" 2020-01-23 21:41:11.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/13 cmake dependency/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,4 @@ -# this test can ONLY be run successfully from run_project_test.py -# due to use of setup_env.json -project('external CMake dependency', ['c', 'cpp']) +project('external CMake dependency', 'c') if not find_program('cmake', required: false).found() error('MESON_SKIP_TEST cmake binary not available.') @@ -39,7 +37,7 @@ assert(depf2.found() == false, 'Invalid CMake targets should fail') # Try to find cmMesonTestDep in a custom prefix -# setup_env.json is used by run_project_tests.py:_run_test to point to ./cmake_pref_env/ + depPrefEnv = dependency('cmMesonTestDep', required : true, method : 'cmake') # Try to find a dependency with a custom CMake module @@ -63,7 +61,7 @@ zlibdep = cc.find_library('z') code = '''#include -int main(void) { +int main(int argc, char **argv) { void * something = deflate; if(something != 0) return 0; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/13 cmake dependency/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/13 cmake dependency/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/13 cmake dependency/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/13 cmake dependency/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #include -int main(void) { +int main(int argc, char **argv) { void * something = deflate; if(something != 0) return 0; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/13 cmake dependency/prog-checkver.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/13 cmake dependency/prog-checkver.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/13 cmake dependency/prog-checkver.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/13 cmake dependency/prog-checkver.c" 2019-11-28 17:37:44.000000000 +0000 @@ -2,7 +2,7 @@ #include #include -int main(void) { +int main(int argc, char **argv) { void * something = deflate; if(strcmp(ZLIB_VERSION, FOUND_ZLIB) != 0) { printf("Meson found '%s' but zlib is '%s'\n", FOUND_ZLIB, ZLIB_VERSION); diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/13 cmake dependency/testFlagSet.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/13 cmake dependency/testFlagSet.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/13 cmake dependency/testFlagSet.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/13 cmake dependency/testFlagSet.c" 2019-11-28 17:37:44.000000000 +0000 @@ -9,7 +9,7 @@ #error "REQUIRED_MESON_FLAG2 not set" #endif -int main(void) { +int main(int argc, char *argv[]) { printf("Hello World\n"); void * something = deflate; if(something != 0) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/14 static dynamic linkage/main.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/14 static dynamic linkage/main.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/14 static dynamic linkage/main.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/14 static dynamic linkage/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,7 +1,7 @@ #include "stdio.h" #include "zlib.h" -int main(void) { +int main() { printf("%s\n", zlibVersion()); return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/14 static dynamic linkage/verify_static.py" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/14 static dynamic linkage/verify_static.py" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/14 static dynamic linkage/verify_static.py" 2020-01-23 12:51:19.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/14 static dynamic linkage/verify_static.py" 2019-04-21 19:25:09.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python """Test script that checks if zlib was statically linked to executable""" import subprocess import sys diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/15 ld binary/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/15 ld binary/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/15 ld binary/meson.build" 2020-01-23 22:34:28.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/15 ld binary/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -project('ld binary') - -ld = find_program('ld') -assert(run_command(ld, '--version').returncode() == 0) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/1 pkg-config/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/1 pkg-config/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/1 pkg-config/meson.build" 2020-01-07 21:10:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/1 pkg-config/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -39,7 +39,7 @@ zlibdep = cc.find_library('z') code = '''#include -int main(void) { +int main(int argc, char **argv) { void * something = deflate; if(something != 0) return 0; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/1 pkg-config/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/1 pkg-config/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/1 pkg-config/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/1 pkg-config/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #include -int main(void) { +int main(int argc, char **argv) { void * something = deflate; if(something != 0) return 0; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/1 pkg-config/prog-checkver.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/1 pkg-config/prog-checkver.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/1 pkg-config/prog-checkver.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/1 pkg-config/prog-checkver.c" 2019-11-28 17:37:44.000000000 +0000 @@ -2,7 +2,7 @@ #include #include -int main(void) { +int main(int argc, char **argv) { void * something = deflate; if(strcmp(ZLIB_VERSION, FOUND_ZLIB) != 0) { printf("Meson found '%s' but zlib is '%s'\n", FOUND_ZLIB, ZLIB_VERSION); diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/2 external library/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/2 external library/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/2 external library/meson.build" 2020-01-07 21:10:26.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/2 external library/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -5,14 +5,14 @@ # Verify that link testing works. linkcode = '''#include -int main(void) { +int main(int argc, char **argv) { void *ptr = (void*)(deflate); return ptr == 0; } ''' nolinkcode='''int nonexisting(); -int main(void) { +int main(int argc, char **argv) { return nonexisting(); } ''' diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/2 external library/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/2 external library/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/2 external library/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/2 external library/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #include -int main(void) { +int main(int argc, char **argv) { void * something = deflate; if(something != 0) return 0; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/3 linker script/bob.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/3 linker script/bob.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/3 linker script/bob.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/3 linker script/bob.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,9 +1,9 @@ #include"bob.h" -int hiddenFunction(void) { +int hiddenFunction() { return 42; } -int bobMcBob(void) { +int bobMcBob() { return hiddenFunction(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/3 linker script/bob.h" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/3 linker script/bob.h" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/3 linker script/bob.h" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/3 linker script/bob.h" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #ifndef BOB_H_ #define BOB_H_ -int bobMcBob(void); +int bobMcBob(); #endif diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/3 linker script/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/3 linker script/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/3 linker script/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/3 linker script/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ #include"bob.h" -int main(void) { +int main(int argc, char **argv) { return bobMcBob() != 42; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/4 extdep static lib/lib.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/4 extdep static lib/lib.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/4 extdep static lib/lib.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/4 extdep static lib/lib.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #include -int statlibfunc(void) { +int statlibfunc() { void * something = deflate; if(something != 0) return 0; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/4 extdep static lib/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/4 extdep static lib/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/4 extdep static lib/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/4 extdep static lib/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ -int statlibfunc(void); +int statlibfunc(); -int main(void) { +int main(int argc, char **argv) { return statlibfunc(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/5 dependency versions/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/5 dependency versions/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/5 dependency versions/meson.build" 2020-01-07 21:10:34.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/5 dependency versions/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -50,12 +50,6 @@ somelibver = dependency('somelib', version : '>= 0.3', fallback : ['somelibver', 'some_dep']) -# Find an internal dependency again with impossible multi-version -somelibver = dependency('somelib', - version : ['>= 0.3', '<0.3'], - required : false, - fallback : ['somelibver', 'some_dep']) -assert(not somelibver.found(), 'Dependency should not be found') # Find somelib again, but with a fallback that will fail because subproject does not exist somelibfail = dependency('somelib', version : '>= 0.2', diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/6 subdir include order/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/6 subdir include order/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/6 subdir include order/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/6 subdir include order/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -4,4 +4,4 @@ #error "Failed" #endif -int main(void) { return 0; } +int main() { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/7 library versions/exe.orig.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/7 library versions/exe.orig.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/7 library versions/exe.orig.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/7 library versions/exe.orig.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,7 @@ int myFunc (void); -int main(void) +int +main (int argc, char *argv[]) { if (myFunc() == 55) return 0; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/7 library versions/lib.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/7 library versions/lib.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/7 library versions/lib.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/7 library versions/lib.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int myFunc(void) { +int myFunc() { return 55; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/8 subproject library install/subprojects/sublib/include/subdefs.h" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/8 subproject library install/subprojects/sublib/include/subdefs.h" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/8 subproject library install/subprojects/sublib/include/subdefs.h" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/8 subproject library install/subprojects/sublib/include/subdefs.h" 2019-11-28 17:37:44.000000000 +0000 @@ -16,6 +16,6 @@ #endif #endif -int DLL_PUBLIC subfunc(void); +int DLL_PUBLIC subfunc(); #endif diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/8 subproject library install/subprojects/sublib/sublib.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/8 subproject library install/subprojects/sublib/sublib.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/8 subproject library install/subprojects/sublib/sublib.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/8 subproject library install/subprojects/sublib/sublib.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ #include -int DLL_PUBLIC subfunc(void) { +int DLL_PUBLIC subfunc() { return 42; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/9 compiler checks with dependencies/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/9 compiler checks with dependencies/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/linuxlike/9 compiler checks with dependencies/meson.build" 2020-01-07 21:10:36.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/linuxlike/9 compiler checks with dependencies/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -10,7 +10,7 @@ assert (cc.has_member('GError', 'message', prefix : '#include ', dependencies : glib), 'GError::message not found') assert (cc.has_header_symbol('glib.h', 'gint32', dependencies : glib), 'gint32 symbol not found') linkcode = '''#include -int main (void) { +int main (int argc, char *argv[]) { GError *error = g_error_new_literal (0, 0, NULL); return error == NULL; } @@ -21,7 +21,7 @@ zlib = cc.find_library ('z') if zlib.found() linkcode = '''#include -int main(void) { +int main(int argc, char *argv[]) { void *ptr = (void*)(deflate); return ptr == 0; } @@ -34,3 +34,5 @@ dependencies : dependency('threads'), prefix : '#include '), 'Could not detect pthread_create with a thread dependency.') + + diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/objc/1 simple/prog.m" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/objc/1 simple/prog.m" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/objc/1 simple/prog.m" 2019-12-04 18:45:59.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/objc/1 simple/prog.m" 2016-01-23 18:52:39.000000000 +0000 @@ -1,5 +1,5 @@ #import -int main(void) { +int main(int argc, char **argv) { return 0; } \ No newline at end of file diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/objc/2 nsstring/stringprog.m" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/objc/2 nsstring/stringprog.m" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/objc/2 nsstring/stringprog.m" 2019-12-04 18:45:59.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/objc/2 nsstring/stringprog.m" 2016-01-23 18:52:39.000000000 +0000 @@ -1,6 +1,6 @@ #import -int main(void) { +int main(int argc, char **argv) { int result; NSString *str = [NSString new]; result = [str length]; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/objc/3 objc args/prog.m" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/objc/3 objc args/prog.m" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/objc/3 objc args/prog.m" 2019-12-04 18:45:59.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/objc/3 objc args/prog.m" 2018-08-25 08:05:43.000000000 +0000 @@ -1,6 +1,6 @@ #import -int main(void) +int main(int argc, char **argv) { #ifdef MESON_TEST int x = 3; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/objc/4 c++ project objc subproject/master.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/objc/4 c++ project objc subproject/master.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/objc/4 c++ project objc subproject/master.cpp" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/objc/4 c++ project objc subproject/master.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -4,7 +4,7 @@ extern "C" int foo(); -int main(void) { +int main() { std::cout << "Starting\n"; std::cout << foo() << "\n"; return 0; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/objcpp/1 simple/prog.mm" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/objcpp/1 simple/prog.mm" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/objcpp/1 simple/prog.mm" 2019-12-04 18:45:59.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/objcpp/1 simple/prog.mm" 2018-08-25 08:05:43.000000000 +0000 @@ -3,7 +3,7 @@ class MyClass { }; -int main(void) { +int main(int argc, char **argv) { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/objcpp/2 objc++ args/prog.mm" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/objcpp/2 objc++ args/prog.mm" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/objcpp/2 objc++ args/prog.mm" 2019-12-04 18:45:59.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/objcpp/2 objc++ args/prog.mm" 2018-08-25 08:05:43.000000000 +0000 @@ -4,7 +4,7 @@ { }; -int main(void) +int main(int argc, char **argv) { #ifdef MESON_OBJCPP_TEST int x = 1; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/osx/1 basic/main.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/osx/1 basic/main.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/osx/1 basic/main.c" 2019-12-04 18:45:59.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/osx/1 basic/main.c" 2016-01-23 18:52:39.000000000 +0000 @@ -1,5 +1,5 @@ #include -int main(void) { +int main(int argc, char **argv) { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/osx/2 library versions/exe.orig.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/osx/2 library versions/exe.orig.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/osx/2 library versions/exe.orig.c" 2019-12-04 18:45:59.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/osx/2 library versions/exe.orig.c" 2017-03-05 16:38:07.000000000 +0000 @@ -1,6 +1,8 @@ int myFunc (void); -int main (void) { +int +main (int argc, char *argv[]) +{ if (myFunc() == 55) return 0; return 1; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/osx/2 library versions/lib.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/osx/2 library versions/lib.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/osx/2 library versions/lib.c" 2019-12-04 18:45:59.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/osx/2 library versions/lib.c" 2016-07-15 10:52:00.000000000 +0000 @@ -1,3 +1,3 @@ -int myFunc(void) { +int myFunc() { return 55; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/osx/2 library versions/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/osx/2 library versions/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/osx/2 library versions/meson.build" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/osx/2 library versions/meson.build" 2019-02-07 09:08:59.000000000 +0000 @@ -8,11 +8,10 @@ zlib_dep = dependency('zlib', required: required) if zlib_dep.found() - build_rpath = zlib_dep.type_name() == 'pkgconfig' ? zlib_dep.get_pkgconfig_variable('libdir') : 'lib' some = shared_library('some', 'lib.c', # duplicate the rpath again, in order # to test Meson's RPATH deduplication - build_rpath : build_rpath, + build_rpath : zlib_dep.get_pkgconfig_variable('libdir'), dependencies : zlib_dep, version : '1.2.3', soversion : '7', diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/osx/4 framework/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/osx/4 framework/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/osx/4 framework/prog.c" 2019-12-04 18:45:59.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/osx/4 framework/prog.c" 2017-05-24 16:55:14.000000000 +0000 @@ -1,3 +1,3 @@ -int main(void) { +int main(int argc, char **argv) { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/osx/4 framework/stat.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/osx/4 framework/stat.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/osx/4 framework/stat.c" 2019-12-04 18:45:59.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/osx/4 framework/stat.c" 2017-05-24 16:55:14.000000000 +0000 @@ -1 +1 @@ -int func(void) { return 933; } +int func() { return 933; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/osx/5 extra frameworks/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/osx/5 extra frameworks/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/osx/5 extra frameworks/prog.c" 2019-12-04 18:45:59.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/osx/5 extra frameworks/prog.c" 2019-02-07 09:08:59.000000000 +0000 @@ -1,3 +1,3 @@ -int main(void) { +int main(int argc, char **argv) { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/osx/5 extra frameworks/stat.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/osx/5 extra frameworks/stat.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/osx/5 extra frameworks/stat.c" 2019-12-04 18:45:59.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/osx/5 extra frameworks/stat.c" 2019-02-07 09:08:59.000000000 +0000 @@ -1 +1 @@ -int func(void) { return 933; } +int func() { return 933; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/osx/7 bitcode/libbar.mm" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/osx/7 bitcode/libbar.mm" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/osx/7 bitcode/libbar.mm" 2019-12-04 18:45:59.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/osx/7 bitcode/libbar.mm" 2019-06-27 16:43:00.000000000 +0000 @@ -1,7 +1,7 @@ #import #import "vis.h" -int EXPORT_PUBLIC libbar(void) { +int EXPORT_PUBLIC libbar(int arg) { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/osx/7 bitcode/libfile.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/osx/7 bitcode/libfile.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/osx/7 bitcode/libfile.c" 2019-12-04 18:45:59.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/osx/7 bitcode/libfile.c" 2019-06-27 16:43:00.000000000 +0000 @@ -1,5 +1,5 @@ #include "vis.h" -int EXPORT_PUBLIC libfunc(void) { +int EXPORT_PUBLIC libfunc() { return 3; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/osx/7 bitcode/libfoo.m" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/osx/7 bitcode/libfoo.m" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/osx/7 bitcode/libfoo.m" 2019-12-04 18:45:59.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/osx/7 bitcode/libfoo.m" 2019-06-27 16:43:00.000000000 +0000 @@ -1,7 +1,7 @@ #import #import "vis.h" -int EXPORT_PUBLIC libfoo(void) { +int EXPORT_PUBLIC libfoo(int arg) { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/osx/8 pie/main.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/osx/8 pie/main.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/osx/8 pie/main.c" 2019-12-04 18:45:59.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/osx/8 pie/main.c" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#include - -int main(void) { - return 0; -} diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/osx/8 pie/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/osx/8 pie/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/osx/8 pie/meson.build" 2019-12-04 18:45:59.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/osx/8 pie/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -project('osx pie', 'c') -e = executable('prog', 'main.c', pie : true) -test('pie', e) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/python/4 custom target depends extmodule/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/python/4 custom target depends extmodule/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/python/4 custom target depends extmodule/meson.build" 2020-01-07 21:13:20.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/python/4 custom target depends extmodule/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -6,7 +6,6 @@ py_mod = import('python') py3 = py_mod.find_installation() py3_dep = py3.dependency(required : false) -cc = meson.get_compiler('c') # Copy to the builddir so that blaster.py can find the built tachyon module # FIXME: We should automatically detect this case and append the correct paths @@ -21,10 +20,6 @@ assert(f.read() == b'success') ''' if py3_dep.found() - message('Detected Python version: ' + py3_dep.version()) - if py3_dep.version().version_compare('>=3.8') and cc.get_id() == 'msvc' and cc.version().version_compare('<=19.00.24215.1') - error('MESON_SKIP_TEST: Python modules do not work with Python 3.8 and VS2015 or earlier.') - endif subdir('ext') out_txt = custom_target('tachyon flux', diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/python3/2 extmodule/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/python3/2 extmodule/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/python3/2 extmodule/meson.build" 2020-01-07 21:13:15.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/python3/2 extmodule/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -6,17 +6,8 @@ py3_mod = import('python3') py3 = py3_mod.find_python() py3_dep = dependency('python3', required : false) -cc = meson.get_compiler('c') if py3_dep.found() - message('Detected Python version: ' + py3_dep.version()) - # Building extensions for Python 3 using Visual Studio 2015 - # no longer works (or, rather, they build but don't run). - # Disable the tests in this case. - if py3_dep.version().version_compare('>=3.8') and cc.get_id() == 'msvc' and cc.version().version_compare('<=19.00.24215.1') - error('MESON_SKIP_TEST: Python modules do not work with Python 3.8 and VS2015 or earlier.') - endif - subdir('ext') test('extmod', diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/python3/4 custom target depends extmodule/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/python3/4 custom target depends extmodule/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/python3/4 custom target depends extmodule/meson.build" 2020-01-07 21:13:15.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/python3/4 custom target depends extmodule/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -6,7 +6,6 @@ py3_mod = import('python3') py3 = py3_mod.find_python() py3_dep = dependency('python3', required : false) -cc = meson.get_compiler('c') # Copy to the builddir so that blaster.py can find the built tachyon module # FIXME: We should automatically detect this case and append the correct paths @@ -21,11 +20,6 @@ assert(f.read() == b'success') ''' if py3_dep.found() - message('Detected Python version: ' + py3_dep.version()) - if py3_dep.version().version_compare('>=3.8') and cc.get_id() == 'msvc' and cc.version().version_compare('<=19.00.24215.1') - error('MESON_SKIP_TEST: Python modules do not work with Python 3.8 and VS2015 or earlier.') - endif - subdir('ext') out_txt = custom_target('tachyon flux', diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/rust/4 polyglot/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/rust/4 polyglot/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/rust/4 polyglot/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/rust/4 polyglot/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -2,7 +2,7 @@ void f(); -int main(void) { +int main() { printf("Hello from C!\n"); f(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/rust/5 polyglot static/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/rust/5 polyglot static/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/rust/5 polyglot static/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/rust/5 polyglot static/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -2,7 +2,7 @@ void f(); -int main(void) { +int main() { printf("Hello from C!\n"); f(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/11 cross prog/some_cross_tool.py" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/11 cross prog/some_cross_tool.py" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/11 cross prog/some_cross_tool.py" 2020-01-23 12:51:19.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/11 cross prog/some_cross_tool.py" 2018-10-31 09:31:20.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python from __future__ import print_function diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/11 cross prog/sometool.py" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/11 cross prog/sometool.py" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/11 cross prog/sometool.py" 2020-01-23 12:51:19.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/11 cross prog/sometool.py" 2018-10-31 09:31:20.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python from __future__ import print_function diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/14 testsetup selection/main.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/14 testsetup selection/main.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/14 testsetup selection/main.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/14 testsetup selection/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int main(void) { +int main() { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/14 testsetup selection/subprojects/bar/bar.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/14 testsetup selection/subprojects/bar/bar.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/14 testsetup selection/subprojects/bar/bar.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/14 testsetup selection/subprojects/bar/bar.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int main(void) { +int main() { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/14 testsetup selection/subprojects/foo/foo.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/14 testsetup selection/subprojects/foo/foo.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/14 testsetup selection/subprojects/foo/foo.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/14 testsetup selection/subprojects/foo/foo.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int main(void) { +int main() { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/25 non-permitted kwargs/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/25 non-permitted kwargs/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/25 non-permitted kwargs/meson.build" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/25 non-permitted kwargs/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ project('non-permitted kwargs', 'c') cc = meson.get_compiler('c') cc.has_header_symbol('stdio.h', 'printf', prefixxx: '#define XXX') -cc.links('int main(void){}', argsxx: '') +cc.links('int main(){}', argsxx: '') cc.get_id(invalidxx: '') diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/29 guessed linker dependencies/exe/app.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/29 guessed linker dependencies/exe/app.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/29 guessed linker dependencies/exe/app.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/29 guessed linker dependencies/exe/app.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ void liba_func(); -int main(void) { +int main() { liba_func(); return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/32 pkgconfig use libraries/app/app.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/32 pkgconfig use libraries/app/app.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/32 pkgconfig use libraries/app/app.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/32 pkgconfig use libraries/app/app.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ void libb_func(); -int main(void) { +int main() { libb_func(); return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/34 command line/meson_options.txt" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/34 command line/meson_options.txt" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/34 command line/meson_options.txt" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/34 command line/meson_options.txt" 2019-11-28 17:37:44.000000000 +0000 @@ -1,2 +1 @@ option('set_sub_opt', type : 'boolean', value : false) -option('set_percent_opt', type : 'string', value: 'not_set') diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/39 python extmodule/blaster.py" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/39 python extmodule/blaster.py" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/39 python extmodule/blaster.py" 2020-01-23 12:51:19.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/39 python extmodule/blaster.py" 2018-10-31 09:31:57.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python import sys import tachyon diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/45 vscpp17/main.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/45 vscpp17/main.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/45 vscpp17/main.cpp" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/45 vscpp17/main.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -1,7 +1,7 @@ -[[nodiscard]] int foo(void) { +[[nodiscard]] int foo() { return 0; } -int main(void) { +int main() { return foo(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/4 suite selection/failing_test.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/4 suite selection/failing_test.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/4 suite selection/failing_test.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/4 suite selection/failing_test.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1 +1 @@ -int main(void) { return -1 ; } +int main() { return -1 ; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/4 suite selection/subprojects/subprjfail/failing_test.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/4 suite selection/subprojects/subprjfail/failing_test.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/4 suite selection/subprojects/subprjfail/failing_test.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/4 suite selection/subprojects/subprjfail/failing_test.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1 +1 @@ -int main(void) { return -1 ; } +int main() { return -1 ; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/4 suite selection/subprojects/subprjmix/failing_test.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/4 suite selection/subprojects/subprjmix/failing_test.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/4 suite selection/subprojects/subprjmix/failing_test.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/4 suite selection/subprojects/subprjmix/failing_test.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1 +1 @@ -int main(void) { return -1 ; } +int main() { return -1 ; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/4 suite selection/subprojects/subprjmix/successful_test.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/4 suite selection/subprojects/subprjmix/successful_test.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/4 suite selection/subprojects/subprjmix/successful_test.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/4 suite selection/subprojects/subprjmix/successful_test.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1 +1 @@ -int main(void) { return 0 ; } +int main() { return 0 ; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/4 suite selection/subprojects/subprjsucc/successful_test.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/4 suite selection/subprojects/subprjsucc/successful_test.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/4 suite selection/subprojects/subprjsucc/successful_test.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/4 suite selection/subprojects/subprjsucc/successful_test.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1 +1 @@ -int main(void) { return 0 ; } +int main() { return 0 ; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/4 suite selection/successful_test.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/4 suite selection/successful_test.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/4 suite selection/successful_test.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/4 suite selection/successful_test.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1 +1 @@ -int main(void) { return 0 ; } +int main() { return 0 ; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/57 introspection/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/57 introspection/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/57 introspection/meson.build" 2019-12-29 22:47:27.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/57 introspection/meson.build" 2019-08-28 17:15:39.000000000 +0000 @@ -13,9 +13,8 @@ list_test_plusassign += ['bugs everywhere'] if false - vers_str = '<=99.9.9' - dependency('somethingthatdoesnotexist', required: true, version: '>=1.2.3') - dependency('look_i_have_a_fallback', version: ['>=1.0.0', vers_str], fallback: ['oh_no', 'the_subproject_does_not_exist']) + dependency('somethingthatdoesnotexist', required: true) + dependency('look_i_have_a_fallback', fallback: ['oh_no', 'the_subproject_does_not_exist']) endif subdir('sharedlib') diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/57 introspection/t1.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/57 introspection/t1.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/57 introspection/t1.cpp" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/57 introspection/t1.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #include "sharedlib/shared.hpp" -int main(void) { +int main() { SharedClass cl1; if(cl1.getNumber() != 42) { return 1; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/57 introspection/t2.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/57 introspection/t2.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/57 introspection/t2.cpp" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/57 introspection/t2.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #include "staticlib/static.h" -int main(void) { +int main() { if(add_numbers(1, 2) != 3) { return 1; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/57 introspection/t3.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/57 introspection/t3.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/57 introspection/t3.cpp" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/57 introspection/t3.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -1,7 +1,7 @@ #include "sharedlib/shared.hpp" #include "staticlib/static.h" -int main(void) { +int main() { for(int i = 0; i < 1000; add_numbers(i, 1)) { SharedClass cl1; if(cl1.getNumber() != 42) { diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/59 introspect buildoptions/main.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/59 introspect buildoptions/main.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/59 introspect buildoptions/main.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/59 introspect buildoptions/main.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #include -int main(void) { +int main() { printf("Hello World"); return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/61 identity cross/build_wrapper.py" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/61 identity cross/build_wrapper.py" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/61 identity cross/build_wrapper.py" 2020-01-23 12:51:19.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/61 identity cross/build_wrapper.py" 2019-08-28 17:15:39.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python import subprocess, sys diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/61 identity cross/host_wrapper.py" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/61 identity cross/host_wrapper.py" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/61 identity cross/host_wrapper.py" 2020-01-23 12:51:19.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/61 identity cross/host_wrapper.py" 2019-08-28 17:15:39.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python import subprocess, sys diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/65 cmake parser/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/65 cmake parser/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/65 cmake parser/meson.build" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/65 cmake parser/meson.build" 2019-11-28 17:37:44.000000000 +0000 @@ -15,5 +15,5 @@ assert(dep.get_variable(cmake : 'CACHED_STRING_ARRAY_NS') == ['foo', 'bar'], 'set(CACHED STRING) without spaces is incorrect') assert(dep.get_variable(cmake : 'CACHED_STRING_ARRAY_WS') == ['foo', 'foo bar', 'bar'], 'set(CACHED STRING[]) with spaces is incorrect') -# We don't support this, so it should be unset. +# We don't suppor this, so it should be unset. assert(dep.get_variable(cmake : 'ENV{var}', default_value : 'sentinal') == 'sentinal', 'set(ENV) should be ignored') \ No newline at end of file diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/68 static archive stripping/app/appA.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/68 static archive stripping/app/appA.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/68 static archive stripping/app/appA.c" 2020-01-23 22:29:05.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/68 static archive stripping/app/appA.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,4 +1,4 @@ #include #include -int main(void) { printf("The answer is: %d\n", libA_func()); } +int main() { printf("The answer is: %d\n", libA_func()); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/68 static archive stripping/app/appB.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/68 static archive stripping/app/appB.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/68 static archive stripping/app/appB.c" 2020-01-23 22:29:05.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/68 static archive stripping/app/appB.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,4 +1,4 @@ #include #include -int main(void) { printf("The answer is: %d\n", libB_func()); } +int main() { printf("The answer is: %d\n", libB_func()); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/71 cross/crossfile.in" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/71 cross/crossfile.in" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/71 cross/crossfile.in" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/71 cross/crossfile.in" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -[host_machine] -system = '@system@' -cpu_family = '@cpu_family@' -cpu = '@cpu@' -endian = '@endian@' diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/71 cross/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/71 cross/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/71 cross/meson.build" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/71 cross/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -project('crosstest') - -if get_option('generate') - conf_data = configuration_data() - conf_data.set('system', build_machine.system()) - conf_data.set('cpu', build_machine.cpu()) - conf_data.set('cpu_family', build_machine.cpu_family()) - conf_data.set('endian', build_machine.endian()) - - configure_file(input: 'crossfile.in', - output: 'crossfile', - configuration: conf_data) - message('Written cross file') -else - assert(meson.is_cross_build(), 'not setup as cross build') -endif diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/71 cross/meson_options.txt" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/71 cross/meson_options.txt" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/71 cross/meson_options.txt" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/71 cross/meson_options.txt" 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -option('generate', type : 'boolean', value : false) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/73 wrap file url/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/73 wrap file url/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/73 wrap file url/meson.build" 2020-01-23 12:51:19.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/73 wrap file url/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -project('test wrap with file url') - -exe = subproject('foo').get_variable('foo_exe') -test('test1', exe) Binary files /tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/73 wrap file url/subprojects/foo-patch.tar.xz and /tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/73 wrap file url/subprojects/foo-patch.tar.xz differ Binary files /tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/73 wrap file url/subprojects/foo.tar.xz and /tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/73 wrap file url/subprojects/foo.tar.xz differ diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/74 summary/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/74 summary/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/74 summary/meson.build" 2020-02-25 18:00:47.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/74 summary/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -project('My Project', version : '1.0') - -subproject('sub') -subproject('sub2', required : false) - -summary({'Some boolean': false, - 'Another boolean': true, - 'Some string': 'Hello World', - 'A list': ['string', 1, true], - 'empty list': [], - }, section: 'Configuration') -summary('A number', 1, section: 'Configuration') -summary('yes', true, bool_yn : true, section: 'Configuration') -summary('no', false, bool_yn : true, section: 'Configuration') diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/74 summary/subprojects/sub/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/74 summary/subprojects/sub/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/74 summary/subprojects/sub/meson.build" 2020-01-23 22:29:05.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/74 summary/subprojects/sub/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -project('Some Subproject', version : '2.0') - -summary('string', 'bar') -summary({'integer': 1, 'boolean': true}) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/74 summary/subprojects/sub2/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/74 summary/subprojects/sub2/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/unit/74 summary/subprojects/sub2/meson.build" 2020-01-23 22:29:05.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/unit/74 summary/subprojects/sub2/meson.build" 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -project('sub2') - -error('This subproject failed') - -summary('Section', 'Should not be seen') diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/warning/1 version for string div/a/b.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/warning/1 version for string div/a/b.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/warning/1 version for string div/a/b.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/warning/1 version for string div/a/b.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int main(void) +int main() { } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/wasm/1 basic/hello.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/wasm/1 basic/hello.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/wasm/1 basic/hello.cpp" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/wasm/1 basic/hello.cpp" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #include -int main(void) { +int main() { std::cout << "Hello World" << std::endl; return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/10 vs module defs generated custom target/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/10 vs module defs generated custom target/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/10 vs module defs generated custom target/prog.c" 2019-12-04 18:45:59.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/10 vs module defs generated custom target/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ -int somedllfunc(void); +int somedllfunc(); -int main(void) { +int main(int argc, char **argv) { return somedllfunc() == 42 ? 0 : 1; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/10 vs module defs generated custom target/subdir/somedll.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/10 vs module defs generated custom target/subdir/somedll.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/10 vs module defs generated custom target/subdir/somedll.c" 2019-12-04 18:45:59.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/10 vs module defs generated custom target/subdir/somedll.c" 2018-10-31 09:31:20.000000000 +0000 @@ -1,3 +1,3 @@ -int somedllfunc(void) { +int somedllfunc() { return 42; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/11 exe implib/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/11 exe implib/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/11 exe implib/prog.c" 2019-12-04 18:45:59.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/11 exe implib/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,6 @@ #include int __declspec(dllexport) -main(void) { +main(int argc, char **argv) { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/12 resources with custom targets/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/12 resources with custom targets/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/12 resources with custom targets/prog.c" 2019-12-04 18:45:59.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/12 resources with custom targets/prog.c" 2018-10-31 09:31:20.000000000 +0000 @@ -10,10 +10,5 @@ int nCmdShow) { HICON hIcon; hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(MY_ICON)); - // avoid unused argument error while matching template - ((void)hInstance); - ((void)hPrevInstance); - ((void)lpszCmdLine); - ((void)nCmdShow); return hIcon ? 0 : 1; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/13 test argument extra paths/exe/main.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/13 test argument extra paths/exe/main.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/13 test argument extra paths/exe/main.c" 2019-12-04 18:45:59.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/13 test argument extra paths/exe/main.c" 2018-10-31 09:31:20.000000000 +0000 @@ -1,5 +1,5 @@ #include -int main(void) { +int main(int ac, char **av) { return foo_process(); } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/14 resources with custom target depend_files/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/14 resources with custom target depend_files/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/14 resources with custom target depend_files/prog.c" 2019-12-04 18:45:59.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/14 resources with custom target depend_files/prog.c" 2018-10-31 09:31:20.000000000 +0000 @@ -10,10 +10,5 @@ int nCmdShow) { HICON hIcon; hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(MY_ICON)); - // avoid unused argument error while matching template - ((void)hInstance); - ((void)hPrevInstance); - ((void)lpszCmdLine); - ((void)nCmdShow); return hIcon ? 0 : 1; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/15 resource scripts with duplicate filenames/exe3/src_dll/main.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/15 resource scripts with duplicate filenames/exe3/src_dll/main.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/15 resource scripts with duplicate filenames/exe3/src_dll/main.c" 2019-12-04 18:45:59.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/15 resource scripts with duplicate filenames/exe3/src_dll/main.c" 2018-10-31 09:31:20.000000000 +0000 @@ -2,9 +2,5 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { - // avoid unused argument error while matching template - ((void)hinstDLL); - ((void)fdwReason); - ((void)lpvReserved); return TRUE; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/15 resource scripts with duplicate filenames/exe3/src_exe/main.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/15 resource scripts with duplicate filenames/exe3/src_exe/main.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/15 resource scripts with duplicate filenames/exe3/src_exe/main.c" 2019-12-04 18:45:59.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/15 resource scripts with duplicate filenames/exe3/src_exe/main.c" 2018-10-31 09:31:20.000000000 +0000 @@ -1,3 +1,3 @@ -int main(void) { +int main(int argc, char **argv) { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/15 resource scripts with duplicate filenames/exe4/src_dll/main.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/15 resource scripts with duplicate filenames/exe4/src_dll/main.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/15 resource scripts with duplicate filenames/exe4/src_dll/main.c" 2019-12-04 18:45:59.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/15 resource scripts with duplicate filenames/exe4/src_dll/main.c" 2018-10-31 09:31:20.000000000 +0000 @@ -2,9 +2,5 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { - // avoid unused argument error while matching template - ((void)hinstDLL); - ((void)fdwReason); - ((void)lpvReserved); return TRUE; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/15 resource scripts with duplicate filenames/exe4/src_exe/main.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/15 resource scripts with duplicate filenames/exe4/src_exe/main.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/15 resource scripts with duplicate filenames/exe4/src_exe/main.c" 2019-12-04 18:45:59.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/15 resource scripts with duplicate filenames/exe4/src_exe/main.c" 2018-10-31 09:31:20.000000000 +0000 @@ -1,3 +1,3 @@ -int main(void) { +int main(int argc, char **argv) { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/15 resource scripts with duplicate filenames/verify.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/15 resource scripts with duplicate filenames/verify.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/15 resource scripts with duplicate filenames/verify.c" 2019-12-04 18:45:59.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/15 resource scripts with duplicate filenames/verify.c" 2018-10-31 09:31:20.000000000 +0000 @@ -1,7 +1,7 @@ #include #include -int main(int argc, char *argv[]) +int main(int arc, char *argv[]) { // verify that the expected resource exists and has the expected contents HRSRC hRsrc; @@ -9,8 +9,6 @@ HGLOBAL hGlobal; void* data; - ((void)argc); - hRsrc = FindResource(NULL, argv[1], RT_RCDATA); assert(hRsrc); diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/16 gui app/console_prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/16 gui app/console_prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/16 gui app/console_prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/16 gui app/console_prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,3 +1,3 @@ -int main(void) { +int main(int argc, char **argv) { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/16 gui app/gui_app_tester.py" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/16 gui app/gui_app_tester.py" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/16 gui app/gui_app_tester.py" 2020-01-23 12:51:19.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/16 gui app/gui_app_tester.py" 2018-10-31 09:31:20.000000000 +0000 @@ -1,19 +1,26 @@ #!/usr/bin/env python3 -import os +import re +import subprocess import sys -try: - import pefile -except ImportError: - if 'CI' in os.environ: - raise - # Skip the test if not on CI - sys.exit(77) -executable = sys.argv[1] -expected = int(sys.argv[2]) +tool = sys.argv[1] +executable = sys.argv[2] +expected = int(sys.argv[3]) +actual = -1 -actual = pefile.PE(executable).dump_dict()['OPTIONAL_HEADER']['Subsystem']['Value'] +if 'objdump' in tool: + result = subprocess.check_output([tool, '-p', executable]).decode() + match = re.search(r'^Subsystem\s+(\d+)', result, re.MULTILINE) +elif 'dumpbin' in tool: + result = subprocess.check_output([tool, '/headers', executable]).decode() + match = re.search(r'^\s*(\d+) subsystem(?! version)', result, re.MULTILINE) +else: + print('unknown tool') + sys.exit(1) + +if match: + actual = int(match.group(1)) print('subsystem expected: %d, actual: %d' % (expected, actual)) sys.exit(0 if (expected == actual) else 1) diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/16 gui app/gui_prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/16 gui app/gui_prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/16 gui app/gui_prog.c" 2019-12-04 18:45:59.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/16 gui app/gui_prog.c" 2018-10-31 09:31:20.000000000 +0000 @@ -2,10 +2,5 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { - // avoid unused argument error while matching template - ((void)hInstance); - ((void)hPrevInstance); - ((void)lpCmdLine); - ((void)nCmdShow); return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/16 gui app/meson.build" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/16 gui app/meson.build" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/16 gui app/meson.build" 2020-01-23 12:51:19.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/16 gui app/meson.build" 2018-12-09 14:27:16.000000000 +0000 @@ -17,5 +17,10 @@ tester = find_program('gui_app_tester.py') -test('is_gui', tester, args: [gui_prog, '2']) -test('not_gui', tester, args: [console_prog, '3']) +tool = find_program('objdump', 'dumpbin', required: false) +# TODO: when 'llvm-objdump -f' emits the subsystem type, we could use that also + +if tool.found() + test('is_gui', tester, args: [tool.path(), gui_prog, '2']) + test('not_gui', tester, args: [tool.path(), console_prog, '3']) +endif diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/1 basic/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/1 basic/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/1 basic/prog.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/1 basic/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ #include -int main(void) { +int main(int argc, char **argv) { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/2 winmain/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/2 winmain/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/2 winmain/prog.c" 2019-12-04 18:45:59.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/2 winmain/prog.c" 2016-01-23 18:52:39.000000000 +0000 @@ -6,10 +6,5 @@ HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow) { -// avoid unused argument error while matching template - ((void)hInstance); - ((void)hPrevInstance); - ((void)lpszCmdLine); - ((void)nCmdShow); return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/3 cpp/prog.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/3 cpp/prog.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/3 cpp/prog.cpp" 2019-12-04 18:45:59.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/3 cpp/prog.cpp" 2016-01-23 18:52:39.000000000 +0000 @@ -2,6 +2,6 @@ class Foo; -int main(void) { +int main(int argc, char **argv) { return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/4 winmaincpp/prog.cpp" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/4 winmaincpp/prog.cpp" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/4 winmaincpp/prog.cpp" 2019-12-04 18:45:59.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/4 winmaincpp/prog.cpp" 2016-01-23 18:52:39.000000000 +0000 @@ -8,10 +8,5 @@ HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow) { -// avoid unused argument error while matching template - ((void)hInstance); - ((void)hPrevInstance); - ((void)lpszCmdLine); - ((void)nCmdShow); return 0; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/5 resources/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/5 resources/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/5 resources/prog.c" 2019-12-04 18:45:59.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/5 resources/prog.c" 2018-08-25 08:05:43.000000000 +0000 @@ -12,10 +12,5 @@ int nCmdShow) { HICON hIcon; hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(MY_ICON)); -// avoid unused argument error while matching template - ((void)hInstance); - ((void)hPrevInstance); - ((void)lpszCmdLine); - ((void)nCmdShow); return hIcon ? 0 : 1; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/6 vs module defs/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/6 vs module defs/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/6 vs module defs/prog.c" 2019-12-04 18:45:59.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/6 vs module defs/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ -int somedllfunc(void); +int somedllfunc(); -int main(void) { +int main(int argc, char **argv) { return somedllfunc() == 42 ? 0 : 1; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/6 vs module defs/subdir/somedll.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/6 vs module defs/subdir/somedll.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/6 vs module defs/subdir/somedll.c" 2019-12-04 18:45:59.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/6 vs module defs/subdir/somedll.c" 2017-05-12 16:38:51.000000000 +0000 @@ -1,3 +1,3 @@ -int somedllfunc(void) { +int somedllfunc() { return 42; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/7 dll versioning/exe.orig.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/7 dll versioning/exe.orig.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/7 dll versioning/exe.orig.c" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/7 dll versioning/exe.orig.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,6 +1,7 @@ int myFunc (void); -int main(void) +int +main (int argc, char *argv[]) { if (myFunc() == 55) return 0; diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/7 dll versioning/installed_files.txt" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/7 dll versioning/installed_files.txt" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/7 dll versioning/installed_files.txt" 2019-12-04 18:45:50.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/7 dll versioning/installed_files.txt" 2019-11-28 17:37:44.000000000 +0000 @@ -4,6 +4,7 @@ ?msvc:usr/bin/noversion.dll ?msvc:usr/bin/noversion.pdb ?msvc:usr/lib/noversion.lib +?msvc:usr/lib/noversion.pdb ?msvc:usr/bin/onlyversion-1.dll ?msvc:usr/bin/onlyversion-1.pdb ?msvc:usr/lib/onlyversion.lib diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/7 dll versioning/lib.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/7 dll versioning/lib.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/7 dll versioning/lib.c" 2019-12-04 18:45:59.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/7 dll versioning/lib.c" 2018-10-31 09:31:20.000000000 +0000 @@ -1,6 +1,6 @@ #ifdef _WIN32 __declspec(dllexport) #endif -int myFunc(void) { +int myFunc() { return 55; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/8 find program/test-script" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/8 find program/test-script" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/8 find program/test-script" 2020-01-23 12:51:19.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/8 find program/test-script" 2018-10-31 09:31:20.000000000 +0000 @@ -1,3 +1,3 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python print('1') diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/9 vs module defs generated/prog.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/9 vs module defs generated/prog.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/9 vs module defs generated/prog.c" 2019-12-04 18:45:59.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/9 vs module defs generated/prog.c" 2019-11-28 17:37:44.000000000 +0000 @@ -1,5 +1,5 @@ -int somedllfunc(void); +int somedllfunc(); -int main(void) { +int main(int argc, char **argv) { return somedllfunc() == 42 ? 0 : 1; } diff -Nru "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/9 vs module defs generated/subdir/somedll.c" "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/9 vs module defs generated/subdir/somedll.c" --- "/tmp/tmpL5_Fwf/otsle6Dt7G/meson-0.53.2/test cases/windows/9 vs module defs generated/subdir/somedll.c" 2019-12-04 18:45:59.000000000 +0000 +++ "/tmp/tmpL5_Fwf/L5z0D9oz5T/meson-0.52.1/test cases/windows/9 vs module defs generated/subdir/somedll.c" 2018-10-31 09:31:20.000000000 +0000 @@ -1,3 +1,3 @@ -int somedllfunc(void) { +int somedllfunc() { return 42; } diff -Nru meson-0.53.2/tools/ac_converter.py meson-0.52.1/tools/ac_converter.py --- meson-0.53.2/tools/ac_converter.py 2019-12-29 22:47:27.000000000 +0000 +++ meson-0.52.1/tools/ac_converter.py 2019-11-28 17:37:44.000000000 +0000 @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -help_message = """Usage: {} +help_message = """Usage: %s This script reads config.h.meson, looks for header checks and writes the corresponding meson declaration. @@ -368,7 +368,7 @@ sizes = [] if len(sys.argv) != 2: - print(help_message.format(sys.argv[0])) + print(help_message % sys.argv[0]) sys.exit(0) with open(sys.argv[1]) as f: @@ -389,9 +389,9 @@ token = arr[1] if token in function_data: fdata = function_data[token] - functions.append([token, fdata[0], fdata[1]]) + functions.append((token, fdata[0], fdata[1])) elif token.startswith('HAVE_') and not token.endswith('_H'): - functions.append([token]) + functions.append((token, )) except Exception: pass @@ -414,7 +414,7 @@ print('check_headers = [') for token, hname in headers: - print(" ['{}', '{}'],".format(token, hname)) + print(" ['%s', '%s']," % (token, hname)) print(']\n') print('''foreach h : check_headers @@ -427,12 +427,12 @@ # Convert function checks. print('check_functions = [') -for tok in functions: - if len(tok) == 3: - tokstr, fdata0, fdata1 = tok - print(" ['{}', '{}', '#include<{}>'],".format(tokstr, fdata0, fdata1)) +for token in functions: + if len(token) == 3: + token, fdata0, fdata1 = token + print(" ['%s', '%s', '#include<%s>']," % (token, fdata0, fdata1)) else: - print('# check token', tok) + print('# check token', token) print(']\n') print('''foreach f : check_functions @@ -445,7 +445,7 @@ # Convert sizeof checks. for elem, typename in sizes: - print("cdata.set('{}', cc.sizeof('{}'))".format(elem, typename)) + print("cdata.set('%s', cc.sizeof('%s'))" % (elem, typename)) print(''' configure_file(input : 'config.h.meson', diff -Nru meson-0.53.2/tools/boost_names.py meson-0.52.1/tools/boost_names.py --- meson-0.53.2/tools/boost_names.py 2019-12-04 18:45:50.000000000 +0000 +++ meson-0.52.1/tools/boost_names.py 2019-11-28 17:37:44.000000000 +0000 @@ -31,7 +31,7 @@ import re Module = collections.namedtuple('Module', ['dirname', 'name', 'libnames']) -Module.__repr__ = lambda self: str((self.dirname, self.name, self.libnames)) # type: ignore +Module.__repr__ = lambda self: str((self.dirname, self.name, self.libnames)) LIBS = 'libs' diff -Nru meson-0.53.2/tools/cmake2meson.py meson-0.52.1/tools/cmake2meson.py --- meson-0.53.2/tools/cmake2meson.py 2020-01-23 12:51:19.000000000 +0000 +++ meson-0.52.1/tools/cmake2meson.py 2019-11-28 17:37:44.000000000 +0000 @@ -14,22 +14,21 @@ # See the License for the specific language governing permissions and # limitations under the License. -import typing as T +from typing import List from pathlib import Path import sys import re -import argparse class Token: - def __init__(self, tid: str, value: str): + def __init__(self, tid, value): self.tid = tid self.value = value self.lineno = 0 self.colno = 0 class Statement: - def __init__(self, name: str, args: list): + def __init__(self, name, args): self.name = name.lower() self.args = args @@ -47,7 +46,7 @@ ('rparen', re.compile(r'\)')), ] - def lex(self, code: str) -> T.Iterator[Token]: + def lex(self, code): lineno = 1 line_start = 0 loc = 0 @@ -81,10 +80,10 @@ elif tid == 'varexp': yield(Token('varexp', match_text[2:-1])) else: - raise ValueError('lex: unknown element {}'.format(tid)) + raise RuntimeError('Wharrgarbl') break if not matched: - raise ValueError('Lexer got confused line %d column %d' % (lineno, col)) + raise RuntimeError('Lexer got confused line %d column %d' % (lineno, col)) class Parser: def __init__(self, code: str): @@ -97,18 +96,18 @@ except StopIteration: self.current = Token('eof', '') - def accept(self, s: str) -> bool: + def accept(self, s): if self.current.tid == s: self.getsym() return True return False - def expect(self, s: str) -> bool: + def expect(self, s): if self.accept(s): return True - raise ValueError('Expecting %s got %s.' % (s, self.current.tid), self.current.lineno, self.current.colno) + raise RuntimeError('Expecting %s got %s.' % (s, self.current.tid), self.current.lineno, self.current.colno) - def statement(self) -> Statement: + def statement(self): cur = self.current if self.accept('comment'): return Statement('_', [cur.value]) @@ -118,7 +117,7 @@ self.expect('rparen') return Statement(cur.value, args) - def arguments(self) -> list: + def arguments(self): args = [] if self.accept('lparen'): args.append(self.arguments()) @@ -135,7 +134,7 @@ args += rest return args - def parse(self) -> T.Iterator[Statement]: + def parse(self): while not self.accept('eof'): yield(self.statement()) @@ -148,9 +147,9 @@ self.cmake_root = Path(cmake_root).expanduser() self.indent_unit = ' ' self.indent_level = 0 - self.options = [] # type: T.List[tuple] + self.options = [] # type: List[tuple] - def convert_args(self, args: T.List[Token], as_array: bool = True) -> str: + def convert_args(self, args: List[Token], as_array: bool = True): res = [] if as_array: start = '[' @@ -166,14 +165,15 @@ elif i.tid == 'string': res.append("'%s'" % i.value) else: - raise ValueError('Unknown arg type {}'.format(i.tid)) + print(i) + raise RuntimeError('Unknown arg type.') if len(res) > 1: return start + ', '.join(res) + end if len(res) == 1: return res[0] return '' - def write_entry(self, outfile: T.TextIO, t: Statement): + def write_entry(self, outfile, t): if t.name in Converter.ignored_funcs: return preincrement = 0 @@ -313,8 +313,8 @@ optfile.write(line) if __name__ == '__main__': - p = argparse.ArgumentParser(description='Convert CMakeLists.txt to meson.build and meson_options.txt') - p.add_argument('cmake_root', help='CMake project root (where top-level CMakeLists.txt is)') - P = p.parse_args() - - Converter(P.cmake_root).convert() + if len(sys.argv) != 2: + print(sys.argv[0], '') + sys.exit(1) + c = Converter(sys.argv[1]) + c.convert() diff -Nru meson-0.53.2/tools/dircondenser.py meson-0.52.1/tools/dircondenser.py --- meson-0.53.2/tools/dircondenser.py 2020-01-23 12:51:19.000000000 +0000 +++ meson-0.52.1/tools/dircondenser.py 2019-11-28 17:37:44.000000000 +0000 @@ -32,28 +32,25 @@ This directory must be run from source root as it touches run_unittests.py. ''' -import typing as T -import os -import sys -import subprocess +import os, sys, subprocess from glob import glob -def get_entries() -> T.List[T.Tuple[int, str]]: +def get_entries(): entries = [] for e in glob('*'): if not os.path.isdir(e): - raise SystemExit('Current directory must not contain any files.') + sys.exit('Current directory must not contain any files.') (number, rest) = e.split(' ', 1) try: - numstr = int(number) + number = int(number) except ValueError: - raise SystemExit('Dir name {} does not start with a number.'.format(e)) - entries.append((numstr, rest)) + sys.exit('Dir name %d does not start with a number.' % e) + entries.append((number, rest)) entries.sort() return entries -def replace_source(sourcefile: str, replacements: T.List[T.Tuple[str, str]]): +def replace_source(sourcefile, replacements): with open(sourcefile, 'r') as f: contents = f.read() for old_name, new_name in replacements: @@ -61,7 +58,7 @@ with open(sourcefile, 'w') as f: f.write(contents) -def condense(dirname: str): +def condense(dirname): curdir = os.getcwd() os.chdir(dirname) entries = get_entries() @@ -80,6 +77,6 @@ if __name__ == '__main__': if len(sys.argv) != 1: - raise SystemExit('This script takes no arguments.') + sys.exit('This script takes no arguments.') for d in glob('test cases/*'): condense(d)