From f4b344f5b080f0d151283eca9046d5668c22cee7 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Sat, 23 Feb 2019 14:02:08 +0530 Subject: [PATCH 1/7] azure-pipelines: Fix cygwin python3 installation The package has been moved from python3-pip to python3N-pip where N is 5, 6, 7. We use Python 3.5, so let's use that. --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 90ebeff8d..23cbda7cb 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -76,13 +76,13 @@ jobs: libglib2.0-devel,^ libgtk3-devel,^ ninja,^ - python3-pip,^ + python35-pip,^ vala,^ zlib-devel displayName: Install Dependencies - script: | set PATH=%CYGWIN_ROOT%\bin;%SYSTEMROOT%\system32 - env.exe -- python3 run_tests.py --backend=ninja + env.exe -- python3.5 run_tests.py --backend=ninja displayName: Run Tests - task: CopyFiles@2 condition: not(canceled()) From 9291f37b65b3cb4e9e553feccffca125699fbda8 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Mon, 25 Feb 2019 03:12:23 +0530 Subject: [PATCH 2/7] ci: Debug why dmd --version is returning 1 --- ci/install-dmd.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/install-dmd.ps1 b/ci/install-dmd.ps1 index fc8226c33..aeacdf203 100644 --- a/ci/install-dmd.ps1 +++ b/ci/install-dmd.ps1 @@ -68,4 +68,4 @@ $dmd_bin = Join-Path $dmd_install "dmd2\windows\bin" $Env:Path = $Env:Path + ";" + $dmd_bin #echo "Testing DMD..." -& dmd.exe --version 2>&1>$null +& dmd.exe --version From a81207881b2ad170ab4567b7328cbde77ef83e80 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Mon, 25 Feb 2019 19:33:08 +0200 Subject: [PATCH 3/7] Disable D tests if dmd install is broken. --- run_project_tests.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/run_project_tests.py b/run_project_tests.py index c35928fa4..030cd51ac 100755 --- a/run_project_tests.py +++ b/run_project_tests.py @@ -440,6 +440,14 @@ def have_d_compiler(): elif shutil.which("gdc"): return True elif shutil.which("dmd"): + # The Windows installer sometimes produces a DMD install + # that exists but segfaults every time the compiler is run. + # Don't know why. Don't know how to fix. Skip in this case. + cp = subprocess.run(['dmd', '--version'], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + if cp.stdout == b'': + return False return True return False From 067ff7eeae26eda8edc9f7f7432f551c3e373eaa Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Mon, 25 Feb 2019 21:46:45 +0200 Subject: [PATCH 4/7] Fall back to current interpreter when python3 not found. --- mesonbuild/interpreter.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index e33cb7fe1..8449ea645 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -2782,6 +2782,9 @@ external dependencies (including libraries) must go to "dependencies".''') progobj = self.program_from_file_for(for_machine, args, silent=silent) if progobj is None: 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) if required and (progobj is None or not progobj.found()): raise InvalidArguments('Program(s) {!r} not found or not executable'.format(args)) if progobj is None: From 7564a6335308fb14501cb04eceb555ea291c5dd0 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Mon, 25 Feb 2019 22:25:16 +0200 Subject: [PATCH 5/7] Copy python3.5 to python3 so tests pass on Cygwin. --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 23cbda7cb..fa24b32a1 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -82,6 +82,7 @@ jobs: displayName: Install Dependencies - script: | set PATH=%CYGWIN_ROOT%\bin;%SYSTEMROOT%\system32 + cp /usr/bin/python3.5 /usr/bin/python3 env.exe -- python3.5 run_tests.py --backend=ninja displayName: Run Tests - task: CopyFiles@2 From 5d751a25064065cce73eaa6c77b5b19b248c898a Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Tue, 26 Feb 2019 00:56:21 +0200 Subject: [PATCH 6/7] Pick target exactly rather than relying on dict order. --- run_unittests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/run_unittests.py b/run_unittests.py index ba0527dff..fbd51df79 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -5236,13 +5236,13 @@ class RewriterTests(BasePlatformTests): out = self.extract_test_data(out) self.assertDictEqual(out, {}) - def test_tatrget_add_subdir(self): + def test_target_add_subdir(self): self.prime('2 subdirs') self.rewrite(self.builddir, os.path.join(self.builddir, 'addTgt.json')) out = self.rewrite(self.builddir, os.path.join(self.builddir, 'info.json')) out = self.extract_test_data(out) expected = {'name': 'something', 'sources': ['first.c', 'second.c']} - self.assertDictEqual(list(out['target'].values())[0], expected) + self.assertDictEqual(out['target']['94b671c@@something@exe'], expected) def test_kwargs_info(self): self.prime('3 kwargs') From 9acbd6278959ddf1f4c92d5d7fd87e47d2c27c20 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Tue, 26 Feb 2019 01:32:56 +0200 Subject: [PATCH 7/7] Launch Meson via python3 so the binary name is correct. --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index fa24b32a1..186f77c6c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -83,7 +83,7 @@ jobs: - script: | set PATH=%CYGWIN_ROOT%\bin;%SYSTEMROOT%\system32 cp /usr/bin/python3.5 /usr/bin/python3 - env.exe -- python3.5 run_tests.py --backend=ninja + env.exe -- python3 run_tests.py --backend=ninja displayName: Run Tests - task: CopyFiles@2 condition: not(canceled())