IP Library Granted Patent US 12,277,411
Granted Patent B2
US 12,277,411 · App. 18/130,337 · Granted Apr 15, 2025

Calculating lowest dependency version compatible with dependency specification

Inventors: Leigh Griffin (Waterford, IE); Anne Mulhern (Westford, MA)
Assignee: Red Hat, Inc.
G06F8/43G06F8/34G06F8/423G06F8/433G06F8/71G06F16/221G06F16/2379G06F21/568H04N21/26258
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,277,411
App. No.
18/130,337
Granted
Apr 15, 2025
Kind
B2
Abstract

Embodiments of the present disclosure involve determining, for each package required for execution of an application, the lowest version that is compatible with a dependency specification of the package. For each of a set of packages required to execute an application: analyzing a dependency specification corresponding to the package to determine a set of relations, the set of relations defining version numbers of the package that are compatible with the application. The set of relations may be desugared to generate a basic format set of relations, and conflicting relations may be removed from the basic format set of relations. Duplicate relations may also be removed from the basic format set of relations to generate a deduplicated set of relations. A lowest version of the package that is compatible with the dependency specification may be determined based on operators used among the deduplicated set of relations.

Claims (81)

1. A method comprising:

for each of a set of packages required to execute an application:

analyzing, by a processing device, a dependency specification corresponding to the package to determine a set of relations, the set of relations defining version numbers of the package that are compatible with the application;

desugaring the set of relations to generate a basic format set of relations;

removing conflicting relations from the basic format set of relations;

removing duplicate relations from the basic format set of relations to generate a deduplicated set of relations; and

determining a lowest version of the package that is compatible with the dependency specification based on operators used among the deduplicated set of relations.

2. The method of claim 1 , further comprising:

for each of the set of packages required to execute the application, annotating the corresponding dependency specification with the determined lowest version of the package.

3. The method of claim 1 , wherein desugaring the set of relations comprises:

comparing each relation of the set of relations to a set of desugaring rules to determine a basic format of the relation.

4. The method of claim 1 , wherein determining the lowest version of the package that is compatible with the dependency specification comprises:

in response to determining that there is only a single relation among the deduplicated set of relations that includes an equivalency operator, determining whether the single relation is compatible with each of the other relations in the deduplicated set of relations; and

if the single relation is compatible with each of the other relations in the deduplicated set of relations, identifying a version number specified by the single relation as the lowest version of the package that is compatible with the application.

5. The method of claim 1 , wherein determining the lowest version of the package that is compatible with the dependency specification comprises:

in response to determining that there are multiple relations among the deduplicated set of relations that includes an equivalency operator, randomly selecting a first relation of the multiple relations and discarding the others;

determining whether the first relation is compatible with each of the other relations in the deduplicated set of relations; and

if the first relation is compatible with each of the other relations in the deduplicated set of relations, identifying a version number specified by the first relation as the lowest version of the package that is compatible with the application.

6. The method of claim 5 , further comprising:

in response to determining that the first relation is not compatible with each of the other relations in the deduplicated set of relations:

randomly selecting a second relation of the multiple relations and discarding the others;

determining whether the second relation is compatible with each of the other relations in the deduplicated set of relations; and

if the second relation is compatible with each of the other relations in the deduplicated set of relations, identifying a version number specified by the second relation as the lowest version of the package that is compatible with the application.

7. The method of claim 1 , wherein determining the lowest version of the package that is compatible with the application comprises:

in response to determining that relations within the deduplicated set of relations include only greater than/equal to operators and less than operators:

identifying a largest version number corresponding to a greater than/equal to operator;

identifying a smallest version number corresponding to a less than operator; and

if the smallest version number is less than or equal to the largest version number, identifying the smallest version number as the lowest version of the package that is compatible with the application.

8. A system comprising:

a memory; and

a processing device operatively coupled to the memory, the processing device to:

for each of a set of packages required to execute an application:

analyze a dependency specification corresponding to the package to determine a set of relations, the set of relations defining version numbers of the package that are compatible with the application;

desugar the set of relations to generate a basic format set of relations;

remove conflicting relations from the basic format set of relations;

remove duplicate relations from the basic format set of relations to generate a deduplicated set of relations; and

determine a lowest version of the package that is compatible with the dependency specification based on operators used among the deduplicated set of relations.

9. The system of claim 8 , wherein the processing device is further to:

for each of the set of packages required to execute the application, annotate the corresponding dependency specification with the determined lowest version of the package.

10. The system of claim 8 , wherein to desugar the set of relations, the processing device is to:

compare each relation of the set of relations to a set of desugaring rules to determine a basic format of the relation.

11. The system of claim 8 , wherein to determine the lowest version of the package that is compatible with the dependency specification, the processing device is to:

in response to determining that there is only a single relation among the deduplicated set of relations that includes an equivalency operator, determine whether the single relation is compatible with each of the other relations in the deduplicated set of relations; and

if the single relation is compatible with each of the other relations in the deduplicated set of relations, identify a version number specified by the single relation as the lowest version of the package that is compatible with the application.

12. The system of claim 8 , wherein to determine the lowest version of the package that is compatible with the dependency specification, the processing device is to:

in response to determining that there are multiple relations among the deduplicated set of relations that includes an equivalency operator, randomly select a first relation of the multiple relations and discarding the others;

determine whether the first relation is compatible with each of the other relations in the deduplicated set of relations; and

if the first relation is compatible with each of the other relations in the deduplicated set of relations, identify a version number specified by the first relation as the lowest version of the package that is compatible with the application.

13. The system of claim 12 , wherein the processing device is further to:

in response to determining that the first relation is not compatible with each of the other relations in the deduplicated set of relations:

randomly select a second relation of the multiple relations and discarding the others;

determining whether the second relation is compatible with each of the other relations in the deduplicated set of relations; and

if the second relation is compatible with each of the other relations in the deduplicated set of relations, identify a version number specified by the second relation as the lowest version of the package that is compatible with the application.

14. The system of claim 8 , wherein to determine the lowest version of the package that is compatible with the application, the processing device is to:

in response to determining that relations within the deduplicated set of relations include only greater than/equal to operators and less than operators:

identify a largest version number corresponding to a greater than/equal to operator;

identify a smallest version number corresponding to a less than operator; and

if the smallest version number is less than or equal to the largest version number, identify the smallest version number as the lowest version of the package that is compatible with the application.

15. A non-transitory computer-readable medium having instructions stored thereon which, when executed by a processing device, cause the processing device to:

for each of a set of packages required to execute an application:

analyze a dependency specification corresponding to the package to determine a set of relations, the set of relations defining version numbers of the package that are compatible with the application;

desugar the set of relations to generate a basic format set of relations;

remove conflicting relations from the basic format set of relations;

remove duplicate relations from the basic format set of relations to generate a deduplicated set of relations; and

determine a lowest version of the package that is compatible with the dependency specification based on operators used among the deduplicated set of relations.

16. The non-transitory computer-readable medium of claim 15 , wherein the processing device is further to:

for each of the set of packages required to execute the application, annotate the corresponding dependency specification with the determined lowest version of the package.

17. The non-transitory computer-readable medium of claim 15 , wherein to desugar the set of relations, the processing device is to:

compare each relation of the set of relations to a set of desugaring rules to determine a basic format of the relation.

18. The non-transitory computer-readable medium of claim 15 , wherein to determine the lowest version of the package that is compatible with the dependency specification, the processing device is to:

in response to determining that there is only a single relation among the deduplicated set of relations that includes an equivalency operator, determine whether the single relation is compatible with each of the other relations in the deduplicated set of relations; and

if the single relation is compatible with each of the other relations in the deduplicated set of relations, identify a version number specified by the single relation as the lowest version of the package that is compatible with the application.

19. The non-transitory computer-readable medium of claim 15 , wherein to determine the lowest version of the package that is compatible with the dependency specification, the processing device is to:

in response to determining that there are multiple relations among the deduplicated set of relations that includes an equivalency operator, randomly select a first relation of the multiple relations and discarding the others;

determine whether the first relation is compatible with each of the other relations in the deduplicated set of relations; and

if the first relation is compatible with each of the other relations in the deduplicated set of relations, identify a version number specified by the first relation as the lowest version of the package that is compatible with the application.

20. The non-transitory computer-readable medium of claim 19 , wherein the processing device is further to:

in response to determining that the first relation is not compatible with each of the other relations in the deduplicated set of relations:

randomly select a second relation of the multiple relations and discarding the others;

determining whether the second relation is compatible with each of the other relations in the deduplicated set of relations; and

if the second relation is compatible with each of the other relations in the deduplicated set of relations, identify a version number specified by the second relation as the lowest version of the package that is compatible with the application.

Assignments (2)
CHANGE OF NAME Recorded Mar 3, 2026
From: RED HAT, INC.
To: RED HAT, LLC
Reel/Frame 074913/0759 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded May 26, 2023
From: GRIFFIN, LEIGH; MULHERN, ANNE
To: RED HAT, INC.
Reel/Frame 063777/0878 →