Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

diff fails on apks: can't make X relative to Y #620

Open
tstromberg opened this issue Nov 13, 2024 · 2 comments
Open

diff fails on apks: can't make X relative to Y #620

tstromberg opened this issue Nov 13, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@tstromberg
Copy link
Collaborator

tstromberg commented Nov 13, 2024

mal diff py3.13-debugpy-1.8.7-r0.apk py3.13-debugpy-1.8.8-r0.apk generates the following error

💣 rel("py3.13-debugpy-1.8.7-r0.apk","/private/var/folders/gw/86t1jg2109s5j8vzszj281kc0000gn/T/py3.13-debugpy-1.8.7-r0.apk3113364428/usr/lib/python3.13/site-packages/debugpy/__main__.py"):
Rel: can't make /private/var/folders/gw/86t1jg2109s5j8vzszj281kc0000gn/T/py3.13-debugpy-1.8.7-r0.apk3113364428/usr/lib/python3.13/site-packages/debugpy/__main__.py relative to py3.13-debugpy-1.8.7-r0.apk

My guess is it will also fail against other archive formats.

Reported by @imjasonh

@tstromberg tstromberg added the bug Something isn't working label Nov 13, 2024
@egibs
Copy link
Member

egibs commented Nov 13, 2024

Quick test on two APKs in the same directory:

$HOME/go/1.23.2/bin/mal diff py3.13-debugpy-bin-1.8.6-r1.apk py3.13-debugpy-bin-1.8.7-r0.apk
├─ 🔵 Deleted: ../py3.13-debugpy-bin-1.8.6-r1.apk ∴ /usr/bin/debugpy [LOW]
│     ≡ filesystem [LOW]
│       🔵 path/usr_bin — path reference within /usr/bin: /usr/bin/python3.13
│
├─ 🔵 Added: ../py3.13-debugpy-bin-1.8.7-r0.apk ∴ /usr/bin/debugpy [LOW]
│     ≡ filesystem [LOW]
│       🔵 path/usr_bin — path reference within /usr/bin: /usr/bin/python3.13
│
├─ 🟡 Moved: ../py3.13-debugpy-bin-1.8.6-r1.apk ∴ /var/lib/db/sbom/py3.13-debugpy-bin-1.8.6-r1.spdx.json -> py3.13-debugpy-bin-1.8.7-r0.apk ∴ /var/lib/db/sbom/py3.13-debugpy-bin-1.8.7-r0.spdx.json (score: 0.973626)
│

The curious thing here is that identical file names are showing as deleted/added instead of modified.

@egibs
Copy link
Member

egibs commented Nov 13, 2024

Ah, I see why. This is from the clean path changes for archives in #617. I'll work on handling this differently for diffs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants