Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Install latest meson version to CI images #88

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"

Expand Down
5 changes: 4 additions & 1 deletion packer/freebsd.pkr.hcl
Original file line number Diff line number Diff line change
@@ -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}"
Expand Down Expand Up @@ -67,7 +69,6 @@ build {
bash \
git-tiny \
gmake \
meson \
ninja \
perl5 \
pkgconf \
Expand All @@ -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
Expand Down
17 changes: 17 additions & 0 deletions packer/linux_debian.pkr.hcl
Original file line number Diff line number Diff line change
@@ -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}"
Expand Down Expand Up @@ -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 = [
Expand Down
4 changes: 3 additions & 1 deletion packer/windows.pkr.hcl
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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",
]
}

Expand Down
1 change: 0 additions & 1 deletion scripts/linux_debian_install_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ apt-get -y install --no-install-recommends \
gdb \
git \
make \
meson \
perl \
pkg-config \
\
Expand Down