canonical/layer-basic

charm build fails when it can't satisfy setuptools

Closed this issue · 2 comments

On one hand layer-basic wheelhouse.txt declares setuptools<42 but later setuptools_scm[toml]>=3.4 will require a setuptools>=42.

$ charm build
build: DEPRECATED: implicit series; specify series in metadata.yaml instead
build: Build dir not specified via command-line or environment; defaulting to /tmp/charm-builds
build: Please add a `repo` key to your layer.yaml, with a url from which your layer can be cloned.
build: Destination charm directory: /tmp/charm-builds/layer-basic
build: Processing layer: layer:options
build: Processing layer: layer-basic (from .)
build: Empty metadata.yaml
Collecting pip<19.0,>=18.1
  Using cached pip-18.1.tar.gz (1.3 MB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'error'
  ERROR: Command errored out with exit status 1:
   command: /tmp/tmpwcvrezm5/bin/python3 /tmp/tmpwcvrezm5/lib/python3.6/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-oadnjc9s/overlay --no-warn-script-location --no-binary :all: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel
       cwd: None
  Complete output (51 lines):
  Collecting setuptools
    Using cached setuptools-45.1.0.zip (859 kB)
  Collecting wheel
    Using cached wheel-0.34.0.tar.gz (60 kB)
    Installing build dependencies: started
    Installing build dependencies: finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: /tmp/tmpwcvrezm5/bin/python3 /tmp/tmpwcvrezm5/lib/python3.6/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-7g4pbsan/overlay --no-warn-script-location --no-binary :all: --only-binary :none: -i https://pypi.org/simple -- 'setuptools >= 42' 'setuptools_scm[toml]>=3.4'
         cwd: None
    Complete output (39 lines):
    Collecting setuptools>=42
      Using cached setuptools-45.1.0.zip (859 kB)
    Collecting setuptools_scm[toml]>=3.4
      Using cached setuptools_scm-3.4.3.tar.gz (45 kB)
      Installing build dependencies: started
      Installing build dependencies: finished with status 'error'
      ERROR: Command errored out with exit status 2:
       command: /tmp/tmpwcvrezm5/bin/python3 /tmp/tmpwcvrezm5/lib/python3.6/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-gpzbcj12/overlay --no-warn-script-location --no-binary :all: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=34.4' wheel
           cwd: None
      Complete output (27 lines):
      Collecting setuptools>=34.4
        Using cached setuptools-45.1.0.zip (859 kB)
      Collecting wheel
        Using cached wheel-0.34.0.tar.gz (60 kB)
      ERROR: Exception:
      Traceback (most recent call last):
        File "/tmp/tmpwcvrezm5/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 186, in _main
          status = self.run(options, args)
        File "/tmp/tmpwcvrezm5/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 331, in run
          resolver.resolve(requirement_set)
        File "/tmp/tmpwcvrezm5/lib/python3.6/site-packages/pip/_internal/legacy_resolve.py", line 177, in resolve
          discovered_reqs.extend(self._resolve_one(requirement_set, req))
        File "/tmp/tmpwcvrezm5/lib/python3.6/site-packages/pip/_internal/legacy_resolve.py", line 333, in _resolve_one
          abstract_dist = self._get_abstract_dist_for(req_to_install)
        File "/tmp/tmpwcvrezm5/lib/python3.6/site-packages/pip/_internal/legacy_resolve.py", line 282, in _get_abstract_dist_for
          abstract_dist = self.preparer.prepare_linked_requirement(req)
        File "/tmp/tmpwcvrezm5/lib/python3.6/site-packages/pip/_internal/operations/prepare.py", line 516, in prepare_linked_requirement
          req, self.req_tracker, self.finder, self.build_isolation,
        File "/tmp/tmpwcvrezm5/lib/python3.6/site-packages/pip/_internal/operations/prepare.py", line 94, in _get_prepared_distribution
          with req_tracker.track(req):
        File "/snap/charm/397/usr/lib/python3.6/contextlib.py", line 81, in __enter__
          return next(self.gen)
        File "/tmp/tmpwcvrezm5/lib/python3.6/site-packages/pip/_internal/req/req_tracker.py", line 148, in track
          self.add(req)
        File "/tmp/tmpwcvrezm5/lib/python3.6/site-packages/pip/_internal/req/req_tracker.py", line 115, in add
          raise LookupError(message)
      LookupError: https://files.pythonhosted.org/packages/15/39/728ccb81172c73f14084948b2d4561d5e51649dcf4b21d1f207b7363b1d7/wheel-0.34.0.tar.gz#sha256=a69231973dccde8558f80f2ef058335a1d0bc1b55b2a5a2dfb5097e151e3c498 (from https://pypi.org/simple/wheel/) (requires-python:!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7) is already being built: wheel from https://files.pythonhosted.org/packages/15/39/728ccb81172c73f14084948b2d4561d5e51649dcf4b21d1f207b7363b1d7/wheel-0.34.0.tar.gz#sha256=a69231973dccde8558f80f2ef058335a1d0bc1b55b2a5a2dfb5097e151e3c498
      ----------------------------------------
    ERROR: Command errored out with exit status 2: /tmp/tmpwcvrezm5/bin/python3 /tmp/tmpwcvrezm5/lib/python3.6/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-gpzbcj12/overlay --no-warn-script-location --no-binary :all: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=34.4' wheel Check the logs for full command output.
    ----------------------------------------
  ERROR: Command errored out with exit status 1: /tmp/tmpwcvrezm5/bin/python3 /tmp/tmpwcvrezm5/lib/python3.6/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-7g4pbsan/overlay --no-warn-script-location --no-binary :all: --only-binary :none: -i https://pypi.org/simple -- 'setuptools >= 42' 'setuptools_scm[toml]>=3.4' Check the logs for full command output.
  ----------------------------------------
ERROR: Command errored out with exit status 1: /tmp/tmpwcvrezm5/bin/python3 /tmp/tmpwcvrezm5/lib/python3.6/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-oadnjc9s/overlay --no-warn-script-location --no-binary :all: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel Check the logs for full command output.

Command failed: bash -c . /tmp/tmpwcvrezm5/bin/activate ; pip3 download --no-binary :all: -d /tmp/tmp7vhdaugr -r /home/freyes/Projects/charms/layers/layer-basic/wheelhouse.txt

With this change things compile again.

$ charm build
build: DEPRECATED: implicit series; specify series in metadata.yaml instead
build: Build dir not specified via command-line or environment; defaulting to /tmp/charm-builds
build: Please add a `repo` key to your layer.yaml, with a url from which your layer can be cloned.
build: Destination charm directory: /tmp/charm-builds/layer-basic
build: Processing layer: layer:options
build: Processing layer: layer-basic (from .)
build: Empty metadata.yaml
proof: E: Missing required metadata field (name)
proof: E: Missing required metadata field (summary)
proof: I: metadata name (None) must match directory name (layer-basic) exactly for local deployment.
proof: I: `display-name` not provided, add for custom naming in the UI
proof: E: Charm must have either a maintainer or maintainers field
proof: W: Metadata missing required field "tags"
proof: E: missing series: must be a list of series names
proof: I: No icon.svg file.
proof: I: all charms should provide at least one thing
proof: I: File config.yaml not found.
$ git diff
diff --git a/wheelhouse.txt b/wheelhouse.txt
index 664a385..e27cab5 100644
--- a/wheelhouse.txt
+++ b/wheelhouse.txt
@@ -3,6 +3,7 @@
 # the older setuptools at the system level if include_system_packages is true
 pip>=18.1,<19.0
 setuptools<42
+setuptools_scm[toml]<3.4
 setuptools-scm<=1.17.0
 charmhelpers>=0.4.0,<1.0.0
 charms.reactive>=0.1.0,<2.0.0

Something changed in the dependencies and this is no longer reproducible. Closing.