canonical / snapcraft

Package, distribute, and update any app for Linux and IoT.
https://snapcraft.io
GNU General Public License v3.0
1.18k stars 443 forks source link

snapcraft 8.2.10 build failure #4843

Closed chenrui333 closed 3 months ago

chenrui333 commented 3 months ago

Bug Description

snapcraft 8.2.10 build failure

To Reproduce

brew install -s https://raw.githubusercontent.com/Homebrew/homebrew-core/8e944da56201148b5a8181631001ce8c1d2f30f2/Formula/s/snapcraft.rb

Environment

ubuntu 22.04

snapcraft.yaml

n/a

Relevant log output

==> /home/linuxbrew/.linuxbrew/Cellar/snapcraft/8.2.10/bin/snapcraft --version
  /home/linuxbrew/.linuxbrew/Cellar/snapcraft/8.2.10/libexec/lib/python3.12/site-packages/apt/__init__.py:37: Warning: W:Unable to read /home/linuxbrew/.linuxbrew/Cellar/apt/2.9.4/etc/apt/apt.conf.d/ - DirectoryExists (2: No such file or directory)
    apt_pkg.init_config()
  /home/linuxbrew/.linuxbrew/Cellar/snapcraft/8.2.10/libexec/lib/python3.12/site-packages/gnupg/_util.py:129: SyntaxWarning: invalid escape sequence '\d'
    _VERSION_STRING_REGEX = re.compile('(\d)(\.)(\d)(\.)(\d+)')
  /home/linuxbrew/.linuxbrew/Cellar/snapcraft/8.2.10/libexec/lib/python3.12/site-packages/gnupg/_parsers.py:846: SyntaxWarning: invalid escape sequence '\d'
    allowed_entry = re.findall('^(\d+)(|w|m|y)$', self._expiration_time)
  Traceback (most recent call last):
    File "/home/linuxbrew/.linuxbrew/Cellar/snapcraft/8.2.10/bin/snapcraft", line 8, in <module>
      sys.exit(main())
               ^^^^^^
    File "/home/linuxbrew/.linuxbrew/Cellar/snapcraft/8.2.10/libexec/lib/python3.12/site-packages/snapcraft/application.py", line 368, in main
      return app.run()
             ^^^^^^^^^
    File "/home/linuxbrew/.linuxbrew/Cellar/snapcraft/8.2.10/libexec/lib/python3.12/site-packages/craft_application/application.py", line 487, in run
      self._register_default_plugins()
    File "/home/linuxbrew/.linuxbrew/Cellar/snapcraft/8.2.10/libexec/lib/python3.12/site-packages/snapcraft/application.py", line 117, in _register_default_plugins
      craft_parts.plugins.unregister("dotnet")
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  AttributeError: module 'craft_parts.plugins' has no attribute 'unregister'. Did you mean: 'register'?


### Additional context

full build log, https://github.com/Homebrew/homebrew-core/actions/runs/9387671141/job/25851261032?pr=173791
relates to https://github.com/Homebrew/homebrew-core/pull/173791
mr-cal commented 3 months ago

https://raw.githubusercontent.com/Homebrew/homebrew-core/8e944da56201148b5a8181631001ce8c1d2f30f2/Formula/s/snapcraft.rb shows:

  resource "craft-parts" do
    url "https://files.pythonhosted.org/packages/af/30/22154fdfc6ec43cdce792855fe7708239ebae2afba922c0159ad7f16f745/craft-parts-1.29.0.tar.gz"
    sha256 "09958d5c5802cf48fd9d7d189f5c30bf7a4721d0b668bd14e47bee32edd25a5b"
  end

That shows craft-parts 1.29.0 but snapcraft 8.2.10 uses craft-parts 1.30.0, which includes this new craft_parts.plugins.unregister() call.

https://github.com/canonical/snapcraft/blob/8.2.10/requirements.txt#L12

@chenrui333 - do you know why the BrewTestBot wouldn't pick up that dependency change?

chenrui333 commented 3 months ago

@mr-cal yeah it was dependency update issue, we figured it out and ship the new release, thanks!

mr-cal commented 3 months ago

Great!

@chenrui333, by the way, does Homebrew parse requirements.txt or the install_requires from setup.py?

install_requires is incorrect in snapcraft because it doesn't define minimum versions.

We plan to fix that sometime in the near future.