unblob icon indicating copy to clipboard operation
unblob copied to clipboard

Python package is incompatible with dissect-squashfs

Open evan-goode opened this issue 1 year ago • 1 comments

Describe the bug

Hi, I'm trying to use the Python packages unblob and dissect-squashfs in the same project, but I can't since unblob depends on a rather old (2020) version of dissect.cstruct and dissect-squashfs depends on dissect.cstruct == 4.*. Poetry gives me the following error:

Because no versions of dissect-squashfs match >1.5,<1.6.dev1 || >1.6.dev1,<1.6.dev2 || >1.6.dev2,<2.0
 and dissect-squashfs (1.6.dev1) depends on dissect.cstruct (==4.*), dissect-squashfs (>1.5,<1.6.dev2 || >1.6.dev2,<2.0) requires dissect.cstruct (==4.*).
And because dissect-squashfs (1.6.dev2) depends on dissect.cstruct (==4.*)
 and dissect-squashfs (1.5) depends on dissect.cstruct (==3.*), dissect-squashfs (>=1.5,<2.0) requires dissect.cstruct (>=3.0.dev,<5).
Because no versions of unblob match >24.6.10,<25.0.0
 and unblob (24.6.10) depends on dissect.cstruct (>=2.0,<3.0), unblob (>=24.6.10,<25.0.0) requires dissect.cstruct (>=2.0,<3.0).
Thus, unblob (>=24.6.10,<25.0.0) is incompatible with dissect-squashfs (>=1.5,<2.0).
So, because sample-project depends on both dissect-squashfs (^1.5) and unblob (^24.6.10), version solving failed.

Would it be possible to update unblob to use the latest version of dissect.cstruct?

To Reproduce Steps to reproduce the behavior:

Use this pyproject.toml:

[tool.poetry]
name = "sample-project"
version = "0.1.0"
description = ""
authors = ["Author Name <[email protected]>"]
# readme = "README.md"
# license = "BSD"
packages = [
  { include = "sample_package" }
]

[tool.poetry.dependencies]
python = "^3.10"
dissect-squashfs = "^1.5"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

and run poetry add unblob.

Expected behavior I would like to be able to use both dissect-squashfs and unblob in the same codebase.

Environment information (please complete the following information):

  • OS: NixOS
  • poetry env info:
Virtualenv
Python:         3.11.9
Implementation: CPython
Path:           /home/evan/.cache/pypoetry/virtualenvs/sample-project-VQNKDeYX-py3.11
Executable:     /home/evan/.cache/pypoetry/virtualenvs/sample-project-VQNKDeYX-py3.11/bin/python
Valid:          True

Base
Platform:   linux
OS:         posix
Python:     3.11.9
Path:       /nix/store/6b1fqdwb3g56j5pazv8zkx9qd0mv3wiz-python3-3.11.9
Executable: /nix/store/6b1fqdwb3g56j5pazv8zkx9qd0mv3wiz-python3-3.11.9/bin/python3.11

evan-goode avatar Jun 25 '24 16:06 evan-goode

Good point, we should update it. Unfortunately, dissect.cstruct 4.0 is not API compatible, at least on the typing level, so it needs some massaging.

vlaci avatar Jun 26 '24 09:06 vlaci

@evan-goode #907 should fix this issue. Could you check it?

vlaci avatar Jul 23 '24 14:07 vlaci