Skip to content

Conversation

@chrngc
Copy link
Contributor

@chrngc chrngc commented Dec 30, 2025

…tPackageVersionToTdnfArg function.

Merge Checklist

All boxes should be checked before merging the PR

  • [] The changes in the PR have been built and tested
  • [] cgmanifest file has been updated if required
  • [] Ready to merge

Description

It was discovered that building a package with its SPEC file having two version arguments for the same depended package will result in the toolkit trying to install the latest version of the depended package.

Example (SPEC file & build command):

BuildRequires: golang < 1.25
BuildRequires: golang >= 1.24.9

sudo make -j8 build-packages \
                      REBUILD_TOOLS=y CONFIG_FILE= \
                      SRPM_PACK_LIST="${specList}" CONCURRENT_PACKAGE_BUILDS=8 \
                      VALIDATE_TOOLCHAIN_GPG=n \

This SPEC file will result in the toolkit choosing to use the latest golang package (v1.25.1)

Investigation leads to the discovery of this specific function: convertPackageVersionToTdnfArg in this file: edge-microvisor-toolkit/toolkit/tools/internal/packagerepo/repocloner/rpmrepocloner/rpmrepocloner.go forgetting to process the second version argument pkgVer.SCondition.

The original code removes the >= argument to avoid overheads. On top of that, it ignores the possibility of the package having a second argument, in this case, <. It was also verified that switching the first and second version argument (switching order) will result in the same outcome.

Any Newly Introduced Dependencies

How Has This Been Tested?

The convertPackageVersionToTdnfArg function in rpmrepocloner.go was modified to be able to process the second version argument when it's required. The same build command was used and the result now showed that the correct version of golang is used:
image

@chrngc chrngc requested a review from a team as a code owner December 30, 2025 07:54
Copy link
Contributor

@liulis-sg liulis-sg left a comment

Choose a reason for hiding this comment

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

see above comment

@cheeyanglee cheeyanglee merged commit 58627b6 into open-edge-platform:3.0-dev Jan 2, 2026
8 of 13 checks passed
cheeyanglee pushed a commit to cheeyanglee/edge-microvisor-toolkit that referenced this pull request Jan 3, 2026
open-edge-platform#654)

* Added support for second package condition/version argument in convertPackageVersionToTdnfArg function.

* fixed syntax

* Added back the original comments on the removal of ">" and ">=" constraints.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants