Skip to content
Open
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
15 changes: 14 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ endif

# download and apply patch for gnmi client, which will break advancetls
# backup crypto and gnxi
mkdir backup_crypto
mkdir -p backup_crypto
cp -r vendor/golang.org/x/crypto/* backup_crypto/

# download and patch crypto and gnxi
Expand All @@ -126,6 +126,17 @@ endif
git apply patches/0001-Updated-to-filter-and-write-to-file.patch
git apply patches/0003-Fix-client-json-parsing-issue.patch

# Manually adding patched client packages and their dependencies
# to vendor/modules.txt. This satisfies 'go install -mod=vendor' lookup checks,
# which are required after manual patching/copying of gnxi and gnmi-cli code.
echo "github.com/google/gnxi v0.0.0-20181220173256-89f51f0ce1e2" >> vendor/modules.txt
echo "github.com/google/gnxi/gnmi_get" >> vendor/modules.txt
echo "github.com/google/gnxi/gnmi_set" >> vendor/modules.txt
echo "github.com/openconfig/gnmi/cli" >> vendor/modules.txt
echo "github.com/openconfig/gnmi/client/flags" >> vendor/modules.txt
echo "golang.org/x/crypto/ssh/terminal" >> vendor/modules.txt
echo "github.com/openconfig/gnmi/cmd/gnmi_cli" >> vendor/modules.txt

ifeq ($(CROSS_BUILD_ENVIRON),y)
$(GO) build -o ${GOBIN}/gnmi_get -mod=vendor github.com/google/gnxi/gnmi_get
$(GO) build -o ${GOBIN}/gnmi_set -mod=vendor github.com/google/gnxi/gnmi_set
Expand Down Expand Up @@ -181,6 +192,8 @@ $(BUILD_GNOI_YANG_PROTO_DIR)/.proto_sonic_done: $(SONIC_YANGS)

$(GNOI_YANG): $(BUILD_GNOI_YANG_PROTO_DIR)/.proto_api_done $(BUILD_GNOI_YANG_PROTO_DIR)/.proto_sonic_done
@echo "+++++ Compiling PROTOBUF files; +++++"
# Remove the toolchain directive added by newer Go versions
sed -i '/^toolchain/d' go.mod
$(GO) install github.com/gogo/protobuf/protoc-gen-gofast
@mkdir -p $(@D)
$(foreach file, $(wildcard $(BUILD_GNOI_YANG_PROTO_DIR)/*/*.proto), PATH=$(PROTOC_PATH) protoc -I$(@D) $(PROTOC_OPTS_WITHOUT_VENDOR) --gofast_out=plugins=grpc,Mgoogle/protobuf/struct.proto=github.com/gogo/protobuf/types:$(BUILD_GNOI_YANG_PROTO_DIR) $(file);)
Expand Down
Loading
Loading