Skip to content

Commit 2a7284a

Browse files
committed
fix(base-images): Add lcab package and improve Ubuntu sync process
The 'lcab' package was removed from Ubuntu 24.04 repositories, causing build failures for projects like libarchive. This change resolves the issue by installing 'lcab' from a .deb package into the Ubuntu 24.04 base-builder image. To support this while adhering to the image strategy, version-specific install_deps.sh scripts were created for Ubuntu 20.04 and 24.04. Additionally, the CI workflow for checking synchronization was improved: - Renamed to 'ubuntu_version_sync.yml' for clarity. - Updated to monitor 'install_deps.sh' to prevent future drift.
1 parent 75b7e82 commit 2a7284a

File tree

5 files changed

+99
-5
lines changed

5 files changed

+99
-5
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#
1515
################################################################################
1616

17-
name: 'Check Ubuntu Config Sync'
17+
name: 'Ubuntu Version Sync'
1818

1919
on:
2020
pull_request:
@@ -54,6 +54,7 @@ jobs:
5454
5555
declare -A LEGACY_SCRIPTS
5656
LEGACY_SCRIPTS["infra/base-images/base-builder-fuzzbench/fuzzbench_install_dependencies"]="infra/base-images/base-builder-fuzzbench/fuzzbench_install_dependencies_{version}"
57+
LEGACY_SCRIPTS["infra/base-images/base-builder/install_deps.sh"]="infra/base-images/base-builder/install_deps_{version}.sh"
5758
LEGACY_SCRIPTS["infra/base-images/base-builder/install_swift.sh"]="infra/base-images/base-builder/install_swift_{version}.sh"
5859
LEGACY_SCRIPTS["infra/base-images/base-builder/precompile_honggfuzz"]="infra/base-images/base-builder/precompile_honggfuzz_{version}"
5960
LEGACY_SCRIPTS["infra/base-images/base-clang/checkout_build_install_llvm.sh"]="infra/base-images/base-clang/checkout_build_install_llvm_{version}.sh"
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/bash -eux
2+
# Copyright 2022 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
################################################################################
17+
18+
# Install base-builder's dependencies in a architecture-aware way.
19+
20+
21+
case $(uname -m) in
22+
x86_64)
23+
dpkg --add-architecture i386
24+
;;
25+
esac
26+
27+
apt-get update && \
28+
apt-get install -y \
29+
binutils-dev \
30+
build-essential \
31+
curl \
32+
wget \
33+
git \
34+
jq \
35+
patchelf \
36+
rsync \
37+
subversion \
38+
zip
39+
40+
case $(uname -m) in
41+
x86_64)
42+
apt-get install -y libc6-dev-i386
43+
;;
44+
esac
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/bin/bash -eux
2+
# Copyright 2022 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
################################################################################
17+
18+
# Install base-builder's dependencies in a architecture-aware way.
19+
20+
21+
case $(uname -m) in
22+
x86_64)
23+
dpkg --add-architecture i386
24+
;;
25+
esac
26+
27+
apt-get update && \
28+
apt-get install -y \
29+
binutils-dev \
30+
build-essential \
31+
curl \
32+
wget \
33+
git \
34+
jq \
35+
patchelf \
36+
rsync \
37+
subversion \
38+
zip
39+
40+
case $(uname -m) in
41+
x86_64)
42+
apt-get install -y libc6-dev-i386
43+
;;
44+
esac
45+
46+
# Ubuntu 24.04 does not have lcab. Install an older .deb from Ubuntu repos.
47+
curl -LO https://mirrors.edge.kernel.org/ubuntu/pool/universe/l/lcab/lcab_1.0b12-7_amd64.deb && \
48+
apt-get install -y ./lcab_1.0b12-7_amd64.deb && \
49+
rm lcab_1.0b12-7_amd64.deb

infra/base-images/base-builder/ubuntu-20-04.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
FROM gcr.io/oss-fuzz-base/base-clang:ubuntu-20-04
1818

19-
COPY install_deps.sh /
20-
RUN /install_deps.sh && rm /install_deps.sh
19+
COPY install_deps_ubuntu-20-04.sh install_swift_ubuntu_20_04.sh /
20+
RUN /install_deps_ubuntu-20-04.sh
2121

2222
# Build and install latest Python 3.11.
2323
ENV PYTHON_VERSION 3.11.13

infra/base-images/base-builder/ubuntu-24-04.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
FROM gcr.io/oss-fuzz-base/base-clang:ubuntu-24-04
1818

19-
COPY install_deps.sh /
20-
RUN /install_deps.sh && rm /install_deps.sh
19+
COPY install_deps_ubuntu-24-04.sh install_swift_ubuntu_24_04.sh /
20+
RUN /install_deps_ubuntu-24-04.sh
2121

2222
# Build and install latest Python 3.11.
2323
ENV PYTHON_VERSION 3.11.13

0 commit comments

Comments
 (0)