From 9e8a283f7162c9497f6c48afa9c1bc23041528e4 Mon Sep 17 00:00:00 2001 From: Nazir Bilal Yavuz Date: Tue, 29 Aug 2023 13:30:05 +0300 Subject: [PATCH] ci: Install latest meson version to CI images --- .cirrus.yml | 6 ++++++ packer/freebsd.pkr.hcl | 5 ++++- packer/linux_debian.pkr.hcl | 17 +++++++++++++++++ packer/windows.pkr.hcl | 4 +++- scripts/linux_debian_install_deps.sh | 1 - 5 files changed, 30 insertions(+), 3 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index ce835b8..498edf8 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -12,6 +12,10 @@ env: GCP_PROJECT_MAIN: pg-ci-images GCP_PROJECT_DEV: pg-ci-images-dev + # default variables to use in local meson installations + MESON_REPO: https://github.com/mesonbuild/meson.git + MESON_BRANCH: master + # the following variables are chosen in .cirrus.star, based on the branch # being built etc # BRANCH_TYPE = dev|main @@ -154,6 +158,8 @@ task: -force \ -var "image_date=$DATE" \ -var "image_name=${IMAGE_NAME}" \ + -var "meson_repo=${MESON_REPO}" \ + -var "meson_branch=${MESON_BRANCH}" \ -var gcp_project=$GCP_PROJECT \ "$PACKERFILE" diff --git a/packer/freebsd.pkr.hcl b/packer/freebsd.pkr.hcl index 46c9d11..03c7494 100644 --- a/packer/freebsd.pkr.hcl +++ b/packer/freebsd.pkr.hcl @@ -1,6 +1,8 @@ variable "image_date" { type = string } variable "gcp_project" { type = string } variable "image_name" { type = string } +variable "meson_repo" { type = string } +variable "meson_branch" { type = string } locals { image_identity = "${var.image_name}-${var.image_date}" @@ -67,7 +69,6 @@ build { bash \ git-tiny \ gmake \ - meson \ ninja \ perl5 \ pkgconf \ @@ -93,6 +94,8 @@ build { openldap25-client \ openldap25-server + python3 -m pip install git+${var.meson_repo}@${var.meson_branch} + # remove temporary files pkg clean -ay rm -fr /usr/ports /usr/src /usr/tests /usr/lib/debug diff --git a/packer/linux_debian.pkr.hcl b/packer/linux_debian.pkr.hcl index e5f8849..a71bf99 100644 --- a/packer/linux_debian.pkr.hcl +++ b/packer/linux_debian.pkr.hcl @@ -1,6 +1,8 @@ variable "image_date" { type = string } variable "gcp_project" { type = string } variable "image_name" { type = string } +variable "meson_repo" { type = string } +variable "meson_branch" { type = string } locals { image_identity = "${var.image_name}-${var.image_date}" @@ -189,6 +191,21 @@ build { script = "scripts/linux_debian_install_deps.sh" } + provisioner "shell" { + execute_command = "sudo env {{ .Vars }} {{ .Path }}" + inline = ["python3 -m pip install git+${var.meson_repo}@${var.meson_branch} ninja"] + only = ["googlecompute.bullseye"] + } + + # These gives 'error: externally-managed-environment' + # Also, these images install one of the latest version of meson + # See PEP 668 for the detailed specification. + provisioner "shell" { + execute_command = "sudo env {{ .Vars }} {{ .Path }}" + inline = ["apt-get -y install --no-install-recommends meson"] + only = ["googlecompute.sid", "googlecompute.sid-newkernel", "googlecompute.sid-newkernel-uring"] + } + provisioner "shell" { execute_command = "sudo env {{ .Vars }} {{ .Path }}" inline = [ diff --git a/packer/windows.pkr.hcl b/packer/windows.pkr.hcl index 4d2f88f..b000267 100644 --- a/packer/windows.pkr.hcl +++ b/packer/windows.pkr.hcl @@ -1,5 +1,7 @@ variable "image_name" { type = string } variable "image_date" { type = string } +variable "meson_repo" { type = string } +variable "meson_branch" { type = string } variable "build_type" { type = string @@ -114,7 +116,7 @@ build { execute_command = var.execute_command inline = [ "$ErrorActionPreference = 'Stop'", - "py -m pip install meson ninja" + "python3 -m pip install git+${var.meson_repo}@${var.meson_branch} ninja", ] } diff --git a/scripts/linux_debian_install_deps.sh b/scripts/linux_debian_install_deps.sh index eb27044..80b8f36 100755 --- a/scripts/linux_debian_install_deps.sh +++ b/scripts/linux_debian_install_deps.sh @@ -11,7 +11,6 @@ apt-get -y install --no-install-recommends \ gdb \ git \ make \ - meson \ perl \ pkg-config \ \