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

Fix SLES bison dependencies. #1479

Merged
merged 3 commits into from
Oct 24, 2023
Merged
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
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,8 @@ COPY --from=buster-build /google-cloud-ops-agent*.deb /
FROM opensuse/archive:42.3 AS sles12-build-base
ARG OPENJDK_MAJOR_VERSION

# Add home:odassau repo to install 3.4 bison
ADD https://download.opensuse.org/repositories/home:/odassau/SLE_12_SP4/home:odassau.repo /tmp/home:odassau.repo
RUN set -x; \
# The 'OSS Update' repo signature is no longer valid, so verify the checksum instead.
zypper --no-gpg-check refresh 'OSS Update' && \
Expand All @@ -697,13 +699,13 @@ RUN set -x; \
# Remove expired root certificate.
mv /var/lib/ca-certificates/pem/DST_Root_CA_X3.pem /etc/pki/trust/blacklist/ && \
update-ca-certificates && \
# Add home:odassau repo to install >3.4 bison
zypper addrepo https://download.opensuse.org/repositories/home:/odassau/SLE_12_SP4/home:odassau.repo && \
# Add home:odassau repo to install 3.4 bison
zypper addrepo /tmp/home:odassau.repo && \
zypper -n --gpg-auto-import-keys refresh && \
zypper -n update && \
# zypper/libcurl has a use-after-free bug that causes segfaults for particular download sequences.
# If this bug happens to trigger in the future, adding a "zypper -n download" of a subset of the packages can avoid the segfault.
zypper -n install 'bison>3.4' && \
zypper -n install 'bison>3' && \
# Allow fluent-bit to find systemd
ln -fs /usr/lib/systemd /lib/systemd
COPY --from=openjdk-install /usr/local/java-${OPENJDK_MAJOR_VERSION}-openjdk/ /usr/local/java-${OPENJDK_MAJOR_VERSION}-openjdk
Expand Down Expand Up @@ -807,7 +809,7 @@ ARG OPENJDK_MAJOR_VERSION

RUN set -x; zypper -n refresh && \
zypper -n update && \
zypper -n install git systemd autoconf automake flex libtool libcurl-devel libopenssl-devel libyajl-devel gcc gcc-c++ zlib-devel rpm-build expect cmake systemd-devel systemd-rpm-macros unzip zip 'bison>3.4'
zypper -n install git systemd autoconf automake flex libtool libcurl-devel libopenssl-devel libyajl-devel gcc gcc-c++ zlib-devel rpm-build expect cmake systemd-devel systemd-rpm-macros unzip zip 'bison>3'
# Allow fluent-bit to find systemd
RUN ln -fs /usr/lib/systemd /lib/systemd
COPY --from=openjdk-install /usr/local/java-${OPENJDK_MAJOR_VERSION}-openjdk/ /usr/local/java-${OPENJDK_MAJOR_VERSION}-openjdk
Expand Down
12 changes: 7 additions & 5 deletions dockerfiles/compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,21 +154,23 @@ var dockerfileArguments = []templateArguments{
//https://en.opensuse.org/openSUSE:Build_Service_cross_distribution_howto#Detect_a_distribution_flavor_for_special_code
from_image: "opensuse/archive:42.3",
target_name: "sles12",
install_packages: `RUN set -x; \
install_packages: `# Add home:odassau repo to install 3.4 bison
ADD https://download.opensuse.org/repositories/home:/odassau/SLE_12_SP4/home:odassau.repo /tmp/home:odassau.repo
RUN set -x; \
# The 'OSS Update' repo signature is no longer valid, so verify the checksum instead.
zypper --no-gpg-check refresh 'OSS Update' && \
(echo 'b889b4bba03074cd66ef9c0184768f4816d4ccb1fa9ec2721c5583304c5f23d0 /var/cache/zypp/raw/OSS Update/repodata/repomd.xml' | sha256sum --check) && \
zypper -n install git systemd autoconf automake flex libtool libcurl-devel libopenssl-devel libyajl-devel gcc gcc-c++ zlib-devel rpm-build expect cmake systemd-devel systemd-rpm-macros unzip zip && \
# Remove expired root certificate.
mv /var/lib/ca-certificates/pem/DST_Root_CA_X3.pem /etc/pki/trust/blacklist/ && \
update-ca-certificates && \
# Add home:odassau repo to install >3.4 bison
zypper addrepo https://download.opensuse.org/repositories/home:/odassau/SLE_12_SP4/home:odassau.repo && \
# Add home:odassau repo to install 3.4 bison
zypper addrepo /tmp/home:odassau.repo && \
zypper -n --gpg-auto-import-keys refresh && \
zypper -n update && \
# zypper/libcurl has a use-after-free bug that causes segfaults for particular download sequences.
# If this bug happens to trigger in the future, adding a "zypper -n download" of a subset of the packages can avoid the segfault.
zypper -n install 'bison>3.4' && \
zypper -n install 'bison>3' && \
# Allow fluent-bit to find systemd
ln -fs /usr/lib/systemd /lib/systemd` + installJava + installCMake,
package_build: "RUN ./pkg/rpm/build.sh",
Expand All @@ -180,7 +182,7 @@ var dockerfileArguments = []templateArguments{
target_name: "sles15",
install_packages: `RUN set -x; zypper -n refresh && \
zypper -n update && \
zypper -n install git systemd autoconf automake flex libtool libcurl-devel libopenssl-devel libyajl-devel gcc gcc-c++ zlib-devel rpm-build expect cmake systemd-devel systemd-rpm-macros unzip zip 'bison>3.4'
zypper -n install git systemd autoconf automake flex libtool libcurl-devel libopenssl-devel libyajl-devel gcc gcc-c++ zlib-devel rpm-build expect cmake systemd-devel systemd-rpm-macros unzip zip 'bison>3'
# Allow fluent-bit to find systemd
RUN ln -fs /usr/lib/systemd /lib/systemd` + installJava + installCMake,
package_build: "RUN ./pkg/rpm/build.sh",
Expand Down