{"thread":{"id":"58845","subject":"[PATCH 0/2] Use fixed github-actions runner image","startedAt":"2022-11-23T15:03:16Z","lastAt":"2022-11-27T23:36:19Z","messageCount":47,"participants":["Jiang Xin","Johannes Schindelin","Ævar Arnfjörð Bjarmason","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"467868","messageId":"20221123150233.13039-1-worldhello.net@gmail.com","threadId":"58845","inReplyTo":null,"subject":"[PATCH 0/2] Use fixed github-actions runner image","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2022-11-23T15:02:31Z","receivedAt":"2022-11-23T15:03:16Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"From: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n\nToday I found lots of CI errors of my private host git repository\non GitHub. It is because the runner image \"ubuntu-latest\" of the\nCI jobs is ubuntu 22.04 (jammy) instead of ubuntu 20.04 (focal).\n\nThe upgrade of runner images is in progress, and my public forked\nrepository still use 20.04 (focal) as \"ubuntu-latest\".\n\nTwo patches in this series try to protect our CI in advance.\n\nNew CI instance see below:\n\n * https://github.com/jiangxin/git/actions/runs/3532978329\n\n--\n\nJiang Xin (2):\n  github-actions: run gcc-8 on ubuntu-20.04 image\n  ci: upgrade version of p4\n\n .github/workflows/main.yml | 16 ++++++++++++----\n ci/install-dependencies.sh | 10 +++++-----\n ci/lib.sh                  |  8 ++++----\n 3 files changed, 21 insertions(+), 13 deletions(-)\n\n-- \n2.39.0.rc0\n\n"},{"id":"467869","messageId":"20221123150233.13039-2-worldhello.net@gmail.com","threadId":"58845","inReplyTo":"20221123150233.13039-1-worldhello.net@gmail.com","subject":"[PATCH 1/2] github-actions: run gcc-8 on ubuntu-20.04 image","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2022-11-23T15:02:32Z","receivedAt":"2022-11-23T15:03:20Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"From: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n\nGitHub starts to upgrade its runner image \"ubuntu-latest\" from version\n\"ubuntu-20.04\" to version \"ubuntu-22.04\". It will fail to find and\ninstall \"gcc-8\" package on the new runner image.\n\nChange the runner images from \"ubuntu-latest\" to \"ubuntu-20.04\" in order\nto run with \"gcc-8\" as a dependency.\n\nInstead of use the environment \"$runs_on_pool\" as below:\n\n    case \"$runs_on_pool\" in\n    ubuntu-20.04 | ubuntu-latest)\n\t;;\n\nwe can reuse the os field in the matrix, and use a new environment\n\"$runs_on_os\" as below:\n\n    case \"$runs_on_os\" in\n    ubuntu)\n        ;;\n\nSigned-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n---\n .github/workflows/main.yml | 16 ++++++++++++----\n ci/install-dependencies.sh |  6 +++---\n ci/lib.sh                  |  6 +++---\n 3 files changed, 18 insertions(+), 10 deletions(-)\n\ndiff --git a/.github/workflows/main.yml b/.github/workflows/main.yml\nindex 592f9193a8..da0d8ab0bf 100644\n--- a/.github/workflows/main.yml\n+++ b/.github/workflows/main.yml\n@@ -224,6 +224,7 @@ jobs:\n         vector:\n           - jobname: linux-clang\n             cc: clang\n+            os: ubuntu\n             pool: ubuntu-latest\n           - jobname: linux-sha256\n             cc: clang\n@@ -232,36 +233,43 @@ jobs:\n           - jobname: linux-gcc\n             cc: gcc\n             cc_package: gcc-8\n-            pool: ubuntu-latest\n+            os: ubuntu\n+            pool: ubuntu-20.04\n           - jobname: linux-TEST-vars\n             cc: gcc\n-            os: ubuntu\n             cc_package: gcc-8\n-            pool: ubuntu-latest\n+            os: ubuntu\n+            pool: ubuntu-20.04\n           - jobname: osx-clang\n             cc: clang\n+            os: macos\n             pool: macos-latest\n           - jobname: osx-gcc\n             cc: gcc\n             cc_package: gcc-9\n+            os: macos\n             pool: macos-latest\n           - jobname: linux-gcc-default\n             cc: gcc\n+            os: ubuntu\n             pool: ubuntu-latest\n           - jobname: linux-leaks\n             cc: gcc\n+            os: ubuntu\n             pool: ubuntu-latest\n           - jobname: linux-asan\n             cc: gcc\n+            os: ubuntu\n             pool: ubuntu-latest\n           - jobname: linux-ubsan\n             cc: gcc\n+            os: ubuntu\n             pool: ubuntu-latest\n     env:\n       CC: ${{matrix.vector.cc}}\n       CC_PACKAGE: ${{matrix.vector.cc_package}}\n       jobname: ${{matrix.vector.jobname}}\n-      runs_on_pool: ${{matrix.vector.pool}}\n+      runs_on_os: ${{matrix.vector.os}}\n     runs-on: ${{matrix.vector.pool}}\n     steps:\n     - uses: actions/checkout@v2\ndiff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh\nindex 107757a1fe..f639263a62 100755\n--- a/ci/install-dependencies.sh\n+++ b/ci/install-dependencies.sh\n@@ -11,8 +11,8 @@ UBUNTU_COMMON_PKGS=\"make libssl-dev libcurl4-openssl-dev libexpat-dev\n  tcl tk gettext zlib1g-dev perl-modules liberror-perl libauthen-sasl-perl\n  libemail-valid-perl libio-socket-ssl-perl libnet-smtp-ssl-perl\"\n \n-case \"$runs_on_pool\" in\n-ubuntu-latest)\n+case \"$runs_on_os\" in\n+ubuntu)\n \tsudo apt-get -q update\n \tsudo apt-get -q -y install language-pack-is libsvn-perl apache2 \\\n \t\t$UBUNTU_COMMON_PKGS $CC_PACKAGE\n@@ -30,7 +30,7 @@ ubuntu-latest)\n \t\tcp git-lfs-$LINUX_GIT_LFS_VERSION/git-lfs .\n \tpopd\n \t;;\n-macos-latest)\n+macos)\n \texport HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1\n \t# Uncomment this if you want to run perf tests:\n \t# brew install gnu-time\ndiff --git a/ci/lib.sh b/ci/lib.sh\nindex 24d20a5d64..0c0767d354 100755\n--- a/ci/lib.sh\n+++ b/ci/lib.sh\n@@ -225,8 +225,8 @@ export DEFAULT_TEST_TARGET=prove\n export GIT_TEST_CLONE_2GB=true\n export SKIP_DASHED_BUILT_INS=YesPlease\n \n-case \"$runs_on_pool\" in\n-ubuntu-latest)\n+case \"$runs_on_os\" in\n+ubuntu)\n \tif test \"$jobname\" = \"linux-gcc-default\"\n \tthen\n \t\tbreak\n@@ -253,7 +253,7 @@ ubuntu-latest)\n \tGIT_LFS_PATH=\"$HOME/custom/git-lfs\"\n \texport PATH=\"$GIT_LFS_PATH:$P4_PATH:$PATH\"\n \t;;\n-macos-latest)\n+macos)\n \tif [ \"$jobname\" = osx-gcc ]\n \tthen\n \t\tMAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=$(which python3)\"\n-- \n2.39.0.rc0\n\n"},{"id":"467870","messageId":"20221123150233.13039-3-worldhello.net@gmail.com","threadId":"58845","inReplyTo":"20221123150233.13039-1-worldhello.net@gmail.com","subject":"[PATCH 2/2] ci: upgrade version of p4","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2022-11-23T15:02:33Z","receivedAt":"2022-11-23T15:03:32Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"From: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n\nThere would be a segmentation fault when running p4 v16.2 on ubuntu\n22.04 which is the latest version of ubuntu runner image for github\nactions. Upgrade p4 from version 16.2 to 19.2 will fix this issue.\n\nAlso add some instructions to show errors of command \"p4 -V\", so we can\nsee why the output doesn't match.\n\nSigned-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n---\n ci/install-dependencies.sh | 4 ++--\n ci/lib.sh                  | 2 +-\n 2 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh\nindex f639263a62..291e49bdde 100755\n--- a/ci/install-dependencies.sh\n+++ b/ci/install-dependencies.sh\n@@ -83,9 +83,9 @@ esac\n if type p4d >/dev/null 2>&1 && type p4 >/dev/null 2>&1\n then\n \techo \"$(tput setaf 6)Perforce Server Version$(tput sgr0)\"\n-\tp4d -V | grep Rev.\n+\tp4d -V | grep Rev. || { echo >&2 \"p4d: bad version\"; p4d -V; exit 1; }\n \techo \"$(tput setaf 6)Perforce Client Version$(tput sgr0)\"\n-\tp4 -V | grep Rev.\n+\tp4 -V | grep Rev. || { echo >&2 \"p4: bad version\"; p4 -V; exit 1; }\n else\n \techo >&2 \"WARNING: perforce wasn't installed, see above for clues why\"\n fi\ndiff --git a/ci/lib.sh b/ci/lib.sh\nindex 0c0767d354..8474b0f249 100755\n--- a/ci/lib.sh\n+++ b/ci/lib.sh\n@@ -246,7 +246,7 @@ ubuntu)\n \t# were recorded in the Homebrew database upon creating the OS X\n \t# image.\n \t# Keep that in mind when you encounter a broken OS X build!\n-\texport LINUX_P4_VERSION=\"16.2\"\n+\texport LINUX_P4_VERSION=\"19.2\"\n \texport LINUX_GIT_LFS_VERSION=\"1.5.2\"\n \n \tP4_PATH=\"$HOME/custom/p4\"\n-- \n2.39.0.rc0\n\n"},{"id":"467909","messageId":"p646ro03-7n48-5202-9075-p7srso008417@tzk.qr","threadId":"58845","inReplyTo":"20221123150233.13039-2-worldhello.net@gmail.com","subject":"Re: [PATCH 1/2] github-actions: run gcc-8 on ubuntu-20.04 image","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2022-11-24T08:11:14Z","receivedAt":"2022-11-24T08:12:21Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 23 Nov 2022, Jiang Xin wrote:\n\n> From: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n>\n> GitHub starts to upgrade its runner image \"ubuntu-latest\" from version\n> \"ubuntu-20.04\" to version \"ubuntu-22.04\". It will fail to find and\n> install \"gcc-8\" package on the new runner image.\n>\n> Change the runner images from \"ubuntu-latest\" to \"ubuntu-20.04\" in order\n> to run with \"gcc-8\" as a dependency.\n>\n> Instead of use the environment \"$runs_on_pool\" as below:\n>\n>     case \"$runs_on_pool\" in\n>     ubuntu-20.04 | ubuntu-latest)\n> \t;;\n>\n> we can reuse the os field in the matrix, and use a new environment\n> \"$runs_on_os\" as below:\n>\n>     case \"$runs_on_os\" in\n>     ubuntu)\n>         ;;\n\nWhile this is a bit more refactoring than I usually recommend when trying\nto fix an urgent bug, the outcome does look nice and correct.\n\nHere is my\n\n\tReviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nThank you for working on this!\nDscho\n\n>\n> Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n> ---\n>  .github/workflows/main.yml | 16 ++++++++++++----\n>  ci/install-dependencies.sh |  6 +++---\n>  ci/lib.sh                  |  6 +++---\n>  3 files changed, 18 insertions(+), 10 deletions(-)\n>\n> diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml\n> index 592f9193a8..da0d8ab0bf 100644\n> --- a/.github/workflows/main.yml\n> +++ b/.github/workflows/main.yml\n> @@ -224,6 +224,7 @@ jobs:\n>          vector:\n>            - jobname: linux-clang\n>              cc: clang\n> +            os: ubuntu\n>              pool: ubuntu-latest\n>            - jobname: linux-sha256\n>              cc: clang\n> @@ -232,36 +233,43 @@ jobs:\n>            - jobname: linux-gcc\n>              cc: gcc\n>              cc_package: gcc-8\n> -            pool: ubuntu-latest\n> +            os: ubuntu\n> +            pool: ubuntu-20.04\n>            - jobname: linux-TEST-vars\n>              cc: gcc\n> -            os: ubuntu\n>              cc_package: gcc-8\n> -            pool: ubuntu-latest\n> +            os: ubuntu\n> +            pool: ubuntu-20.04\n>            - jobname: osx-clang\n>              cc: clang\n> +            os: macos\n>              pool: macos-latest\n>            - jobname: osx-gcc\n>              cc: gcc\n>              cc_package: gcc-9\n> +            os: macos\n>              pool: macos-latest\n>            - jobname: linux-gcc-default\n>              cc: gcc\n> +            os: ubuntu\n>              pool: ubuntu-latest\n>            - jobname: linux-leaks\n>              cc: gcc\n> +            os: ubuntu\n>              pool: ubuntu-latest\n>            - jobname: linux-asan\n>              cc: gcc\n> +            os: ubuntu\n>              pool: ubuntu-latest\n>            - jobname: linux-ubsan\n>              cc: gcc\n> +            os: ubuntu\n>              pool: ubuntu-latest\n>      env:\n>        CC: ${{matrix.vector.cc}}\n>        CC_PACKAGE: ${{matrix.vector.cc_package}}\n>        jobname: ${{matrix.vector.jobname}}\n> -      runs_on_pool: ${{matrix.vector.pool}}\n> +      runs_on_os: ${{matrix.vector.os}}\n>      runs-on: ${{matrix.vector.pool}}\n>      steps:\n>      - uses: actions/checkout@v2\n> diff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh\n> index 107757a1fe..f639263a62 100755\n> --- a/ci/install-dependencies.sh\n> +++ b/ci/install-dependencies.sh\n> @@ -11,8 +11,8 @@ UBUNTU_COMMON_PKGS=\"make libssl-dev libcurl4-openssl-dev libexpat-dev\n>   tcl tk gettext zlib1g-dev perl-modules liberror-perl libauthen-sasl-perl\n>   libemail-valid-perl libio-socket-ssl-perl libnet-smtp-ssl-perl\"\n>\n> -case \"$runs_on_pool\" in\n> -ubuntu-latest)\n> +case \"$runs_on_os\" in\n> +ubuntu)\n>  \tsudo apt-get -q update\n>  \tsudo apt-get -q -y install language-pack-is libsvn-perl apache2 \\\n>  \t\t$UBUNTU_COMMON_PKGS $CC_PACKAGE\n> @@ -30,7 +30,7 @@ ubuntu-latest)\n>  \t\tcp git-lfs-$LINUX_GIT_LFS_VERSION/git-lfs .\n>  \tpopd\n>  \t;;\n> -macos-latest)\n> +macos)\n>  \texport HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1\n>  \t# Uncomment this if you want to run perf tests:\n>  \t# brew install gnu-time\n> diff --git a/ci/lib.sh b/ci/lib.sh\n> index 24d20a5d64..0c0767d354 100755\n> --- a/ci/lib.sh\n> +++ b/ci/lib.sh\n> @@ -225,8 +225,8 @@ export DEFAULT_TEST_TARGET=prove\n>  export GIT_TEST_CLONE_2GB=true\n>  export SKIP_DASHED_BUILT_INS=YesPlease\n>\n> -case \"$runs_on_pool\" in\n> -ubuntu-latest)\n> +case \"$runs_on_os\" in\n> +ubuntu)\n>  \tif test \"$jobname\" = \"linux-gcc-default\"\n>  \tthen\n>  \t\tbreak\n> @@ -253,7 +253,7 @@ ubuntu-latest)\n>  \tGIT_LFS_PATH=\"$HOME/custom/git-lfs\"\n>  \texport PATH=\"$GIT_LFS_PATH:$P4_PATH:$PATH\"\n>  \t;;\n> -macos-latest)\n> +macos)\n>  \tif [ \"$jobname\" = osx-gcc ]\n>  \tthen\n>  \t\tMAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=$(which python3)\"\n> --\n> 2.39.0.rc0\n>\n>\n"},{"id":"467910","messageId":"n79194n5-8q94-29n4-s447-64r0p2po4r76@tzk.qr","threadId":"58845","inReplyTo":"20221123150233.13039-3-worldhello.net@gmail.com","subject":"Re: [PATCH 2/2] ci: upgrade version of p4","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2022-11-24T08:16:44Z","receivedAt":"2022-11-24T08:19:14Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 23 Nov 2022, Jiang Xin wrote:\n\n> From: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n>\n> There would be a segmentation fault when running p4 v16.2 on ubuntu\n> 22.04 which is the latest version of ubuntu runner image for github\n> actions. Upgrade p4 from version 16.2 to 19.2 will fix this issue.\n\nI was about to embark on a debugging session when I had the splendid idea\nto look at the Git mailing list archives to see whether anybody else had\nencountered that particular problem.\n\nHowever, when I pushed a branch with this fix, it still segfaulted even\nwhen downloading version 19.2 (link:\nhttps://github.com/dscho/git/actions/runs/3538788474/jobs/5939977231#step:3:387):\n\n + wget --quiet https://cdist2.perforce.com/perforce/r19.2/bin.linux26x86_64/p4d\n + wget --quiet https://cdist2.perforce.com/perforce/r19.2/bin.linux26x86_64/p4\n + [...]\n + echo 'Perforce Server Version'\n Perforce Server Version\n + p4d -V\n + grep Rev.\n + echo 'p4d: bad version'\n p4d: bad version\n + p4d -V\n ci/install-dependencies.sh: line 91:  3051 Segmentation fault      (core\n dumped) p4d -V\n\nI guess I'll embark on that debugging session after all ;-)\n\n> Also add some instructions to show errors of command \"p4 -V\", so we can\n> see why the output doesn't match.\n\nThis is an excellent addition. If I read the logs correctly, this change\nadds the error message \"Segmentation fault\" to the output, which is really\nhelpful.\n\nThank you for working on this!\nDscho\n\n>\n> Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n> ---\n>  ci/install-dependencies.sh | 4 ++--\n>  ci/lib.sh                  | 2 +-\n>  2 files changed, 3 insertions(+), 3 deletions(-)\n>\n> diff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh\n> index f639263a62..291e49bdde 100755\n> --- a/ci/install-dependencies.sh\n> +++ b/ci/install-dependencies.sh\n> @@ -83,9 +83,9 @@ esac\n>  if type p4d >/dev/null 2>&1 && type p4 >/dev/null 2>&1\n>  then\n>  \techo \"$(tput setaf 6)Perforce Server Version$(tput sgr0)\"\n> -\tp4d -V | grep Rev.\n> +\tp4d -V | grep Rev. || { echo >&2 \"p4d: bad version\"; p4d -V; exit 1; }\n>  \techo \"$(tput setaf 6)Perforce Client Version$(tput sgr0)\"\n> -\tp4 -V | grep Rev.\n> +\tp4 -V | grep Rev. || { echo >&2 \"p4: bad version\"; p4 -V; exit 1; }\n>  else\n>  \techo >&2 \"WARNING: perforce wasn't installed, see above for clues why\"\n>  fi\n> diff --git a/ci/lib.sh b/ci/lib.sh\n> index 0c0767d354..8474b0f249 100755\n> --- a/ci/lib.sh\n> +++ b/ci/lib.sh\n> @@ -246,7 +246,7 @@ ubuntu)\n>  \t# were recorded in the Homebrew database upon creating the OS X\n>  \t# image.\n>  \t# Keep that in mind when you encounter a broken OS X build!\n> -\texport LINUX_P4_VERSION=\"16.2\"\n> +\texport LINUX_P4_VERSION=\"19.2\"\n>  \texport LINUX_GIT_LFS_VERSION=\"1.5.2\"\n>\n>  \tP4_PATH=\"$HOME/custom/p4\"\n> --\n> 2.39.0.rc0\n>\n>\n"},{"id":"467911","messageId":"53qnqqr9-2r34-0804-003p-335q4s884822@tzk.qr","threadId":"58845","inReplyTo":"20221123150233.13039-1-worldhello.net@gmail.com","subject":"Re: [PATCH 0/2] Use fixed github-actions runner image","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2022-11-24T08:18:05Z","receivedAt":"2022-11-24T08:19:20Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 23 Nov 2022, Jiang Xin wrote:\n\n> From: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n>\n> Today I found lots of CI errors of my private host git repository\n> on GitHub. It is because the runner image \"ubuntu-latest\" of the\n> CI jobs is ubuntu 22.04 (jammy) instead of ubuntu 20.04 (focal).\n\nExcellent timing! This is indeed what I, too, ran into when adjusting\nmicrosoft/git to v2.39.0-rc0. Here are the relevant links for the failing\nand the succeeding runs, for the very same commit, but in different\nrepositories and with different `ubuntu-*` images:\n\nFailing (ubuntu-22.04):\nhttps://github.com/dscho/git/actions/runs/3533530319/jobs/5939252441#step:1:8\n\nSucceeding (ubuntu-20.04):\nhttps://github.com/microsoft/git/actions/runs/3532815597/jobs/5927646267#step:1:9\n\nHaving said that, I applied your fixes on top and pushed out a test\nbranch, but `p4d` still segfaults for me:\n\nhttps://github.com/dscho/git/actions/runs/3538788474/jobs/5939977231#step:3:387\n\nI hope that we can get this fixed very soon and am _very much_ in favor of\nfast-tracking the patches once we confirm that they fix the CI builds.\n\nThanks,\nDscho\n\n> The upgrade of runner images is in progress, and my public forked\n> repository still use 20.04 (focal) as \"ubuntu-latest\".\n>\n> Two patches in this series try to protect our CI in advance.\n>\n> New CI instance see below:\n>\n>  * https://github.com/jiangxin/git/actions/runs/3532978329\n>\n> --\n>\n> Jiang Xin (2):\n>   github-actions: run gcc-8 on ubuntu-20.04 image\n>   ci: upgrade version of p4\n>\n>  .github/workflows/main.yml | 16 ++++++++++++----\n>  ci/install-dependencies.sh | 10 +++++-----\n>  ci/lib.sh                  |  8 ++++----\n>  3 files changed, 21 insertions(+), 13 deletions(-)\n>\n> --\n> 2.39.0.rc0\n>\n>\n"},{"id":"467912","messageId":"9q4525s6-qrq8-1841-n257-711328352n85@tzk.qr","threadId":"58845","inReplyTo":"n79194n5-8q94-29n4-s447-64r0p2po4r76@tzk.qr","subject":"Re: [PATCH 2/2] ci: upgrade version of p4","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2022-11-24T08:41:02Z","receivedAt":"2022-11-24T08:41:17Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 24 Nov 2022, Johannes Schindelin wrote:\n\n> On Wed, 23 Nov 2022, Jiang Xin wrote:\n>\n> > From: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n> >\n> > There would be a segmentation fault when running p4 v16.2 on ubuntu\n> > 22.04 which is the latest version of ubuntu runner image for github\n> > actions. Upgrade p4 from version 16.2 to 19.2 will fix this issue.\n>\n> I was about to embark on a debugging session when I had the splendid idea\n> to look at the Git mailing list archives to see whether anybody else had\n> encountered that particular problem.\n>\n> However, when I pushed a branch with this fix, it still segfaulted even\n> when downloading version 19.2 (link:\n> https://github.com/dscho/git/actions/runs/3538788474/jobs/5939977231#step:3:387):\n>\n>  + wget --quiet https://cdist2.perforce.com/perforce/r19.2/bin.linux26x86_64/p4d\n>  + wget --quiet https://cdist2.perforce.com/perforce/r19.2/bin.linux26x86_64/p4\n>  + [...]\n>  + echo 'Perforce Server Version'\n>  Perforce Server Version\n>  + p4d -V\n>  + grep Rev.\n>  + echo 'p4d: bad version'\n>  p4d: bad version\n>  + p4d -V\n>  ci/install-dependencies.sh: line 91:  3051 Segmentation fault      (core\n>  dumped) p4d -V\n>\n> I guess I'll embark on that debugging session after all ;-)\n\nAnd I did. It turns out that r22.2 works both on ubuntu-20.04 and\nubuntu-22.04 (I locally verified for the former, proof for the latter:\nhttps://github.com/dscho/git/actions/runs/3538941550/jobs/5940295721#step:3:384).\nSo I propose this fixup:\n\n-- snip --\nFrom 81e2d9a4f6ad2d2d9df27edfb666fe2112bdef57 Mon Sep 17 00:00:00 2001\nFrom: Johannes Schindelin <johannes.schindelin@gmx.de>\nDate: Thu, 24 Nov 2022 09:31:41 +0100\nSubject: [PATCH] amend! ci: upgrade version of p4\n\nci: upgrade version of p4\n\nThere would be a segmentation fault when running p4 v16.2 on ubuntu\n22.04 which is the latest version of ubuntu runner image for github\nactions. Upgrade p4 from version 16.2 to 22.2 will fix this issue.\n\nAlso add some instructions to show errors of command \"p4 -V\", so we can\nsee why the output doesn't match.\n\nReviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de>\nSigned-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n---\n ci/lib.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/ci/lib.sh b/ci/lib.sh\nindex 6c658fa21227..eaa75ab3c07d 100755\n--- a/ci/lib.sh\n+++ b/ci/lib.sh\n@@ -252,7 +252,7 @@ ubuntu)\n \t# were recorded in the Homebrew database upon creating the OS X\n \t# image.\n \t# Keep that in mind when you encounter a broken OS X build!\n-\texport LINUX_P4_VERSION=\"19.2\"\n+\texport LINUX_P4_VERSION=\"22.2\"\n \texport LINUX_GIT_LFS_VERSION=\"1.5.2\"\n\n \tP4_PATH=\"$HOME/custom/p4\"\n-- snap --\n\nIf you squash this in, please feel free to also use the updated commit\nmessage.\n\nThank you,\nDscho\n"},{"id":"467913","messageId":"5p3n90pq-4ro8-0278-3q8s-r2p568q3o26r@tzk.qr","threadId":"58845","inReplyTo":"9q4525s6-qrq8-1841-n257-711328352n85@tzk.qr","subject":"Re: [PATCH 2/2] ci: upgrade version of p4","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2022-11-24T08:54:16Z","receivedAt":"2022-11-24T08:54:30Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Me again,\n\nOn Thu, 24 Nov 2022, Johannes Schindelin wrote:\n\n> On Thu, 24 Nov 2022, Johannes Schindelin wrote:\n>\n> > On Wed, 23 Nov 2022, Jiang Xin wrote:\n> >\n> > > From: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n> > >\n> > > There would be a segmentation fault when running p4 v16.2 on ubuntu\n> > > 22.04 which is the latest version of ubuntu runner image for github\n> > > actions. Upgrade p4 from version 16.2 to 19.2 will fix this issue.\n> >\n> > I was about to embark on a debugging session when I had the splendid idea\n> > to look at the Git mailing list archives to see whether anybody else had\n> > encountered that particular problem.\n> >\n> > However, when I pushed a branch with this fix, it still segfaulted even\n> > when downloading version 19.2 (link:\n> > https://github.com/dscho/git/actions/runs/3538788474/jobs/5939977231#step:3:387):\n> >\n> >  + wget --quiet https://cdist2.perforce.com/perforce/r19.2/bin.linux26x86_64/p4d\n> >  + wget --quiet https://cdist2.perforce.com/perforce/r19.2/bin.linux26x86_64/p4\n> >  + [...]\n> >  + echo 'Perforce Server Version'\n> >  Perforce Server Version\n> >  + p4d -V\n> >  + grep Rev.\n> >  + echo 'p4d: bad version'\n> >  p4d: bad version\n> >  + p4d -V\n> >  ci/install-dependencies.sh: line 91:  3051 Segmentation fault      (core\n> >  dumped) p4d -V\n> >\n> > I guess I'll embark on that debugging session after all ;-)\n>\n> And I did. It turns out that r22.2 works both on ubuntu-20.04 and\n> ubuntu-22.04 (I locally verified for the former, proof for the latter:\n> https://github.com/dscho/git/actions/runs/3538941550/jobs/5940295721#step:3:384).\n> So I propose this fixup:\n>\n> -- snip --\n> From 81e2d9a4f6ad2d2d9df27edfb666fe2112bdef57 Mon Sep 17 00:00:00 2001\n> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n> Date: Thu, 24 Nov 2022 09:31:41 +0100\n> Subject: [PATCH] amend! ci: upgrade version of p4\n>\n> ci: upgrade version of p4\n>\n> There would be a segmentation fault when running p4 v16.2 on ubuntu\n> 22.04 which is the latest version of ubuntu runner image for github\n> actions. Upgrade p4 from version 16.2 to 22.2 will fix this issue.\n>\n> Also add some instructions to show errors of command \"p4 -V\", so we can\n> see why the output doesn't match.\n>\n> Reviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n> ---\n>  ci/lib.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/ci/lib.sh b/ci/lib.sh\n> index 6c658fa21227..eaa75ab3c07d 100755\n> --- a/ci/lib.sh\n> +++ b/ci/lib.sh\n> @@ -252,7 +252,7 @@ ubuntu)\n>  \t# were recorded in the Homebrew database upon creating the OS X\n>  \t# image.\n>  \t# Keep that in mind when you encounter a broken OS X build!\n> -\texport LINUX_P4_VERSION=\"19.2\"\n> +\texport LINUX_P4_VERSION=\"22.2\"\n>  \texport LINUX_GIT_LFS_VERSION=\"1.5.2\"\n>\n>  \tP4_PATH=\"$HOME/custom/p4\"\n> -- snap --\n>\n> If you squash this in, please feel free to also use the updated commit\n> message.\n\nHmm. Hold on. While `p4d` now no longer segfaults, it looks as if `git p4`\nis completely broken (see\nhttps://github.com/dscho/git/actions/runs/3538941550/jobs/5940295721#step:4:2005):\n\n  failure: t9800.3 basic git p4 clone\n  \tgit p4 clone --dest=\"$git\" //depot &&\n  \ttest_when_finished cleanup_git &&\n  \t(\n  \t\tcd \"$git\" &&\n  \t\tgit log --oneline >lines &&\n  \t\ttest_line_count = 1 lines\n  \t)\n\n  + git p4 clone --dest=/home/runner/work/git/git/t/trash directory.t9800-git-p4-basic/git //depot\n  Perforce db files in '.' will be created if missing...\n  fatal: 'p4' appears to be a git command, but we were not\n  able to execute it. Maybe git-p4 is broken?\n  error: last command exited with $?=128\n  not ok 3 - basic git p4 clone\n  #\n  #\t\tgit p4 clone --dest=\"$git\" //depot &&\n  #\t\ttest_when_finished cleanup_git &&\n  #\t\t(\n  #\t\t\tcd \"$git\" &&\n  #\t\t\tgit log --oneline >lines &&\n  #\t\t\ttest_line_count = 1 lines\n  #\t\t)\n  #\n\nI guess I will keep digging,\nDscho\n"},{"id":"467914","messageId":"20221124090545.4790-1-worldhello.net@gmail.com","threadId":"58845","inReplyTo":"20221123150233.13039-1-worldhello.net@gmail.com","subject":"[PATCH v2 0/3] Fix broken CI on newer github-actions runner image","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2022-11-24T09:05:42Z","receivedAt":"2022-11-24T09:06:10Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"From: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n\nGitHub CI runner image \"ubuntu-latest\" will upgrade to \"ubuntu-22.04\"\nsoon, and the CI runner image of my private host repository has\nalready been upgraded.\n\nOur CI will break on new runner image because there is not \"gcc-8\"\npackage in ubuntu-22.04. See log of CI#2:\n\n * https://github.com/jiangxin/git-ci-test/actions/runs/3537628107/jobs/5937769957\n\nThis issue is fixed in patch 1/3 by downgrade the version of the runner\nimage for jobs which need \"gcc-8\". But there are still some CI errors.\nThis is because p4/p4d version 16.2 cannot run on ubuntu-22.04. See this\nlog of CI#3:\n\n * https://github.com/jiangxin/git-ci-test/actions/runs/3537650146/jobs/5937813922\n\nThis issue is fixed in patch 2/3 by upgrade p4 and p4d. But all p4\nrelated test cases failed becasue python was missing on ubuntu-22.04.\nSee the log of CI#4:\n\n * https://github.com/jiangxin/git-ci-test/actions/runs/3537695959/jobs/5937929695\n\nThis issue is fixed in patch 3/3 by install python2/python3 on ubutnu.\n\nIf install p4 version 22.2, will break several p4 related test cases,\nsee the log of CI#7:\n\n * https://github.com/jiangxin/git-ci-test/actions/runs/3538795233/jobs/5939989823\n\nSo we choose p4 21.2, and the final successful log of CI#8 is below:\n\n * https://github.com/jiangxin/git-ci-test/actions/runs/3538946849\n\n--\nJiang Xin (3):\n  github-actions: run gcc-8 on ubuntu-20.04 image\n  ci: upgrade version of p4 to 21.2\n  ci: install python on ubuntu\n\n .github/workflows/main.yml | 16 ++++++++++++----\n ci/install-dependencies.sh | 12 ++++++------\n ci/lib.sh                  | 10 ++++++----\n 3 files changed, 24 insertions(+), 14 deletions(-)\n\n-- \n2.39.0.rc0\n\n"},{"id":"467915","messageId":"20221124090545.4790-2-worldhello.net@gmail.com","threadId":"58845","inReplyTo":"20221123150233.13039-1-worldhello.net@gmail.com","subject":"[PATCH v2 1/3] github-actions: run gcc-8 on ubuntu-20.04 image","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2022-11-24T09:05:43Z","receivedAt":"2022-11-24T09:06:17Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"From: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n\nGitHub starts to upgrade its runner image \"ubuntu-latest\" from version\n\"ubuntu-20.04\" to version \"ubuntu-22.04\". It will fail to find and\ninstall \"gcc-8\" package on the new runner image.\n\nChange the runner images from \"ubuntu-latest\" to \"ubuntu-20.04\" in order\nto run with \"gcc-8\" as a dependency.\n\nInstead of use the environment \"$runs_on_pool\" as below:\n\n    case \"$runs_on_pool\" in\n    ubuntu-20.04 | ubuntu-latest)\n\t;;\n\nwe can reuse the os field in the matrix, and use a new environment\n\"$runs_on_os\" as below:\n\n    case \"$runs_on_os\" in\n    ubuntu)\n        ;;\n\nIn this way, we can change the \"ubuntu-latest\" runner image to any\nversion such as \"ubuntu-22.04\" to test CI behavior in advance.\n\nSigned-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n---\n .github/workflows/main.yml | 16 ++++++++++++----\n ci/install-dependencies.sh |  6 +++---\n ci/lib.sh                  |  6 +++---\n 3 files changed, 18 insertions(+), 10 deletions(-)\n\ndiff --git a/.github/workflows/main.yml b/.github/workflows/main.yml\nindex 592f9193a8..da0d8ab0bf 100644\n--- a/.github/workflows/main.yml\n+++ b/.github/workflows/main.yml\n@@ -224,6 +224,7 @@ jobs:\n         vector:\n           - jobname: linux-clang\n             cc: clang\n+            os: ubuntu\n             pool: ubuntu-latest\n           - jobname: linux-sha256\n             cc: clang\n@@ -232,36 +233,43 @@ jobs:\n           - jobname: linux-gcc\n             cc: gcc\n             cc_package: gcc-8\n-            pool: ubuntu-latest\n+            os: ubuntu\n+            pool: ubuntu-20.04\n           - jobname: linux-TEST-vars\n             cc: gcc\n-            os: ubuntu\n             cc_package: gcc-8\n-            pool: ubuntu-latest\n+            os: ubuntu\n+            pool: ubuntu-20.04\n           - jobname: osx-clang\n             cc: clang\n+            os: macos\n             pool: macos-latest\n           - jobname: osx-gcc\n             cc: gcc\n             cc_package: gcc-9\n+            os: macos\n             pool: macos-latest\n           - jobname: linux-gcc-default\n             cc: gcc\n+            os: ubuntu\n             pool: ubuntu-latest\n           - jobname: linux-leaks\n             cc: gcc\n+            os: ubuntu\n             pool: ubuntu-latest\n           - jobname: linux-asan\n             cc: gcc\n+            os: ubuntu\n             pool: ubuntu-latest\n           - jobname: linux-ubsan\n             cc: gcc\n+            os: ubuntu\n             pool: ubuntu-latest\n     env:\n       CC: ${{matrix.vector.cc}}\n       CC_PACKAGE: ${{matrix.vector.cc_package}}\n       jobname: ${{matrix.vector.jobname}}\n-      runs_on_pool: ${{matrix.vector.pool}}\n+      runs_on_os: ${{matrix.vector.os}}\n     runs-on: ${{matrix.vector.pool}}\n     steps:\n     - uses: actions/checkout@v2\ndiff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh\nindex 107757a1fe..f639263a62 100755\n--- a/ci/install-dependencies.sh\n+++ b/ci/install-dependencies.sh\n@@ -11,8 +11,8 @@ UBUNTU_COMMON_PKGS=\"make libssl-dev libcurl4-openssl-dev libexpat-dev\n  tcl tk gettext zlib1g-dev perl-modules liberror-perl libauthen-sasl-perl\n  libemail-valid-perl libio-socket-ssl-perl libnet-smtp-ssl-perl\"\n \n-case \"$runs_on_pool\" in\n-ubuntu-latest)\n+case \"$runs_on_os\" in\n+ubuntu)\n \tsudo apt-get -q update\n \tsudo apt-get -q -y install language-pack-is libsvn-perl apache2 \\\n \t\t$UBUNTU_COMMON_PKGS $CC_PACKAGE\n@@ -30,7 +30,7 @@ ubuntu-latest)\n \t\tcp git-lfs-$LINUX_GIT_LFS_VERSION/git-lfs .\n \tpopd\n \t;;\n-macos-latest)\n+macos)\n \texport HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1\n \t# Uncomment this if you want to run perf tests:\n \t# brew install gnu-time\ndiff --git a/ci/lib.sh b/ci/lib.sh\nindex 24d20a5d64..0c0767d354 100755\n--- a/ci/lib.sh\n+++ b/ci/lib.sh\n@@ -225,8 +225,8 @@ export DEFAULT_TEST_TARGET=prove\n export GIT_TEST_CLONE_2GB=true\n export SKIP_DASHED_BUILT_INS=YesPlease\n \n-case \"$runs_on_pool\" in\n-ubuntu-latest)\n+case \"$runs_on_os\" in\n+ubuntu)\n \tif test \"$jobname\" = \"linux-gcc-default\"\n \tthen\n \t\tbreak\n@@ -253,7 +253,7 @@ ubuntu-latest)\n \tGIT_LFS_PATH=\"$HOME/custom/git-lfs\"\n \texport PATH=\"$GIT_LFS_PATH:$P4_PATH:$PATH\"\n \t;;\n-macos-latest)\n+macos)\n \tif [ \"$jobname\" = osx-gcc ]\n \tthen\n \t\tMAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=$(which python3)\"\n-- \n2.39.0.rc0\n\n"},{"id":"467916","messageId":"20221124090545.4790-3-worldhello.net@gmail.com","threadId":"58845","inReplyTo":"20221123150233.13039-1-worldhello.net@gmail.com","subject":"[PATCH v2 2/3] ci: upgrade version of p4 to 21.2","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2022-11-24T09:05:44Z","receivedAt":"2022-11-24T09:06:19Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"From: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n\nThere would be a segmentation fault when running p4 v16.2 on ubuntu\n22.04 which is the latest version of ubuntu runner image for github\nactions.\n\nBy checking each version from [1], p4d version 21.1 and above can work\nproperly on ubuntu 22.04. But version 22.x will break some p4 test\ncases. So p4 version 21.x is exactly the version we can use.\n\nIn addition to upgrade p4 from version 16.2 to 21.2, also add some\ninstructions to show errors of command \"p4 -V\", so we can see why the\ncommand output doesn't match.\n\n[1]: https://cdist2.perforce.com/perforce/\n\nSigned-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n---\n ci/install-dependencies.sh | 4 ++--\n ci/lib.sh                  | 2 +-\n 2 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh\nindex f639263a62..291e49bdde 100755\n--- a/ci/install-dependencies.sh\n+++ b/ci/install-dependencies.sh\n@@ -83,9 +83,9 @@ esac\n if type p4d >/dev/null 2>&1 && type p4 >/dev/null 2>&1\n then\n \techo \"$(tput setaf 6)Perforce Server Version$(tput sgr0)\"\n-\tp4d -V | grep Rev.\n+\tp4d -V | grep Rev. || { echo >&2 \"p4d: bad version\"; p4d -V; exit 1; }\n \techo \"$(tput setaf 6)Perforce Client Version$(tput sgr0)\"\n-\tp4 -V | grep Rev.\n+\tp4 -V | grep Rev. || { echo >&2 \"p4: bad version\"; p4 -V; exit 1; }\n else\n \techo >&2 \"WARNING: perforce wasn't installed, see above for clues why\"\n fi\ndiff --git a/ci/lib.sh b/ci/lib.sh\nindex 0c0767d354..a618d66b81 100755\n--- a/ci/lib.sh\n+++ b/ci/lib.sh\n@@ -246,7 +246,7 @@ ubuntu)\n \t# were recorded in the Homebrew database upon creating the OS X\n \t# image.\n \t# Keep that in mind when you encounter a broken OS X build!\n-\texport LINUX_P4_VERSION=\"16.2\"\n+\texport LINUX_P4_VERSION=\"21.2\"\n \texport LINUX_GIT_LFS_VERSION=\"1.5.2\"\n \n \tP4_PATH=\"$HOME/custom/p4\"\n-- \n2.39.0.rc0\n\n"},{"id":"467917","messageId":"20221124090545.4790-4-worldhello.net@gmail.com","threadId":"58845","inReplyTo":"20221123150233.13039-1-worldhello.net@gmail.com","subject":"[PATCH v2 3/3] ci: install python on ubuntu","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2022-11-24T09:05:45Z","receivedAt":"2022-11-24T09:06:20Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"From: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n\nPython is missing from the default ubuntu-22.04 runner image, which\nprevent git-p4 from working. To install python on ubuntu, we need to\nprovide correct package name:\n\n * On Ubuntu 18.04 (bionic), \"/usr/bin/python2\" is provided by the\n   \"python\" package, and \"/usr/bin/python3\" is provided by the \"python3\"\n   package.\n\n * On Ubuntu 20.04 (focal) and above, \"/usr/bin/python2\" is provided by\n   the \"python2\" package which has a different name from bionic, and\n   \"/usr/bin/python3\" is provided by \"python3\".\n\nSince the \"ubuntu-latest\" runner image has a higher version, so its safe\nto use \"python2\" or \"python3\" package name.\n\nSigned-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n---\n ci/install-dependencies.sh | 2 +-\n ci/lib.sh                  | 2 ++\n 2 files changed, 3 insertions(+), 1 deletion(-)\n\ndiff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh\nindex 291e49bdde..e28d93a154 100755\n--- a/ci/install-dependencies.sh\n+++ b/ci/install-dependencies.sh\n@@ -15,7 +15,7 @@ case \"$runs_on_os\" in\n ubuntu)\n \tsudo apt-get -q update\n \tsudo apt-get -q -y install language-pack-is libsvn-perl apache2 \\\n-\t\t$UBUNTU_COMMON_PKGS $CC_PACKAGE\n+\t\t$UBUNTU_COMMON_PKGS $CC_PACKAGE $PYTHON_PACKAGE\n \tmkdir --parents \"$P4_PATH\"\n \tpushd \"$P4_PATH\"\n \t\twget --quiet \"$P4WHENCE/bin.linux26x86_64/p4d\"\ndiff --git a/ci/lib.sh b/ci/lib.sh\nindex a618d66b81..ebe702e0ea 100755\n--- a/ci/lib.sh\n+++ b/ci/lib.sh\n@@ -235,8 +235,10 @@ ubuntu)\n \tif [ \"$jobname\" = linux-gcc ]\n \tthen\n \t\tMAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=/usr/bin/python3\"\n+\t\tPYTHON_PACKAGE=python3\n \telse\n \t\tMAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=/usr/bin/python2\"\n+\t\tPYTHON_PACKAGE=python2\n \tfi\n \n \texport GIT_TEST_HTTPD=true\n-- \n2.39.0.rc0\n\n"},{"id":"467918","messageId":"CANYiYbEoar_5kN4jMKuy9Fucpajj5g8TJZrdo3=K1FYDz-2_bw@mail.gmail.com","threadId":"58845","inReplyTo":"n79194n5-8q94-29n4-s447-64r0p2po4r76@tzk.qr","subject":"Re: [PATCH 2/2] ci: upgrade version of p4","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2022-11-24T09:15:51Z","receivedAt":"2022-11-24T09:16:05Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"On Thu, Nov 24, 2022 at 4:16 PM Johannes Schindelin\n<Johannes.Schindelin@gmx.de> wrote:\n> > From: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n> >\n> > There would be a segmentation fault when running p4 v16.2 on ubuntu\n> > 22.04 which is the latest version of ubuntu runner image for github\n> > actions. Upgrade p4 from version 16.2 to 19.2 will fix this issue.\n>\n> I was about to embark on a debugging session when I had the splendid idea\n> to look at the Git mailing list archives to see whether anybody else had\n> encountered that particular problem.\n>\n> However, when I pushed a branch with this fix, it still segfaulted even\n> when downloading version 19.2 (link:\n> https://github.com/dscho/git/actions/runs/3538788474/jobs/5939977231#step:3:387):\n\nYes, p4d 19.2 also has segfault errors, and p4 version 21.x and above\nis OK.  Maybe yesterday I only check p4, and forgot to check p4d by\nhands.\n\nIt is fixed in v2 by upgrade p4 to 21.2.\n\n--\nJiang Xin\n"},{"id":"467919","messageId":"CANYiYbERKwmRj2DU=d4GCPO-jy+g8pMPBgD+vtzwB2iXRH44Ew@mail.gmail.com","threadId":"58845","inReplyTo":"5p3n90pq-4ro8-0278-3q8s-r2p568q3o26r@tzk.qr","subject":"Re: [PATCH 2/2] ci: upgrade version of p4","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2022-11-24T09:17:36Z","receivedAt":"2022-11-24T09:17:53Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"On Thu, Nov 24, 2022 at 4:54 PM Johannes Schindelin\n<Johannes.Schindelin@gmx.de> wrote:\n>\n> Me again,\n> Hmm. Hold on. While `p4d` now no longer segfaults, it looks as if `git p4`\n> is completely broken (see\n> https://github.com/dscho/git/actions/runs/3538941550/jobs/5940295721#step:4:2005):\n>\n>   failure: t9800.3 basic git p4 clone\n>         git p4 clone --dest=\"$git\" //depot &&\n>         test_when_finished cleanup_git &&\n>         (\n>                 cd \"$git\" &&\n>                 git log --oneline >lines &&\n>                 test_line_count = 1 lines\n>         )\n>\n>   + git p4 clone --dest=/home/runner/work/git/git/t/trash directory.t9800-git-p4-basic/git //depot\n>   Perforce db files in '.' will be created if missing...\n>   fatal: 'p4' appears to be a git command, but we were not\n>   able to execute it. Maybe git-p4 is broken?\n>   error: last command exited with $?=128\n>   not ok 3 - basic git p4 clone\n>   #\n>   #             git p4 clone --dest=\"$git\" //depot &&\n>   #             test_when_finished cleanup_git &&\n>   #             (\n>   #                     cd \"$git\" &&\n>   #                     git log --oneline >lines &&\n>   #                     test_line_count = 1 lines\n>   #             )\n>   #\n>\n> I guess I will keep digging,\n> Dscho\n\nI found this is because python is not installed by default on\nubuntu-22.04. This issue is fix in patch 3/3 of reroll v2.\n\n--\nJiang Xin\n"},{"id":"467920","messageId":"7rq4snrp-r2po-qoro-s756-rporso2o44p0@tzk.qr","threadId":"58845","inReplyTo":"CANYiYbERKwmRj2DU=d4GCPO-jy+g8pMPBgD+vtzwB2iXRH44Ew@mail.gmail.com","subject":"Re: [PATCH 2/2] ci: upgrade version of p4","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2022-11-24T09:41:00Z","receivedAt":"2022-11-24T09:41:19Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 24 Nov 2022, Jiang Xin wrote:\n\n> On Thu, Nov 24, 2022 at 4:54 PM Johannes Schindelin\n> <Johannes.Schindelin@gmx.de> wrote:\n> >\n> > Me again,\n> > Hmm. Hold on. While `p4d` now no longer segfaults, it looks as if `git p4`\n> > is completely broken (see\n> > https://github.com/dscho/git/actions/runs/3538941550/jobs/5940295721#step:4:2005):\n> >\n> >   failure: t9800.3 basic git p4 clone\n> >         git p4 clone --dest=\"$git\" //depot &&\n> >         test_when_finished cleanup_git &&\n> >         (\n> >                 cd \"$git\" &&\n> >                 git log --oneline >lines &&\n> >                 test_line_count = 1 lines\n> >         )\n> >\n> >   + git p4 clone --dest=/home/runner/work/git/git/t/trash directory.t9800-git-p4-basic/git //depot\n> >   Perforce db files in '.' will be created if missing...\n> >   fatal: 'p4' appears to be a git command, but we were not\n> >   able to execute it. Maybe git-p4 is broken?\n> >   error: last command exited with $?=128\n> >   not ok 3 - basic git p4 clone\n> >   #\n> >   #             git p4 clone --dest=\"$git\" //depot &&\n> >   #             test_when_finished cleanup_git &&\n> >   #             (\n> >   #                     cd \"$git\" &&\n> >   #                     git log --oneline >lines &&\n> >   #                     test_line_count = 1 lines\n> >   #             )\n> >   #\n> >\n> > I guess I will keep digging,\n> > Dscho\n>\n> I found this is because python is not installed by default on\n> ubuntu-22.04. This issue is fix in patch 3/3 of reroll v2.\n\nExcellent find!\n\nI was pulling out my hair because I could not reproduce the issue, but\nthen I did not override `PYTHON_PATH` in my build and therefore the\nalready-installed python3 was used.\n\nFWIW I confirm that this fixes the build. I restricted the build to the\nnecessary minimum (and threw in an `action-tmate` step for more efficient\ndebugging) and it passed the p4 tests:\nhttps://github.com/dscho/git/actions/runs/3539338333/jobs/5941122554\n\nThank you so much!\nDscho\n"},{"id":"467921","messageId":"2219s80r-q7s3-391o-o3or-7q70sn37ooo9@tzk.qr","threadId":"58845","inReplyTo":"20221124090545.4790-1-worldhello.net@gmail.com","subject":"Re: [PATCH v2 0/3] Fix broken CI on newer github-actions runner image","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2022-11-24T09:44:50Z","receivedAt":"2022-11-24T09:45:05Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 24 Nov 2022, Jiang Xin wrote:\n\n> From: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n>\n> GitHub CI runner image \"ubuntu-latest\" will upgrade to \"ubuntu-22.04\"\n> soon, and the CI runner image of my private host repository has\n> already been upgraded.\n>\n> Our CI will break on new runner image because there is not \"gcc-8\"\n> package in ubuntu-22.04. See log of CI#2:\n>\n>  * https://github.com/jiangxin/git-ci-test/actions/runs/3537628107/jobs/5937769957\n>\n> This issue is fixed in patch 1/3 by downgrade the version of the runner\n> image for jobs which need \"gcc-8\". But there are still some CI errors.\n> This is because p4/p4d version 16.2 cannot run on ubuntu-22.04. See this\n> log of CI#3:\n>\n>  * https://github.com/jiangxin/git-ci-test/actions/runs/3537650146/jobs/5937813922\n>\n> This issue is fixed in patch 2/3 by upgrade p4 and p4d. But all p4\n> related test cases failed becasue python was missing on ubuntu-22.04.\n> See the log of CI#4:\n>\n>  * https://github.com/jiangxin/git-ci-test/actions/runs/3537695959/jobs/5937929695\n>\n> This issue is fixed in patch 3/3 by install python2/python3 on ubutnu.\n>\n> If install p4 version 22.2, will break several p4 related test cases,\n> see the log of CI#7:\n>\n>  * https://github.com/jiangxin/git-ci-test/actions/runs/3538795233/jobs/5939989823\n>\n> So we choose p4 21.2, and the final successful log of CI#8 is below:\n>\n>  * https://github.com/jiangxin/git-ci-test/actions/runs/3538946849\n\nACK!\n\nI verified that this patch series does the job, by applying it on top of\n`microsoft/git`'s tentative rebase to v2.39.0-rc0:\nhttps://github.com/dscho/git/actions/runs/3539338333/jobs/5941122554\n\nThis run was restricted to `linux-clang` and the p4 tests. I care a lot\nabout not using more resources than one's fair share, therefore I wanted\nto avoid using build minutes unnecessarily during my debuging.\n\nTo build even more confidence in the patch series, I will now start a full\nrun (which will take *a lot* of build minutes, unfortunately).\n\nThank you so much!\nDscho\n"},{"id":"467923","messageId":"4oonnq45-s269-sr8n-o5sr-n214593nps8s@tzk.qr","threadId":"58845","inReplyTo":"2219s80r-q7s3-391o-o3or-7q70sn37ooo9@tzk.qr","subject":"Re: [PATCH v2 0/3] Fix broken CI on newer github-actions runner image","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2022-11-24T10:48:14Z","receivedAt":"2022-11-24T10:48:30Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 24 Nov 2022, Johannes Schindelin wrote:\n\n> To build even more confidence in the patch series, I will now start a full\n> run (which will take *a lot* of build minutes, unfortunately).\n\nAnd it passed: https://github.com/dscho/git/actions/runs/3539451056\n\nI also had a look at the range-diff between v1 and v2:\n\n-- snip --\n1:  ef80c39de1e5 ! 1:  6d4607a4ee46 github-actions: run gcc-8 on ubuntu-20.04 image\n    @@ Commit message\n             ubuntu)\n                 ;;\n\n    +    In this way, we can change the \"ubuntu-latest\" runner image to any\n    +    version such as \"ubuntu-22.04\" to test CI behavior in advance.\n    +\n         Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n\n2:  1d0903c8b2f9 ! 2:  eba96648368a ci: upgrade version of p4\n    @@ Metadata\n     Author: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n\n      ## Commit message ##\n    -    ci: upgrade version of p4\n    +    ci: upgrade version of p4 to 21.2\n\n         There would be a segmentation fault when running p4 v16.2 on ubuntu\n         22.04 which is the latest version of ubuntu runner image for github\n    -    actions. Upgrade p4 from version 16.2 to 19.2 will fix this issue.\n    +    actions.\n\n    -    Also add some instructions to show errors of command \"p4 -V\", so we can\n    -    see why the output doesn't match.\n    +    By checking each version from [1], p4d version 21.1 and above can work\n    +    properly on ubuntu 22.04. But version 22.x will break some p4 test\n    +    cases. So p4 version 21.x is exactly the version we can use.\n    +\n    +    In addition to upgrade p4 from version 16.2 to 21.2, also add some\n    +    instructions to show errors of command \"p4 -V\", so we can see why the\n    +    command output doesn't match.\n    +\n    +    [1]: https://cdist2.perforce.com/perforce/\n\n         Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n    @@ ci/lib.sh: ubuntu)\n      \t# image.\n      \t# Keep that in mind when you encounter a broken OS X build!\n     -\texport LINUX_P4_VERSION=\"16.2\"\n    -+\texport LINUX_P4_VERSION=\"19.2\"\n    ++\texport LINUX_P4_VERSION=\"21.2\"\n      \texport LINUX_GIT_LFS_VERSION=\"1.5.2\"\n\n      \tP4_PATH=\"$HOME/custom/p4\"\n-:  ------------ > 3:  8e432f13bef8 ci: install python on ubuntu\n-- snap --\n\nThe changes look good!\n\nOne alternative I considered about 8e432f13bef8 (ci: install python on\nubuntu, 2022-11-24) was to drop testing Python v2.x (it's years past end\nof life after all, see https://endoflife.date/python).\n\nHowever, as we see frequently demonstrated on the Git mailing list:\nlosing focus, trying to force patch series to address more than a single\nconcern, gets us nowhere, and not even fast.\n\nSo I agree that the best idea in this patch series is the stop-gap\nsolution to install `python2` on `ubuntu-22.04`, and deal with deprecating\nPython v2.x support separately, later, or never, whichever comes first ;-)\n\nWith this, here goes my (probably final, because I think this patch series\nis ready):\n\n\tReviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nThank you so much for working on this, it was a thoroughly enjoyable\nexperience for me!\n\nCiao,\nDscho\n"},{"id":"467924","messageId":"221124.86mt8gpqra.gmgdl@evledraar.gmail.com","threadId":"58845","inReplyTo":"20221124090545.4790-2-worldhello.net@gmail.com","subject":"Re: [PATCH v2 1/3] github-actions: run gcc-8 on ubuntu-20.04 image","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2022-11-24T10:46:17Z","receivedAt":"2022-11-24T10:56:31Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Thu, Nov 24 2022, Jiang Xin wrote:\n\n> From: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n>\n> GitHub starts to upgrade its runner image \"ubuntu-latest\" from version\n> \"ubuntu-20.04\" to version \"ubuntu-22.04\". It will fail to find and\n> install \"gcc-8\" package on the new runner image.\n>\n> Change the runner images from \"ubuntu-latest\" to \"ubuntu-20.04\" in order\n> to run with \"gcc-8\" as a dependency.\n\nI very much like this direction, as we shouldn't have to scramble to\nupdate our CI every time GitHub switches defaults, and by using \"latest\"\nin general we also break e.g. re-pushes or re-rolls of outstanding topics/PRs.\n\nI.e. you'll push today, it'll work, tomorrow the \"latest\" image has\nchanged and your CI breaks, but through no fault of the code you're\ntesting.\n\nBut per previous discussion on this exact topic at least Junio & Derrick\n(CC'd) disagreed with going in that direction, see\nhttps://lore.kernel.org/git/220825.865yig4bd7.gmgdl@evledraar.gmail.com/\n(and the E-Mail it links to).\n\nNow, I think that if we have some notification so we'll update the\n\"pinned\" image sooner than later it'll address the concerns they had,\nbut do we have that? I've seen notices from GitHub CI about e.g. some\nthings in the main.yml file being deprecated, will we get those for\nthese \"pinned\" images too in a timely manner?\n\nBecause while I think a non-pinned \"latest\" sucks because it forces us\nto scramble with updates like this, having a \"pinned\" image go away\nentirely (because nobody noticed we should update it sooner-than-later)\nwould suck more.\n\n> Instead of use the environment \"$runs_on_pool\" as below:\n>\n>     case \"$runs_on_pool\" in\n>     ubuntu-20.04 | ubuntu-latest)\n> \t;;\n>\n> we can reuse the os field in the matrix, and use a new environment\n> \"$runs_on_os\" as below:\n>\n>     case \"$runs_on_os\" in\n>     ubuntu)\n>         ;;\n\nI think this is probably a good change, as we won't need to\nsearch-replace the image name in as many places in the future.\n\nBut let's have this as a seperate change. Here you're just refactoring\nthe selection behavior of the main.yml + CI lib, it doesn't need to be\nbundled up with the change to change the target image.\n"},{"id":"467925","messageId":"221124.86ilj4pqfn.gmgdl@evledraar.gmail.com","threadId":"58845","inReplyTo":"20221124090545.4790-3-worldhello.net@gmail.com","subject":"Re: [PATCH v2 2/3] ci: upgrade version of p4 to 21.2","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2022-11-24T10:55:20Z","receivedAt":"2022-11-24T11:01:08Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Thu, Nov 24 2022, Jiang Xin wrote:\n\n> From: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n>\n> There would be a segmentation fault when running p4 v16.2 on ubuntu\n> 22.04 which is the latest version of ubuntu runner image for github\n> actions.\n>\n> By checking each version from [1], p4d version 21.1 and above can work\n> properly on ubuntu 22.04. But version 22.x will break some p4 test\n> cases. So p4 version 21.x is exactly the version we can use.\n>\n> In addition to upgrade p4 from version 16.2 to 21.2, also add some\n> instructions to show errors of command \"p4 -V\", so we can see why the\n> command output doesn't match.\n> [...]\n> diff --git a/ci/lib.sh b/ci/lib.sh\n> index 0c0767d354..a618d66b81 100755\n> --- a/ci/lib.sh\n> +++ b/ci/lib.sh\n> @@ -246,7 +246,7 @@ ubuntu)\n\nOmitted from this context is:\n\n\t# The Linux build installs the defined dependency versions below.\n\t# The OS X build installs much more recent versions,\n\nThat part should be updated here, as it's now out-of-date, they're now\ninstalling the same version: 21.2.\n\n>  \t# were recorded in the Homebrew database upon creating the OS X\n>  \t# image.\n>  \t# Keep that in mind when you encounter a broken OS X build!\n> -\texport LINUX_P4_VERSION=\"16.2\"\n> +\texport LINUX_P4_VERSION=\"21.2\"\n>  \texport LINUX_GIT_LFS_VERSION=\"1.5.2\"\n>  \n>  \tP4_PATH=\"$HOME/custom/p4\"\n\nThis is a welcome change, but it would be even more welcome if you\nfollowed-up and unified the linux and osx p4 logic as a follow-up.\n\nI.e. after this we'll install 21.2 on both osx and linux, so the\nversions are no longer different.\n\nI think we probably won't need to install different versions for the two\never, we just drifted on the linux version, or maybe (per the comment\nwe'll need to adjust) there was some problem before with upgrading the\nlinux version, but no longer?\n\nI didn't dig, but covering some of that in the commit message would be\nmost welcome.\n\nSo can we just s/LINUX_P4_VERSION/P4_VERSION/ or something, and then\nchange this in the \"macos-latest\";\n\n\twget -q \"https://cdist2.perforce.com/perforce/r21.2/bin.macosx1015x86_64/helix-core-server.tgz\"\n\nTo:\n\n\twget -q \"https://cdist2.perforce.com/perforce/r${P4_VERSION}/bin.macosx1015x86_64/helix-core-server.tgz\"\n\nWhile doing that we can just move the \"LINUX_P4_VERSION\" (or whatever we\nrename it to) from lib.sh to \"install-dependencies.sh\".\n\n"},{"id":"467926","messageId":"221124.86edtspq74.gmgdl@evledraar.gmail.com","threadId":"58845","inReplyTo":"20221124090545.4790-4-worldhello.net@gmail.com","subject":"Re: [PATCH v2 3/3] ci: install python on ubuntu","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2022-11-24T11:02:17Z","receivedAt":"2022-11-24T11:06:14Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Thu, Nov 24 2022, Jiang Xin wrote:\n\n> From: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n>\n> Python is missing from the default ubuntu-22.04 runner image, which\n> prevent git-p4 from working. To install python on ubuntu, we need to\n> provide correct package name:\n>\n>  * On Ubuntu 18.04 (bionic), \"/usr/bin/python2\" is provided by the\n>    \"python\" package, and \"/usr/bin/python3\" is provided by the \"python3\"\n>    package.\n>\n>  * On Ubuntu 20.04 (focal) and above, \"/usr/bin/python2\" is provided by\n>    the \"python2\" package which has a different name from bionic, and\n>    \"/usr/bin/python3\" is provided by \"python3\".\n>\n> Since the \"ubuntu-latest\" runner image has a higher version, so its safe\n> to use \"python2\" or \"python3\" package name.\n>\n> Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n> ---\n>  ci/install-dependencies.sh | 2 +-\n>  ci/lib.sh                  | 2 ++\n>  2 files changed, 3 insertions(+), 1 deletion(-)\n>\n> diff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh\n> index 291e49bdde..e28d93a154 100755\n> --- a/ci/install-dependencies.sh\n> +++ b/ci/install-dependencies.sh\n> @@ -15,7 +15,7 @@ case \"$runs_on_os\" in\n>  ubuntu)\n>  \tsudo apt-get -q update\n>  \tsudo apt-get -q -y install language-pack-is libsvn-perl apache2 \\\n> -\t\t$UBUNTU_COMMON_PKGS $CC_PACKAGE\n> +\t\t$UBUNTU_COMMON_PKGS $CC_PACKAGE $PYTHON_PACKAGE\n>  \tmkdir --parents \"$P4_PATH\"\n>  \tpushd \"$P4_PATH\"\n>  \t\twget --quiet \"$P4WHENCE/bin.linux26x86_64/p4d\"\n> diff --git a/ci/lib.sh b/ci/lib.sh\n> index a618d66b81..ebe702e0ea 100755\n> --- a/ci/lib.sh\n> +++ b/ci/lib.sh\n> @@ -235,8 +235,10 @@ ubuntu)\n>  \tif [ \"$jobname\" = linux-gcc ]\n>  \tthen\n>  \t\tMAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=/usr/bin/python3\"\n> +\t\tPYTHON_PACKAGE=python3\n>  \telse\n>  \t\tMAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=/usr/bin/python2\"\n> +\t\tPYTHON_PACKAGE=python2\n>  \tfi\n\nLet's not copy/paste and repeat ourselves here for no reason. Part of\nthis is pre-existing, but if you just re-arrange these variable decls\nyou can do this instead:\n\n\tPYTHON_PACKAGE=python2\n\tif test \"$jobname\" = linux-gcc\n\tthen\n\t\tPYTHON_PACKAGE=python3\n\tfi\n\tMAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=/usr/bin/${PYTHON_PACKAGE}\"\n\nEven if you don't factor out the \"else\" like that (which I think would\nbe OK to do while-we'er-at-it) this should be changed so that the\n\"PYTHON_PACKAGE\" comes before \"MAKEFLAGS\" in the two if/else branches\nhere, so we can then use the variable.\n"},{"id":"467927","messageId":"CANYiYbEbb4sgWtQRSEYJbzcAYTKDRpmVtL62HMR-QekhY_8-bQ@mail.gmail.com","threadId":"58845","inReplyTo":"4oonnq45-s269-sr8n-o5sr-n214593nps8s@tzk.qr","subject":"Re: [PATCH v2 0/3] Fix broken CI on newer github-actions runner image","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2022-11-24T11:23:28Z","receivedAt":"2022-11-24T11:23:53Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"On Thu, Nov 24, 2022 at 6:48 PM Johannes Schindelin\n<Johannes.Schindelin@gmx.de> wrote:\n>\n> Hi,\n>\n> On Thu, 24 Nov 2022, Johannes Schindelin wrote:\n>\n> > To build even more confidence in the patch series, I will now start a full\n> > run (which will take *a lot* of build minutes, unfortunately).\n>\n> And it passed: https://github.com/dscho/git/actions/runs/3539451056\n>\n> I also had a look at the range-diff between v1 and v2:\n>\n> -- snip --\n> 1:  ef80c39de1e5 ! 1:  6d4607a4ee46 github-actions: run gcc-8 on ubuntu-20.04 image\n>     @@ Commit message\n>              ubuntu)\n>                  ;;\n>\n>     +    In this way, we can change the \"ubuntu-latest\" runner image to any\n>     +    version such as \"ubuntu-22.04\" to test CI behavior in advance.\n>     +\n>          Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n>\n> 2:  1d0903c8b2f9 ! 2:  eba96648368a ci: upgrade version of p4\n>     @@ Metadata\n>      Author: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n>\n>       ## Commit message ##\n>     -    ci: upgrade version of p4\n>     +    ci: upgrade version of p4 to 21.2\n>\n>          There would be a segmentation fault when running p4 v16.2 on ubuntu\n>          22.04 which is the latest version of ubuntu runner image for github\n>     -    actions. Upgrade p4 from version 16.2 to 19.2 will fix this issue.\n>     +    actions.\n>\n>     -    Also add some instructions to show errors of command \"p4 -V\", so we can\n>     -    see why the output doesn't match.\n>     +    By checking each version from [1], p4d version 21.1 and above can work\n>     +    properly on ubuntu 22.04. But version 22.x will break some p4 test\n>     +    cases. So p4 version 21.x is exactly the version we can use.\n>     +\n>     +    In addition to upgrade p4 from version 16.2 to 21.2, also add some\n>     +    instructions to show errors of command \"p4 -V\", so we can see why the\n>     +    command output doesn't match.\n>     +\n>     +    [1]: https://cdist2.perforce.com/perforce/\n>\n>          Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n>     @@ ci/lib.sh: ubuntu)\n>         # image.\n>         # Keep that in mind when you encounter a broken OS X build!\n>      -  export LINUX_P4_VERSION=\"16.2\"\n>     -+  export LINUX_P4_VERSION=\"19.2\"\n>     ++  export LINUX_P4_VERSION=\"21.2\"\n>         export LINUX_GIT_LFS_VERSION=\"1.5.2\"\n>\n>         P4_PATH=\"$HOME/custom/p4\"\n> -:  ------------ > 3:  8e432f13bef8 ci: install python on ubuntu\n> -- snap --\n>\n> The changes look good!\n\nThank you for providing this range-diff.\n\n--\nJiang Xin\n"},{"id":"467928","messageId":"CANYiYbEHXwXTpRiha+0SoO_7_6LrJ7iE5c-fc-uzp21+aXKgBQ@mail.gmail.com","threadId":"58845","inReplyTo":"221124.86edtspq74.gmgdl@evledraar.gmail.com","subject":"Re: [PATCH v2 3/3] ci: install python on ubuntu","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2022-11-24T11:37:29Z","receivedAt":"2022-11-24T11:37:44Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"On Thu, Nov 24, 2022 at 7:06 PM Ævar Arnfjörð Bjarmason\n<avarab@gmail.com> wrote:\n>\n>\n> On Thu, Nov 24 2022, Jiang Xin wrote:\n>\n> > From: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n> >\n> > Python is missing from the default ubuntu-22.04 runner image, which\n> > prevent git-p4 from working. To install python on ubuntu, we need to\n> > provide correct package name:\n> >\n> >  * On Ubuntu 18.04 (bionic), \"/usr/bin/python2\" is provided by the\n> >    \"python\" package, and \"/usr/bin/python3\" is provided by the \"python3\"\n> >    package.\n> >\n> >  * On Ubuntu 20.04 (focal) and above, \"/usr/bin/python2\" is provided by\n> >    the \"python2\" package which has a different name from bionic, and\n> >    \"/usr/bin/python3\" is provided by \"python3\".\n> >\n> > Since the \"ubuntu-latest\" runner image has a higher version, so its safe\n> > to use \"python2\" or \"python3\" package name.\n> >\n> > Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n> > ---\n> >  ci/install-dependencies.sh | 2 +-\n> >  ci/lib.sh                  | 2 ++\n> >  2 files changed, 3 insertions(+), 1 deletion(-)\n> >\n> > diff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh\n> > index 291e49bdde..e28d93a154 100755\n> > --- a/ci/install-dependencies.sh\n> > +++ b/ci/install-dependencies.sh\n> > @@ -15,7 +15,7 @@ case \"$runs_on_os\" in\n> >  ubuntu)\n> >       sudo apt-get -q update\n> >       sudo apt-get -q -y install language-pack-is libsvn-perl apache2 \\\n> > -             $UBUNTU_COMMON_PKGS $CC_PACKAGE\n> > +             $UBUNTU_COMMON_PKGS $CC_PACKAGE $PYTHON_PACKAGE\n> >       mkdir --parents \"$P4_PATH\"\n> >       pushd \"$P4_PATH\"\n> >               wget --quiet \"$P4WHENCE/bin.linux26x86_64/p4d\"\n> > diff --git a/ci/lib.sh b/ci/lib.sh\n> > index a618d66b81..ebe702e0ea 100755\n> > --- a/ci/lib.sh\n> > +++ b/ci/lib.sh\n> > @@ -235,8 +235,10 @@ ubuntu)\n> >       if [ \"$jobname\" = linux-gcc ]\n> >       then\n> >               MAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=/usr/bin/python3\"\n> > +             PYTHON_PACKAGE=python3\n> >       else\n> >               MAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=/usr/bin/python2\"\n> > +             PYTHON_PACKAGE=python2\n> >       fi\n>\n> Let's not copy/paste and repeat ourselves here for no reason. Part of\n> this is pre-existing, but if you just re-arrange these variable decls\n> you can do this instead:\n>\n>         PYTHON_PACKAGE=python2\n>         if test \"$jobname\" = linux-gcc\n>         then\n>                 PYTHON_PACKAGE=python3\n>         fi\n>         MAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=/usr/bin/${PYTHON_PACKAGE}\"\n\nThat was exactly my first edition, but I thought it was weird to write\nas \"/usr/bin/${PYTHON_PACKAGE}\". But if use two variables like\nPYTHON_BINARY and PYTHON_PACKAGE, looks even more silly. So I choose\ncurrent solution.\n\n--\nJiang Xin\n"},{"id":"467929","messageId":"221124.86a64gpmkb.gmgdl@evledraar.gmail.com","threadId":"58845","inReplyTo":"CANYiYbEHXwXTpRiha+0SoO_7_6LrJ7iE5c-fc-uzp21+aXKgBQ@mail.gmail.com","subject":"Re: [PATCH v2 3/3] ci: install python on ubuntu","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2022-11-24T12:23:05Z","receivedAt":"2022-11-24T12:26:53Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Thu, Nov 24 2022, Jiang Xin wrote:\n\n> On Thu, Nov 24, 2022 at 7:06 PM Ævar Arnfjörð Bjarmason\n> <avarab@gmail.com> wrote:\n>>\n>>\n>> On Thu, Nov 24 2022, Jiang Xin wrote:\n>>\n>> > From: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n>> >\n>> > Python is missing from the default ubuntu-22.04 runner image, which\n>> > prevent git-p4 from working. To install python on ubuntu, we need to\n>> > provide correct package name:\n>> >\n>> >  * On Ubuntu 18.04 (bionic), \"/usr/bin/python2\" is provided by the\n>> >    \"python\" package, and \"/usr/bin/python3\" is provided by the \"python3\"\n>> >    package.\n>> >\n>> >  * On Ubuntu 20.04 (focal) and above, \"/usr/bin/python2\" is provided by\n>> >    the \"python2\" package which has a different name from bionic, and\n>> >    \"/usr/bin/python3\" is provided by \"python3\".\n>> >\n>> > Since the \"ubuntu-latest\" runner image has a higher version, so its safe\n>> > to use \"python2\" or \"python3\" package name.\n>> >\n>> > Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n>> > ---\n>> >  ci/install-dependencies.sh | 2 +-\n>> >  ci/lib.sh                  | 2 ++\n>> >  2 files changed, 3 insertions(+), 1 deletion(-)\n>> >\n>> > diff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh\n>> > index 291e49bdde..e28d93a154 100755\n>> > --- a/ci/install-dependencies.sh\n>> > +++ b/ci/install-dependencies.sh\n>> > @@ -15,7 +15,7 @@ case \"$runs_on_os\" in\n>> >  ubuntu)\n>> >       sudo apt-get -q update\n>> >       sudo apt-get -q -y install language-pack-is libsvn-perl apache2 \\\n>> > -             $UBUNTU_COMMON_PKGS $CC_PACKAGE\n>> > +             $UBUNTU_COMMON_PKGS $CC_PACKAGE $PYTHON_PACKAGE\n>> >       mkdir --parents \"$P4_PATH\"\n>> >       pushd \"$P4_PATH\"\n>> >               wget --quiet \"$P4WHENCE/bin.linux26x86_64/p4d\"\n>> > diff --git a/ci/lib.sh b/ci/lib.sh\n>> > index a618d66b81..ebe702e0ea 100755\n>> > --- a/ci/lib.sh\n>> > +++ b/ci/lib.sh\n>> > @@ -235,8 +235,10 @@ ubuntu)\n>> >       if [ \"$jobname\" = linux-gcc ]\n>> >       then\n>> >               MAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=/usr/bin/python3\"\n>> > +             PYTHON_PACKAGE=python3\n>> >       else\n>> >               MAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=/usr/bin/python2\"\n>> > +             PYTHON_PACKAGE=python2\n>> >       fi\n>>\n>> Let's not copy/paste and repeat ourselves here for no reason. Part of\n>> this is pre-existing, but if you just re-arrange these variable decls\n>> you can do this instead:\n>>\n>>         PYTHON_PACKAGE=python2\n>>         if test \"$jobname\" = linux-gcc\n>>         then\n>>                 PYTHON_PACKAGE=python3\n>>         fi\n>>         MAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=/usr/bin/${PYTHON_PACKAGE}\"\n>\n> That was exactly my first edition, but I thought it was weird to write\n> as \"/usr/bin/${PYTHON_PACKAGE}\". But if use two variables like\n> PYTHON_BINARY and PYTHON_PACKAGE, looks even more silly. So I choose\n> current solution.\n\nI don't mind if you go for your inital version, it's not much\nduplication, but why does it look silly? I don't think we need to worry\nthat the <package-name> on Ubuntu (and Debian) won't have a 1=1 mapping\nto the /usr/bin/<package-name>. So defining the path in terms of the\npackage name seems like an obvious thing to do.\n"},{"id":"467931","messageId":"221124.865yf4plw1.gmgdl@evledraar.gmail.com","threadId":"58845","inReplyTo":"4oonnq45-s269-sr8n-o5sr-n214593nps8s@tzk.qr","subject":"python 2 EOL (was: [PATCH v2 0/3] Fix broken CI on newer github-actions runner image)","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2022-11-24T12:28:20Z","receivedAt":"2022-11-24T12:40:40Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Thu, Nov 24 2022, Johannes Schindelin wrote:\n\n> On Thu, 24 Nov 2022, Johannes Schindelin wrote:\n> [...]\n> The changes look good!\n>\n> One alternative I considered about 8e432f13bef8 (ci: install python on\n> ubuntu, 2022-11-24) was to drop testing Python v2.x (it's years past end\n> of life after all, see https://endoflife.date/python).\n\nJust 2 years? :)\n\nWe're still pinning \"perl\" to a supported 5.8, which is so out-of-life\nthat I couldn't find a good reference to when exactly it went EOL. My\nguess based on [1] and \"perldoc perlhist\" is sometime around 2009-2010.\n\n> So I agree that the best idea in this patch series is the stop-gap\n> solution to install `python2` on `ubuntu-22.04`, and deal with deprecating\n> Python v2.x support separately, later, or never, whichever comes first ;-)\n\nYes, let's address that later. We had a recent discussion relating to\nEOL-ing it in-tree. See the ML discussion around[2].\n\nI would like to note that you seem to be assuming that upstream's EOL\nfor something like this should match our EOL for supporting the\nsoftware.\n\nI think one could argue that, but that's not at all the stance we've\ntaken in the past, as the \"perl\" example shows.\n\nI've personally wanted to bump the \"perl\" dependency more aggressively\nfor purely selfish reasons in the past (being able to use some newer\nfeature), but the reality is that people \"back-port\" newer git versions\nonto various older platforms.\n\nBut in terms of the cost-benefit of the disruption that would incur I\nalso don't think it's worth it (although a bit past 5.8 is probably\njustifiable at this point).\n\nSomeone using \"perl\" on an older system for git's tests and git-svn\netc. really doesn't need to worry much about the full security surface\nthat \"perl\" might provide, which includes e.g. all the CPAN libraries it\nships with, I expect that the same would go for \"python\".\n\nThe one potential security issue I can think of that we've ever had\nbecause of it is that you could trick \"gitweb\" and the like into\never-growing memory use if you had a perl version older than the \"hash\nrandomization\" security/DoS fix.\n\nBut other than that we're not exposing perl, python etc. directly over\nthe Internet, so I think we don't need to be too paranoid about it.\n\n1. https://endoflife.date/perl\n2. f7b5ff607fa (git-p4: improve encoding handling to support\n   inconsistent encodings, 2022-04-30)\n"},{"id":"467933","messageId":"CANYiYbGMdECEWzCOgBrU3su4m=hrp8MND17cZ8ZaNjpgUbXmuw@mail.gmail.com","threadId":"58845","inReplyTo":"221124.86ilj4pqfn.gmgdl@evledraar.gmail.com","subject":"Re: [PATCH v2 2/3] ci: upgrade version of p4 to 21.2","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2022-11-24T12:56:33Z","receivedAt":"2022-11-24T12:56:49Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"On Thu, Nov 24, 2022 at 7:01 PM Ævar Arnfjörð Bjarmason\n<avarab@gmail.com> wrote:\n>\n> Omitted from this context is:\n>\n>         # The Linux build installs the defined dependency versions below.\n>         # The OS X build installs much more recent versions,\n>\n> That part should be updated here, as it's now out-of-date, they're now\n> installing the same version: 21.2.\n\nYes, the versions of p4 for linux and macos happen to be the same. We\ncan use one variable to define p4 version for both linux and macos.\n\n>\n> >       # were recorded in the Homebrew database upon creating the OS X\n> >       # image.\n> >       # Keep that in mind when you encounter a broken OS X build!\n> > -     export LINUX_P4_VERSION=\"16.2\"\n> > +     export LINUX_P4_VERSION=\"21.2\"\n> >       export LINUX_GIT_LFS_VERSION=\"1.5.2\"\n> >\n> >       P4_PATH=\"$HOME/custom/p4\"\n>\n> This is a welcome change, but it would be even more welcome if you\n> followed-up and unified the linux and osx p4 logic as a follow-up.\n> I.e. after this we'll install 21.2 on both osx and linux, so the\n> versions are no longer different.\n>\n> I think we probably won't need to install different versions for the two\n> ever, we just drifted on the linux version, or maybe (per the comment\n> we'll need to adjust) there was some problem before with upgrading the\n> linux version, but no longer?\n>\n> I didn't dig, but covering some of that in the commit message would be\n> most welcome.\n\nIt is commit d1c9195116 (ci: avoid brew for installing perforce,\n2022-05-12), which changed the installation method of p4 on macOS.\nThere is also a note about the obsolete comment in ci/lib.sh in this\ncommit.\n\n> So can we just s/LINUX_P4_VERSION/P4_VERSION/ or something, and then\n> change this in the \"macos-latest\";\n>\n>         wget -q \"https://cdist2.perforce.com/perforce/r21.2/bin.macosx1015x86_64/helix-core-server.tgz\"\n>\n> To:\n>\n>         wget -q \"https://cdist2.perforce.com/perforce/r${P4_VERSION}/bin.macosx1015x86_64/helix-core-server.tgz\"\n\n> While doing that we can just move the \"LINUX_P4_VERSION\" (or whatever we\n> rename it to) from lib.sh to \"install-dependencies.sh\".\n>\n\nWill do.\n\n--\nJiang Xin\n"},{"id":"467936","messageId":"20221124153934.12470-1-worldhello.net@gmail.com","threadId":"58845","inReplyTo":"20221124090545.4790-1-worldhello.net@gmail.com","subject":"[PATCH v3 0/4] Fix broken CI on newer github-actions runner image","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2022-11-24T15:39:30Z","receivedAt":"2022-11-24T15:39:43Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"From: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n\n# Changes since v2\n\n1. Split patch 2/3 of v2 into two patches:\n\n   patch 2/4: ci: show error message of \"p4 -V\"\n   patch 3/4: ci: p4 on Linux has the same version as on macOS\n\n2. In patch 3/4, remove variable \"LINUX_P4_VERSION\" and use\n   a fixed version \"21.2\" for p4 on both Linux and macOS.\n\n3. For patch 4/4, follow Ævar's suggestion to make the code simpler.\n\n\n# Range-diff v2..v3\n\n1:  79c851529c ! 1:  1c0d639487 github-actions: run gcc-8 on ubuntu-20.04 image\n    @@ Commit message\n         In this way, we can change the \"ubuntu-latest\" runner image to any\n         version such as \"ubuntu-22.04\" to test CI behavior in advance.\n     \n    +    Reviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n         Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n     \n      ## .github/workflows/main.yml ##\n2:  faa5076fe0 ! 2:  fed880b8bd ci: upgrade version of p4 to 21.2\n    @@ Metadata\n     Author: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n     \n      ## Commit message ##\n    -    ci: upgrade version of p4 to 21.2\n    +    ci: show error message of \"p4 -V\"\n     \n    -    There would be a segmentation fault when running p4 v16.2 on ubuntu\n    -    22.04 which is the latest version of ubuntu runner image for github\n    -    actions.\n    +    When installing p4 as a dependency, we used to pipe output of \"p4 -V\" to\n    +    validate the installation, but this would hide potential errors of p4.\n    +    E.g.: A broken p4 installation fails to run.\n     \n    -    By checking each version from [1], p4d version 21.1 and above can work\n    -    properly on ubuntu 22.04. But version 22.x will break some p4 test\n    -    cases. So p4 version 21.x is exactly the version we can use.\n    -\n    -    In addition to upgrade p4 from version 16.2 to 21.2, also add some\n    -    instructions to show errors of command \"p4 -V\", so we can see why the\n    -    command output doesn't match.\n    -\n    -    [1]: https://cdist2.perforce.com/perforce/\n    +    Add some instructions to show errors of command \"p4 -V\", so we can see\n    +    why the command output doesn't match.\n     \n    +    Reviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n         Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n     \n      ## ci/install-dependencies.sh ##\n    @@ ci/install-dependencies.sh: esac\n      else\n      \techo >&2 \"WARNING: perforce wasn't installed, see above for clues why\"\n      fi\n    -\n    - ## ci/lib.sh ##\n    -@@ ci/lib.sh: ubuntu)\n    - \t# were recorded in the Homebrew database upon creating the OS X\n    - \t# image.\n    - \t# Keep that in mind when you encounter a broken OS X build!\n    --\texport LINUX_P4_VERSION=\"16.2\"\n    -+\texport LINUX_P4_VERSION=\"21.2\"\n    - \texport LINUX_GIT_LFS_VERSION=\"1.5.2\"\n    - \n    - \tP4_PATH=\"$HOME/custom/p4\"\n-:  ---------- > 3:  da2f516fc9 ci: p4 on Linux has the same version as on macOS\n3:  f080b2fdcd ! 4:  bd1850cc93 ci: install python on ubuntu\n    @@ Commit message\n         Since the \"ubuntu-latest\" runner image has a higher version, so its safe\n         to use \"python2\" or \"python3\" package name.\n     \n    +    Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n         Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n     \n      ## ci/install-dependencies.sh ##\n    @@ ci/install-dependencies.sh: case \"$runs_on_os\" in\n     \n      ## ci/lib.sh ##\n     @@ ci/lib.sh: ubuntu)\n    - \tif [ \"$jobname\" = linux-gcc ]\n    + \t\tbreak\n    + \tfi\n    + \n    +-\tif [ \"$jobname\" = linux-gcc ]\n    ++\tPYTHON_PACKAGE=python2\n    ++\tif test \"$jobname\" = linux-gcc\n      \tthen\n    - \t\tMAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=/usr/bin/python3\"\n    +-\t\tMAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=/usr/bin/python3\"\n    +-\telse\n    +-\t\tMAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=/usr/bin/python2\"\n     +\t\tPYTHON_PACKAGE=python3\n    - \telse\n    - \t\tMAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=/usr/bin/python2\"\n    -+\t\tPYTHON_PACKAGE=python2\n      \tfi\n    ++\tMAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=/usr/bin/$PYTHON_PACKAGE\"\n      \n      \texport GIT_TEST_HTTPD=true\n    + \n\n--\n\nJiang Xin (4):\n  github-actions: run gcc-8 on ubuntu-20.04 image\n  ci: show error message of \"p4 -V\"\n  ci: p4 on Linux has the same version as on macOS\n  ci: install python on ubuntu\n\n .github/workflows/main.yml | 16 ++++++++++++----\n ci/install-dependencies.sh | 16 ++++++++--------\n ci/lib.sh                  | 15 +++++++--------\n 3 files changed, 27 insertions(+), 20 deletions(-)\n\n-- \n2.39.0.rc0\n\n"},{"id":"467937","messageId":"20221124153934.12470-2-worldhello.net@gmail.com","threadId":"58845","inReplyTo":"20221124090545.4790-1-worldhello.net@gmail.com","subject":"[PATCH v3 1/4] github-actions: run gcc-8 on ubuntu-20.04 image","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2022-11-24T15:39:31Z","receivedAt":"2022-11-24T15:39:46Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"From: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n\nGitHub starts to upgrade its runner image \"ubuntu-latest\" from version\n\"ubuntu-20.04\" to version \"ubuntu-22.04\". It will fail to find and\ninstall \"gcc-8\" package on the new runner image.\n\nChange the runner images from \"ubuntu-latest\" to \"ubuntu-20.04\" in order\nto run with \"gcc-8\" as a dependency.\n\nInstead of use the environment \"$runs_on_pool\" as below:\n\n    case \"$runs_on_pool\" in\n    ubuntu-20.04 | ubuntu-latest)\n\t;;\n\nwe can reuse the os field in the matrix, and use a new environment\n\"$runs_on_os\" as below:\n\n    case \"$runs_on_os\" in\n    ubuntu)\n        ;;\n\nIn this way, we can change the \"ubuntu-latest\" runner image to any\nversion such as \"ubuntu-22.04\" to test CI behavior in advance.\n\nReviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de>\nSigned-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n---\n .github/workflows/main.yml | 16 ++++++++++++----\n ci/install-dependencies.sh |  6 +++---\n ci/lib.sh                  |  6 +++---\n 3 files changed, 18 insertions(+), 10 deletions(-)\n\ndiff --git a/.github/workflows/main.yml b/.github/workflows/main.yml\nindex 592f9193a8..da0d8ab0bf 100644\n--- a/.github/workflows/main.yml\n+++ b/.github/workflows/main.yml\n@@ -224,6 +224,7 @@ jobs:\n         vector:\n           - jobname: linux-clang\n             cc: clang\n+            os: ubuntu\n             pool: ubuntu-latest\n           - jobname: linux-sha256\n             cc: clang\n@@ -232,36 +233,43 @@ jobs:\n           - jobname: linux-gcc\n             cc: gcc\n             cc_package: gcc-8\n-            pool: ubuntu-latest\n+            os: ubuntu\n+            pool: ubuntu-20.04\n           - jobname: linux-TEST-vars\n             cc: gcc\n-            os: ubuntu\n             cc_package: gcc-8\n-            pool: ubuntu-latest\n+            os: ubuntu\n+            pool: ubuntu-20.04\n           - jobname: osx-clang\n             cc: clang\n+            os: macos\n             pool: macos-latest\n           - jobname: osx-gcc\n             cc: gcc\n             cc_package: gcc-9\n+            os: macos\n             pool: macos-latest\n           - jobname: linux-gcc-default\n             cc: gcc\n+            os: ubuntu\n             pool: ubuntu-latest\n           - jobname: linux-leaks\n             cc: gcc\n+            os: ubuntu\n             pool: ubuntu-latest\n           - jobname: linux-asan\n             cc: gcc\n+            os: ubuntu\n             pool: ubuntu-latest\n           - jobname: linux-ubsan\n             cc: gcc\n+            os: ubuntu\n             pool: ubuntu-latest\n     env:\n       CC: ${{matrix.vector.cc}}\n       CC_PACKAGE: ${{matrix.vector.cc_package}}\n       jobname: ${{matrix.vector.jobname}}\n-      runs_on_pool: ${{matrix.vector.pool}}\n+      runs_on_os: ${{matrix.vector.os}}\n     runs-on: ${{matrix.vector.pool}}\n     steps:\n     - uses: actions/checkout@v2\ndiff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh\nindex 107757a1fe..f639263a62 100755\n--- a/ci/install-dependencies.sh\n+++ b/ci/install-dependencies.sh\n@@ -11,8 +11,8 @@ UBUNTU_COMMON_PKGS=\"make libssl-dev libcurl4-openssl-dev libexpat-dev\n  tcl tk gettext zlib1g-dev perl-modules liberror-perl libauthen-sasl-perl\n  libemail-valid-perl libio-socket-ssl-perl libnet-smtp-ssl-perl\"\n \n-case \"$runs_on_pool\" in\n-ubuntu-latest)\n+case \"$runs_on_os\" in\n+ubuntu)\n \tsudo apt-get -q update\n \tsudo apt-get -q -y install language-pack-is libsvn-perl apache2 \\\n \t\t$UBUNTU_COMMON_PKGS $CC_PACKAGE\n@@ -30,7 +30,7 @@ ubuntu-latest)\n \t\tcp git-lfs-$LINUX_GIT_LFS_VERSION/git-lfs .\n \tpopd\n \t;;\n-macos-latest)\n+macos)\n \texport HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1\n \t# Uncomment this if you want to run perf tests:\n \t# brew install gnu-time\ndiff --git a/ci/lib.sh b/ci/lib.sh\nindex 24d20a5d64..0c0767d354 100755\n--- a/ci/lib.sh\n+++ b/ci/lib.sh\n@@ -225,8 +225,8 @@ export DEFAULT_TEST_TARGET=prove\n export GIT_TEST_CLONE_2GB=true\n export SKIP_DASHED_BUILT_INS=YesPlease\n \n-case \"$runs_on_pool\" in\n-ubuntu-latest)\n+case \"$runs_on_os\" in\n+ubuntu)\n \tif test \"$jobname\" = \"linux-gcc-default\"\n \tthen\n \t\tbreak\n@@ -253,7 +253,7 @@ ubuntu-latest)\n \tGIT_LFS_PATH=\"$HOME/custom/git-lfs\"\n \texport PATH=\"$GIT_LFS_PATH:$P4_PATH:$PATH\"\n \t;;\n-macos-latest)\n+macos)\n \tif [ \"$jobname\" = osx-gcc ]\n \tthen\n \t\tMAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=$(which python3)\"\n-- \n2.39.0.rc0\n\n"},{"id":"467938","messageId":"20221124153934.12470-3-worldhello.net@gmail.com","threadId":"58845","inReplyTo":"20221124090545.4790-1-worldhello.net@gmail.com","subject":"[PATCH v3 2/4] ci: show error message of \"p4 -V\"","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2022-11-24T15:39:32Z","receivedAt":"2022-11-24T15:39:49Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"From: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n\nWhen installing p4 as a dependency, we used to pipe output of \"p4 -V\" to\nvalidate the installation, but this would hide potential errors of p4.\nE.g.: A broken p4 installation fails to run.\n\nAdd some instructions to show errors of command \"p4 -V\", so we can see\nwhy the command output doesn't match.\n\nReviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de>\nSigned-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n---\n ci/install-dependencies.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh\nindex f639263a62..291e49bdde 100755\n--- a/ci/install-dependencies.sh\n+++ b/ci/install-dependencies.sh\n@@ -83,9 +83,9 @@ esac\n if type p4d >/dev/null 2>&1 && type p4 >/dev/null 2>&1\n then\n \techo \"$(tput setaf 6)Perforce Server Version$(tput sgr0)\"\n-\tp4d -V | grep Rev.\n+\tp4d -V | grep Rev. || { echo >&2 \"p4d: bad version\"; p4d -V; exit 1; }\n \techo \"$(tput setaf 6)Perforce Client Version$(tput sgr0)\"\n-\tp4 -V | grep Rev.\n+\tp4 -V | grep Rev. || { echo >&2 \"p4: bad version\"; p4 -V; exit 1; }\n else\n \techo >&2 \"WARNING: perforce wasn't installed, see above for clues why\"\n fi\n-- \n2.39.0.rc0\n\n"},{"id":"467939","messageId":"20221124153934.12470-4-worldhello.net@gmail.com","threadId":"58845","inReplyTo":"20221124090545.4790-1-worldhello.net@gmail.com","subject":"[PATCH v3 3/4] ci: p4 on Linux has the same version as on macOS","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2022-11-24T15:39:33Z","receivedAt":"2022-11-24T15:39:50Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"From: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n\nThere would be a segmentation fault when running p4 v16.2 on ubuntu\n22.04 which is the latest version of ubuntu runner image for github\nactions.\n\nBy checking each version from [1], p4d version 21.1 and above can work\nproperly on ubuntu 22.04. But version 22.x will break some p4 test\ncases. So p4 version 21.x is exactly the version we can use.\n\nWith this update, the versions of p4 for Linux and macOS happen to be\nthe same. So we can add the version number directly into the \"P4WHENCE\"\nvariable, and reuse it in p4 installation for macOS.\n\nBy removing the \"LINUX_P4_VERSION\" variable from \"ci/lib.sh\", the\ncomment left above has nothing to do with p4, but still applies to\ngit-lfs. Since we have a fixed version of git-lfs installed on Linux,\nwe may have a different version on macOS.\n\n[1]: https://cdist2.perforce.com/perforce/\n\nReviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de>\nHelped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nSigned-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n---\n ci/install-dependencies.sh | 4 ++--\n ci/lib.sh                  | 1 -\n 2 files changed, 2 insertions(+), 3 deletions(-)\n\ndiff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh\nindex 291e49bdde..f860c35c75 100755\n--- a/ci/install-dependencies.sh\n+++ b/ci/install-dependencies.sh\n@@ -5,7 +5,7 @@\n \n . ${0%/*}/lib.sh\n \n-P4WHENCE=https://cdist2.perforce.com/perforce/r$LINUX_P4_VERSION\n+P4WHENCE=https://cdist2.perforce.com/perforce/r21.2\n LFSWHENCE=https://github.com/github/git-lfs/releases/download/v$LINUX_GIT_LFS_VERSION\n UBUNTU_COMMON_PKGS=\"make libssl-dev libcurl4-openssl-dev libexpat-dev\n  tcl tk gettext zlib1g-dev perl-modules liberror-perl libauthen-sasl-perl\n@@ -40,7 +40,7 @@ macos)\n \tmkdir -p $HOME/bin\n \t(\n \t\tcd $HOME/bin\n-\t\twget -q \"https://cdist2.perforce.com/perforce/r21.2/bin.macosx1015x86_64/helix-core-server.tgz\" &&\n+\t\twget -q \"$P4WHENCE/bin.macosx1015x86_64/helix-core-server.tgz\" &&\n \t\ttar -xf helix-core-server.tgz &&\n \t\tsudo xattr -d com.apple.quarantine p4 p4d 2>/dev/null || true\n \t)\ndiff --git a/ci/lib.sh b/ci/lib.sh\nindex 0c0767d354..991ea4f8a6 100755\n--- a/ci/lib.sh\n+++ b/ci/lib.sh\n@@ -246,7 +246,6 @@ ubuntu)\n \t# were recorded in the Homebrew database upon creating the OS X\n \t# image.\n \t# Keep that in mind when you encounter a broken OS X build!\n-\texport LINUX_P4_VERSION=\"16.2\"\n \texport LINUX_GIT_LFS_VERSION=\"1.5.2\"\n \n \tP4_PATH=\"$HOME/custom/p4\"\n-- \n2.39.0.rc0\n\n"},{"id":"467940","messageId":"20221124153934.12470-5-worldhello.net@gmail.com","threadId":"58845","inReplyTo":"20221124090545.4790-1-worldhello.net@gmail.com","subject":"[PATCH v3 4/4] ci: install python on ubuntu","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2022-11-24T15:39:34Z","receivedAt":"2022-11-24T15:39:51Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"From: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n\nPython is missing from the default ubuntu-22.04 runner image, which\nprevent git-p4 from working. To install python on ubuntu, we need to\nprovide correct package name:\n\n * On Ubuntu 18.04 (bionic), \"/usr/bin/python2\" is provided by the\n   \"python\" package, and \"/usr/bin/python3\" is provided by the \"python3\"\n   package.\n\n * On Ubuntu 20.04 (focal) and above, \"/usr/bin/python2\" is provided by\n   the \"python2\" package which has a different name from bionic, and\n   \"/usr/bin/python3\" is provided by \"python3\".\n\nSince the \"ubuntu-latest\" runner image has a higher version, so its safe\nto use \"python2\" or \"python3\" package name.\n\nHelped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nSigned-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n---\n ci/install-dependencies.sh | 2 +-\n ci/lib.sh                  | 8 ++++----\n 2 files changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh\nindex f860c35c75..e804b1935e 100755\n--- a/ci/install-dependencies.sh\n+++ b/ci/install-dependencies.sh\n@@ -15,7 +15,7 @@ case \"$runs_on_os\" in\n ubuntu)\n \tsudo apt-get -q update\n \tsudo apt-get -q -y install language-pack-is libsvn-perl apache2 \\\n-\t\t$UBUNTU_COMMON_PKGS $CC_PACKAGE\n+\t\t$UBUNTU_COMMON_PKGS $CC_PACKAGE $PYTHON_PACKAGE\n \tmkdir --parents \"$P4_PATH\"\n \tpushd \"$P4_PATH\"\n \t\twget --quiet \"$P4WHENCE/bin.linux26x86_64/p4d\"\ndiff --git a/ci/lib.sh b/ci/lib.sh\nindex 991ea4f8a6..fbebad4b9c 100755\n--- a/ci/lib.sh\n+++ b/ci/lib.sh\n@@ -232,12 +232,12 @@ ubuntu)\n \t\tbreak\n \tfi\n \n-\tif [ \"$jobname\" = linux-gcc ]\n+\tPYTHON_PACKAGE=python2\n+\tif test \"$jobname\" = linux-gcc\n \tthen\n-\t\tMAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=/usr/bin/python3\"\n-\telse\n-\t\tMAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=/usr/bin/python2\"\n+\t\tPYTHON_PACKAGE=python3\n \tfi\n+\tMAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=/usr/bin/$PYTHON_PACKAGE\"\n \n \texport GIT_TEST_HTTPD=true\n \n-- \n2.39.0.rc0\n\n"},{"id":"467942","messageId":"221124.86wn7knx1x.gmgdl@evledraar.gmail.com","threadId":"58845","inReplyTo":"20221124153934.12470-3-worldhello.net@gmail.com","subject":"Re: [PATCH v3 2/4] ci: show error message of \"p4 -V\"","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2022-11-24T16:10:12Z","receivedAt":"2022-11-24T16:23:14Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Thu, Nov 24 2022, Jiang Xin wrote:\n\n> From: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n>\n> When installing p4 as a dependency, we used to pipe output of \"p4 -V\" to\n> validate the installation, but this would hide potential errors of p4.\n> E.g.: A broken p4 installation fails to run.\n>\n> Add some instructions to show errors of command \"p4 -V\", so we can see\n> why the command output doesn't match.\n>\n> Reviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n> ---\n>  ci/install-dependencies.sh | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n>\n> diff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh\n> index f639263a62..291e49bdde 100755\n> --- a/ci/install-dependencies.sh\n> +++ b/ci/install-dependencies.sh\n> @@ -83,9 +83,9 @@ esac\n>  if type p4d >/dev/null 2>&1 && type p4 >/dev/null 2>&1\n>  then\n>  \techo \"$(tput setaf 6)Perforce Server Version$(tput sgr0)\"\n> -\tp4d -V | grep Rev.\n> +\tp4d -V | grep Rev. || { echo >&2 \"p4d: bad version\"; p4d -V; exit 1; }\n>  \techo \"$(tput setaf 6)Perforce Client Version$(tput sgr0)\"\n> -\tp4 -V | grep Rev.\n> +\tp4 -V | grep Rev. || { echo >&2 \"p4: bad version\"; p4 -V; exit 1; }\n>  else\n>  \techo >&2 \"WARNING: perforce wasn't installed, see above for clues why\"\n>  fi\n\nI think it makes sense to detect this, but the specific remedy makes no\nsense to me.\n\nI.e. as your CL's CI output shows the reason we want this is because you\nhad a p4d (and p4?) that segfaulted. I can reproduce that locally as:\n\n\twget --quiet https://cdist2.perforce.com/perforce/r16.2/bin.linux26x86_64/p4d -O p4d; chmod +x p4d; ./p4d\n\tSegmentation fault\n\nBut we had the initial command piped into Rev, so we wouldn't show that,\njust\n\n\t$ wget --quiet https://cdist2.perforce.com/perforce/r16.2/bin.linux26x86_64/p4d -O p4d; chmod +x p4d; ./p4d | grep Rev; echo $?\n\t1\n\nSo we want to show that it segfaults, but how it is useful once that\ncommand fails to pretend that it's a \"bad version?\" The issue is that\nthe command can't show the version at all.\n\n\t$ { echo >&2 \"p4d: bad version\"; ./p4d -V; exit 1; }\n\tp4d: bad version\n\tSegmentation fault\n\texit\n\nI think this should just be a plain:\n\n\techo \"$(tput setaf 6)Perforce Server Version$(tput sgr0)\"\n        p4d -V\n        echo \"$(tput setaf 6)Perforce Client Version$(tput sgr0)\"\n\tp4 -V\n\nAs we're already under \"set -e\" (in ci/lib.sh).\n\nI.e. I don't see why we need to work at making the output less verbose,\nand then if we fail run the command again.\n\nIf we really want to make it less verbose and avoid hiding segfault\nmessages perhaps we could filter out the stuff we don't care about?:\n\t\n\t$ ./p4d -V | sed -ne '/[Cc]opyright/d; /[Ll]icense/d; /http/d; /product/d; p'\n\tPerforce - The Fast Software Configuration Management System.\n\tVersion of OpenSSL Libraries: OpenSSL 1.1.1q  5 Jul 2022\n\tVersion of OpenLDAP Libraries: 2.4.59\n\tVersion of Cyrus SASL Libraries: 2.1.27\n\tUsing the 'SmartHeap' memory manager.\n\tRev. P4D/LINUX26X86_64/2021.1/2313999 (2022/07/15).\n\t\nBut I don't see the point of that effort, we won't look at these trace\nlogs unless something fails, so just including the raw output seems most\nsensible.\n"},{"id":"467946","messageId":"221124.86sfi8nvzz.gmgdl@evledraar.gmail.com","threadId":"58845","inReplyTo":"20221124153934.12470-2-worldhello.net@gmail.com","subject":"Re: [PATCH v3 1/4] github-actions: run gcc-8 on ubuntu-20.04 image","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2022-11-24T16:29:09Z","receivedAt":"2022-11-24T16:46:06Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Thu, Nov 24 2022, Jiang Xin wrote:\n\n> From: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n>\n> GitHub starts to upgrade its runner image \"ubuntu-latest\" from version\n> \"ubuntu-20.04\" to version \"ubuntu-22.04\". It will fail to find and\n> install \"gcc-8\" package on the new runner image.\n>\n> Change the runner images from \"ubuntu-latest\" to \"ubuntu-20.04\" in order\n> to run with \"gcc-8\" as a dependency.\n>\n> Instead of use the environment \"$runs_on_pool\" as below:\n>\n>     case \"$runs_on_pool\" in\n>     ubuntu-20.04 | ubuntu-latest)\n> \t;;\n>\n> we can reuse the os field in the matrix, and use a new environment\n> \"$runs_on_os\" as below:\n>\n>     case \"$runs_on_os\" in\n>     ubuntu)\n>         ;;\n>\n> In this way, we can change the \"ubuntu-latest\" runner image to any\n> version such as \"ubuntu-22.04\" to test CI behavior in advance.\n>\n> Reviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n> ---\n>  .github/workflows/main.yml | 16 ++++++++++++----\n>  ci/install-dependencies.sh |  6 +++---\n>  ci/lib.sh                  |  6 +++---\n>  3 files changed, 18 insertions(+), 10 deletions(-)\n>\n> diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml\n> index 592f9193a8..da0d8ab0bf 100644\n> --- a/.github/workflows/main.yml\n> +++ b/.github/workflows/main.yml\n> @@ -224,6 +224,7 @@ jobs:\n>          vector:\n>            - jobname: linux-clang\n>              cc: clang\n> +            os: ubuntu\n>              pool: ubuntu-latest\n>            - jobname: linux-sha256\n>              cc: clang\n> @@ -232,36 +233,43 @@ jobs:\n>            - jobname: linux-gcc\n>              cc: gcc\n>              cc_package: gcc-8\n> -            pool: ubuntu-latest\n> +            os: ubuntu\n> +            pool: ubuntu-20.04\n>            - jobname: linux-TEST-vars\n>              cc: gcc\n> -            os: ubuntu\n>              cc_package: gcc-8\n> -            pool: ubuntu-latest\n> +            os: ubuntu\n> +            pool: ubuntu-20.04\n>            - jobname: osx-clang\n>              cc: clang\n> +            os: macos\n>              pool: macos-latest\n>            - jobname: osx-gcc\n>              cc: gcc\n>              cc_package: gcc-9\n> +            os: macos\n>              pool: macos-latest\n>            - jobname: linux-gcc-default\n>              cc: gcc\n> +            os: ubuntu\n>              pool: ubuntu-latest\n>            - jobname: linux-leaks\n>              cc: gcc\n> +            os: ubuntu\n>              pool: ubuntu-latest\n>            - jobname: linux-asan\n>              cc: gcc\n> +            os: ubuntu\n>              pool: ubuntu-latest\n>            - jobname: linux-ubsan\n>              cc: gcc\n> +            os: ubuntu\n>              pool: ubuntu-latest\n>      env:\n>        CC: ${{matrix.vector.cc}}\n>        CC_PACKAGE: ${{matrix.vector.cc_package}}\n>        jobname: ${{matrix.vector.jobname}}\n> -      runs_on_pool: ${{matrix.vector.pool}}\n> +      runs_on_os: ${{matrix.vector.os}}\n>      runs-on: ${{matrix.vector.pool}}\n>      steps:\n>      - uses: actions/checkout@v2\n> diff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh\n> index 107757a1fe..f639263a62 100755\n> --- a/ci/install-dependencies.sh\n> +++ b/ci/install-dependencies.sh\n> @@ -11,8 +11,8 @@ UBUNTU_COMMON_PKGS=\"make libssl-dev libcurl4-openssl-dev libexpat-dev\n>   tcl tk gettext zlib1g-dev perl-modules liberror-perl libauthen-sasl-perl\n>   libemail-valid-perl libio-socket-ssl-perl libnet-smtp-ssl-perl\"\n>  \n> -case \"$runs_on_pool\" in\n> -ubuntu-latest)\n> +case \"$runs_on_os\" in\n> +ubuntu)\n>  \tsudo apt-get -q update\n>  \tsudo apt-get -q -y install language-pack-is libsvn-perl apache2 \\\n>  \t\t$UBUNTU_COMMON_PKGS $CC_PACKAGE\n> @@ -30,7 +30,7 @@ ubuntu-latest)\n>  \t\tcp git-lfs-$LINUX_GIT_LFS_VERSION/git-lfs .\n>  \tpopd\n>  \t;;\n> -macos-latest)\n> +macos)\n>  \texport HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1\n>  \t# Uncomment this if you want to run perf tests:\n>  \t# brew install gnu-time\n> diff --git a/ci/lib.sh b/ci/lib.sh\n> index 24d20a5d64..0c0767d354 100755\n> --- a/ci/lib.sh\n> +++ b/ci/lib.sh\n> @@ -225,8 +225,8 @@ export DEFAULT_TEST_TARGET=prove\n>  export GIT_TEST_CLONE_2GB=true\n>  export SKIP_DASHED_BUILT_INS=YesPlease\n>  \n> -case \"$runs_on_pool\" in\n> -ubuntu-latest)\n> +case \"$runs_on_os\" in\n> +ubuntu)\n>  \tif test \"$jobname\" = \"linux-gcc-default\"\n>  \tthen\n>  \t\tbreak\n> @@ -253,7 +253,7 @@ ubuntu-latest)\n>  \tGIT_LFS_PATH=\"$HOME/custom/git-lfs\"\n>  \texport PATH=\"$GIT_LFS_PATH:$P4_PATH:$PATH\"\n>  \t;;\n> -macos-latest)\n> +macos)\n>  \tif [ \"$jobname\" = osx-gcc ]\n>  \tthen\n>  \t\tMAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=$(which python3)\"\n\nAt the end of [1] I suggested splitting up the refactoring part of\nthis. I still think that would be a good thing to do, but just to\ncomment on the *actual* change (which I was hoping a split-out would\nmake clearer).\n\nThis is proposing to refactor\n\"runs-on-pool={ubuntu-latest,macos-latest}\" to \"os={ubuntu,macos}\". I\nthink it's worth cleaning up how we match main.yml and ci/*.sh, but\nthink it's a bit of a digression in this otherwise narrowly focused\nseries.\n\nNow, this seems to somewhat come back to being all my fault. AFAICT I\nadded \"os\" in c08bb260105 (CI: rename the \"Linux32\" job to lower-case\n\"linux32\", 2021-11-23) as part of some WIP (or from an earlier version?)\nthat ende dup doing nothing.\n\nBut looking at it again, I don't see how an \"os\" here makes much\nsense. For \"macos-latest\" if we're going to refactor it let's just stop\nselecting stuff based on this \"pool name\", and instead fold it into the\nadjacent \"jobname\" selection:\n\t\n\tdiff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh\n\tindex 107757a1fea..b5a373060c1 100755\n\t--- a/ci/install-dependencies.sh\n\t+++ b/ci/install-dependencies.sh\n\t@@ -30,7 +30,9 @@ ubuntu-latest)\n\t \t\tcp git-lfs-$LINUX_GIT_LFS_VERSION/git-lfs .\n\t \tpopd\n\t \t;;\n\t-macos-latest)\n\t+esac\n\t+case \"$jobname\" in\n\t+osx-*)\n\t \texport HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1\n\t \t# Uncomment this if you want to run perf tests:\n\t \t# brew install gnu-time\n\tdiff --git a/ci/lib.sh b/ci/lib.sh\n\tindex 24d20a5d648..fef60a507e9 100755\n\t--- a/ci/lib.sh\n\t+++ b/ci/lib.sh\n\t@@ -253,19 +253,17 @@ ubuntu-latest)\n\t \tGIT_LFS_PATH=\"$HOME/custom/git-lfs\"\n\t \texport PATH=\"$GIT_LFS_PATH:$P4_PATH:$PATH\"\n\t \t;;\n\t-macos-latest)\n\t-\tif [ \"$jobname\" = osx-gcc ]\n\t-\tthen\n\t-\t\tMAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=$(which python3)\"\n\t-\telse\n\t-\t\tMAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=$(which python2)\"\n\t-\t\tMAKEFLAGS=\"$MAKEFLAGS NO_APPLE_COMMON_CRYPTO=NoThanks\"\n\t-\t\tMAKEFLAGS=\"$MAKEFLAGS NO_OPENSSL=NoThanks\"\n\t-\tfi\n\t-\t;;\n\t esac\n\t \n\t case \"$jobname\" in\n\t+osx-gcc)\n\t+\tMAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=$(which python3)\"\n\t+\t;;\n\t+osx-clang)\n\t+\tMAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=$(which python2)\"\n\t+\tMAKEFLAGS=\"$MAKEFLAGS NO_APPLE_COMMON_CRYPTO=NoThanks\"\n\t+\tMAKEFLAGS=\"$MAKEFLAGS NO_OPENSSL=NoThanks\"\n\t+\t;;\n\t linux32)\n\t \tCC=gcc\n\t \t;;\n\nThat nicely sidesteps the need to refactor it here, and IMO makes it\nmore future-proof.\n\nFor the \"ubuntu\" case I think it's even worse, because it now *looks*\nlike a case that should be equivalent to just:\n\n\ttest \"$(lsb_release -si 2>&1 | grep -x Debian)\" = \"Debian\"\n\nBut it's not, because we're not setting this \"os=ubuntu\" in all the\nplaces where the OS is Ubuntu. It really just means \"the stuff that used\nto set env.runs_on_pool=ubuntu-latest, which e.g. doesn't cover the\n\"documentation\" job, which runs on \"ubuntu-latest\".\n\nSo I think *if* we're going to refactor this while-at-it, let's not make\nit \"os=ubuntu\", but e.g. \"extra_ubuntu_packages: 1\", which is really\nwhat it means. I.e. we're intercepting it in ci/lib.sh to set the \"p4\"\nvariables etc., which we only need if we're doing the optional \"apt\ninstall\" on the \"ubuntu-latest\".\n\n1. https://lore.kernel.org/git/221124.86mt8gpqra.gmgdl@evledraar.gmail.com/\n"},{"id":"467966","messageId":"xmqq8rjzhc5k.fsf@gitster.g","threadId":"58845","inReplyTo":"221124.86wn7knx1x.gmgdl@evledraar.gmail.com","subject":"Re: [PATCH v3 2/4] ci: show error message of \"p4 -V\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2022-11-25T04:48:55Z","receivedAt":"2022-11-25T04:49:04Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n\n>>  if type p4d >/dev/null 2>&1 && type p4 >/dev/null 2>&1\n>>  then\n>>  \techo \"$(tput setaf 6)Perforce Server Version$(tput sgr0)\"\n>> -\tp4d -V | grep Rev.\n>> +\tp4d -V | grep Rev. || { echo >&2 \"p4d: bad version\"; p4d -V; exit 1; }\n>>  \techo \"$(tput setaf 6)Perforce Client Version$(tput sgr0)\"\n>> -\tp4 -V | grep Rev.\n>> +\tp4 -V | grep Rev. || { echo >&2 \"p4: bad version\"; p4 -V; exit 1; }\n>>  else\n>>  \techo >&2 \"WARNING: perforce wasn't installed, see above for clues why\"\n>>  fi\n>\n> I think it makes sense to detect this, but the specific remedy makes no\n> sense to me.\n> ...\n> So we want to show that it segfaults, but how it is useful once that\n> command fails to pretend that it's a \"bad version?\" The issue is that\n> the command can't show the version at all.\n>\n> \t$ { echo >&2 \"p4d: bad version\"; ./p4d -V; exit 1; }\n> \tp4d: bad version\n> \tSegmentation fault\n> \texit\n> ...\n> But I don't see the point of that effort, we won't look at these trace\n> logs unless something fails, so just including the raw output seems most\n> sensible.\n\nYup, makes sense.\n\nThanks, both, for working on this topic.\n"},{"id":"467975","messageId":"xmqq1qprecfq.fsf@gitster.g","threadId":"58845","inReplyTo":"221124.865yf4plw1.gmgdl@evledraar.gmail.com","subject":"Re: python 2 EOL","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2022-11-25T07:11:05Z","receivedAt":"2022-11-25T07:11:09Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n\n>> So I agree that the best idea in this patch series is the stop-gap\n>> solution to install `python2` on `ubuntu-22.04`, and deal with deprecating\n>> Python v2.x support separately, later, or never, whichever comes first ;-)\n>\n> Yes, let's address that later. We had a recent discussion relating to\n> EOL-ing it in-tree. See the ML discussion around[2].\n> ...\n> 2. f7b5ff607fa (git-p4: improve encoding handling to support\n>    inconsistent encodings, 2022-04-30)\n\nI agree with two of you that a good first step is the posted patch.\n\nI do not seem to find any message in the thread that led to the\ncommit about dropping Python 2 support, though.\n\nThanks.\n"},{"id":"467977","messageId":"xmqqpmdbcxen.fsf@gitster.g","threadId":"58845","inReplyTo":"221124.86mt8gpqra.gmgdl@evledraar.gmail.com","subject":"Re: [PATCH v2 1/3] github-actions: run gcc-8 on ubuntu-20.04 image","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2022-11-25T07:21:04Z","receivedAt":"2022-11-25T07:21:12Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n\n> Because while I think a non-pinned \"latest\" sucks because it forces us\n> to scramble with updates like this, having a \"pinned\" image go away\n> entirely (because nobody noticed we should update it sooner-than-later)\n> would suck more.\n\nYeah, that matches my preference, assuming that we do not have a\npre-warning to help us avoid scrambling either way.\n\nIf we have such a pre-warning, I would say it may be nicer to pin a\nversion, even if the only upside is that we can say we test with\n\"this exact version\".\n"},{"id":"467994","messageId":"20221125095954.4826-1-worldhello.net@gmail.com","threadId":"58845","inReplyTo":"20221124153934.12470-1-worldhello.net@gmail.com","subject":"[PATCH v4 0/4] Fix broken CI on newer github-actions runner image","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2022-11-25T09:59:50Z","receivedAt":"2022-11-25T10:00:03Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"From: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n\nGitHub CI runner image \"ubuntu-latest\" will upgrade to \"ubuntu-22.04\"\nsoon. Our CI will break on the new runner image because there is not\n\"gcc-8\" package in ubuntu-22.04. See log of CI#10:\n\n * https://github.com/jiangxin/git-ci-test/actions/runs/3546701459/jobs/5956020103#step:3:106\n\nAnother issue in CI#10 is \"pd4 -V” failed without an error output. See:\n\n * https://github.com/jiangxin/git-ci-test/actions/runs/3546701459/jobs/5956019973#step:3:315\n\nThis first issue is fixed in patch 1/4 by downgrading the version of\nthe runner image for jobs which need \"gcc-8\". The second issue is\nfixed in patch 2/4 by removing the pipe from \"p4d -V\".  Then, we can\nsee there was a sigfault when running \"p4d -V\". See log of CI#11:\n\n * https://github.com/jiangxin/git-ci-test/actions/runs/3546723251/jobs/5956063536#step:3:311\n\nThis issue is fixed in patch 3/4 by upgrading version of p4 on Linux\nto the same version as on macOS. But all p4 related test cases failed\nbecasue python was missing on ubuntu-22.04.  See the log of CI#12:\n\n * https://github.com/jiangxin/git-ci-test/actions/runs/3546734918/jobs/5956087614#step:4:22733\n\nThis issue is fixed in patch 4/4 by installing python2/python3 on\nLinux.  All test cases passed. See log of CI#13:\n\n * https://github.com/jiangxin/git-ci-test/actions/runs/3546744257\n\n# range-diff v3..v4\n\n1:  1c0d639487 ! 1:  28588dad56 github-actions: run gcc-8 on ubuntu-20.04 image\n    @@ Commit message\n         \"ubuntu-20.04\" to version \"ubuntu-22.04\". It will fail to find and\n         install \"gcc-8\" package on the new runner image.\n     \n    -    Change the runner images from \"ubuntu-latest\" to \"ubuntu-20.04\" in order\n    -    to run with \"gcc-8\" as a dependency.\n    +    Change some of the runner images from \"ubuntu-latest\" to \"ubuntu-20.04\"\n    +    in order to install \"gcc-8\" as a dependency.\n     \n    -    Instead of use the environment \"$runs_on_pool\" as below:\n    +    The first revision of this patch tried to replace \"$runs_on_pool\" in\n    +    \"ci/*.sh\" with a new \"$runs_on_os\" environment variable based on the\n    +    \"os\" filed in the matrix strategy. But these \"os\" fields in matrix\n    +    strategies are obsolete legacies from commit [1] and commit [2], and\n    +    are no longer useful. So remove these unused \"os\" fields.\n     \n    -        case \"$runs_on_pool\" in\n    -        ubuntu-20.04 | ubuntu-latest)\n    -            ;;\n    -\n    -    we can reuse the os field in the matrix, and use a new environment\n    -    \"$runs_on_os\" as below:\n    -\n    -        case \"$runs_on_os\" in\n    -        ubuntu)\n    -            ;;\n    -\n    -    In this way, we can change the \"ubuntu-latest\" runner image to any\n    -    version such as \"ubuntu-22.04\" to test CI behavior in advance.\n    +    [1]: c08bb26010 (CI: rename the \"Linux32\" job to lower-case \"linux32\",\n    +                     2021-11-23)\n    +    [2]: 25715419bf (CI: don't run \"make test\" twice in one job, 2021-11-23)\n     \n         Reviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n    +    Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n         Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n     \n      ## .github/workflows/main.yml ##\n     @@ .github/workflows/main.yml: jobs:\n    -         vector:\n    -           - jobname: linux-clang\n    -             cc: clang\n    -+            os: ubuntu\n                  pool: ubuntu-latest\n                - jobname: linux-sha256\n                  cc: clang\n    -@@ .github/workflows/main.yml: jobs:\n    +-            os: ubuntu\n    +             pool: ubuntu-latest\n                - jobname: linux-gcc\n                  cc: gcc\n                  cc_package: gcc-8\n     -            pool: ubuntu-latest\n    -+            os: ubuntu\n     +            pool: ubuntu-20.04\n                - jobname: linux-TEST-vars\n                  cc: gcc\n     -            os: ubuntu\n                  cc_package: gcc-8\n     -            pool: ubuntu-latest\n    -+            os: ubuntu\n     +            pool: ubuntu-20.04\n                - jobname: osx-clang\n                  cc: clang\n    -+            os: macos\n                  pool: macos-latest\n    -           - jobname: osx-gcc\n    -             cc: gcc\n    -             cc_package: gcc-9\n    -+            os: macos\n    -             pool: macos-latest\n    -           - jobname: linux-gcc-default\n    -             cc: gcc\n    -+            os: ubuntu\n    -             pool: ubuntu-latest\n    -           - jobname: linux-leaks\n    -             cc: gcc\n    -+            os: ubuntu\n    -             pool: ubuntu-latest\n    -           - jobname: linux-asan\n    -             cc: gcc\n    -+            os: ubuntu\n    -             pool: ubuntu-latest\n    -           - jobname: linux-ubsan\n    -             cc: gcc\n    -+            os: ubuntu\n    -             pool: ubuntu-latest\n    -     env:\n    -       CC: ${{matrix.vector.cc}}\n    -       CC_PACKAGE: ${{matrix.vector.cc_package}}\n    -       jobname: ${{matrix.vector.jobname}}\n    --      runs_on_pool: ${{matrix.vector.pool}}\n    -+      runs_on_os: ${{matrix.vector.os}}\n    -     runs-on: ${{matrix.vector.pool}}\n    -     steps:\n    -     - uses: actions/checkout@v2\n    +@@ .github/workflows/main.yml: jobs:\n    +         - jobname: linux-musl\n    +           image: alpine\n    +         - jobname: linux32\n    +-          os: ubuntu32\n    +           image: daald/ubuntu32:xenial\n    +         - jobname: pedantic\n    +           image: fedora\n     \n      ## ci/install-dependencies.sh ##\n     @@ ci/install-dependencies.sh: UBUNTU_COMMON_PKGS=\"make libssl-dev libcurl4-openssl-dev libexpat-dev\n    -  tcl tk gettext zlib1g-dev perl-modules liberror-perl libauthen-sasl-perl\n       libemail-valid-perl libio-socket-ssl-perl libnet-smtp-ssl-perl\"\n      \n    --case \"$runs_on_pool\" in\n    + case \"$runs_on_pool\" in\n     -ubuntu-latest)\n    -+case \"$runs_on_os\" in\n    -+ubuntu)\n    ++ubuntu-*)\n      \tsudo apt-get -q update\n      \tsudo apt-get -q -y install language-pack-is libsvn-perl apache2 \\\n      \t\t$UBUNTU_COMMON_PKGS $CC_PACKAGE\n    -@@ ci/install-dependencies.sh: ubuntu-latest)\n    - \t\tcp git-lfs-$LINUX_GIT_LFS_VERSION/git-lfs .\n    - \tpopd\n    - \t;;\n    --macos-latest)\n    -+macos)\n    - \texport HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1\n    - \t# Uncomment this if you want to run perf tests:\n    - \t# brew install gnu-time\n     \n      ## ci/lib.sh ##\n    -@@ ci/lib.sh: export DEFAULT_TEST_TARGET=prove\n    - export GIT_TEST_CLONE_2GB=true\n    +@@ ci/lib.sh: export GIT_TEST_CLONE_2GB=true\n      export SKIP_DASHED_BUILT_INS=YesPlease\n      \n    --case \"$runs_on_pool\" in\n    + case \"$runs_on_pool\" in\n     -ubuntu-latest)\n    -+case \"$runs_on_os\" in\n    -+ubuntu)\n    ++ubuntu-*)\n      \tif test \"$jobname\" = \"linux-gcc-default\"\n      \tthen\n      \t\tbreak\n    -@@ ci/lib.sh: ubuntu-latest)\n    - \tGIT_LFS_PATH=\"$HOME/custom/git-lfs\"\n    - \texport PATH=\"$GIT_LFS_PATH:$P4_PATH:$PATH\"\n    - \t;;\n    --macos-latest)\n    -+macos)\n    - \tif [ \"$jobname\" = osx-gcc ]\n    - \tthen\n    - \t\tMAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=$(which python3)\"\n2:  fed880b8bd ! 2:  b914f1d2fc ci: show error message of \"p4 -V\"\n    @@ Metadata\n     Author: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n     \n      ## Commit message ##\n    -    ci: show error message of \"p4 -V\"\n    +    ci: remove the pipe after \"p4 -V\" to cache errors\n     \n    -    When installing p4 as a dependency, we used to pipe output of \"p4 -V\" to\n    -    validate the installation, but this would hide potential errors of p4.\n    -    E.g.: A broken p4 installation fails to run.\n    +    When installing p4 as a dependency, we used to pipe output of \"p4 -V\"\n    +    and \"p4d -V\" to validate the installation and output a condensed version\n    +    information. But this would hide potential errors of p4 and would stop\n    +    with an empty output. E.g.: p4d version 16.2 running on ubuntu 22.04\n    +    causes sigfaults.\n     \n    -    Add some instructions to show errors of command \"p4 -V\", so we can see\n    -    why the command output doesn't match.\n    +    By removing the pipe after \"p4 -V\" and \"p4d -V\", we may get a verbose\n    +    output, and stop immediately on errors becuase we have \"set -e\" in\n    +    \"ci/lib.sh\". Since we won't look at these trace logs unless something\n    +    fails, so just including the raw output seems most sensible.\n     \n         Reviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n    +    Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n         Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n     \n      ## ci/install-dependencies.sh ##\n    @@ ci/install-dependencies.sh: esac\n      then\n      \techo \"$(tput setaf 6)Perforce Server Version$(tput sgr0)\"\n     -\tp4d -V | grep Rev.\n    -+\tp4d -V | grep Rev. || { echo >&2 \"p4d: bad version\"; p4d -V; exit 1; }\n    ++\tp4d -V\n      \techo \"$(tput setaf 6)Perforce Client Version$(tput sgr0)\"\n     -\tp4 -V | grep Rev.\n    -+\tp4 -V | grep Rev. || { echo >&2 \"p4: bad version\"; p4 -V; exit 1; }\n    ++\tp4 -V\n      else\n      \techo >&2 \"WARNING: perforce wasn't installed, see above for clues why\"\n      fi\n3:  da2f516fc9 = 3:  4aa2b30c36 ci: p4 on Linux has the same version as on macOS\n4:  bd1850cc93 = 4:  35909fd459 ci: install python on ubuntu\n      \n--\n\nJiang Xin (4):\n  github-actions: run gcc-8 on ubuntu-20.04 image\n  ci: remove the pipe after \"p4 -V\" to cache errors\n  ci: p4 on Linux has the same version as on macOS\n  ci: install python on ubuntu\n\n .github/workflows/main.yml |  7 ++-----\n ci/install-dependencies.sh | 12 ++++++------\n ci/lib.sh                  | 11 +++++------\n 3 files changed, 13 insertions(+), 17 deletions(-)\n\n-- \n2.39.0.rc0\n\n"},{"id":"467995","messageId":"20221125095954.4826-3-worldhello.net@gmail.com","threadId":"58845","inReplyTo":"20221124153934.12470-1-worldhello.net@gmail.com","subject":"[PATCH v4 2/4] ci: remove the pipe after \"p4 -V\" to cache errors","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2022-11-25T09:59:52Z","receivedAt":"2022-11-25T10:00:03Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"From: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n\nWhen installing p4 as a dependency, we used to pipe output of \"p4 -V\"\nand \"p4d -V\" to validate the installation and output a condensed version\ninformation. But this would hide potential errors of p4 and would stop\nwith an empty output. E.g.: p4d version 16.2 running on ubuntu 22.04\ncauses sigfaults.\n\nBy removing the pipe after \"p4 -V\" and \"p4d -V\", we may get a verbose\noutput, and stop immediately on errors becuase we have \"set -e\" in\n\"ci/lib.sh\". Since we won't look at these trace logs unless something\nfails, so just including the raw output seems most sensible.\n\nReviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de>\nHelped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nSigned-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n---\n ci/install-dependencies.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh\nindex feefd6e9bb..97a1a1f574 100755\n--- a/ci/install-dependencies.sh\n+++ b/ci/install-dependencies.sh\n@@ -83,9 +83,9 @@ esac\n if type p4d >/dev/null 2>&1 && type p4 >/dev/null 2>&1\n then\n \techo \"$(tput setaf 6)Perforce Server Version$(tput sgr0)\"\n-\tp4d -V | grep Rev.\n+\tp4d -V\n \techo \"$(tput setaf 6)Perforce Client Version$(tput sgr0)\"\n-\tp4 -V | grep Rev.\n+\tp4 -V\n else\n \techo >&2 \"WARNING: perforce wasn't installed, see above for clues why\"\n fi\n-- \n2.39.0.rc0\n\n"},{"id":"467996","messageId":"20221125095954.4826-2-worldhello.net@gmail.com","threadId":"58845","inReplyTo":"20221124153934.12470-1-worldhello.net@gmail.com","subject":"[PATCH v4 1/4] github-actions: run gcc-8 on ubuntu-20.04 image","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2022-11-25T09:59:51Z","receivedAt":"2022-11-25T10:00:06Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"From: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n\nGitHub starts to upgrade its runner image \"ubuntu-latest\" from version\n\"ubuntu-20.04\" to version \"ubuntu-22.04\". It will fail to find and\ninstall \"gcc-8\" package on the new runner image.\n\nChange some of the runner images from \"ubuntu-latest\" to \"ubuntu-20.04\"\nin order to install \"gcc-8\" as a dependency.\n\nThe first revision of this patch tried to replace \"$runs_on_pool\" in\n\"ci/*.sh\" with a new \"$runs_on_os\" environment variable based on the\n\"os\" filed in the matrix strategy. But these \"os\" fields in matrix\nstrategies are obsolete legacies from commit [1] and commit [2], and\nare no longer useful. So remove these unused \"os\" fields.\n\n[1]: c08bb26010 (CI: rename the \"Linux32\" job to lower-case \"linux32\",\n                 2021-11-23)\n[2]: 25715419bf (CI: don't run \"make test\" twice in one job, 2021-11-23)\n\nReviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de>\nHelped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nSigned-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n---\n .github/workflows/main.yml | 7 ++-----\n ci/install-dependencies.sh | 2 +-\n ci/lib.sh                  | 2 +-\n 3 files changed, 4 insertions(+), 7 deletions(-)\n\ndiff --git a/.github/workflows/main.yml b/.github/workflows/main.yml\nindex 592f9193a8..9afacfa0b3 100644\n--- a/.github/workflows/main.yml\n+++ b/.github/workflows/main.yml\n@@ -227,17 +227,15 @@ jobs:\n             pool: ubuntu-latest\n           - jobname: linux-sha256\n             cc: clang\n-            os: ubuntu\n             pool: ubuntu-latest\n           - jobname: linux-gcc\n             cc: gcc\n             cc_package: gcc-8\n-            pool: ubuntu-latest\n+            pool: ubuntu-20.04\n           - jobname: linux-TEST-vars\n             cc: gcc\n-            os: ubuntu\n             cc_package: gcc-8\n-            pool: ubuntu-latest\n+            pool: ubuntu-20.04\n           - jobname: osx-clang\n             cc: clang\n             pool: macos-latest\n@@ -288,7 +286,6 @@ jobs:\n         - jobname: linux-musl\n           image: alpine\n         - jobname: linux32\n-          os: ubuntu32\n           image: daald/ubuntu32:xenial\n         - jobname: pedantic\n           image: fedora\ndiff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh\nindex 107757a1fe..feefd6e9bb 100755\n--- a/ci/install-dependencies.sh\n+++ b/ci/install-dependencies.sh\n@@ -12,7 +12,7 @@ UBUNTU_COMMON_PKGS=\"make libssl-dev libcurl4-openssl-dev libexpat-dev\n  libemail-valid-perl libio-socket-ssl-perl libnet-smtp-ssl-perl\"\n \n case \"$runs_on_pool\" in\n-ubuntu-latest)\n+ubuntu-*)\n \tsudo apt-get -q update\n \tsudo apt-get -q -y install language-pack-is libsvn-perl apache2 \\\n \t\t$UBUNTU_COMMON_PKGS $CC_PACKAGE\ndiff --git a/ci/lib.sh b/ci/lib.sh\nindex 24d20a5d64..eb203662c5 100755\n--- a/ci/lib.sh\n+++ b/ci/lib.sh\n@@ -226,7 +226,7 @@ export GIT_TEST_CLONE_2GB=true\n export SKIP_DASHED_BUILT_INS=YesPlease\n \n case \"$runs_on_pool\" in\n-ubuntu-latest)\n+ubuntu-*)\n \tif test \"$jobname\" = \"linux-gcc-default\"\n \tthen\n \t\tbreak\n-- \n2.39.0.rc0\n\n"},{"id":"467997","messageId":"20221125095954.4826-4-worldhello.net@gmail.com","threadId":"58845","inReplyTo":"20221124153934.12470-1-worldhello.net@gmail.com","subject":"[PATCH v4 3/4] ci: p4 on Linux has the same version as on macOS","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2022-11-25T09:59:53Z","receivedAt":"2022-11-25T10:00:08Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"From: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n\nThere would be a segmentation fault when running p4 v16.2 on ubuntu\n22.04 which is the latest version of ubuntu runner image for github\nactions.\n\nBy checking each version from [1], p4d version 21.1 and above can work\nproperly on ubuntu 22.04. But version 22.x will break some p4 test\ncases. So p4 version 21.x is exactly the version we can use.\n\nWith this update, the versions of p4 for Linux and macOS happen to be\nthe same. So we can add the version number directly into the \"P4WHENCE\"\nvariable, and reuse it in p4 installation for macOS.\n\nBy removing the \"LINUX_P4_VERSION\" variable from \"ci/lib.sh\", the\ncomment left above has nothing to do with p4, but still applies to\ngit-lfs. Since we have a fixed version of git-lfs installed on Linux,\nwe may have a different version on macOS.\n\n[1]: https://cdist2.perforce.com/perforce/\n\nReviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de>\nHelped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nSigned-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n---\n ci/install-dependencies.sh | 4 ++--\n ci/lib.sh                  | 1 -\n 2 files changed, 2 insertions(+), 3 deletions(-)\n\ndiff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh\nindex 97a1a1f574..b569893b38 100755\n--- a/ci/install-dependencies.sh\n+++ b/ci/install-dependencies.sh\n@@ -5,7 +5,7 @@\n \n . ${0%/*}/lib.sh\n \n-P4WHENCE=https://cdist2.perforce.com/perforce/r$LINUX_P4_VERSION\n+P4WHENCE=https://cdist2.perforce.com/perforce/r21.2\n LFSWHENCE=https://github.com/github/git-lfs/releases/download/v$LINUX_GIT_LFS_VERSION\n UBUNTU_COMMON_PKGS=\"make libssl-dev libcurl4-openssl-dev libexpat-dev\n  tcl tk gettext zlib1g-dev perl-modules liberror-perl libauthen-sasl-perl\n@@ -40,7 +40,7 @@ macos-latest)\n \tmkdir -p $HOME/bin\n \t(\n \t\tcd $HOME/bin\n-\t\twget -q \"https://cdist2.perforce.com/perforce/r21.2/bin.macosx1015x86_64/helix-core-server.tgz\" &&\n+\t\twget -q \"$P4WHENCE/bin.macosx1015x86_64/helix-core-server.tgz\" &&\n \t\ttar -xf helix-core-server.tgz &&\n \t\tsudo xattr -d com.apple.quarantine p4 p4d 2>/dev/null || true\n \t)\ndiff --git a/ci/lib.sh b/ci/lib.sh\nindex eb203662c5..927b4529b0 100755\n--- a/ci/lib.sh\n+++ b/ci/lib.sh\n@@ -246,7 +246,6 @@ ubuntu-*)\n \t# were recorded in the Homebrew database upon creating the OS X\n \t# image.\n \t# Keep that in mind when you encounter a broken OS X build!\n-\texport LINUX_P4_VERSION=\"16.2\"\n \texport LINUX_GIT_LFS_VERSION=\"1.5.2\"\n \n \tP4_PATH=\"$HOME/custom/p4\"\n-- \n2.39.0.rc0\n\n"},{"id":"467998","messageId":"20221125095954.4826-5-worldhello.net@gmail.com","threadId":"58845","inReplyTo":"20221124153934.12470-1-worldhello.net@gmail.com","subject":"[PATCH v4 4/4] ci: install python on ubuntu","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2022-11-25T09:59:54Z","receivedAt":"2022-11-25T10:00:20Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"From: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n\nPython is missing from the default ubuntu-22.04 runner image, which\nprevent git-p4 from working. To install python on ubuntu, we need to\nprovide correct package name:\n\n * On Ubuntu 18.04 (bionic), \"/usr/bin/python2\" is provided by the\n   \"python\" package, and \"/usr/bin/python3\" is provided by the \"python3\"\n   package.\n\n * On Ubuntu 20.04 (focal) and above, \"/usr/bin/python2\" is provided by\n   the \"python2\" package which has a different name from bionic, and\n   \"/usr/bin/python3\" is provided by \"python3\".\n\nSince the \"ubuntu-latest\" runner image has a higher version, so its safe\nto use \"python2\" or \"python3\" package name.\n\nHelped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nSigned-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n---\n ci/install-dependencies.sh | 2 +-\n ci/lib.sh                  | 8 ++++----\n 2 files changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh\nindex b569893b38..d8fafc8ed2 100755\n--- a/ci/install-dependencies.sh\n+++ b/ci/install-dependencies.sh\n@@ -15,7 +15,7 @@ case \"$runs_on_pool\" in\n ubuntu-*)\n \tsudo apt-get -q update\n \tsudo apt-get -q -y install language-pack-is libsvn-perl apache2 \\\n-\t\t$UBUNTU_COMMON_PKGS $CC_PACKAGE\n+\t\t$UBUNTU_COMMON_PKGS $CC_PACKAGE $PYTHON_PACKAGE\n \tmkdir --parents \"$P4_PATH\"\n \tpushd \"$P4_PATH\"\n \t\twget --quiet \"$P4WHENCE/bin.linux26x86_64/p4d\"\ndiff --git a/ci/lib.sh b/ci/lib.sh\nindex 927b4529b0..cb30699f34 100755\n--- a/ci/lib.sh\n+++ b/ci/lib.sh\n@@ -232,12 +232,12 @@ ubuntu-*)\n \t\tbreak\n \tfi\n \n-\tif [ \"$jobname\" = linux-gcc ]\n+\tPYTHON_PACKAGE=python2\n+\tif test \"$jobname\" = linux-gcc\n \tthen\n-\t\tMAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=/usr/bin/python3\"\n-\telse\n-\t\tMAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=/usr/bin/python2\"\n+\t\tPYTHON_PACKAGE=python3\n \tfi\n+\tMAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=/usr/bin/$PYTHON_PACKAGE\"\n \n \texport GIT_TEST_HTTPD=true\n \n-- \n2.39.0.rc0\n\n"},{"id":"468021","messageId":"xmqqlenxb5xv.fsf@gitster.g","threadId":"58845","inReplyTo":"20221125095954.4826-3-worldhello.net@gmail.com","subject":"Re: [PATCH v4 2/4] ci: remove the pipe after \"p4 -V\" to cache errors","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2022-11-27T00:24:12Z","receivedAt":"2022-11-27T00:24:20Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jiang Xin <worldhello.net@gmail.com> writes:\n\n> Subject: Re: [PATCH v4 2/4] ci: remove the pipe after \"p4 -V\" to cache errors\n\n\"cache\" -> \"catch\", I think.\n\n> From: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n>\n> When installing p4 as a dependency, we used to pipe output of \"p4 -V\"\n> and \"p4d -V\" to validate the installation and output a condensed version\n> information. But this would hide potential errors of p4 and would stop\n> with an empty output. E.g.: p4d version 16.2 running on ubuntu 22.04\n> causes sigfaults.\n\n... before it produces any output.\n\n> By removing the pipe after \"p4 -V\" and \"p4d -V\", we may get a verbose\n> output, and stop immediately on errors becuase we have \"set -e\" in\n\n\"because\".\n\n> \"ci/lib.sh\". Since we won't look at these trace logs unless something\n> fails, so just including the raw output seems most sensible.\n\nYou started the sentence with \"Since\", so \"so\" should be dropped.\n\n> Reviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n> Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n> ---\n>  ci/install-dependencies.sh | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n\nWell reasoned.  Will queue.  Thanks.\n\n> diff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh\n> index feefd6e9bb..97a1a1f574 100755\n> --- a/ci/install-dependencies.sh\n> +++ b/ci/install-dependencies.sh\n> @@ -83,9 +83,9 @@ esac\n>  if type p4d >/dev/null 2>&1 && type p4 >/dev/null 2>&1\n>  then\n>  \techo \"$(tput setaf 6)Perforce Server Version$(tput sgr0)\"\n> -\tp4d -V | grep Rev.\n> +\tp4d -V\n>  \techo \"$(tput setaf 6)Perforce Client Version$(tput sgr0)\"\n> -\tp4 -V | grep Rev.\n> +\tp4 -V\n>  else\n>  \techo >&2 \"WARNING: perforce wasn't installed, see above for clues why\"\n>  fi\n"},{"id":"468022","messageId":"xmqqedtpb5xd.fsf@gitster.g","threadId":"58845","inReplyTo":"20221125095954.4826-2-worldhello.net@gmail.com","subject":"Re: [PATCH v4 1/4] github-actions: run gcc-8 on ubuntu-20.04 image","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2022-11-27T00:24:30Z","receivedAt":"2022-11-27T00:24:36Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jiang Xin <worldhello.net@gmail.com> writes:\n\n> From: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n>\n> GitHub starts to upgrade its runner image \"ubuntu-latest\" from version\n> \"ubuntu-20.04\" to version \"ubuntu-22.04\". It will fail to find and\n> install \"gcc-8\" package on the new runner image.\n>\n> Change some of the runner images from \"ubuntu-latest\" to \"ubuntu-20.04\"\n> in order to install \"gcc-8\" as a dependency.\n>\n> The first revision of this patch tried to replace \"$runs_on_pool\" in\n> \"ci/*.sh\" with a new \"$runs_on_os\" environment variable based on the\n> \"os\" filed in the matrix strategy. But these \"os\" fields in matrix\n\n\"filed\" -> \"field\".\n\n> strategies are obsolete legacies from commit [1] and commit [2], and\n> are no longer useful. So remove these unused \"os\" fields.\n>\n> [1]: c08bb26010 (CI: rename the \"Linux32\" job to lower-case \"linux32\",\n>                  2021-11-23)\n> [2]: 25715419bf (CI: don't run \"make test\" twice in one job, 2021-11-23)\n>\n> Reviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n> Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n> ---\n\nVery well explained.  With the patch text alone, readers would have\nbeen puzzled about the removal of \"os\" and the description certainly\nhelps.\n\nI also like the changes to ci/*.sh to match any future versions of\n\"ubuntu-*\" used in the pool name.  It is a sensible way to future\nproofing.\n\nWill queue.  Thanks, all.\n"},{"id":"468023","messageId":"xmqqa64db5ql.fsf@gitster.g","threadId":"58845","inReplyTo":"20221125095954.4826-4-worldhello.net@gmail.com","subject":"Re: [PATCH v4 3/4] ci: p4 on Linux has the same version as on macOS","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2022-11-27T00:28:34Z","receivedAt":"2022-11-27T00:28:40Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jiang Xin <worldhello.net@gmail.com> writes:\n\n> From: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n>\n> There would be a segmentation fault when running p4 v16.2 on ubuntu\n> 22.04 which is the latest version of ubuntu runner image for github\n> actions.\n>\n> By checking each version from [1], p4d version 21.1 and above can work\n> properly on ubuntu 22.04. But version 22.x will break some p4 test\n> cases. So p4 version 21.x is exactly the version we can use.\n>\n> With this update, the versions of p4 for Linux and macOS happen to be\n> the same. So we can add the version number directly into the \"P4WHENCE\"\n> variable, and reuse it in p4 installation for macOS.\n\nMakes sense.  This needs to be retitled from a statement of the fact ...\n\n> Subject: Re: [PATCH v4 3/4] ci: p4 on Linux has the same version as on macOS\n\n... to description of a choice _we_ made, e.g.\n\n    ci: use the same version of p4 on both Linux and macOS\n\nor something like that.\n\nOther than that, looks good.\n\nThanks.\n\n> By removing the \"LINUX_P4_VERSION\" variable from \"ci/lib.sh\", the\n> comment left above has nothing to do with p4, but still applies to\n> git-lfs. Since we have a fixed version of git-lfs installed on Linux,\n> we may have a different version on macOS.\n>\n> [1]: https://cdist2.perforce.com/perforce/\n>\n> Reviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n> Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n> ---\n>  ci/install-dependencies.sh | 4 ++--\n>  ci/lib.sh                  | 1 -\n>  2 files changed, 2 insertions(+), 3 deletions(-)\n>\n> diff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh\n> index 97a1a1f574..b569893b38 100755\n> --- a/ci/install-dependencies.sh\n> +++ b/ci/install-dependencies.sh\n> @@ -5,7 +5,7 @@\n>  \n>  . ${0%/*}/lib.sh\n>  \n> -P4WHENCE=https://cdist2.perforce.com/perforce/r$LINUX_P4_VERSION\n> +P4WHENCE=https://cdist2.perforce.com/perforce/r21.2\n>  LFSWHENCE=https://github.com/github/git-lfs/releases/download/v$LINUX_GIT_LFS_VERSION\n>  UBUNTU_COMMON_PKGS=\"make libssl-dev libcurl4-openssl-dev libexpat-dev\n>   tcl tk gettext zlib1g-dev perl-modules liberror-perl libauthen-sasl-perl\n> @@ -40,7 +40,7 @@ macos-latest)\n>  \tmkdir -p $HOME/bin\n>  \t(\n>  \t\tcd $HOME/bin\n> -\t\twget -q \"https://cdist2.perforce.com/perforce/r21.2/bin.macosx1015x86_64/helix-core-server.tgz\" &&\n> +\t\twget -q \"$P4WHENCE/bin.macosx1015x86_64/helix-core-server.tgz\" &&\n>  \t\ttar -xf helix-core-server.tgz &&\n>  \t\tsudo xattr -d com.apple.quarantine p4 p4d 2>/dev/null || true\n>  \t)\n> diff --git a/ci/lib.sh b/ci/lib.sh\n> index eb203662c5..927b4529b0 100755\n> --- a/ci/lib.sh\n> +++ b/ci/lib.sh\n> @@ -246,7 +246,6 @@ ubuntu-*)\n>  \t# were recorded in the Homebrew database upon creating the OS X\n>  \t# image.\n>  \t# Keep that in mind when you encounter a broken OS X build!\n> -\texport LINUX_P4_VERSION=\"16.2\"\n>  \texport LINUX_GIT_LFS_VERSION=\"1.5.2\"\n>  \n>  \tP4_PATH=\"$HOME/custom/p4\"\n"},{"id":"468024","messageId":"xmqq4julb5nk.fsf@gitster.g","threadId":"58845","inReplyTo":"20221125095954.4826-5-worldhello.net@gmail.com","subject":"Re: [PATCH v4 4/4] ci: install python on ubuntu","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2022-11-27T00:30:23Z","receivedAt":"2022-11-27T00:30:27Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jiang Xin <worldhello.net@gmail.com> writes:\n\n> From: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n>\n> Python is missing from the default ubuntu-22.04 runner image, which\n> prevent git-p4 from working. To install python on ubuntu, we need to\n> provide correct package name:\n>\n>  * On Ubuntu 18.04 (bionic), \"/usr/bin/python2\" is provided by the\n>    \"python\" package, and \"/usr/bin/python3\" is provided by the \"python3\"\n>    package.\n>\n>  * On Ubuntu 20.04 (focal) and above, \"/usr/bin/python2\" is provided by\n>    the \"python2\" package which has a different name from bionic, and\n>    \"/usr/bin/python3\" is provided by \"python3\".\n>\n> Since the \"ubuntu-latest\" runner image has a higher version, so its safe\n> to use \"python2\" or \"python3\" package name.\n\nMakes sense.  Just out of curiousity (read: not a suggestion to\nchange anything), what happens if you say \"apt install python\" on a\nrecent system?\n\nWill queue.  Thanks.\n\n> Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n> Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>\n> ---\n>  ci/install-dependencies.sh | 2 +-\n>  ci/lib.sh                  | 8 ++++----\n>  2 files changed, 5 insertions(+), 5 deletions(-)\n>\n> diff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh\n> index b569893b38..d8fafc8ed2 100755\n> --- a/ci/install-dependencies.sh\n> +++ b/ci/install-dependencies.sh\n> @@ -15,7 +15,7 @@ case \"$runs_on_pool\" in\n>  ubuntu-*)\n>  \tsudo apt-get -q update\n>  \tsudo apt-get -q -y install language-pack-is libsvn-perl apache2 \\\n> -\t\t$UBUNTU_COMMON_PKGS $CC_PACKAGE\n> +\t\t$UBUNTU_COMMON_PKGS $CC_PACKAGE $PYTHON_PACKAGE\n>  \tmkdir --parents \"$P4_PATH\"\n>  \tpushd \"$P4_PATH\"\n>  \t\twget --quiet \"$P4WHENCE/bin.linux26x86_64/p4d\"\n> diff --git a/ci/lib.sh b/ci/lib.sh\n> index 927b4529b0..cb30699f34 100755\n> --- a/ci/lib.sh\n> +++ b/ci/lib.sh\n> @@ -232,12 +232,12 @@ ubuntu-*)\n>  \t\tbreak\n>  \tfi\n>  \n> -\tif [ \"$jobname\" = linux-gcc ]\n> +\tPYTHON_PACKAGE=python2\n> +\tif test \"$jobname\" = linux-gcc\n>  \tthen\n> -\t\tMAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=/usr/bin/python3\"\n> -\telse\n> -\t\tMAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=/usr/bin/python2\"\n> +\t\tPYTHON_PACKAGE=python3\n>  \tfi\n> +\tMAKEFLAGS=\"$MAKEFLAGS PYTHON_PATH=/usr/bin/$PYTHON_PACKAGE\"\n>  \n>  \texport GIT_TEST_HTTPD=true\n"},{"id":"468035","messageId":"CANYiYbGmZjBzRNd9W2kws9KCnxXAvVpkGNUzRJs4LtLKW+ukmQ@mail.gmail.com","threadId":"58845","inReplyTo":"xmqq4julb5nk.fsf@gitster.g","subject":"Re: [PATCH v4 4/4] ci: install python on ubuntu","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2022-11-27T09:01:04Z","receivedAt":"2022-11-27T09:01:21Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"On Sun, Nov 27, 2022 at 8:30 AM Junio C Hamano <gitster@pobox.com> wrote:\n> > Since the \"ubuntu-latest\" runner image has a higher version, so its safe\n> > to use \"python2\" or \"python3\" package name.\n>\n> Makes sense.  Just out of curiousity (read: not a suggestion to\n> change anything), what happens if you say \"apt install python\" on a\n> recent system?\n\nIn order to reproduce, I start a docker container like  this:\n\n    $ docker run -it --rm ubuntu:22.04 /bin/bash\n\nFetch the latest apt source list, by running:\n\n    $ apt-get update\n\nThen install python with the following errors:\n\n    $ apt-get install python\n    Reading package lists... Done\n    Building dependency tree... Done\n    Reading state information... Done\n    Package python is not available, but is referred to by another package.\nThis may mean that the package is missing, has been obsoleted, or\nis only available from another source\nHowever the following packages replace it:\n  2to3 python2-minimal python2 dh-python python-is-python3\n\nE: Package 'python' has no installation candidate\n\nWe can also find python package name from packages.ubuntu.com:\n\n1. form the link below, we can say Ubuntu 18.04 is the last version\n(LTS?) which has python package:\n\n    https://packages.ubuntu.com/search?keywords=python&searchon=names&suite=all&section=all\n\n2. Ubuntu 20.04 is the first version (LTS) which rename its python\npacakge to python2 package:\n\n    https://packages.ubuntu.com/search?keywords=python2&searchon=names&suite=all&section=all\n\n> Will queue.  Thanks.\n\nThanks.\n\n--\nJiang Xin\n"},{"id":"468036","messageId":"CANYiYbE3tyLBrCoDxVWPN_eWUesCYAmjzaFYj9CnjAUvuEO+wg@mail.gmail.com","threadId":"58845","inReplyTo":"xmqqlenxb5xv.fsf@gitster.g","subject":"Re: [PATCH v4 2/4] ci: remove the pipe after \"p4 -V\" to cache errors","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2022-11-27T09:14:49Z","receivedAt":"2022-11-27T09:15:04Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"On Sun, Nov 27, 2022 at 8:24 AM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Jiang Xin <worldhello.net@gmail.com> writes:\n>\n> > Subject: Re: [PATCH v4 2/4] ci: remove the pipe after \"p4 -V\" to cache errors\n>\n> \"cache\" -> \"catch\", I think.\n\noops, it's a typo. I used to copy and paste the commit log to MS word\nor Apple pages to check for typos, but this step is very cumbersome,\nand I always forget it.\n\nI see this has been fixed in your tree, so there is no need to send v5.\n\n--\nJiang Xin\n"},{"id":"468054","messageId":"xmqqh6yk9dht.fsf@gitster.g","threadId":"58845","inReplyTo":"CANYiYbGmZjBzRNd9W2kws9KCnxXAvVpkGNUzRJs4LtLKW+ukmQ@mail.gmail.com","subject":"Re: [PATCH v4 4/4] ci: install python on ubuntu","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2022-11-27T23:36:14Z","receivedAt":"2022-11-27T23:36:19Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jiang Xin <worldhello.net@gmail.com> writes:\n\n>     $ apt-get install python\n>     Reading package lists... Done\n>     Building dependency tree... Done\n>     Reading state information... Done\n>     Package python is not available, but is referred to by another package.\n> This may mean that the package is missing, has been obsoleted, or\n> is only available from another source\n> However the following packages replace it:\n>   2to3 python2-minimal python2 dh-python python-is-python3\n>\n> E: Package 'python' has no installation candidate\n\nOK, I see.  Thanks.  I wondered if \"python\" redirects to either one\nof these versions.  Not that I would suggest another approach based\non such a redirection, even if it existed--as I said, the question\nwas purely out of curiosity.\n\n"}]}