Skip to content

Commit

Permalink
make the change, provides -> vendored as expected
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Hall <[email protected]>
  • Loading branch information
imjasonh committed Jul 11, 2024
1 parent 23771e9 commit d7c7fda
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 28 deletions.
4 changes: 2 additions & 2 deletions pkg/sca/sca.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,9 @@ func generateSharedObjectNameDeps(ctx context.Context, hdl SCAHandle, generated
for _, soname := range sonames {
libver := sonameLibver(soname)

if allowedPrefix(path, libDirs) {
if allowedPrefix(path, libDirs) &&
// .so's in site-packages are not considered provides, they're vendored.
//!strings.Contains(path, "site-packages") {
!strings.Contains(path, "site-packages") {
if !hdl.Options().NoProvides {
generated.Provides = append(generated.Provides, fmt.Sprintf("so:%s=%s", soname, libver))
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/sca/sca_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,9 @@ func TestSitePackagesSODeps(t *testing.T) {
"cmd:pyftmerge=0.13.2-r0",
"cmd:pyftsubset=0.13.2-r0",
"cmd:ttx=0.13.2-r0",
"so:libXau-154567c4.so.6.0.0=6.0.0",
}),
Vendored: util.Dedup([]string{
"pc:numpy=2.0.0",
"so:libbrotlicommon-3ecfe81c.so.1=1",
"so:libbrotlidec-ba690955.so.1=1",
"so:libfreetype-be14bf51.so.6.20.1=6.20.1",
Expand All @@ -305,11 +307,9 @@ func TestSitePackagesSODeps(t *testing.T) {
"so:libwebp-2fd3cdca.so.7.1.9=7.1.9",
"so:libwebpdemux-f2642bcc.so.2.0.15=2.0.15",
"so:libwebpmux-d524b4d5.so.3.1.0=3.1.0",
"so:libXau-154567c4.so.6.0.0=6.0.0",
"so:libxcb-b8a56d01.so.1.1.0=1.1.0",
}),
Vendored: util.Dedup([]string{
"pc:numpy=2.0.0",
}),
}

got := config.Dependencies{}
Expand Down
25 changes: 3 additions & 22 deletions pkg/sca/testdata/generated/x86_64/APKINDEX.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"Origin": "py3-seaborn",
"Maintainer": "",
"URL": "",
"Checksum": "q9P+r+kcudXekTlFqDyRQ3G8N40=",
"Checksum": "cni9CM1COnur18JkHDh9AS1kj7E=",
"Dependencies": [
"cmd:python3.12",
"numpy",
Expand All @@ -61,29 +61,10 @@
"cmd:numpy-config=0.13.2-r0",
"cmd:pyftmerge=0.13.2-r0",
"cmd:pyftsubset=0.13.2-r0",
"cmd:ttx=0.13.2-r0",
"so:libXau-154567c4.so.6.0.0=6.0.0",
"so:libbrotlicommon-3ecfe81c.so.1=1",
"so:libbrotlidec-ba690955.so.1=1",
"so:libfreetype-be14bf51.so.6.20.1=6.20.1",
"so:libgfortran-040039e1-0352e75f.so.5.0.0=5.0.0",
"so:libharfbuzz-89381d8f.so.0.60850.0=0.60850.0",
"so:libjpeg-77ae51ab.so.62.4.0=62.4.0",
"so:liblcms2-e69eef39.so.2.0.16=2.0.16",
"so:liblzma-13fa198c.so.5.4.5=5.4.5",
"so:libopenjp2-05423b53.so=0",
"so:libpng16-58efbb84.so.16.43.0=16.43.0",
"so:libquadmath-96973f99-934c22de.so.0.0.0=0.0.0",
"so:libscipy_openblas64_-99b71e71.so=0",
"so:libsharpyuv-898c0cb5.so.0.1.0=0.1.0",
"so:libtiff-0a86184d.so.6.0.2=6.0.2",
"so:libwebp-2fd3cdca.so.7.1.9=7.1.9",
"so:libwebpdemux-f2642bcc.so.2.0.15=2.0.15",
"so:libwebpmux-d524b4d5.so.3.1.0=3.1.0",
"so:libxcb-b8a56d01.so.1.1.0=1.1.0"
"cmd:ttx=0.13.2-r0"
],
"InstallIf": null,
"Size": 70266592,
"Size": 70266593,
"InstalledSize": 214917013,
"ProviderPriority": 0,
"BuildTime": "1970-01-01T00:00:00Z",
Expand Down
Binary file modified pkg/sca/testdata/generated/x86_64/APKINDEX.tar.gz
Binary file not shown.
Binary file modified pkg/sca/testdata/generated/x86_64/py3-seaborn-0.13.2-r0.apk
Binary file not shown.

0 comments on commit d7c7fda

Please sign in to comment.