Skip to content
Merged
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
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ $(GO_MOD):
$(GO) mod init github.com/Azure/sonic-mgmt-framework

$(GO_DEPS): $(GO_MOD) $(GO_CODEGEN_INIT)
@# Run go mod tidy only if installed Go >= go.mod's go directive
@GO_MOD_VER=$$(sed -n 's/^go //p' go.mod) && \
GO_CUR_VER=$$($(GO) env GOVERSION | sed 's/go//') && \
if printf '%s\n' "$$GO_MOD_VER" "$$GO_CUR_VER" | sort -V | head -1 | grep -qx "$$GO_MOD_VER"; then \
echo "Running go mod tidy (Go $$GO_CUR_VER >= go.mod $$GO_MOD_VER)"; \
$(GO) mod tidy; \
else \
echo "Skipping go mod tidy (Go $$GO_CUR_VER < go.mod $$GO_MOD_VER)"; \
fi
$(GO) mod vendor
$(MGMT_COMMON_DIR)/patches/apply.sh vendor
touch $@
Comment on lines 39 to 51

Copilot AI Mar 25, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$(GO_DEPS) only depends on go.mod (and codegen init), but the recipe runs go mod tidy/vendor which reads and may update go.sum. If go.sum changes (e.g., via merge/conflict resolution or dependency update) while vendor/.done already exists, make go-deps won’t rerun and vendor/ can become stale relative to go.sum. Consider adding go.sum as an explicit prerequisite (e.g., define GO_SUM=go.sum and include it in the dependency list) so vendoring is rebuilt when checksums change.

Copilot uses AI. Check for mistakes.
Expand Down
Loading