Merge pull request #14068 from opensourcerouting/fix/backport_libyang_to_9.0

Switch to libyang 2.1.80
This commit is contained in:
Donald Sharp 2023-07-21 08:59:24 -04:00 committed by GitHub
commit e9420ea75f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 32 additions and 22 deletions

View File

@ -18,8 +18,8 @@ makedepends="ncurses-dev net-snmp-dev gawk texinfo perl
ncurses-libs ncurses-terminfo ncurses-terminfo-base patch pax-utils pcre2
perl pkgconf python3 python3-dev readline readline-dev sqlite-libs pcre2-dev
squashfs-tools sudo tar texinfo xorriso xz-libs py-pip rtrlib rtrlib-dev
py3-sphinx elfutils elfutils-dev libyang-dev protobuf-c-compiler protobuf-c-dev
lua5.3-dev lua5.3"
py3-sphinx elfutils elfutils-dev protobuf-c-compiler protobuf-c-dev
lua5.3-dev lua5.3 gzip"
checkdepends="pytest py-setuptools"
install="$pkgname.pre-install $pkgname.pre-deinstall $pkgname.post-deinstall"
subpackages="$pkgname-dev $pkgname-doc $pkgname-dbg"

2
debian/control vendored
View File

@ -22,7 +22,7 @@ Build-Depends: bison,
librtr-dev (>= 0.8.0~) <!pkg.frr.nortrlib>,
libsnmp-dev,
libssh-dev <!pkg.frr.nortrlib>,
libyang2-dev,
libyang2-dev (>= 2.1.80),
lsb-base,
pkg-config,
python3:native,

View File

@ -1,7 +1,7 @@
# syntax=docker/dockerfile:1
# Create a basic stage set up to build APKs
FROM alpine:3.17 as alpine-builder
FROM alpine:3.18 as alpine-builder
RUN apk add \
--update-cache \
abuild \
@ -12,22 +12,29 @@ RUN apk add \
&& echo 'builder ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
RUN adduser -D -G abuild builder && su builder -c 'abuild-keygen -a -n'
# This stage builds a dist tarball from the source
FROM alpine:3.17 as source-builder
# This stage builds an APK for libyang
FROM alpine-builder as alpine-apk-builder-libyang
RUN mkdir -p /src/libyang
COPY docker/alpine/libyang/APKBUILD /src/libyang
RUN chown -R builder /pkgs /src
USER builder
RUN cd /src/libyang \
&& abuild checksum \
&& git init \
&& abuild -r -P /pkgs/apk
RUN mkdir -p /src/alpine
# This stage builds a dist tarball from the source
FROM alpine:3.18 as source-builder
RUN mkdir -p /src/alpine /pkgs/apk
COPY alpine/APKBUILD.in /src/alpine
COPY --from=alpine-apk-builder-libyang /pkgs/apk/src /pkgs/apk
RUN cd /pkgs/apk/x86_64 && apk add --allow-untrusted *.apk
RUN source /src/alpine/APKBUILD.in \
&& apk add \
--no-cache \
--update-cache \
$makedepends \
gzip \
py-pip \
rtrlib \
protobuf-c-dev \
&& pip install pytest
RUN mkdir -p /pkgs/apk
COPY . /src
ARG PKGVER
RUN cd /src \
@ -40,6 +47,8 @@ RUN cd /src \
# This stage builds an APK from the dist tarball
FROM alpine-builder as alpine-apk-builder
COPY --from=source-builder /src/frr-*.tar.gz /src/alpine/* /dist/
COPY --from=alpine-apk-builder-libyang /pkgs/apk/src /pkgs/apk
RUN cd /pkgs/apk/x86_64 && apk add --allow-untrusted *.apk
RUN find /pkgs/apk -type f -name APKINDEX.tar.gz -delete
RUN chown -R builder /dist /pkgs
USER builder
@ -49,7 +58,7 @@ RUN cd /dist \
&& abuild -r -P /pkgs/apk
# This stage installs frr from the apk
FROM alpine:3.17
FROM alpine:3.18
RUN mkdir -p /pkgs/apk
COPY --from=alpine-apk-builder /pkgs/apk/ /pkgs/apk/
RUN apk add \

View File

@ -1,7 +1,7 @@
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Christian Franke <nobody@nowhere.ws>
pkgname=libyang
pkgver=2.0.194
pkgver=2.1.80
pkgrel=0
pkgdesc="YANG data modelling language parser and toolkit"
url="https://github.com/CESNET/libyang"

View File

@ -10,8 +10,8 @@ RUN dnf install --enablerepo=powertools -y rpm-build git autoconf pcre-devel \
groff pkgconfig json-c-devel pam-devel bison flex python3-pytest \
c-ares-devel python3-devel python3-sphinx libcap-devel platform-python-devel \
protobuf-c-devel \
https://ci1.netdef.org/artifact/LIBYANG-LIBYANGV2/shared/build-2/CentOS-8-x86_64-Packages/libyang2-2.0.0.10.g2eb910e4-1.el8.x86_64.rpm \
https://ci1.netdef.org/artifact/LIBYANG-LIBYANGV2/shared/build-2/CentOS-8-x86_64-Packages/libyang2-devel-2.0.0.10.g2eb910e4-1.el8.x86_64.rpm \
https://ci1.netdef.org/artifact/LIBYANG-LIBYANG2/shared/build-00181/RedHat-8-x86_64-Packages/libyang-2.1.80-1.el8.x86_64.rpm \
https://ci1.netdef.org/artifact/LIBYANG-LIBYANG2/shared/build-00181/RedHat-8-x86_64-Packages/libyang-devel-2.1.80-1.el8.x86_64.rpm \
https://ci1.netdef.org/artifact/RPKI-RTRLIB/shared/build-00146/CentOS-7-x86_64-Packages/librtr-0.8.0-1.el7.x86_64.rpm \
https://ci1.netdef.org/artifact/RPKI-RTRLIB/shared/build-00146/CentOS-7-x86_64-Packages/librtr-devel-0.8.0-1.el7.x86_64.rpm
@ -42,7 +42,7 @@ RUN sed -i -e "s|mirrorlist=|#mirrorlist=|g" /etc/yum.repos.d/CentOS-* \
&& sed -i -e "s|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g" /etc/yum.repos.d/CentOS-*
RUN mkdir -p /pkgs/rpm \
&& yum install -y https://ci1.netdef.org/artifact/LIBYANG-LIBYANGV2/shared/build-2/CentOS-8-x86_64-Packages/libyang2-2.0.0.10.g2eb910e4-1.el8.x86_64.rpm \
&& yum install -y https://ci1.netdef.org/artifact/LIBYANG-LIBYANG2/shared/build-00181/RedHat-8-x86_64-Packages/libyang-2.1.80-1.el8.x86_64.rpm \
https://ci1.netdef.org/artifact/RPKI-RTRLIB/shared/build-00146/CentOS-7-x86_64-Packages/librtr-0.8.0-1.el7.x86_64.rpm
COPY --from=centos-8-builder /rpmbuild/RPMS/ /pkgs/rpm/

View File

@ -37,13 +37,14 @@ RUN microdnf --disableplugin=subscription-manager --setopt=install_weak_deps=0 i
systemd-devel \
texinfo \
tzdata \
protobuf-c-devel \
&& microdnf --disableplugin=subscription-manager clean all
RUN curl -sSL -o /tmp/libyang2.rpm https://ci1.netdef.org/artifact/LIBYANG-LIBYANGV2/shared/build-12/RedHat-8-x86_64-Packages/libyang2-2.0.7-1.el8.x86_64.rpm \
RUN curl -sSL -o /tmp/libyang2.rpm https://ci1.netdef.org/artifact/LIBYANG-LIBYANG2/shared/build-181/RedHat-8-x86_64-Packages/libyang-2.1.80-1.el8.x86_64.rpm \
&& rpm -i /tmp/libyang2.rpm \
&& rm -f /tmp/libyang2.rpm
RUN curl -sSL -o /tmp/libyang2-devel.rpm https://ci1.netdef.org/artifact/LIBYANG-LIBYANGV2/shared/build-12/RedHat-8-x86_64-Packages/libyang2-devel-2.0.7-1.el8.x86_64.rpm \
RUN curl -sSL -o /tmp/libyang2-devel.rpm https://ci1.netdef.org/artifact/LIBYANG-LIBYANG2/shared/build-181/RedHat-8-x86_64-Packages/libyang-devel-2.1.80-1.el8.x86_64.rpm \
&& rpm -i /tmp/libyang2-devel.rpm \
&& rm -f /tmp/libyang2-devel.rpm
@ -102,7 +103,7 @@ RUN microdnf --disableplugin=subscription-manager --setopt=install_weak_deps=0 i
systemd \
&& microdnf --disableplugin=subscription-manager clean all
RUN curl -sSL -o /tmp/libyang2.rpm https://ci1.netdef.org/artifact/LIBYANG-LIBYANGV2/shared/build-12/RedHat-8-x86_64-Packages/libyang2-2.0.7-1.el8.x86_64.rpm \
RUN curl -sSL -o /tmp/libyang2.rpm https://ci1.netdef.org/artifact/LIBYANG-LIBYANG2/shared/build-181/RedHat-8-x86_64-Packages/libyang-2.1.80-1.el8.x86_64.rpm \
&& rpm -i /tmp/libyang2.rpm \
&& rm -f /tmp/libyang2.rpm

View File

@ -184,7 +184,7 @@ BuildRequires: make
BuildRequires: ncurses-devel
BuildRequires: readline-devel
BuildRequires: texinfo
BuildRequires: libyang2-devel
BuildRequires: libyang-devel >= 2.1.80
%if 0%{?rhel} && 0%{?rhel} < 7
#python27-devel is available from ius community repo for RedHat/CentOS 6
BuildRequires: python27-devel

View File

@ -302,7 +302,7 @@ parts:
- libpcre2-8-0
source: https://github.com/CESNET/libyang.git
source-type: git
source-tag: v2.0.7
source-tag: v2.1.80
plugin: cmake
configflags:
- -DCMAKE_INSTALL_PREFIX:PATH=/usr