From 458c6283ec0f5fe3fe0ebe6cf088d8db1eaf3f09 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Mon, 22 May 2023 09:35:55 +0200 Subject: [PATCH 1/5] [vcpkg-find-acquire-program] Revise test port --- .../vcpkg-find-acquire-program/portfile.cmake | 70 +++++++++++++------ .../vcpkg-find-acquire-program/vcpkg.json | 2 +- 2 files changed, 50 insertions(+), 22 deletions(-) diff --git a/scripts/test_ports/vcpkg-find-acquire-program/portfile.cmake b/scripts/test_ports/vcpkg-find-acquire-program/portfile.cmake index 88a4856c5f5e1c..46ac4cdd7f0e83 100644 --- a/scripts/test_ports/vcpkg-find-acquire-program/portfile.cmake +++ b/scripts/test_ports/vcpkg-find-acquire-program/portfile.cmake @@ -1,21 +1,49 @@ -set(VCPKG_POLICY_EMPTY_PACKAGE enabled) - -if(CMAKE_HOST_WIN32) - foreach(PROG GO JOM NASM PERL YASM GIT PYTHON3 PYTHON2 RUBY 7Z NUGET FLEX BISON GPERF GASPREPROCESSOR DARK SCONS SWIG DOXYGEN ARIA2 PKGCONFIG) - vcpkg_find_acquire_program(${PROG}) - foreach(SUBPROG IN LISTS ${PROG}) - if(NOT EXISTS "${SUBPROG}") - message(FATAL_ERROR "Program ${SUBPROG} did not exist.") - endif() - endforeach() - endforeach() -endif() - -foreach(PROG GN NINJA MESON BAZEL) - vcpkg_find_acquire_program(${PROG}) - foreach(SUBPROG IN LISTS ${PROG}) - if(NOT EXISTS "${SUBPROG}") - message(FATAL_ERROR "Program ${SUBPROG} did not exist.") - endif() - endforeach() -endforeach() +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) + +set(programs BAZEL BISON FLEX GIT GN MESON NINJA PERL PKGCONFIG PYTHON2 PYTHON3 SCONS SWIG YASM) +vcpkg_find_acquire_program(BAZEL) +vcpkg_find_acquire_program(BISON) +vcpkg_find_acquire_program(FLEX) +vcpkg_find_acquire_program(GIT) +vcpkg_find_acquire_program(GN) +vcpkg_find_acquire_program(MESON) +vcpkg_find_acquire_program(NINJA) +vcpkg_find_acquire_program(PERL) +vcpkg_find_acquire_program(PKGCONFIG) +vcpkg_find_acquire_program(PYTHON2) +vcpkg_find_acquire_program(PYTHON3) +vcpkg_find_acquire_program(SCONS) +vcpkg_find_acquire_program(SWIG) +vcpkg_find_acquire_program(YASM) + +if(VCPKG_HOST_IS_LINUX) + list(APPEND programs PATCHELF) + vcpkg_find_acquire_program(PATCHELF) +endif() + +if(VCPKG_HOST_IS_WINDOWS) + list(APPEND programs 7Z ARIA2 CLANG DARK DOXYGEN GASPREPROCESSOR GO GPERF JOM NASM NUGET RUBY) + vcpkg_find_acquire_program(7Z) + vcpkg_find_acquire_program(ARIA2) + vcpkg_find_acquire_program(CLANG) + vcpkg_find_acquire_program(DARK) + vcpkg_find_acquire_program(DOXYGEN) + vcpkg_find_acquire_program(GASPREPROCESSOR) + vcpkg_find_acquire_program(GO) + vcpkg_find_acquire_program(GPERF) + vcpkg_find_acquire_program(JOM) + vcpkg_find_acquire_program(NASM) + vcpkg_find_acquire_program(NUGET) + vcpkg_find_acquire_program(RUBY) +endif() + +set(missing "") +foreach(program IN LISTS programs) + if(NOT EXISTS "${program}") + list(APPEND missing "${program}") + endif() +endforeach() +if(missing) + list(JOIN missing "\n " missing) + message(FATAL_ERROR "The following programs do not exist:\n ${missing}") +endif() diff --git a/scripts/test_ports/vcpkg-find-acquire-program/vcpkg.json b/scripts/test_ports/vcpkg-find-acquire-program/vcpkg.json index 987003b4cf0d3c..fb9166ef5b82c8 100644 --- a/scripts/test_ports/vcpkg-find-acquire-program/vcpkg.json +++ b/scripts/test_ports/vcpkg-find-acquire-program/vcpkg.json @@ -3,5 +3,5 @@ "version-string": "0", "port-version": 1, "description": "Test port to exercise vcpkg_find_acquire_program", - "supports": "windows" + "supports": "native" } From ef53a7f458f77271bb687ce207148441d5c6925b Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Mon, 22 May 2023 19:02:12 +0200 Subject: [PATCH 2/5] Update --- .../vcpkg-find-acquire-program/portfile.cmake | 28 +++++++++++++------ 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/scripts/test_ports/vcpkg-find-acquire-program/portfile.cmake b/scripts/test_ports/vcpkg-find-acquire-program/portfile.cmake index 46ac4cdd7f0e83..90431bf82dc388 100644 --- a/scripts/test_ports/vcpkg-find-acquire-program/portfile.cmake +++ b/scripts/test_ports/vcpkg-find-acquire-program/portfile.cmake @@ -1,28 +1,31 @@ set(VCPKG_POLICY_EMPTY_PACKAGE enabled) -set(programs BAZEL BISON FLEX GIT GN MESON NINJA PERL PKGCONFIG PYTHON2 PYTHON3 SCONS SWIG YASM) +set(variables BAZEL BISON FLEX GIT GN NINJA PERL PKGCONFIG PYTHON2 PYTHON3 YASM) vcpkg_find_acquire_program(BAZEL) vcpkg_find_acquire_program(BISON) vcpkg_find_acquire_program(FLEX) vcpkg_find_acquire_program(GIT) vcpkg_find_acquire_program(GN) -vcpkg_find_acquire_program(MESON) vcpkg_find_acquire_program(NINJA) vcpkg_find_acquire_program(PERL) vcpkg_find_acquire_program(PKGCONFIG) vcpkg_find_acquire_program(PYTHON2) vcpkg_find_acquire_program(PYTHON3) -vcpkg_find_acquire_program(SCONS) -vcpkg_find_acquire_program(SWIG) vcpkg_find_acquire_program(YASM) +if(NOT VCPKG_TARGET_IS_OSX) + # System python too old (3.9; meson needs 3.10) + list(APPEND variables MESON) + vcpkg_find_acquire_program(MESON) +endif() + if(VCPKG_HOST_IS_LINUX) - list(APPEND programs PATCHELF) + list(APPEND variables PATCHELF) vcpkg_find_acquire_program(PATCHELF) endif() if(VCPKG_HOST_IS_WINDOWS) - list(APPEND programs 7Z ARIA2 CLANG DARK DOXYGEN GASPREPROCESSOR GO GPERF JOM NASM NUGET RUBY) + list(APPEND variables 7Z ARIA2 CLANG DARK DOXYGEN GASPREPROCESSOR GO GPERF JOM NASM NUGET RUBY SCONS SWIG) vcpkg_find_acquire_program(7Z) vcpkg_find_acquire_program(ARIA2) vcpkg_find_acquire_program(CLANG) @@ -35,15 +38,22 @@ if(VCPKG_HOST_IS_WINDOWS) vcpkg_find_acquire_program(NASM) vcpkg_find_acquire_program(NUGET) vcpkg_find_acquire_program(RUBY) + vcpkg_find_acquire_program(SCONS) + vcpkg_find_acquire_program(SWIG) endif() set(missing "") -foreach(program IN LISTS programs) +foreach(variable IN LISTS variables) + list(POP_BACK "${variable}" program) if(NOT EXISTS "${program}") - list(APPEND missing "${program}") + list(APPEND missing "${program}: ${${program}}") + endif() + list(POP_FRONT "${variable}" interpreter) + if(interpreter AND NOT EXISTS "${interpreter}") + list(APPEND missing "${program} (interpreter): ${interpreter}") endif() endforeach() if(missing) list(JOIN missing "\n " missing) - message(FATAL_ERROR "The following programs do not exist:\n ${missing}") + message(FATAL_ERROR "The following variables do not exist:\n ${missing}") endif() From 9a0bb545bef52f8d6d1266c5d9926673133be7da Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Mon, 22 May 2023 20:40:37 +0200 Subject: [PATCH 3/5] Update --- scripts/test_ports/vcpkg-find-acquire-program/portfile.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/test_ports/vcpkg-find-acquire-program/portfile.cmake b/scripts/test_ports/vcpkg-find-acquire-program/portfile.cmake index 90431bf82dc388..13e1a05e5085de 100644 --- a/scripts/test_ports/vcpkg-find-acquire-program/portfile.cmake +++ b/scripts/test_ports/vcpkg-find-acquire-program/portfile.cmake @@ -1,5 +1,8 @@ set(VCPKG_POLICY_EMPTY_PACKAGE enabled) +# For each vcpkg_find_acquire_program(NAME).cmake script, +# there must be a literal call to vcpkg_find_acquire_program(NAME).cmake + set(variables BAZEL BISON FLEX GIT GN NINJA PERL PKGCONFIG PYTHON2 PYTHON3 YASM) vcpkg_find_acquire_program(BAZEL) vcpkg_find_acquire_program(BISON) @@ -55,5 +58,5 @@ foreach(variable IN LISTS variables) endforeach() if(missing) list(JOIN missing "\n " missing) - message(FATAL_ERROR "The following variables do not exist:\n ${missing}") + message(FATAL_ERROR "The following programs do not exist:\n ${missing}") endif() From f3939dfe73f3f6807c15e0b58359c970ece44d34 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Mon, 22 May 2023 20:41:47 +0200 Subject: [PATCH 4/5] Test expected fail --- .../test_ports/vcpkg-find-acquire-program/portfile.cmake | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/test_ports/vcpkg-find-acquire-program/portfile.cmake b/scripts/test_ports/vcpkg-find-acquire-program/portfile.cmake index 13e1a05e5085de..c87d12398ceff9 100644 --- a/scripts/test_ports/vcpkg-find-acquire-program/portfile.cmake +++ b/scripts/test_ports/vcpkg-find-acquire-program/portfile.cmake @@ -45,15 +45,18 @@ if(VCPKG_HOST_IS_WINDOWS) vcpkg_find_acquire_program(SWIG) endif() +list(APPEND variables EXPECTED_FAIL) +set(EXPECTED_FAIL /INTERPRETER /PROGRAM) + set(missing "") foreach(variable IN LISTS variables) list(POP_BACK "${variable}" program) if(NOT EXISTS "${program}") - list(APPEND missing "${program}: ${${program}}") + list(APPEND missing "${variable}: ${program}") endif() list(POP_FRONT "${variable}" interpreter) if(interpreter AND NOT EXISTS "${interpreter}") - list(APPEND missing "${program} (interpreter): ${interpreter}") + list(APPEND missing "${variable} (interpreter): ${interpreter}") endif() endforeach() if(missing) From 503fe0d2634d881271ae2bee73e31e255732b3c9 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Wed, 24 May 2023 07:34:23 +0200 Subject: [PATCH 5/5] Revert test --- scripts/test_ports/vcpkg-find-acquire-program/portfile.cmake | 3 --- 1 file changed, 3 deletions(-) diff --git a/scripts/test_ports/vcpkg-find-acquire-program/portfile.cmake b/scripts/test_ports/vcpkg-find-acquire-program/portfile.cmake index c87d12398ceff9..0316fc2b69b27d 100644 --- a/scripts/test_ports/vcpkg-find-acquire-program/portfile.cmake +++ b/scripts/test_ports/vcpkg-find-acquire-program/portfile.cmake @@ -45,9 +45,6 @@ if(VCPKG_HOST_IS_WINDOWS) vcpkg_find_acquire_program(SWIG) endif() -list(APPEND variables EXPECTED_FAIL) -set(EXPECTED_FAIL /INTERPRETER /PROGRAM) - set(missing "") foreach(variable IN LISTS variables) list(POP_BACK "${variable}" program)