Skip to content

Commit c05fab6

Browse files
authored
Merge pull request #2 from GiulioSavini/feature/ubuntu-26.04-support
feat: Ubuntu 26.04 support + Docker compile CI
2 parents 4193003 + 5163998 commit c05fab6

7 files changed

Lines changed: 135 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,37 @@ jobs:
4444
assert len(info.get('galaxy_tags', [])) >= 5, 'need at least 5 tags'
4545
print('Galaxy metadata OK')
4646
"
47+
48+
build-container:
49+
name: Build & compile (${{ matrix.target }})
50+
runs-on: ubuntu-latest
51+
strategy:
52+
fail-fast: false
53+
matrix:
54+
target:
55+
- ubuntu2204
56+
- ubuntu2404
57+
- ubuntu2604
58+
- debian12
59+
- rocky9
60+
- rocky8
61+
- oraclelinux8
62+
- oraclelinux9
63+
- fedora
64+
steps:
65+
- uses: actions/checkout@v4
66+
67+
# Builds the per-distro Docker image and compiles open-vm-tools inside it,
68+
# producing the .deb/.rpm. This is the real "does it compile in Docker"
69+
# gate — a failed image build or compile fails the job for that target.
70+
- name: Build container and compile open-vm-tools
71+
working-directory: containers
72+
run: ./build-all.sh --target ${{ matrix.target }}
73+
74+
- name: Upload built package
75+
if: always()
76+
uses: actions/upload-artifact@v4
77+
with:
78+
name: vmtools-${{ matrix.target }}
79+
path: output/${{ matrix.target }}/*
80+
if-no-files-found: warn

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
55

66
## [Unreleased]
77

8+
### Added
9+
- Ubuntu 26.04 LTS (Resolute Raccoon) support: `containers/Dockerfile.ubuntu2604` build target, `ubuntu2604` added to `build-all.sh`, and `resolute` listed in Galaxy platforms (the Ansible role already resolves the `ubuntu2604` package subdir dynamically from `ansible_distribution_version`)
10+
- CI now builds each per-distro Docker image and compiles open-vm-tools inside it (matrix `build-container` job), so "does it compile in Docker" is verified on every push/PR and the resulting package is uploaded as an artifact
11+
812
### Fixed
913
- RHEL build deps: enable EPEL from Fedora mirror when `epel-release` isn't in the distro repos, and enable CodeReady Builder via `subscription-manager` on real RHEL (so `xmlsec1-devel`, `libmspack-devel` and `rpcgen` resolve)
1014

build.sh

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,44 @@ get_latest_version() {
8787
# ------------------------------------------------------------------------------
8888
# Install build dependencies
8989
# ------------------------------------------------------------------------------
90+
91+
# Ubuntu 26.04: il postinst di 'install-info' (script /usr/sbin/update-info-dir)
92+
# puo' fallire ("export: ... bad variable name") e lasciare dpkg in stato
93+
# "1 not fully installed or removed", bloccando OGNI apt successivo anche se le
94+
# dipendenze sono gia' presenti. Su una build-host l'indice dei doc 'info' e'
95+
# irrilevante: se dpkg e' rotto completiamo le configurazioni pendenti e, se il
96+
# trigger update-info-dir e' la causa, lo rendiamo no-op (reversibile via divert).
97+
repair_broken_dpkg() {
98+
# dpkg pulito -> niente da fare
99+
[ -z "$(dpkg --audit 2>/dev/null)" ] && return 0
100+
101+
warn "Stato dpkg incompleto rilevato, tentativo di riparazione..."
102+
103+
# 1) Tentativo pulito: riconfigura con un environment minimale (copre il caso
104+
# in cui la causa e' una variabile d'ambiente malformata ereditata dalla shell).
105+
if env -i PATH=/usr/sbin:/usr/bin:/sbin:/bin LC_ALL=C \
106+
DEBIAN_FRONTEND=noninteractive dpkg --configure -a >/dev/null 2>&1; then
107+
log "dpkg riconfigurato correttamente."
108+
return 0
109+
fi
110+
111+
# 2) Fallback: il trigger update-info-dir e' rotto -> neutralizzalo e riprova.
112+
if [ -e /usr/sbin/update-info-dir ] \
113+
&& ! grep -q 'vmtools-builder-noop' /usr/sbin/update-info-dir 2>/dev/null; then
114+
warn "Neutralizzo /usr/sbin/update-info-dir (bug noto install-info su Ubuntu 26.04)."
115+
dpkg-divert --quiet --local --rename \
116+
--divert /usr/sbin/update-info-dir.distrib /usr/sbin/update-info-dir 2>/dev/null || true
117+
printf '#!/bin/sh\n# vmtools-builder-noop: workaround bug install-info update-info-dir\nexit 0\n' \
118+
> /usr/sbin/update-info-dir
119+
chmod 0755 /usr/sbin/update-info-dir
120+
fi
121+
DEBIAN_FRONTEND=noninteractive dpkg --configure -a \
122+
|| warn "dpkg ancora non pulito dopo la riparazione; proseguo comunque."
123+
}
124+
90125
install_deps_debian() {
91126
log "Installazione dipendenze di build (Debian/Ubuntu)..."
127+
repair_broken_dpkg
92128
apt-get update -qq
93129
apt-get install -y --no-install-recommends \
94130
build-essential \
@@ -447,6 +483,11 @@ EOF
447483
# posti diversi (es. Fedora non genera 99-vmware-scsi-udev.rules, Rocky/OL
448484
# si'; udev rules dir e' /usr/lib su alcuni, /lib su altri). Cosi' il pacco
449485
# contiene esattamente cio' che e' stato installato.
486+
# I file .la (libtool archive) non servono a runtime e su Fedora moderno la
487+
# brp di rpmbuild li rimuove dal buildroot: se restano nel filelist generato
488+
# da staging la build fallisce con "File not found: ...la". Li togliamo dallo
489+
# staging cosi' filelist e buildroot restano coerenti su tutte le distro.
490+
find "$RPM_STAGING" -name '*.la' -type f -delete
450491
FILELIST="$RPM_TOPDIR/SPECS/${PKG_NAME}.files"
451492
( cd "$RPM_STAGING" && find . \( -type f -o -type l \) -printf '/%P\n' ) > "$FILELIST"
452493

containers/Dockerfile.ubuntu2604

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
FROM ubuntu:26.04
2+
3+
LABEL maintainer="Infrastructure Team"
4+
LABEL description="Build container for open-vm-tools .deb (Ubuntu 26.04 LTS Resolute Raccoon)"
5+
6+
ENV DEBIAN_FRONTEND=noninteractive
7+
8+
# Reti dove la porta 80 in uscita e' filtrata (es. proxy aziendale che lascia
9+
# passare solo 443): i mirror http di Ubuntu vanno in timeout. Passiamo ad
10+
# HTTPS. L'immagine base non porta le CA, quindi facciamo un bootstrap di
11+
# ca-certificates disabilitando la verifica TLS SOLO per quel primo fetch
12+
# (l'integrita' dei pacchetti resta garantita dalle firme GPG del repo);
13+
# subito dopo l'update gira verificato.
14+
RUN sed -i 's|http://|https://|g' /etc/apt/sources.list.d/ubuntu.sources && \
15+
apt-get -o Acquire::https::Verify-Peer=false -o Acquire::https::Verify-Host=false update -qq && \
16+
apt-get -o Acquire::https::Verify-Peer=false -o Acquire::https::Verify-Host=false \
17+
install -y --no-install-recommends ca-certificates && \
18+
apt-get update -qq && \
19+
apt-get install -y --no-install-recommends \
20+
build-essential \
21+
automake \
22+
autoconf \
23+
libtool \
24+
pkg-config \
25+
libglib2.0-dev \
26+
libpam0g-dev \
27+
libssl-dev \
28+
libxml2-dev \
29+
libxmlsec1-dev \
30+
libmspack-dev \
31+
libfuse3-dev \
32+
libudev-dev \
33+
libdrm-dev \
34+
libtirpc-dev \
35+
rpcsvc-proto \
36+
curl \
37+
wget \
38+
git \
39+
dpkg-dev \
40+
fakeroot \
41+
debhelper \
42+
&& apt-get clean \
43+
&& rm -rf /var/lib/apt/lists/*
44+
45+
COPY build-inside-container.sh /build.sh
46+
RUN chmod +x /build.sh
47+
48+
VOLUME /output
49+
ENTRYPOINT ["/build.sh"]

containers/build-all.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ header(){ echo -e "${CYAN}$*${NC}"; }
3232
TARGETS=(
3333
"ubuntu2204"
3434
"ubuntu2404"
35+
"ubuntu2604"
3536
"debian12"
3637
"rocky9"
3738
"rocky8"

containers/build-inside-container.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,11 @@ EOF
306306
# posti diversi (es. Fedora non genera 99-vmware-scsi-udev.rules, Rocky/OL
307307
# si'; udev rules dir e' /usr/lib su alcuni, /lib su altri). Cosi' il pacco
308308
# contiene esattamente cio' che e' stato installato.
309+
# I file .la (libtool archive) non servono a runtime e su Fedora moderno la
310+
# brp di rpmbuild li rimuove dal buildroot: se restano nel filelist generato
311+
# da staging la build fallisce con "File not found: ...la". Li togliamo dallo
312+
# staging cosi' filelist e buildroot restano coerenti su tutte le distro.
313+
find "$RPM_STAGING" -name '*.la' -type f -delete
309314
FILELIST="$RPM_TOPDIR/SPECS/${PKG_NAME}.files"
310315
( cd "$RPM_STAGING" && find . \( -type f -o -type l \) -printf '/%P\n' ) > "$FILELIST"
311316

meta/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ galaxy_info:
1414
- focal
1515
- jammy
1616
- noble
17+
- resolute
1718
- name: Debian
1819
versions:
1920
- bullseye

0 commit comments

Comments
 (0)