]> git.puffer.fish Git - mirror/frr.git/commitdiff
build: libyangv2 is mainlined, update
authorChristian Hopps <chopps@gmail.com>
Thu, 27 May 2021 10:28:01 +0000 (10:28 +0000)
committerIgor Ryzhov <iryzhov@nfware.com>
Fri, 28 May 2021 13:36:56 +0000 (16:36 +0300)
Signed-off-by: Christian Hopps <chopps@gmail.com>
doc/developer/building-libyang.rst
docker/ubuntu18-ci/Dockerfile
docker/ubuntu20-ci/Dockerfile

index 3b33eb38797ee4da962c6ecf2a16dd14549ac110..c36cd34287cfe1e00317d46ed63ec1f62a944711 100644 (file)
@@ -14,8 +14,7 @@ DEB packages are available as CI artifacts `here
 
 .. warning::
 
-   ``libyang`` version 2.0.0 or newer is required to build FRR. Currently a tag
-   (``v2.0.0``) is used from the libyang2 branch.
+   ``libyang`` version 2.0.0 or newer is required to build FRR.
 
 .. note::
 
@@ -25,20 +24,20 @@ DEB packages are available as CI artifacts `here
    packages.
 
    Depending on your platform, you may also need to install the PCRE
-   development package. Typically this is ``libpcre-dev`` or ``pcre-devel``.
+   development package. Typically this is ``libpcre2-dev`` or ``pcre2-devel``.
 
 **Option 2: Source Install**
 
 .. note::
 
    Ensure that the `libyang build requirements
-   <https://github.com/CESNET/libyang/tree/libyang2#build-requirements>`_
+   <https://github.com/CESNET/libyang/#build-requirements>`_
    are met before continuing. Usually this entails installing ``cmake`` and
-   ``libpcre-dev`` or ``pcre-devel``.
+   ``libpcre2-dev`` or ``pcre2-devel``.
 
 .. code-block:: console
 
-   git clone https://github.com/CESNET/libyang.git -b libyang2
+   git clone https://github.com/CESNET/libyang.git
    cd libyang
    git checkout v2.0.0
    mkdir build; cd build
index 86fbe4f49ca3b7097b1b50ce723c399c94d2041a..cf75c3015dd9305682f444655f7c15bebf3d3ee3 100644 (file)
@@ -5,13 +5,19 @@ ENV APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn
 # Update Ubuntu Software repository
 RUN apt update && \
     apt-get install -y \
-      git autoconf automake libtool make libreadline-dev texinfo \
+      git autoconf automake curl libtool make libreadline-dev texinfo \
       pkg-config libpam0g-dev libjson-c-dev bison flex python3-pytest \
       libc-ares-dev python3-dev libsystemd-dev python-ipaddress python3-sphinx \
       install-info build-essential libsystemd-dev libsnmp-dev perl libcap-dev \
       libelf-dev \
       sudo gdb iputils-ping time \
-      mininet python-pip iproute2 iperf && \
+      mininet python-pip iproute2 iperf libpcre2-dev \
+      libpcre3-dev \
+      && \
+    curl -fLO https://ci1.netdef.org/artifact/LIBYANG-LIBYANGV2/shared/build-2/Ubuntu-18.04-x86_64-Packages/libyang2_2.0.0.10.g2eb910e4-1_amd64.deb && \
+    curl -fLO https://ci1.netdef.org/artifact/LIBYANG-LIBYANGV2/shared/build-2/Ubuntu-18.04-x86_64-Packages/libyang2-dev_2.0.0.10.g2eb910e4-1_amd64.deb && \
+    dpkg -i libyang2_2.0.0.10.g2eb910e4-1_amd64.deb libyang2-dev_2.0.0.10.g2eb910e4-1_amd64.deb && \
+    rm -f libyang2_2.0.0.10.g2eb910e4-1_amd64.deb libyang2-dev_2.0.0.10.g2eb910e4-1_amd64.deb && \
       pip install ipaddr && \
       pip install "pytest<5" && \
       pip install "scapy>=2.4.2" && \
@@ -26,22 +32,8 @@ RUN groupadd -r -g 92 frr && \
       echo 'frr ALL = NOPASSWD: ALL' | tee /etc/sudoers.d/frr && \
       mkdir -p /home/frr && chown frr.frr /home/frr
 
-#for libyang 2
-RUN apt-get install -y cmake libpcre2-dev
-
 USER frr:frr
 
-# build and install libyang1
-RUN cd && pwd && ls -al && \
-    git clone https://github.com/CESNET/libyang.git -b libyang2 && \
-    cd libyang && \
-    git checkout v2.0.0 && \
-    mkdir build; cd build && \
-    cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr \
-          -DCMAKE_BUILD_TYPE:String="Release" .. && \
-    make -j $(nproc) && \
-    sudo make install
-
 COPY --chown=frr:frr . /home/frr/frr/
 
 RUN cd && ls -al && ls -al frr
index ead5c56c54986719d516a79b6bdf7d8feae9c961..8a4a156a51519c201f8d24c1042ce9dc4ab840f6 100644 (file)
@@ -5,13 +5,19 @@ ENV APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn
 # Update Ubuntu Software repository
 RUN apt update && \
     apt-get install -y \
-      git autoconf automake libtool make libreadline-dev texinfo \
+      git autoconf automake curl libtool make libreadline-dev texinfo \
       pkg-config libpam0g-dev libjson-c-dev bison flex python3-pytest \
       libc-ares-dev python3-dev libsystemd-dev python-ipaddress python3-sphinx \
       install-info build-essential libsystemd-dev libsnmp-dev perl \
       libcap-dev python2 libelf-dev \
       sudo gdb curl iputils-ping time \
-      mininet iproute2 iperf && \
+      mininet iproute2 iperf libpcre2-dev \
+      libpcre3-dev \
+      && \
+    curl -fLO https://ci1.netdef.org/artifact/LIBYANG-LIBYANGV2/shared/build-2/Ubuntu-20.04-x86_64-Packages/libyang2_2.0.0.10.g2eb910e4-1_amd64.deb && \
+    curl -fLO https://ci1.netdef.org/artifact/LIBYANG-LIBYANGV2/shared/build-2/Ubuntu-20.04-x86_64-Packages/libyang2-dev_2.0.0.10.g2eb910e4-1_amd64.deb && \
+    dpkg -i libyang2_2.0.0.10.g2eb910e4-1_amd64.deb libyang2-dev_2.0.0.10.g2eb910e4-1_amd64.deb && \
+    rm -f libyang2_2.0.0.10.g2eb910e4-1_amd64.deb libyang2-dev_2.0.0.10.g2eb910e4-1_amd64.deb && \
       curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output /tmp/get-pip.py && \
       python2 /tmp/get-pip.py && \
       rm -f  /tmp/get-pip.py && \
@@ -29,22 +35,8 @@ RUN groupadd -r -g 92 frr && \
       echo 'frr ALL = NOPASSWD: ALL' | tee /etc/sudoers.d/frr && \
       mkdir -p /home/frr && chown frr.frr /home/frr
 
-#for libyang 2
-RUN apt-get install -y cmake libpcre2-dev
-
 USER frr:frr
 
-# build and install libyang1
-RUN cd && pwd && ls -al && \
-    git clone https://github.com/CESNET/libyang.git -b libyang2 && \
-    cd libyang && \
-    git checkout v2.0.0 && \
-    mkdir build; cd build && \
-    cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr \
-          -DCMAKE_BUILD_TYPE:String="Release" .. && \
-    make -j $(nproc) && \
-    sudo make install
-
 COPY --chown=frr:frr . /home/frr/frr/
 
 RUN cd && ls -al && ls -al frr