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

No longer works on macOS #141

Open
Saviq opened this issue Dec 6, 2024 · 6 comments
Open

No longer works on macOS #141

Saviq opened this issue Dec 6, 2024 · 6 comments

Comments

@Saviq
Copy link

Saviq commented Dec 6, 2024

Bug Description

Expects the debian module to be there, so fails on macOS.

To Reproduce

Try this Homebrew recipe:

Homebrew/homebrew-core@master...Saviq:homebrew-core:snapcraft-8-5

part yaml

N/A

Relevant log output

$ snapcraft --version
Traceback (most recent call last):
  File "/opt/homebrew/bin/snapcraft", line 5, in <module>
    from snapcraft.application import main
  File "/opt/homebrew/Cellar/snapcraft/8.5.0/libexec/lib/python3.13/site-packages/snapcraft/application.py", line 38, in <module>
    from snapcraft import cli, commands, errors, models, services, store
  File "/opt/homebrew/Cellar/snapcraft/8.5.0/libexec/lib/python3.13/site-packages/snapcraft/cli.py", line 34, in <module>
    from snapcraft.parts import plugins
  File "/opt/homebrew/Cellar/snapcraft/8.5.0/libexec/lib/python3.13/site-packages/snapcraft/parts/__init__.py", line 21, in <module>
    from .lifecycle import patch_elf, set_global_environment, set_step_environment
  File "/opt/homebrew/Cellar/snapcraft/8.5.0/libexec/lib/python3.13/site-packages/snapcraft/parts/lifecycle.py", line 40, in <module>
    from .parts import PartsLifecycle, launch_shell
  File "/opt/homebrew/Cellar/snapcraft/8.5.0/libexec/lib/python3.13/site-packages/snapcraft/parts/parts.py", line 25, in <module>
    from craft_archives import repo
  File "/opt/homebrew/Cellar/snapcraft/8.5.0/libexec/lib/python3.13/site-packages/craft_archives/repo/__init__.py", line 19, in <module>
    from .installer import install, install_in_root
  File "/opt/homebrew/Cellar/snapcraft/8.5.0/libexec/lib/python3.13/site-packages/craft_archives/repo/installer.py", line 25, in <module>
    from .apt_sources_manager import AptSourcesManager
  File "/opt/homebrew/Cellar/snapcraft/8.5.0/libexec/lib/python3.13/site-packages/craft_archives/repo/apt_sources_manager.py", line 27, in <module>
    from debian.deb822 import Deb822
ModuleNotFoundError: No module named 'debian'
@tigarmo
Copy link
Collaborator

tigarmo commented Dec 6, 2024

That's odd - craft-archives uses the python-debian package which is a regular PyPI package, so it should be present on the environment. Does the issue happen if you install craft-archives on a venv and do from craft_archives import repo?

@Saviq
Copy link
Author

Saviq commented Dec 6, 2024

@tigarmo is there a point in having python-debian on macOS? So far it was only included on the linux side of the brew formula:

https://github.com/Saviq/homebrew-core/blob/dea4f2af75ade15db4abb0bfa2dcdd6110c88a00/Formula/s/snapcraft.rb#L73-L76

(there are some others, too, so there must be prior art around skipping these where appropriate)

@tigarmo
Copy link
Collaborator

tigarmo commented Dec 6, 2024

arguably there's no point in having craft-archives at all on macOS, but the library itself doesn't have any checks

@Saviq
Copy link
Author

Saviq commented Dec 6, 2024

If Snapcraft can/should deal without craft-archives, that's even better - please transfer the issue to Snapcraft in that case.

@tigarmo
Copy link
Collaborator

tigarmo commented Dec 6, 2024

It's still unclear to me whether there is an issue at all. Snapcraft declares that it needs craft-archives, which in turn declares that it needs python-debian. Any setup that doesn't include the dependencies is bound to be, at the very least, fragile.

Wouldn't the correct fix be to add python-debian to the homebrew formula?

@Saviq
Copy link
Author

Saviq commented Dec 9, 2024

Not my call to make, but I'd say if we can, we shouldn't have dormant bytes in there. There's a reason why the formula has on_linux do….

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants