-
Install Rust using rustup.
-
Install Protobuf compiler (
protoc
)# Ubuntu sudo apt-get install protobuf-compiler # Windows winget install -e --id Google.Protobuf
-
Install libswsscommon and its dependencies (optional, for swss-common/hamgrd, Linux only)
-
Clone the swss-common repo
git clone https://github.com/sonic-net/sonic-swss-common
-
Modify
loadLoadScript
fromsonic-swss-common/common/redisapi.h
to change hard-coded paths.You can do this by hand, or apply the following patch. (Modify the part in
<>
to point to the directory where you cloned sonic-swss-common)diff --git a/common/redisapi.h b/common/redisapi.h index bdb32b5..cb44c38 100644 --- a/common/redisapi.h +++ b/common/redisapi.h @@ -63,7 +63,7 @@ static inline std::string loadLuaScript(const std::string& path) { SWSS_LOG_ENTER(); - return readTextFile("/usr/share/swss/" + path); + return readTextFile("<path to sonic-swss-common>/common/" + path); } static inline std::set<std::string> runRedisScript(RedisContext &ctx, const std::string& sha,
-
Build the repo using the instructions from their README.
(Their README is a bit out of date, and is missing some dependencies. Sorry about that.)
cd sonic-swss-common ./autogen.sh ./configure make -j `nproc`
-
Set
SWSS_COMMON_REPO
andLD_LIBRARY_PATH
to the local paths of sonic-swss-common.export SWSS_COMMON_REPO="<path to sonic-swss-common>" export LD_LIBRARY_PATH="$SWSS_COMMON_REPO/common/.libs"
-
-
Install GNU Make (optional)
# Ubuntu sudo apt-get install make # Windows winget install -e --id GnuWin32.Make
See the contributors guide for information about how to contribute.