Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package apko for openSUSE:Factory checked in 
at 2025-05-13 20:06:00
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/apko (Old)
 and      /work/SRC/openSUSE:Factory/.apko.new.30101 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "apko"

Tue May 13 20:06:00 2025 rev:51 rq:1276996 version:0.27.6

Changes:
--------
--- /work/SRC/openSUSE:Factory/apko/apko.changes        2025-05-09 
18:51:50.666290345 +0200
+++ /work/SRC/openSUSE:Factory/.apko.new.30101/apko.changes     2025-05-13 
20:06:02.944292087 +0200
@@ -1,0 +2,15 @@
+Tue May 13 04:29:43 UTC 2025 - Johannes Kastl 
<opensuse_buildserv...@ojkastl.de>
+
+- Update to version 0.27.6:
+  * lock: fix up filter for wanted arches (#1670)
+  * ldsocache snapshot/20250507 (#1665)
+
+-------------------------------------------------------------------
+Mon May 12 19:02:25 UTC 2025 - Johannes Kastl 
<opensuse_buildserv...@ojkastl.de>
+
+- Update to version 0.27.5:
+  * build(deps): bump github.com/charmbracelet/log from 0.4.1 to
+    0.4.2 (#1669)
+  * Respect arch flags when using lockfiles (#1664)
+
+-------------------------------------------------------------------

Old:
----
  apko-0.27.4.obscpio

New:
----
  apko-0.27.6.obscpio

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ apko.spec ++++++
--- /var/tmp/diff_new_pack.dMzy6E/_old  2025-05-13 20:06:04.536359065 +0200
+++ /var/tmp/diff_new_pack.dMzy6E/_new  2025-05-13 20:06:04.536359065 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           apko
-Version:        0.27.4
+Version:        0.27.6
 Release:        0
 Summary:        Build OCI images from APK packages directly without Dockerfile
 License:        Apache-2.0

++++++ _service ++++++
--- /var/tmp/diff_new_pack.dMzy6E/_old  2025-05-13 20:06:04.572360579 +0200
+++ /var/tmp/diff_new_pack.dMzy6E/_new  2025-05-13 20:06:04.576360747 +0200
@@ -3,7 +3,7 @@
     <param name="url">https://github.com/chainguard-dev/apko</param>
     <param name="scm">git</param>
     <param name="exclude">.git</param>
-    <param name="revision">v0.27.4</param>
+    <param name="revision">v0.27.6</param>
     <param name="versionformat">@PARENT_TAG@</param>
     <param name="versionrewrite-pattern">v(.*)</param>
     <param name="changesgenerate">enable</param>

++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.dMzy6E/_old  2025-05-13 20:06:04.604361926 +0200
+++ /var/tmp/diff_new_pack.dMzy6E/_new  2025-05-13 20:06:04.608362094 +0200
@@ -1,6 +1,6 @@
 <servicedata>
 <service name="tar_scm">
                 <param 
name="url">https://github.com/chainguard-dev/apko</param>
-              <param 
name="changesrevision">8d3343552cb4e6df0990a48d1c13cfff5a20511f</param></service></servicedata>
+              <param 
name="changesrevision">f19d835ff999789c485ca1ec018c624f96bc7487</param></service></servicedata>
 (No newline at EOF)
 

++++++ apko-0.27.4.obscpio -> apko-0.27.6.obscpio ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/apko-0.27.4/go.mod new/apko-0.27.6/go.mod
--- old/apko-0.27.4/go.mod      2025-05-08 22:10:25.000000000 +0200
+++ new/apko-0.27.6/go.mod      2025-05-13 02:12:44.000000000 +0200
@@ -5,7 +5,7 @@
 require (
        chainguard.dev/sdk v0.1.31
        github.com/chainguard-dev/clog v1.7.0
-       github.com/charmbracelet/log v0.4.1
+       github.com/charmbracelet/log v0.4.2
        github.com/go-git/go-git/v5 v5.16.0
        github.com/google/go-cmp v0.7.0
        github.com/google/go-containerregistry v0.20.3
@@ -50,8 +50,11 @@
        github.com/beorn7/perks v1.0.1 // indirect
        github.com/buger/jsonparser v1.1.1 // indirect
        github.com/cespare/xxhash/v2 v2.3.0 // indirect
-       github.com/charmbracelet/lipgloss v1.0.0 // indirect
-       github.com/charmbracelet/x/ansi v0.4.2 // indirect
+       github.com/charmbracelet/colorprofile 
v0.2.3-0.20250311203215-f60798e515dc // indirect
+       github.com/charmbracelet/lipgloss v1.1.0 // indirect
+       github.com/charmbracelet/x/ansi v0.8.0 // indirect
+       github.com/charmbracelet/x/cellbuf 
v0.0.13-0.20250311204145-2c3ea96c31dd // indirect
+       github.com/charmbracelet/x/term v0.2.1 // indirect
        github.com/cloudflare/circl v1.6.1 // indirect
        github.com/common-nighthawk/go-figure 
v0.0.0-20210622060536-734e95fb86be // indirect
        github.com/containerd/stargz-snapshotter/estargz v0.16.3 // indirect
@@ -88,6 +91,7 @@
        github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
        github.com/mailru/easyjson v0.7.7 // indirect
        github.com/mattn/go-isatty v0.0.20 // indirect
+       github.com/mattn/go-runewidth v0.0.16 // indirect
        github.com/mitchellh/go-homedir v1.1.0 // indirect
        github.com/moby/docker-image-spec v1.3.1 // indirect
        github.com/muesli/termenv v0.16.0 // indirect
@@ -111,6 +115,7 @@
        github.com/vbatts/tar-split v0.11.6 // indirect
        github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect
        github.com/xanzy/ssh-agent v0.3.3 // indirect
+       github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
        go.opentelemetry.io/auto/sdk v1.1.0 // indirect
        
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc 
v0.60.0 // indirect
        go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0 
// indirect
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/apko-0.27.4/go.sum new/apko-0.27.6/go.sum
--- old/apko-0.27.4/go.sum      2025-05-08 22:10:25.000000000 +0200
+++ new/apko-0.27.6/go.sum      2025-05-13 02:12:44.000000000 +0200
@@ -42,12 +42,18 @@
 github.com/cespare/xxhash/v2 v2.3.0/go.mod 
h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
 github.com/chainguard-dev/clog v1.7.0 
h1:guPznsK8vLHvzz1QJe2yU6MFeYaiSOFOQBYw4OXu+g8=
 github.com/chainguard-dev/clog v1.7.0/go.mod 
h1:4+WFhRMsGH79etYXY3plYdp+tCz/KCkU8fAr0HoaPvs=
-github.com/charmbracelet/lipgloss v1.0.0 
h1:O7VkGDvqEdGi93X+DeqsQ7PKHDgtQfF8j8/O2qFMQNg=
-github.com/charmbracelet/lipgloss v1.0.0/go.mod 
h1:U5fy9Z+C38obMs+T+tJqst9VGzlOYGj4ri9reL3qUlo=
-github.com/charmbracelet/log v0.4.1 
h1:6AYnoHKADkghm/vt4neaNEXkxcXLSV2g1rdyFDOpTyk=
-github.com/charmbracelet/log v0.4.1/go.mod 
h1:pXgyTsqsVu4N9hGdHmQ0xEA4RsXof402LX9ZgiITn2I=
-github.com/charmbracelet/x/ansi v0.4.2 
h1:0JM6Aj/g/KC154/gOP4vfxun0ff6itogDYk41kof+qk=
-github.com/charmbracelet/x/ansi v0.4.2/go.mod 
h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw=
+github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc 
h1:4pZI35227imm7yK2bGPcfpFEmuY1gc2YSTShr4iJBfs=
+github.com/charmbracelet/colorprofile 
v0.2.3-0.20250311203215-f60798e515dc/go.mod 
h1:X4/0JoqgTIPSFcRA/P6INZzIuyqdFY5rm8tb41s9okk=
+github.com/charmbracelet/lipgloss v1.1.0 
h1:vYXsiLHVkK7fp74RkV7b2kq9+zDLoEU4MZoFqR/noCY=
+github.com/charmbracelet/lipgloss v1.1.0/go.mod 
h1:/6Q8FR2o+kj8rz4Dq0zQc3vYf7X+B0binUUBwA0aL30=
+github.com/charmbracelet/log v0.4.2 
h1:hYt8Qj6a8yLnvR+h7MwsJv/XvmBJXiueUcI3cIxsyig=
+github.com/charmbracelet/log v0.4.2/go.mod 
h1:qifHGX/tc7eluv2R6pWIpyHDDrrb/AG71Pf2ysQu5nw=
+github.com/charmbracelet/x/ansi v0.8.0 
h1:9GTq3xq9caJW8ZrBTe0LIe2fvfLR/bYXKTx2llXn7xE=
+github.com/charmbracelet/x/ansi v0.8.0/go.mod 
h1:wdYl/ONOLHLIVmQaxbIYEC/cRKOQyjTkowiI4blgS9Q=
+github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd 
h1:vy0GVL4jeHEwG5YOXDmi86oYw2yuYUGqz6a8sLwg0X8=
+github.com/charmbracelet/x/cellbuf 
v0.0.13-0.20250311204145-2c3ea96c31dd/go.mod 
h1:xe0nKWGd3eJgtqZRaN9RjMtK7xUYchjzPr7q6kcvCCs=
+github.com/charmbracelet/x/term v0.2.1 
h1:AQeHeLZ1OqSXhrAWpYUtZyX1T3zVxfpZuEQMIQaGIAQ=
+github.com/charmbracelet/x/term v0.2.1/go.mod 
h1:oQ4enTYFV7QN4m0i9mzHrViD7TQKvNEEkHUMCmsxdUg=
 github.com/client9/misspell v0.3.4/go.mod 
h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
 github.com/cloudflare/circl v1.6.1 
h1:zqIqSPIndyBh1bjLVVDHMPpVKqp8Su/V+6MeDzzQBQ0=
 github.com/cloudflare/circl v1.6.1/go.mod 
h1:uddAzsPgqdMAYatqJ0lsjX1oECcQLIlRpzZh3pJrofs=
@@ -190,6 +196,8 @@
 github.com/mattn/go-colorable v0.1.13/go.mod 
h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
 github.com/mattn/go-isatty v0.0.20 
h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
 github.com/mattn/go-isatty v0.0.20/go.mod 
h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
+github.com/mattn/go-runewidth v0.0.16 
h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc=
+github.com/mattn/go-runewidth v0.0.16/go.mod 
h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
 github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod 
h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
 github.com/mitchellh/go-homedir v1.1.0 
h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
 github.com/mitchellh/go-homedir v1.1.0/go.mod 
h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
@@ -236,6 +244,7 @@
 github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod 
h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
 github.com/prometheus/procfs v0.15.1 
h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
 github.com/prometheus/procfs v0.15.1/go.mod 
h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
+github.com/rivo/uniseg v0.2.0/go.mod 
h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
 github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
 github.com/rivo/uniseg v0.4.7/go.mod 
h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
 github.com/rogpeppe/go-internal v1.14.1 
h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=
@@ -275,6 +284,8 @@
 github.com/wk8/go-ordered-map/v2 v2.1.8/go.mod 
h1:5nJHM5DyteebpVlHnWMV0rPz6Zp7+xBAnxjb1X5vnTw=
 github.com/xanzy/ssh-agent v0.3.3 
h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM=
 github.com/xanzy/ssh-agent v0.3.3/go.mod 
h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw=
+github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e 
h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no=
+github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod 
h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM=
 github.com/yuin/goldmark v1.1.27/go.mod 
h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
 github.com/yuin/goldmark v1.2.1/go.mod 
h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
 github.com/yuin/goldmark v1.4.13/go.mod 
h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
Binary files 
old/apko-0.27.4/internal/cli/testdata/top_image/blobs/sha256/10a1a18309374068005a73edacbd06b17fe67378c95d1e66e0cc2be1270c0328
 and 
new/apko-0.27.6/internal/cli/testdata/top_image/blobs/sha256/10a1a18309374068005a73edacbd06b17fe67378c95d1e66e0cc2be1270c0328
 differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/apko-0.27.4/internal/cli/testdata/top_image/blobs/sha256/14160a36b6fb2f3d325eb09ada490e6ca171285b2ab0cd5d41989c11972eb153
 
new/apko-0.27.6/internal/cli/testdata/top_image/blobs/sha256/14160a36b6fb2f3d325eb09ada490e6ca171285b2ab0cd5d41989c11972eb153
--- 
old/apko-0.27.4/internal/cli/testdata/top_image/blobs/sha256/14160a36b6fb2f3d325eb09ada490e6ca171285b2ab0cd5d41989c11972eb153
       2025-05-08 22:10:25.000000000 +0200
+++ 
new/apko-0.27.6/internal/cli/testdata/top_image/blobs/sha256/14160a36b6fb2f3d325eb09ada490e6ca171285b2ab0cd5d41989c11972eb153
       1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-{"schemaVersion":2,"mediaType":"application/vnd.oci.image.manifest.v1+json","config":{"mediaType":"application/vnd.oci.image.config.v1+json","size":785,"digest":"sha256:c167d5b680a5a084c621b7e9af9973d68ccf6475af4b0858f2067fb556614f3b"},"layers":[{"mediaType":"application/vnd.oci.image.layer.v1.tar+gzip","size":4126,"digest":"sha256:bf74ddaf55d32ec9672a0a40efc6cb1bf0a167763c18fc22586c8a301167822f"},{"mediaType":"application/vnd.oci.image.layer.v1.tar+gzip","size":2885,"digest":"sha256:81168b5de29746299ae4cdb269544f6dff75d8f0e6b03b314cee06723c7e2f6b"}],"annotations":{"org.opencontainers.image.created":"1970-01-01T00:00:00Z"}}
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/apko-0.27.4/internal/cli/testdata/top_image/blobs/sha256/45338ea1681a61ef1ff24b109f0c13aa95113a33cfb684377f8b89fe63b754b5
 
new/apko-0.27.6/internal/cli/testdata/top_image/blobs/sha256/45338ea1681a61ef1ff24b109f0c13aa95113a33cfb684377f8b89fe63b754b5
--- 
old/apko-0.27.4/internal/cli/testdata/top_image/blobs/sha256/45338ea1681a61ef1ff24b109f0c13aa95113a33cfb684377f8b89fe63b754b5
       2025-05-08 22:10:25.000000000 +0200
+++ 
new/apko-0.27.6/internal/cli/testdata/top_image/blobs/sha256/45338ea1681a61ef1ff24b109f0c13aa95113a33cfb684377f8b89fe63b754b5
       1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-{"schemaVersion":2,"mediaType":"application/vnd.oci.image.manifest.v1+json","config":{"mediaType":"application/vnd.oci.image.config.v1+json","size":785,"digest":"sha256:bafb997874b76dcef4ccfbf7d651aaab7ec557ce580053743664d5f7294de0e7"},"layers":[{"mediaType":"application/vnd.oci.image.layer.v1.tar+gzip","size":4123,"digest":"sha256:583625b6164fff3b017f62b9fcd60cb53fff18a7e89ee538212134a13fc29fb1"},{"mediaType":"application/vnd.oci.image.layer.v1.tar+gzip","size":2886,"digest":"sha256:10a1a18309374068005a73edacbd06b17fe67378c95d1e66e0cc2be1270c0328"}],"annotations":{"org.opencontainers.image.created":"1970-01-01T00:00:00Z"}}
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/apko-0.27.4/internal/cli/testdata/top_image/blobs/sha256/4b10507918b5efe4c90ac76f16db810f1716a56f03bed52cdd0343d19ba271f6
 
new/apko-0.27.6/internal/cli/testdata/top_image/blobs/sha256/4b10507918b5efe4c90ac76f16db810f1716a56f03bed52cdd0343d19ba271f6
--- 
old/apko-0.27.4/internal/cli/testdata/top_image/blobs/sha256/4b10507918b5efe4c90ac76f16db810f1716a56f03bed52cdd0343d19ba271f6
       1970-01-01 01:00:00.000000000 +0100
+++ 
new/apko-0.27.6/internal/cli/testdata/top_image/blobs/sha256/4b10507918b5efe4c90ac76f16db810f1716a56f03bed52cdd0343d19ba271f6
       2025-05-13 02:12:44.000000000 +0200
@@ -0,0 +1 @@
+{"schemaVersion":2,"mediaType":"application/vnd.oci.image.manifest.v1+json","config":{"mediaType":"application/vnd.oci.image.config.v1+json","size":785,"digest":"sha256:5c4c61f795999d7bd3ff3f58c301048611bec273fe44160b56b4e08979cda440"},"layers":[{"mediaType":"application/vnd.oci.image.layer.v1.tar+gzip","size":4123,"digest":"sha256:583625b6164fff3b017f62b9fcd60cb53fff18a7e89ee538212134a13fc29fb1"},{"mediaType":"application/vnd.oci.image.layer.v1.tar+gzip","size":2879,"digest":"sha256:711ee9486fdd666205191953b580a158b9e7b00f61226ba901207aa1fcf47fc9"}],"annotations":{"org.opencontainers.image.created":"1970-01-01T00:00:00Z"}}
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/apko-0.27.4/internal/cli/testdata/top_image/blobs/sha256/5c4c61f795999d7bd3ff3f58c301048611bec273fe44160b56b4e08979cda440
 
new/apko-0.27.6/internal/cli/testdata/top_image/blobs/sha256/5c4c61f795999d7bd3ff3f58c301048611bec273fe44160b56b4e08979cda440
--- 
old/apko-0.27.4/internal/cli/testdata/top_image/blobs/sha256/5c4c61f795999d7bd3ff3f58c301048611bec273fe44160b56b4e08979cda440
       1970-01-01 01:00:00.000000000 +0100
+++ 
new/apko-0.27.6/internal/cli/testdata/top_image/blobs/sha256/5c4c61f795999d7bd3ff3f58c301048611bec273fe44160b56b4e08979cda440
       2025-05-13 02:12:44.000000000 +0200
@@ -0,0 +1 @@
+{"architecture":"arm64","author":"github.com/chainguard-dev/apko","created":"1970-01-01T00:00:00Z","history":[{"author":"apko","created":"1970-01-01T00:00:00Z","created_by":"apko","comment":"This
 is an apko single-layer 
image"},{"author":"apko","created":"1970-01-01T00:00:00Z","created_by":"apko","comment":"This
 is an apko single-layer 
image"}],"os":"linux","rootfs":{"type":"layers","diff_ids":["sha256:2888aac57b90cf66093aa48092bf1f1f1b1bdb85bde8601a5f8cf0f06c814763","sha256:784eebdb74c40aa099ac9c540bed2aa82b85358977de5bcdbc77b226886ec772"]},"config":{"Entrypoint":["/bin/sh","-l"],"Env":["PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin","SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt"],"Labels":{"org.opencontainers.image.created":"1970-01-01T00:00:00Z"}}}
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/apko-0.27.4/internal/cli/testdata/top_image/blobs/sha256/6905923b21195a7d29fe6bf23cca9151f99299d09c1d90eb94cff5dc541ed836
 
new/apko-0.27.6/internal/cli/testdata/top_image/blobs/sha256/6905923b21195a7d29fe6bf23cca9151f99299d09c1d90eb94cff5dc541ed836
--- 
old/apko-0.27.4/internal/cli/testdata/top_image/blobs/sha256/6905923b21195a7d29fe6bf23cca9151f99299d09c1d90eb94cff5dc541ed836
       1970-01-01 01:00:00.000000000 +0100
+++ 
new/apko-0.27.6/internal/cli/testdata/top_image/blobs/sha256/6905923b21195a7d29fe6bf23cca9151f99299d09c1d90eb94cff5dc541ed836
       2025-05-13 02:12:44.000000000 +0200
@@ -0,0 +1 @@
+{"architecture":"amd64","author":"github.com/chainguard-dev/apko","created":"1970-01-01T00:00:00Z","history":[{"author":"apko","created":"1970-01-01T00:00:00Z","created_by":"apko","comment":"This
 is an apko single-layer 
image"},{"author":"apko","created":"1970-01-01T00:00:00Z","created_by":"apko","comment":"This
 is an apko single-layer 
image"}],"os":"linux","rootfs":{"type":"layers","diff_ids":["sha256:783b8b05724ae7998917558527ef930f1442af2f071850913fc406992e44606c","sha256:bcbc0962300bf4b912c13fb2c6c6ec1c845d99f262ee1b0d9b6afb6f2f7059a9"]},"config":{"Entrypoint":["/bin/sh","-l"],"Env":["PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin","SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt"],"Labels":{"org.opencontainers.image.created":"1970-01-01T00:00:00Z"}}}
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/apko-0.27.4/internal/cli/testdata/top_image/blobs/sha256/6deb651bac24febb91142c3235682e65b4d2b6736984ce92f608b9842bf9e88b
 
new/apko-0.27.6/internal/cli/testdata/top_image/blobs/sha256/6deb651bac24febb91142c3235682e65b4d2b6736984ce92f608b9842bf9e88b
--- 
old/apko-0.27.4/internal/cli/testdata/top_image/blobs/sha256/6deb651bac24febb91142c3235682e65b4d2b6736984ce92f608b9842bf9e88b
       1970-01-01 01:00:00.000000000 +0100
+++ 
new/apko-0.27.6/internal/cli/testdata/top_image/blobs/sha256/6deb651bac24febb91142c3235682e65b4d2b6736984ce92f608b9842bf9e88b
       2025-05-13 02:12:44.000000000 +0200
@@ -0,0 +1 @@
+{"schemaVersion":2,"mediaType":"application/vnd.oci.image.manifest.v1+json","config":{"mediaType":"application/vnd.oci.image.config.v1+json","size":785,"digest":"sha256:6905923b21195a7d29fe6bf23cca9151f99299d09c1d90eb94cff5dc541ed836"},"layers":[{"mediaType":"application/vnd.oci.image.layer.v1.tar+gzip","size":4126,"digest":"sha256:bf74ddaf55d32ec9672a0a40efc6cb1bf0a167763c18fc22586c8a301167822f"},{"mediaType":"application/vnd.oci.image.layer.v1.tar+gzip","size":2883,"digest":"sha256:c5b9928e3d484d9c545353ab2a45f024c74b16fd44e0d5b2d7d28dca14a8ff4e"}],"annotations":{"org.opencontainers.image.created":"1970-01-01T00:00:00Z"}}
\ No newline at end of file
Binary files 
old/apko-0.27.4/internal/cli/testdata/top_image/blobs/sha256/711ee9486fdd666205191953b580a158b9e7b00f61226ba901207aa1fcf47fc9
 and 
new/apko-0.27.6/internal/cli/testdata/top_image/blobs/sha256/711ee9486fdd666205191953b580a158b9e7b00f61226ba901207aa1fcf47fc9
 differ
Binary files 
old/apko-0.27.4/internal/cli/testdata/top_image/blobs/sha256/81168b5de29746299ae4cdb269544f6dff75d8f0e6b03b314cee06723c7e2f6b
 and 
new/apko-0.27.6/internal/cli/testdata/top_image/blobs/sha256/81168b5de29746299ae4cdb269544f6dff75d8f0e6b03b314cee06723c7e2f6b
 differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/apko-0.27.4/internal/cli/testdata/top_image/blobs/sha256/bafb997874b76dcef4ccfbf7d651aaab7ec557ce580053743664d5f7294de0e7
 
new/apko-0.27.6/internal/cli/testdata/top_image/blobs/sha256/bafb997874b76dcef4ccfbf7d651aaab7ec557ce580053743664d5f7294de0e7
--- 
old/apko-0.27.4/internal/cli/testdata/top_image/blobs/sha256/bafb997874b76dcef4ccfbf7d651aaab7ec557ce580053743664d5f7294de0e7
       2025-05-08 22:10:25.000000000 +0200
+++ 
new/apko-0.27.6/internal/cli/testdata/top_image/blobs/sha256/bafb997874b76dcef4ccfbf7d651aaab7ec557ce580053743664d5f7294de0e7
       1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-{"architecture":"arm64","author":"github.com/chainguard-dev/apko","created":"1970-01-01T00:00:00Z","history":[{"author":"apko","created":"1970-01-01T00:00:00Z","created_by":"apko","comment":"This
 is an apko single-layer 
image"},{"author":"apko","created":"1970-01-01T00:00:00Z","created_by":"apko","comment":"This
 is an apko single-layer 
image"}],"os":"linux","rootfs":{"type":"layers","diff_ids":["sha256:2888aac57b90cf66093aa48092bf1f1f1b1bdb85bde8601a5f8cf0f06c814763","sha256:bbee945b3496e2f8493351721e2a99b8855871828825448e239663afa9a9f887"]},"config":{"Entrypoint":["/bin/sh","-l"],"Env":["PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin","SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt"],"Labels":{"org.opencontainers.image.created":"1970-01-01T00:00:00Z"}}}
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/apko-0.27.4/internal/cli/testdata/top_image/blobs/sha256/c167d5b680a5a084c621b7e9af9973d68ccf6475af4b0858f2067fb556614f3b
 
new/apko-0.27.6/internal/cli/testdata/top_image/blobs/sha256/c167d5b680a5a084c621b7e9af9973d68ccf6475af4b0858f2067fb556614f3b
--- 
old/apko-0.27.4/internal/cli/testdata/top_image/blobs/sha256/c167d5b680a5a084c621b7e9af9973d68ccf6475af4b0858f2067fb556614f3b
       2025-05-08 22:10:25.000000000 +0200
+++ 
new/apko-0.27.6/internal/cli/testdata/top_image/blobs/sha256/c167d5b680a5a084c621b7e9af9973d68ccf6475af4b0858f2067fb556614f3b
       1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-{"architecture":"amd64","author":"github.com/chainguard-dev/apko","created":"1970-01-01T00:00:00Z","history":[{"author":"apko","created":"1970-01-01T00:00:00Z","created_by":"apko","comment":"This
 is an apko single-layer 
image"},{"author":"apko","created":"1970-01-01T00:00:00Z","created_by":"apko","comment":"This
 is an apko single-layer 
image"}],"os":"linux","rootfs":{"type":"layers","diff_ids":["sha256:783b8b05724ae7998917558527ef930f1442af2f071850913fc406992e44606c","sha256:f95c9a2c33d0677226db00b3890b5f89efe1e12819aca4396971620e6fd679dd"]},"config":{"Entrypoint":["/bin/sh","-l"],"Env":["PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin","SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt"],"Labels":{"org.opencontainers.image.created":"1970-01-01T00:00:00Z"}}}
\ No newline at end of file
Binary files 
old/apko-0.27.4/internal/cli/testdata/top_image/blobs/sha256/c5b9928e3d484d9c545353ab2a45f024c74b16fd44e0d5b2d7d28dca14a8ff4e
 and 
new/apko-0.27.6/internal/cli/testdata/top_image/blobs/sha256/c5b9928e3d484d9c545353ab2a45f024c74b16fd44e0d5b2d7d28dca14a8ff4e
 differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/apko-0.27.4/internal/cli/testdata/top_image/index.json 
new/apko-0.27.6/internal/cli/testdata/top_image/index.json
--- old/apko-0.27.4/internal/cli/testdata/top_image/index.json  2025-05-08 
22:10:25.000000000 +0200
+++ new/apko-0.27.6/internal/cli/testdata/top_image/index.json  2025-05-13 
02:12:44.000000000 +0200
@@ -1 +1 @@
-{"schemaVersion":2,"mediaType":"application/vnd.oci.image.index.v1+json","manifests":[{"mediaType":"application/vnd.oci.image.manifest.v1+json","size":631,"digest":"sha256:14160a36b6fb2f3d325eb09ada490e6ca171285b2ab0cd5d41989c11972eb153","platform":{"architecture":"amd64","os":"linux"}},{"mediaType":"application/vnd.oci.image.manifest.v1+json","size":631,"digest":"sha256:45338ea1681a61ef1ff24b109f0c13aa95113a33cfb684377f8b89fe63b754b5","platform":{"architecture":"arm64","os":"linux"}}],"annotations":{"org.opencontainers.image.created":"1970-01-01T00:00:00Z"}}
\ No newline at end of file
+{"schemaVersion":2,"mediaType":"application/vnd.oci.image.index.v1+json","manifests":[{"mediaType":"application/vnd.oci.image.manifest.v1+json","size":631,"digest":"sha256:6deb651bac24febb91142c3235682e65b4d2b6736984ce92f608b9842bf9e88b","platform":{"architecture":"amd64","os":"linux"}},{"mediaType":"application/vnd.oci.image.manifest.v1+json","size":631,"digest":"sha256:4b10507918b5efe4c90ac76f16db810f1716a56f03bed52cdd0343d19ba271f6","platform":{"architecture":"arm64","os":"linux"}}],"annotations":{"org.opencontainers.image.created":"1970-01-01T00:00:00Z"}}
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/apko-0.27.4/internal/ldso-cache/.gitignore 
new/apko-0.27.6/internal/ldso-cache/.gitignore
--- old/apko-0.27.4/internal/ldso-cache/.gitignore      2025-05-08 
22:10:25.000000000 +0200
+++ new/apko-0.27.6/internal/ldso-cache/.gitignore      2025-05-13 
02:12:44.000000000 +0200
@@ -2,7 +2,6 @@
 *.exe
 *.exe~
 *.dll
-*.so
 *.dylib
 
 # Test binary, built with `go test -c`
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/apko-0.27.4/internal/ldso-cache/ldsocache.go 
new/apko-0.27.6/internal/ldso-cache/ldsocache.go
--- old/apko-0.27.4/internal/ldso-cache/ldsocache.go    2025-05-08 
22:10:25.000000000 +0200
+++ new/apko-0.27.6/internal/ldso-cache/ldsocache.go    2025-05-13 
02:12:44.000000000 +0200
@@ -1,4 +1,4 @@
-// Copyright 2023 Chainguard, Inc.
+// Copyright 2023, 2025 Chainguard, Inc.
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -24,9 +24,9 @@
        "io"
        "io/fs"
        "log"
-       "os"
        "path/filepath"
        "slices"
+       "sort"
        "strings"
        "unsafe"
 )
@@ -129,6 +129,103 @@
        Extensions []LDSOCacheExtensionSection
 }
 
+type elfInfo struct {
+       Machine elf.Machine `yaml:"machine"`
+       Sonames []string    `yaml:"sonames"`
+}
+
+func doGetElfInfo(libfReaderAt io.ReaderAt) (elfInfo, error) {
+       info := elfInfo{}
+
+       elflibf, err := elf.NewFile(libfReaderAt)
+       if err != nil {
+               return info, err
+       }
+       // FIXME: do we need to check for the ELF magic bytes?
+       if elflibf.FileHeader.Type != elf.ET_DYN {
+               return info, fmt.Errorf("not a dynamic object")
+       }
+       sonames, err := elflibf.DynString(elf.DT_SONAME)
+       if err != nil {
+               return info, err
+       }
+       info = elfInfo{
+               Machine: elflibf.FileHeader.Machine,
+               Sonames: sonames,
+       }
+       return info, nil
+}
+
+var (
+       // allow mock implementations
+       getElfInfo = doGetElfInfo
+)
+
+type libInfo struct {
+       path string
+       elf  elfInfo
+}
+
+func getLibInfo(fsys fs.FS, dir string, dirent fs.DirEntry) (libInfo, error) {
+       li := libInfo{}
+       realname := dirent.Name()
+       fullpath := filepath.Join(dir, realname)
+       mode := dirent.Type()
+       isLink := (mode&fs.ModeSymlink != 0)
+
+       if !(mode.IsRegular() || isLink) {
+               return li, fmt.Errorf("DEBUG: %s is neither a link nor a 
regular file", fullpath)
+       }
+       if isLink {
+               // Stat follows symlinks
+               info, err := fs.Stat(fsys, fullpath)
+               if err != nil {
+                       return li, err
+               }
+               if !info.Mode().IsRegular() {
+                       return li, fmt.Errorf("DEBUG: %s is not a link to a 
regular file", fullpath)
+               }
+       }
+
+       libf, err := fsys.Open(fullpath)
+       if err != nil {
+               return li, err
+       }
+       defer libf.Close()
+       var libfReaderAt io.ReaderAt
+       libfReaderAt, ok := libf.(io.ReaderAt)
+       if !ok {
+               // Ugly: Work around lack of ReaderAt support by
+               // reading the entire file into memory
+               buf, err := fs.ReadFile(fsys, fullpath)
+               if err != nil {
+                       return li, err
+               }
+               libfReaderAt = bytes.NewReader(buf)
+       }
+       ei, err := getElfInfo(libfReaderAt)
+       if err != nil {
+               return li, err
+       }
+       // ldconfig will add an entry for a .so file even if it has
+       // no SONAME. Observed with libR.so on Ubuntu.
+       if len(ei.Sonames) == 0 && strings.HasSuffix(realname, ".so") {
+               debugf("DEBUG: %s has no SONAME, using filename as an 
SONAME\n", realname)
+               ei.Sonames = append(ei.Sonames, realname)
+       }
+       if len(ei.Sonames) == 0 && strings.HasSuffix(realname, ".so") {
+               debugf("DEBUG: %s has no DT_SONAME, using %s as an SONAME\n", 
realname, realname)
+               ei.Sonames = append(ei.Sonames, realname)
+       }
+
+       li = libInfo{
+               path: fullpath,
+               elf:  ei,
+       }
+
+       return li, nil
+}
+
 // accepts a library name and returns its name and a version
 // ex: "libfoo.so.1" -> "libfoo", "1"
 // ex: "libbar.so" -> "libbar", ""
@@ -160,109 +257,57 @@
 
 // Scan `libdir` for shared libraries. Adds a new entry into `entryMap` for
 // any that don't already have an entry there.
-func AddLDSOCacheEntriesForDir(fsys fs.FS, libdir string, entryMap 
map[string]LDSOCacheEntry) error {
+func ldsoCacheEntriesForDir(fsys fs.FS, libdir string) ([]LDSOCacheEntry, 
error) {
        var err error
+       entryMap := map[string]LDSOCacheEntry{}
+
        // fs.FS wants all file paths to be relative
        if filepath.IsAbs(libdir) {
                libdir, err = filepath.Rel("/", libdir)
                if err != nil {
-                       return err
+                       return nil, err
                }
        }
        dirents, err := fs.ReadDir(fsys, libdir)
        if err != nil {
                if errors.Is(err, fs.ErrNotExist) {
-                       return nil
+                       return nil, nil
                }
-               return err
+               return nil, err
        }
 
        for _, dirent := range dirents {
-               realname := dirent.Name()
-               fullpath := filepath.Join(libdir, realname)
-               mode := dirent.Type()
-               isLink := (mode&fs.ModeSymlink != 0)
-
-               if isLink {
-                       // Stat follows symlinks
-                       info, err := fs.Stat(fsys, fullpath)
-                       if err != nil {
-                               debugf("Warning: Could not stat %s\n", fullpath)
-                               continue
-                       }
-                       if !info.Mode().IsRegular() {
-                               debugf("DEBUG: Skipping %s, not a link to a 
regular file\n", fullpath)
-                               continue
-                       }
-               }
-
-               if !(mode.IsRegular() || isLink) {
-                       continue
-               }
-               libf, err := fsys.Open(fullpath)
+               // Check that it has a valid library name
+               _, _, err := ParseLibFilename(dirent.Name())
                if err != nil {
-                       debugf("Warning: could not open %s\n", fullpath)
                        continue
                }
-               defer libf.Close()
-               var libfReaderAt io.ReaderAt
-               libfReaderAt, ok := libf.(io.ReaderAt)
-               if !ok {
-                       // Ugly: Work around lack of ReaderAt support by
-                       // reading the entire file into memory
-                       buf, err := fs.ReadFile(fsys, fullpath)
-                       if err != nil {
-                               debugf("DEBUG: Unable to open %s\n", fullpath)
-                               continue
-                       }
-                       libf.Close()
-                       libfReaderAt = bytes.NewReader(buf)
-               }
-               elflibf, err := elf.NewFile(libfReaderAt)
+               li, err := getLibInfo(fsys, libdir, dirent)
                if err != nil {
-                       debugf("DEBUG: Unable to open %s as ELF\n", fullpath)
-                       continue
-               }
-               // FIXME: do we need to check for the ELF magic bytes?
-               if elflibf.FileHeader.Type != elf.ET_DYN {
+                       debugf("%s\n", err)
                        continue
                }
+
                flags := uint32(0)
                flags |= FlagELF
                // FIXME: Shouldn't just assert this
                flags |= FlagELFLIBC6
-               sonames, err := elflibf.DynString(elf.DT_SONAME)
-               if err != nil {
-                       continue
-               }
-               switch elflibf.FileHeader.Machine {
+               switch li.elf.Machine {
                case elf.EM_X86_64:
                        flags |= FlagX8664LIB64
                case elf.EM_AARCH64:
                        flags |= FlagAARCH64LIB64
                // FIXME: Add other architectures
                default:
-                       return fmt.Errorf("unknown machine type")
-               }
-               libf.Close()
-
-               // ldconfig will add an entry for a .so file even if it has
-               // no SONAME. Observed with libR.so on Ubuntu.
-               if len(sonames) == 0 && strings.HasSuffix(realname, ".so") {
-                       sonames = append(sonames, realname)
-                       debugf("DEBUG: %s has no SONAME, using filename as an 
SONAME\n", realname)
-               }
-
-               if len(sonames) == 0 && strings.HasSuffix(realname, ".so") {
-                       sonames = append(sonames, realname)
-                       debugf("DEBUG: %s has no DT_SONAME, using %s as an 
SONAME\n", realname, realname)
+                       return nil, fmt.Errorf("%s: unknown machine type %v", 
li.path, li.elf.Machine)
                }
 
-               for _, soname := range sonames {
+               for _, soname := range li.elf.Sonames {
                        fname, _, err := ParseLibFilename(soname)
                        if err != nil {
                                continue
                        }
+                       realname := dirent.Name()
                        linkname := fname + ".so"
                        if realname != soname && realname != linkname {
                                debugf("DEBUG: Skipping %s because it doesn't 
match soname %s or linkname %s\n", realname, soname, linkname)
@@ -274,25 +319,13 @@
                        }
                        entryMap[realname] = LDSOCacheEntry{
                                // fullpath is relative to "/"
-                               Name:            filepath.Join("/", fullpath),
+                               Name:            filepath.Join("/", li.path),
                                Flags:           flags,
                                OSVersionNeeded: 0,
                                HWCapNeeded:     0,
                        }
                }
        }
-       return nil
-}
-
-func AddLDSOCacheEntriesForDirs(fsys fs.FS, libdirs []string) 
([]LDSOCacheEntry, error) {
-       entryMap := map[string]LDSOCacheEntry{}
-
-       for _, libdir := range libdirs {
-               err := AddLDSOCacheEntriesForDir(fsys, libdir, entryMap)
-               if err != nil {
-                       return nil, err
-               }
-       }
 
        keys := make([]string, 0, len(entryMap))
        for k := range entryMap {
@@ -307,8 +340,28 @@
        return entries, nil
 }
 
+func LDSOCacheEntriesForDirs(fsys fs.FS, libdirs []string) ([]LDSOCacheEntry, 
error) {
+       allEntries := []LDSOCacheEntry{}
+
+       for _, libdir := range libdirs {
+               entries, err := ldsoCacheEntriesForDir(fsys, libdir)
+               if err != nil {
+                       return nil, err
+               }
+               allEntries = append(allEntries, entries...)
+       }
+
+       // ld expects entries to be reverse-sorted by name. Otherwise
+       // it may report "No such file or directory"
+       sort.Slice(allEntries, func(i, j int) bool {
+               return filepath.Base(allEntries[j].Name) < 
filepath.Base(allEntries[i].Name)
+       })
+
+       return allEntries, nil
+}
+
 func BuildCacheFileForDirs(fsys fs.FS, libdirs []string) (*LDSOCacheFile, 
error) {
-       entries, err := AddLDSOCacheEntriesForDirs(fsys, libdirs)
+       entries, err := LDSOCacheEntriesForDirs(fsys, libdirs)
        if err != nil {
                return nil, err
        }
@@ -330,14 +383,7 @@
 // LoadCacheFile attempts to load a cache file from disk.  When
 // successful, it returns an LDSOCacheFile pointer which contains
 // all relevant information from the cache file.
-func LoadCacheFile(path string) (*LDSOCacheFile, error) {
-       bindata, err := os.ReadFile(path)
-       if err != nil {
-               return nil, err
-       }
-
-       r := bytes.NewReader(bindata)
-
+func LoadCacheFile(r io.ReadSeeker) (*LDSOCacheFile, error) {
        // TODO(kaniini): Use binary.BigEndian for BE targets.
        header := LDSORawCacheHeader{}
        if err := binary.Read(r, binary.LittleEndian, &header); err != nil {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/apko-0.27.4/internal/ldso-cache/ldsocache_test.go 
new/apko-0.27.6/internal/ldso-cache/ldsocache_test.go
--- old/apko-0.27.4/internal/ldso-cache/ldsocache_test.go       2025-05-08 
22:10:25.000000000 +0200
+++ new/apko-0.27.6/internal/ldso-cache/ldsocache_test.go       2025-05-13 
02:12:44.000000000 +0200
@@ -1,15 +1,22 @@
 package ldsocache
 
 import (
+       "errors"
+       "io"
        "os"
+       "path/filepath"
        "testing"
 
        "github.com/stretchr/testify/require"
+       "gopkg.in/yaml.v3"
 )
 
 func Test_LoadCacheFile(t *testing.T) {
-       cacheFile, err := LoadCacheFile("testdata/ld.so.cache")
+       f, err := os.Open("testdata/ld.so.cache")
        require.NoError(t, err)
+       cacheFile, err := LoadCacheFile(f)
+       require.NoError(t, err)
+       f.Close()
        require.Equalf(t, uint32(65), cacheFile.Header.NumLibs, "there should 
be 65 libraries in this cache file")
        require.Equalf(t, uint32(1421), cacheFile.Header.StrTableSize, "the 
string table should be 1421 bytes long")
        require.Equalf(t, 1, len(cacheFile.Extensions), "there must be 1 
extension")
@@ -20,8 +27,11 @@
 }
 
 func Test_WriteCacheFile(t *testing.T) {
-       cacheFile, err := LoadCacheFile("testdata/ld.so.cache")
+       f, err := os.Open("testdata/ld.so.cache")
+       require.NoError(t, err)
+       cacheFile, err := LoadCacheFile(f)
        require.NoError(t, err)
+       f.Close()
        out, err := os.CreateTemp(t.TempDir(), "ld.so.cache-new")
        require.NoError(t, err)
        err = cacheFile.Write(out)
@@ -119,19 +129,69 @@
        require.Contains(t, dirs, "/b/libs")
 }
 
-func Test_GenerateCacheFile(t *testing.T) {
-       // This uses the host system, uncomment to run tests on your machine.
-       t.Skip()
+// Instead of real ELF binaries, our "libraries" are YAML files
+// that are used to populate an elfInfo structure.
+func mockGetElfInfo(r io.ReaderAt) (elfInfo, error) {
+       var info elfInfo
+       buf := make([]byte, 1024)
+       size, err := r.ReadAt(buf, 0)
+       if !errors.Is(err, io.EOF) {
+               return info, err
+       }
+       if size == 0 {
+               return info, err
+       }
+       err = yaml.Unmarshal(buf[:size-1], &info)
+       if err != nil {
+               return info, err
+       }
+       return info, nil
+}
 
-       libdirs := []string{"/lib"}
-       root := os.DirFS("/")
-       dirs, err := ParseLDSOConf(root, "etc/ld.so.conf")
-       require.NoError(t, err)
-       libdirs = append(libdirs, dirs...)
+func Test_GenerateCacheFile(t *testing.T) {
+       getElfInfo = mockGetElfInfo
+       root := os.DirFS("testdata/libroot")
+       libdirs, err := ParseLDSOConf(root, "etc/ld.so.conf")
+       require.NoError(t, err)
+       expectedLibDirs := []string{
+               "/usr/local/lib",
+               "/usr/local/lib64",
+               "/lib",
+               "/lib64",
+               "/usr/lib",
+               "/usr/lib64",
+               "/usr/local/sdk-v1/lib",
+               "/usr/local/sdk-v2/lib",
+       }
+       require.ElementsMatch(t, expectedLibDirs, libdirs)
        cacheFile, err := BuildCacheFileForDirs(root, libdirs)
        require.NoError(t, err)
-       lsc, err := os.Create("testdata/ld.so.cache-generated")
+       lsc, err := os.CreateTemp(t.TempDir(), "ld.so.cache-generated")
        require.NoError(t, err)
        err = cacheFile.Write(lsc)
        require.NoError(t, err)
+       lsc.Close()
+
+       f, err := os.Open(lsc.Name())
+       require.NoError(t, err)
+       cacheFile, err = LoadCacheFile(f)
+       require.NoError(t, err)
+       f.Close()
+       expectedLibs := []string{
+               "/lib/libfoo.so.1",
+               "/lib/libnosoname.so",
+               "/lib64/libfoo.so.1",
+               "/lib64/libnosoname.so",
+               "/usr/local/lib/sdk-v1/libsdk.so.1",
+               "/usr/local/lib/sdk-v2/libsdk.so.1",
+               "/usr/local/lib/sdk-v1/libsdk.so",
+               "/usr/local/lib/sdk-v2/libsdk.so",
+       }
+       expectedLibLen := len(expectedLibs)
+       require.Equalf(t, uint32(expectedLibLen), cacheFile.Header.NumLibs, 
"there should be %d libraries in this cache file", expectedLibLen)
+       for i := 1; i < int(cacheFile.Header.NumLibs); i++ {
+               prev := filepath.Base(cacheFile.Entries[i-1].Name)
+               cur := filepath.Base(cacheFile.Entries[i].Name)
+               require.GreaterOrEqual(t, prev, cur)
+       }
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/apko-0.27.4/internal/ldso-cache/testdata/libroot/etc/ld.so.conf 
new/apko-0.27.6/internal/ldso-cache/testdata/libroot/etc/ld.so.conf
--- old/apko-0.27.4/internal/ldso-cache/testdata/libroot/etc/ld.so.conf 
1970-01-01 01:00:00.000000000 +0100
+++ new/apko-0.27.6/internal/ldso-cache/testdata/libroot/etc/ld.so.conf 
2025-05-13 02:12:44.000000000 +0200
@@ -0,0 +1,2 @@
+include /etc/ld.so.conf.d/*.conf
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/apko-0.27.4/internal/ldso-cache/testdata/libroot/etc/ld.so.conf.d/libc.conf 
new/apko-0.27.6/internal/ldso-cache/testdata/libroot/etc/ld.so.conf.d/libc.conf
--- 
old/apko-0.27.4/internal/ldso-cache/testdata/libroot/etc/ld.so.conf.d/libc.conf 
    1970-01-01 01:00:00.000000000 +0100
+++ 
new/apko-0.27.6/internal/ldso-cache/testdata/libroot/etc/ld.so.conf.d/libc.conf 
    2025-05-13 02:12:44.000000000 +0200
@@ -0,0 +1,6 @@
+/usr/local/lib
+/usr/local/lib64
+/lib
+/lib64
+/usr/lib
+/usr/lib64
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/apko-0.27.4/internal/ldso-cache/testdata/libroot/etc/ld.so.conf.d/sdk-v1.conf
 
new/apko-0.27.6/internal/ldso-cache/testdata/libroot/etc/ld.so.conf.d/sdk-v1.conf
--- 
old/apko-0.27.4/internal/ldso-cache/testdata/libroot/etc/ld.so.conf.d/sdk-v1.conf
   1970-01-01 01:00:00.000000000 +0100
+++ 
new/apko-0.27.6/internal/ldso-cache/testdata/libroot/etc/ld.so.conf.d/sdk-v1.conf
   2025-05-13 02:12:44.000000000 +0200
@@ -0,0 +1 @@
+/usr/local/sdk-v1/lib
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/apko-0.27.4/internal/ldso-cache/testdata/libroot/etc/ld.so.conf.d/sdk-v2.conf
 
new/apko-0.27.6/internal/ldso-cache/testdata/libroot/etc/ld.so.conf.d/sdk-v2.conf
--- 
old/apko-0.27.4/internal/ldso-cache/testdata/libroot/etc/ld.so.conf.d/sdk-v2.conf
   1970-01-01 01:00:00.000000000 +0100
+++ 
new/apko-0.27.6/internal/ldso-cache/testdata/libroot/etc/ld.so.conf.d/sdk-v2.conf
   2025-05-13 02:12:44.000000000 +0200
@@ -0,0 +1 @@
+/usr/local/sdk-v2/lib
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/apko-0.27.4/internal/ldso-cache/testdata/libroot/lib 
new/apko-0.27.6/internal/ldso-cache/testdata/libroot/lib
--- old/apko-0.27.4/internal/ldso-cache/testdata/libroot/lib    1970-01-01 
01:00:00.000000000 +0100
+++ new/apko-0.27.6/internal/ldso-cache/testdata/libroot/lib    2025-05-13 
20:06:04.836371686 +0200
@@ -0,0 +1 @@
+symbolic link to usr/lib
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/apko-0.27.4/internal/ldso-cache/testdata/libroot/usr/lib/libfoo.so.1 
new/apko-0.27.6/internal/ldso-cache/testdata/libroot/usr/lib/libfoo.so.1
--- old/apko-0.27.4/internal/ldso-cache/testdata/libroot/usr/lib/libfoo.so.1    
1970-01-01 01:00:00.000000000 +0100
+++ new/apko-0.27.6/internal/ldso-cache/testdata/libroot/usr/lib/libfoo.so.1    
2025-05-13 02:12:44.000000000 +0200
@@ -0,0 +1,3 @@
+machine: 0x3e
+sonames:
+  - libfoo.so.1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/apko-0.27.4/internal/ldso-cache/testdata/libroot/usr/lib/libnosoname.so 
new/apko-0.27.6/internal/ldso-cache/testdata/libroot/usr/lib/libnosoname.so
--- old/apko-0.27.4/internal/ldso-cache/testdata/libroot/usr/lib/libnosoname.so 
1970-01-01 01:00:00.000000000 +0100
+++ new/apko-0.27.6/internal/ldso-cache/testdata/libroot/usr/lib/libnosoname.so 
2025-05-13 02:12:44.000000000 +0200
@@ -0,0 +1,2 @@
+machine: 0x3e
+sonames: []
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/apko-0.27.4/internal/ldso-cache/testdata/libroot/usr/local/lib 
new/apko-0.27.6/internal/ldso-cache/testdata/libroot/usr/local/lib
--- old/apko-0.27.4/internal/ldso-cache/testdata/libroot/usr/local/lib  
1970-01-01 01:00:00.000000000 +0100
+++ new/apko-0.27.6/internal/ldso-cache/testdata/libroot/usr/local/lib  
2025-05-13 20:06:04.812370677 +0200
@@ -0,0 +1 @@
+symbolic link to lib64
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/apko-0.27.4/internal/ldso-cache/testdata/libroot/usr/local/sdk-v1/lib/libsdk.so
 
new/apko-0.27.6/internal/ldso-cache/testdata/libroot/usr/local/sdk-v1/lib/libsdk.so
--- 
old/apko-0.27.4/internal/ldso-cache/testdata/libroot/usr/local/sdk-v1/lib/libsdk.so
 1970-01-01 01:00:00.000000000 +0100
+++ 
new/apko-0.27.6/internal/ldso-cache/testdata/libroot/usr/local/sdk-v1/lib/libsdk.so
 2025-05-13 20:06:04.828371349 +0200
@@ -0,0 +1 @@
+symbolic link to libsdk.so.1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/apko-0.27.4/internal/ldso-cache/testdata/libroot/usr/local/sdk-v1/lib/libsdk.so.1
 
new/apko-0.27.6/internal/ldso-cache/testdata/libroot/usr/local/sdk-v1/lib/libsdk.so.1
--- 
old/apko-0.27.4/internal/ldso-cache/testdata/libroot/usr/local/sdk-v1/lib/libsdk.so.1
       1970-01-01 01:00:00.000000000 +0100
+++ 
new/apko-0.27.6/internal/ldso-cache/testdata/libroot/usr/local/sdk-v1/lib/libsdk.so.1
       2025-05-13 20:06:04.820371013 +0200
@@ -0,0 +1 @@
+symbolic link to libsdk.so.1.2.3
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/apko-0.27.4/internal/ldso-cache/testdata/libroot/usr/local/sdk-v1/lib/libsdk.so.1.2.3
 
new/apko-0.27.6/internal/ldso-cache/testdata/libroot/usr/local/sdk-v1/lib/libsdk.so.1.2.3
--- 
old/apko-0.27.4/internal/ldso-cache/testdata/libroot/usr/local/sdk-v1/lib/libsdk.so.1.2.3
   1970-01-01 01:00:00.000000000 +0100
+++ 
new/apko-0.27.6/internal/ldso-cache/testdata/libroot/usr/local/sdk-v1/lib/libsdk.so.1.2.3
   2025-05-13 02:12:44.000000000 +0200
@@ -0,0 +1,3 @@
+machine: 0x3e
+sonames:
+  - libsdk.so.1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/apko-0.27.4/internal/ldso-cache/testdata/libroot/usr/local/sdk-v2/lib/libsdk.so
 
new/apko-0.27.6/internal/ldso-cache/testdata/libroot/usr/local/sdk-v2/lib/libsdk.so
--- 
old/apko-0.27.4/internal/ldso-cache/testdata/libroot/usr/local/sdk-v2/lib/libsdk.so
 1970-01-01 01:00:00.000000000 +0100
+++ 
new/apko-0.27.6/internal/ldso-cache/testdata/libroot/usr/local/sdk-v2/lib/libsdk.so
 2025-05-13 20:06:04.808370508 +0200
@@ -0,0 +1 @@
+symbolic link to libsdk.so.1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/apko-0.27.4/internal/ldso-cache/testdata/libroot/usr/local/sdk-v2/lib/libsdk.so.1
 
new/apko-0.27.6/internal/ldso-cache/testdata/libroot/usr/local/sdk-v2/lib/libsdk.so.1
--- 
old/apko-0.27.4/internal/ldso-cache/testdata/libroot/usr/local/sdk-v2/lib/libsdk.so.1
       1970-01-01 01:00:00.000000000 +0100
+++ 
new/apko-0.27.6/internal/ldso-cache/testdata/libroot/usr/local/sdk-v2/lib/libsdk.so.1
       2025-05-13 20:06:04.800370172 +0200
@@ -0,0 +1 @@
+symbolic link to libsdk.so.1.3.1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/apko-0.27.4/internal/ldso-cache/testdata/libroot/usr/local/sdk-v2/lib/libsdk.so.1.3.1
 
new/apko-0.27.6/internal/ldso-cache/testdata/libroot/usr/local/sdk-v2/lib/libsdk.so.1.3.1
--- 
old/apko-0.27.4/internal/ldso-cache/testdata/libroot/usr/local/sdk-v2/lib/libsdk.so.1.3.1
   1970-01-01 01:00:00.000000000 +0100
+++ 
new/apko-0.27.6/internal/ldso-cache/testdata/libroot/usr/local/sdk-v2/lib/libsdk.so.1.3.1
   2025-05-13 02:12:44.000000000 +0200
@@ -0,0 +1,3 @@
+machine: 0x3e
+sonames:
+  - libsdk.so.1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/apko-0.27.4/pkg/build/lock.go 
new/apko-0.27.6/pkg/build/lock.go
--- old/apko-0.27.4/pkg/build/lock.go   2025-05-08 22:10:25.000000000 +0200
+++ new/apko-0.27.6/pkg/build/lock.go   2025-05-13 02:12:44.000000000 +0200
@@ -73,7 +73,7 @@
                                return nil, nil, err
                        }
                }
-               pls = l.Arch2LockedPackages()
+               pls = l.Arch2LockedPackages(input.Archs)
        }
 
        ics := make(map[string]*types.ImageConfiguration, len(mc.Contexts)+1)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/apko-0.27.4/pkg/lock/lock.go 
new/apko-0.27.6/pkg/lock/lock.go
--- old/apko-0.27.4/pkg/lock/lock.go    2025-05-08 22:10:25.000000000 +0200
+++ new/apko-0.27.6/pkg/lock/lock.go    2025-05-13 02:12:44.000000000 +0200
@@ -4,6 +4,8 @@
        "encoding/json"
        "fmt"
        "os"
+
+       "chainguard.dev/apko/pkg/build/types"
 )
 
 type Lock struct {
@@ -79,8 +81,8 @@
        return os.WriteFile(lockFile, jsonb, os.ModePerm)
 }
 
-// Arch2LockedPackages returns map: for each arch -> list of 
{package_name}={version}.
-func (lock Lock) Arch2LockedPackages() map[string][]string {
+// Arch2LockedPackages returns map: for each arch -> list of 
{package_name}={version} in archs.
+func (lock Lock) Arch2LockedPackages(archs []types.Architecture) 
map[string][]string {
        lockedPackages := map[string][]string{}
        for _, p := range lock.Contents.Packages {
                _, ok := lockedPackages[p.Architecture]
@@ -89,5 +91,9 @@
                }
                lockedPackages[p.Architecture] = 
append(lockedPackages[p.Architecture], fmt.Sprintf("%s=%s", p.Name, p.Version))
        }
-       return lockedPackages
+       wantedPackages := map[string][]string{}
+       for _, arch := range archs {
+               wantedPackages[arch.String()] = lockedPackages[arch.String()]
+       }
+       return wantedPackages
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/apko-0.27.4/pkg/lock/lock_test.go 
new/apko-0.27.6/pkg/lock/lock_test.go
--- old/apko-0.27.4/pkg/lock/lock_test.go       1970-01-01 01:00:00.000000000 
+0100
+++ new/apko-0.27.6/pkg/lock/lock_test.go       2025-05-13 02:12:44.000000000 
+0200
@@ -0,0 +1,42 @@
+// Copyright 2025 Chainguard, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package lock
+
+import (
+       "testing"
+
+       "chainguard.dev/apko/pkg/build/types"
+)
+
+func TestArch2LockedPackages(t *testing.T) {
+       l := Lock{
+               Contents: LockContents{
+                       Packages: []LockPkg{{
+                               Name:         "avx",
+                               Version:      "1.2.3",
+                               Architecture: "x86_64",
+                       }, {
+                               Name:         "sve",
+                               Version:      "2.3.4",
+                               Architecture: "aarch64",
+                       }},
+               },
+       }
+
+       archs := []types.Architecture{types.Architecture("aarch64")}
+       if got, want := len(l.Arch2LockedPackages(archs)), 1; got != want {
+               t.Errorf("wanted %d arch, got %d", want, got)
+       }
+}

++++++ apko.obsinfo ++++++
--- /var/tmp/diff_new_pack.dMzy6E/_old  2025-05-13 20:06:04.964377071 +0200
+++ /var/tmp/diff_new_pack.dMzy6E/_new  2025-05-13 20:06:04.964377071 +0200
@@ -1,5 +1,5 @@
 name: apko
-version: 0.27.4
-mtime: 1746735025
-commit: 8d3343552cb4e6df0990a48d1c13cfff5a20511f
+version: 0.27.6
+mtime: 1747095164
+commit: f19d835ff999789c485ca1ec018c624f96bc7487
 

++++++ vendor.tar.gz ++++++
/work/SRC/openSUSE:Factory/apko/vendor.tar.gz 
/work/SRC/openSUSE:Factory/.apko.new.30101/vendor.tar.gz differ: char 82, line 1

Reply via email to