Skip to content

Commit

Permalink
Bump Thrift version from 0.13.0 to 0.14.1 (#9881)
Browse files Browse the repository at this point in the history
#### Why I did it
To bump the Thrift version to 0.14.1 
- To avoid [CVE-2020-13949](https://nvd.nist.gov/vuln/detail/CVE-2020-13949) 
- to fix some dependencies issues

#### How I did it
- rename `src/thrfit_0_13_0` to `src/thrift_2` to remove version number in the path. (`src/thrift` contains rules to build thrift 0.11.0  )
- Add thrift sources as submodule as there are no prepared debian packages for version >0.13.0 on [debian.org](https://packages.debian.org/search?searchon=sourcenames&keywords=thrift)
- Added patches with fixes for original thrift debian rules:(remove unneeded packages, fix multi job build)
#### How to verify it
```
BLDENV=buster make -f Makefile.work target/debs/buster/libthrift-dev_0.14.1_amd64.deb
```
  • Loading branch information
Myron Sosyak authored Feb 16, 2022
1 parent 9677401 commit 125fe99
Show file tree
Hide file tree
Showing 13 changed files with 322 additions and 146 deletions.
5 changes: 4 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,7 @@
url = https://github.com/Azure/sonic-linkmgrd.git
[submodule "src/sonic-p4rt/sonic-pins"]
path = src/sonic-p4rt/sonic-pins
url = https://github.com/Azure/sonic-pins.git
url = https://github.com/Azure/sonic-pins.git
[submodule "src/thrift_0_14_1/thrift"]
path = src/thrift_0_14_1/thrift
url = https://github.com/apache/thrift.git
4 changes: 2 additions & 2 deletions platform/broadcom/libsaithrift-dev.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ LIBSAITHRIFT_DEV = libsaithrift$(SAITHRIFT_VER)-dev_$(SAI_VER)_amd64.deb
$(LIBSAITHRIFT_DEV)_SRC_PATH = $(SRC_PATH)/sonic-sairedis/SAI
#Support two different versions of thrift
ifeq ($(SAITHRIFT_V2),y)
$(LIBSAITHRIFT_DEV)_DEPENDS += $(LIBTHRIFT_0_13_0) $(LIBTHRIFT_DEV_0_13_0) $(PYTHON3_THRIFT_0_13_0) $(THRIFT_COMPILER_0_13_0)
$(LIBSAITHRIFT_DEV)_RDEPENDS += $(LIBTHRIFT_0_13_0)
$(LIBSAITHRIFT_DEV)_DEPENDS += $(LIBTHRIFT_0_14_1) $(LIBTHRIFT_DEV_0_14_1) $(PYTHON3_THRIFT_0_14_1) $(THRIFT_COMPILER_0_14_1)
$(LIBSAITHRIFT_DEV)_RDEPENDS += $(LIBTHRIFT_0_14_1)
$(LIBSAITHRIFT_DEV)_BUILD_ENV = SAITHRIFTV2=true SAITHRIFT_VER=v2
else
$(LIBSAITHRIFT_DEV)_DEPENDS += $(LIBTHRIFT) $(LIBTHRIFT_DEV) $(PYTHON_THRIFT) $(THRIFT_COMPILER)
Expand Down
8 changes: 0 additions & 8 deletions rules/thrift_0_13_0.dep

This file was deleted.

17 changes: 0 additions & 17 deletions rules/thrift_0_13_0.mk

This file was deleted.

8 changes: 8 additions & 0 deletions rules/thrift_0_14_1.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
SPATH := $($(LIBTHRIFT_0_14_1)_SRC_PATH)
DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/thrift_0_14_1.mk rules/thrift_0_14_1.dep
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
DEP_FILES += $(shell git ls-files $(SPATH))

$(LIBTHRIFT_0_14_1)_CACHE_MODE := GIT_CONTENT_SHA
$(LIBTHRIFT_0_14_1)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
$(LIBTHRIFT_0_14_1)_DEP_FILES := $(DEP_FILES)
20 changes: 20 additions & 0 deletions rules/thrift_0_14_1.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# thrift package

THRIFT_0_14_1_VERSION = 0.14.1
THRIFT_0_14_1_VERSION_FULL = $(THRIFT_0_14_1_VERSION)

LIBTHRIFT_0_14_1 = libthrift0_$(THRIFT_0_14_1_VERSION)_$(CONFIGURED_ARCH).deb
$(LIBTHRIFT_0_14_1)_SRC_PATH = $(SRC_PATH)/thrift_0_14_1/thrift
SONIC_DPKG_DEBS += $(LIBTHRIFT_0_14_1)

LIBTHRIFT_0_14_1_DEV = libthrift-dev_$(THRIFT_0_14_1_VERSION)_$(CONFIGURED_ARCH).deb
$(eval $(call add_derived_package,$(LIBTHRIFT_0_14_1),$(LIBTHRIFT_0_14_1_DEV)))

PYTHON3_THRIFT_0_14_1 = python3-thrift_$(THRIFT_0_14_1_VERSION)_$(CONFIGURED_ARCH).deb
$(eval $(call add_derived_package,$(LIBTHRIFT_0_14_1),$(PYTHON3_THRIFT_0_14_1)))

PYTHON_THRIFT_0_14_1 = python-thrift_$(THRIFT_0_14_1_VERSION)_$(CONFIGURED_ARCH).deb
$(eval $(call add_derived_package,$(LIBTHRIFT_0_14_1),$(PYTHON_THRIFT_0_14_1)))

THRIFT_0_14_1_COMPILER = thrift-compiler_$(THRIFT_0_14_1_VERSION)_$(CONFIGURED_ARCH).deb
$(eval $(call add_derived_package,$(LIBTHRIFT_0_14_1),$(THRIFT_0_14_1_COMPILER)))
1 change: 0 additions & 1 deletion src/thrift_0_13_0/.gitignore

This file was deleted.

32 changes: 0 additions & 32 deletions src/thrift_0_13_0/Makefile

This file was deleted.

85 changes: 0 additions & 85 deletions src/thrift_0_13_0/patch/0001-Remove-unneeded-packages.patch

This file was deleted.

1 change: 1 addition & 0 deletions src/thrift_0_14_1/thrift
Submodule thrift added at f6fa17
118 changes: 118 additions & 0 deletions src/thrift_0_14_1/thrift.patch/0001-Remove-unneeded-packages.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
From e9e789bdeb4eb3ae5bf905f83171c66558f29551 Mon Sep 17 00:00:00 2001
From: Myron sosyak <myronx.sosyak@intel.com>
Date: Fri, 28 Jan 2022 15:01:35 +0000
Subject: [PATCH 1/2] Remove unneeded packages

---
debian/control | 83 +++-----------------------------------------------
1 file changed, 5 insertions(+), 78 deletions(-)

diff --git a/debian/control b/debian/control
index a9e934f17..752076582 100644
--- a/debian/control
+++ b/debian/control
@@ -1,14 +1,12 @@
Source: thrift
Section: devel
Priority: extra
-Build-Depends: dotnet-runtime-3.1, dotnet-sdk-3.1, debhelper (>= 9), build-essential, python-dev, ant,
- erlang-base, ruby-dev | ruby1.9.1-dev, ruby-bundler ,autoconf, automake,
- pkg-config, libtool, bison, flex, libboost-dev | libboost1.56-dev | libboost1.63-all-dev,
- python-all, python-setuptools, python-all-dev, python-all-dbg,
+Build-Depends: debhelper (>= 9), build-essential, python-dev,
+ autoconf, automake,
+ pkg-config, libtool,
+ python-all, python-setuptools, python-all-dev,
python3-all, python3-setuptools, python3-all-dev, python3-all-dbg,
- openjdk-8-jdk | openjdk-8-jdk-headless | openjdk-11-jdk | openjdk-11-jdk-headless | default-jdk,
- libboost-test-dev | libboost-test1.56-dev | libboost-test1.63-dev, libevent-dev, libssl-dev, perl (>= 5.8.0-7),
- php (>= 5), php-dev (>= 5), libglib2.0-dev, qtchooser, qtbase5-dev-tools
+ libevent-dev, libssl-dev, libglib2.0-dev
Maintainer: Thrift Developer's <dev@thrift.apache.org>
Homepage: http://thrift.apache.org/
Vcs-Git: https://github.com/apache/thrift.git
@@ -95,65 +93,6 @@ Description: Python bindings for Thrift (debug version)
definition to Python classes, and then the modules in this package will allow
you to use those classes in your programs.

-Package: ruby-thrift
-Architecture: all
-Section: libs
-Depends: ruby | ruby-interpreter, ${shlibs:Depends}, ${misc:Depends}
-Provides: libthrift-ruby
-Replaces: libthrift-ruby
-Breaks: libthrift-ruby
-Description: Ruby bindings for Thrift
- Thrift is a software framework for scalable cross-language services
- development. It combines a software stack with a code generation engine to
- build services that work efficiently and seamlessly.
- .
- This package contains the Ruby bindings for Thrift. You will need the thrift
- tool (in the thrift-compiler package) to compile your definition to Ruby
- classes, and then the modules in this package will allow you to use those
- classes in your programs.
-
-Package: libthrift-java
-Architecture: all
-Section: java
-Depends: ${misc:Depends}
-Description: Java bindings for Thrift
- Thrift is a software framework for scalable cross-language services
- development. It combines a software stack with a code generation engine to
- build services that work efficiently and seamlessly.
- .
- This package contains the Java bindings for Thrift. You will need the thrift
- tool (in the thrift-compiler package) to compile your definition to Java
- classes, and then the modules in this package will allow you to use those
- classes in your programs.
-
-Package: libthrift-netstd
-Architecture: all
-Section: netstd
-Depends: dotnet-runtime-3.1, ${misc:Depends}
-Description: NET Standard bindings for Thrift
- Thrift is a software framework for scalable cross-language services
- development. It combines a software stack with a code generation engine to
- build services that work efficiently and seamlessly.
- .
- This package contains the NET Standard bindings for Thrift. You will need the thrift
- tool (in the thrift-compiler package) to compile your definition to C#
- classes, and then the modules in this package will allow you to use those
- classes in your programs.
-
-Package: libthrift-perl
-Architecture: all
-Section: perl
-Depends: perl (>= 5.8.0-7), ${misc:Depends}
-Description: Perl bindings for Thrift
- Thrift is a software framework for scalable cross-language services
- development. It combines a software stack with a code generation engine to
- build services that work efficiently and seamlessly.
- .
- This package contains the Perl bindings for Thrift. You will need the thrift
- tool (in the thrift-compiler package) to compile your definition to Perl
- classes, and then the modules in this package will allow you to use those
- classes in your programs.
-
Package: libthrift0
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -187,15 +126,3 @@ Description: Thrift C++ library (development headers)
.
This package contains the development libraries required for writing C++
applications using Thrift.
-
-Package: php5-thrift
-Architecture: any
-Section: php
-Depends: ${php:Depends}, ${shlibs:Depends}, ${misc:Depends}
-Provides: ${php:Provides}
-Description: PHP bindings for Thrift
- Thrift is a software framework for scalable cross-language services
- development. It combines a software stack with a code generation engine to
- build services that work efficiently and seamlessly.
- .
- This package contains the PHP bindings for Thrift.
--
2.17.1

Loading

0 comments on commit 125fe99

Please sign in to comment.