-
Notifications
You must be signed in to change notification settings - Fork 110
Description
We need to design improved models for Package, Dependencies, Embeds and Requirements.
Some background:
-
What we routinely calls "dependencies" are not really dependencies: more often these are requirements that are "resolved" to actual concrete dependencies. To really "depend" on a software package, you need to know the exact resolved version. On the other hand, a requirement expresses the need for some range of versions (even if it's a range of a single version).
-
We should distinguish a "require" relationship between packages vs. an actual "resolved" dependency to a concrete version, and track if the resolved dependency is present in the codebase or not.
-
Dependencies (or requirements) may be only documented in a package manifest (like pom.xml) or a lockfile (like package-lock.json), or also be present in the codebase.
-
We need to track also when a package contains another package (or for that matter when an app contains or embeds packages).
Therefore we may have three levels of tree-like data we need to track for packages:
- "potential" requirements (we call these dependencies today). This is a logically a flat list of PURLs with VERS attached to a package instance.
- "resolved" dependencies (we call these dependencies today too, but sometimes also packages). This is logically a tree (or graph) of PURLs with a resolved version. Each such dependency is derived and satisfies one or more "requirement".
- "embeds" are packages embedded in other packages, e.g., they are physically copied, vendor and or built into a product codebase. These could have been the results of provisioning/fetching resolved dependencies, or could be a straight copy. These are not much tracked as such today.
We have agreed on some key model updates, based on discussions here and in our weekly calls:
- Enhance ScanCode.io models to support relating dependencies to packages
- Enhance ScanCode Toolkit models to support relating dependencies to packages
- DJC: Enhance DejaCode models to support relating dependencies to packages dejacode#138
- Enhance PurlDB models to support relating dependencies to packages purldb#485
Enhance python-inspector models to support relating dependencies to packages using the new modelsEnhance nuget-inspector models to support relating dependencies to packages using the new modelsCreate dependency-inspector to relate dependencies to packages using the new models
The https://github.com/nexB/dependency-inspector tickets to create lockfiles are:
- Create a yarn.lock lock file with
yarn
dependency-inspector#3 - Create lock file with
pnpm
dependency-inspector#5 - Create a package-json.lock lock file with
npm
dependency-inspector#4 - Create SwiftPM lockfile dependency-inspector#12
- Create cocoapods lockfile dependency-inspector#10
- Create Python frozen requirements file dependency-inspector#8
- Create .Net lock file with
dotnet restore
and other built in commands dependency-inspector#11
Then for the effective resolution of dependencies as a tree from manifests and lockfiles:
- npm: SCIO: Lock and resolve locked npm dependencies from yarn and npm #1201 and SCIO: Resolve npm dependencies based on lockfiles #1237
- pypi: SCIO: Detect frozen Python requirements locked with deplock #1262
- nuget: SCIO: Detect frozen .NuGet dependencies locked with deplock #1263
- cocoapods: SCIO: Detect and resolve locked Cocoapods requirements #1279
- swift: SCIO: Detect and resolve locked Swift requirements #1278
And beyond:
Here are also some related issues, but not directly need to complete this feature:
- Support packages embedded in other packages
- Improve the definition of a package and dependency
- Introduce successor packages Introduce the concept of a "successor package" to the purldb data model purldb#175
- and also https://github.com/nexB/python-inspector, https://github.com/nexB/nuget-inspector and other inspectors.