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
24 changes: 19 additions & 5 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ stages:
vmImage: ubuntu-latest

container:
image: sonicdev-microsoft.azurecr.io:443/sonic-slave-bookworm:latest
image: sonicdev-microsoft.azurecr.io:443/sonic-slave-trixie:latest

steps:
- checkout: self
Expand All @@ -50,8 +50,13 @@ stages:
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/$(BUILD_BRANCH)'
patterns: |
target/debs/bookworm/libyang*.deb
target/python-wheels/bookworm/sonic_yang_models*.whl
target/debs/trixie/libpcre3_*.deb
target/debs/trixie/libpcre16-3_*.deb
target/debs/trixie/libpcre32-3_*.deb
target/debs/trixie/libpcrecpp0v5_*.deb
target/debs/trixie/libpcre3-dev_*.deb
target/debs/trixie/libyang*.deb
target/python-wheels/trixie/sonic_yang_models*.whl
displayName: "Download sonic buildimage"

- script: |
Expand All @@ -63,12 +68,21 @@ stages:
sudo sed -ri 's/redis-server.sock/redis.sock/' /etc/redis/redis.conf
sudo service redis-server start

# LIBPCRE3 (not in Trixie repos, required by libyang 1.0.73)
sudo dpkg -i ../target/debs/trixie/libpcre3_*.deb \
../target/debs/trixie/libpcre16-3_*.deb \
../target/debs/trixie/libpcre32-3_*.deb \
../target/debs/trixie/libpcrecpp0v5_*.deb

# LIBPCRE3-DEV (required by libyang-dev)
sudo dpkg -i ../target/debs/trixie/libpcre3-dev_*.deb

# LIBYANG
sudo dpkg -i ../target/debs/bookworm/libyang*1.0.73*.deb
sudo dpkg -i ../target/debs/trixie/libyang*1.0.73*.deb
displayName: "Install dependency"

- script: |
sudo pip3 install ../target/python-wheels/bookworm/sonic_yang_models-1.0-py3-none-any.whl
sudo pip3 install ../target/python-wheels/trixie/sonic_yang_models-1.0-py3-none-any.whl
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

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

This pip install uses a hard-coded wheel filename (sonic_yang_models-1.0-py3-none-any.whl) but the downloaded artifact pattern is sonic_yang_models*.whl. If the wheel version/build tag changes, the pipeline will fail even though the artifact was downloaded. Consider installing via a wildcard/path discovery (or using the exact filename produced by the buildimage pipeline) to keep this step resilient to version bumps.

Suggested change
sudo pip3 install ../target/python-wheels/trixie/sonic_yang_models-1.0-py3-none-any.whl
set -- ../target/python-wheels/trixie/sonic_yang_models*.whl
if [ "$1" = "../target/python-wheels/trixie/sonic_yang_models*.whl" ]; then
echo "No sonic_yang_models wheel found under ../target/python-wheels/trixie/"
exit 1
fi
if [ "$#" -ne 1 ]; then
echo "Expected exactly one sonic_yang_models wheel, found $#"
ls -1 ../target/python-wheels/trixie/sonic_yang_models*.whl
exit 1
fi
sudo pip3 install "$1"

Copilot uses AI. Check for mistakes.
displayName: "Install sonic yangs"

- script: |
Expand Down
2 changes: 1 addition & 1 deletion cvl/cvl.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ func loadSchemaFiles() CVLRetCode {
// Now parse each schema file
var module *yparser.YParserModule
if module, _ = yparser.ParseSchemaFile(modelFilePath); module == nil {
CVL_LOG(FATAL, fmt.Sprintf("Unable to parse schema file %s", modelFile))
CVL_LOG(FATAL, "Unable to parse schema file %s", modelFile)
return CVL_ERROR
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ require (
google.golang.org/protobuf v1.21.0 // indirect
)

go 1.21
go 1.24.4
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

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

The go.mod "go" directive typically only accepts a major.minor language version (e.g., "go 1.24"); using a patch version like "1.24.4" can make go.mod parsing fail. If you need to pin the toolchain patch level, keep "go 1.24" and add a separate "toolchain go1.24.4" directive.

Suggested change
go 1.24.4
go 1.24
toolchain go1.24.4

Copilot uses AI. Check for mistakes.
11 changes: 11 additions & 0 deletions translib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,17 @@ $(TRANSFORMER_TEST_APP_BIN): $(TRANSFORMER_ALL_SRCS) $(TRANSLIB_MAIN_SRCS) $(YGO

$(YGOT_BINDS): $(YANG_FILES)
$(RM) $@
# Go 1.24+ changed 'go mod vendor' to only include packages directly
# imported by the module. The ygot tool packages and their dependencies
# are used by 'go run' below but not directly imported, so they are no
# longer vendored automatically. Add them to vendor/modules.txt.
@grep -q 'github.com/openconfig/ygot/ygen' $(TOPDIR)/vendor/modules.txt 2>/dev/null || \
( echo "github.com/openconfig/gnmi/ctree" >> $(TOPDIR)/vendor/modules.txt && \
echo "github.com/openconfig/gnmi/errlist" >> $(TOPDIR)/vendor/modules.txt && \
echo "github.com/openconfig/gnmi/proto/gnmi" >> $(TOPDIR)/vendor/modules.txt && \
echo "github.com/openconfig/ygot/genutil" >> $(TOPDIR)/vendor/modules.txt && \
echo "github.com/openconfig/ygot/generator" >> $(TOPDIR)/vendor/modules.txt && \
echo "github.com/openconfig/ygot/ygen" >> $(TOPDIR)/vendor/modules.txt )
$(GO) run \
--mod=vendor \
$(TOPDIR)/vendor/github.com/openconfig/ygot/generator/generator.go \
Comment on lines +72 to 85
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

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

Editing vendor/modules.txt by appending raw package paths is very likely to produce an invalid or misleading modules.txt, because entries are expected to be grouped under a corresponding "# " header (and optionally "## explicit"). Appending at EOF can associate these packages with the wrong module header or leave them without one, and it also makes the build non-reproducible by mutating generated vendoring output during the build. Prefer making vendoring include the needed tool packages (e.g., add a build-tagged tools file with blank imports for the ygot generator/ygen deps and regenerate vendor), rather than patching modules.txt in-place.

Suggested change
# Go 1.24+ changed 'go mod vendor' to only include packages directly
# imported by the module. The ygot tool packages and their dependencies
# are used by 'go run' below but not directly imported, so they are no
# longer vendored automatically. Add them to vendor/modules.txt.
@grep -q 'github.com/openconfig/ygot/ygen' $(TOPDIR)/vendor/modules.txt 2>/dev/null || \
( echo "github.com/openconfig/gnmi/ctree" >> $(TOPDIR)/vendor/modules.txt && \
echo "github.com/openconfig/gnmi/errlist" >> $(TOPDIR)/vendor/modules.txt && \
echo "github.com/openconfig/gnmi/proto/gnmi" >> $(TOPDIR)/vendor/modules.txt && \
echo "github.com/openconfig/ygot/genutil" >> $(TOPDIR)/vendor/modules.txt && \
echo "github.com/openconfig/ygot/generator" >> $(TOPDIR)/vendor/modules.txt && \
echo "github.com/openconfig/ygot/ygen" >> $(TOPDIR)/vendor/modules.txt )
$(GO) run \
--mod=vendor \
$(TOPDIR)/vendor/github.com/openconfig/ygot/generator/generator.go \
# Run the ygot generator through normal module resolution instead of
# mutating vendor/modules.txt at build time. Editing vendor metadata
# in-place is not reproducible and can leave modules.txt invalid.
$(GO) run \
--mod=mod \
github.com/openconfig/ygot/generator \

Copilot uses AI. Check for mistakes.
Expand Down