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

Latest charm doesn't honor wheelhouse.txt #648

Closed
3 tasks done
hloeung opened this issue Nov 8, 2022 · 2 comments
Closed
3 tasks done

Latest charm doesn't honor wheelhouse.txt #648

hloeung opened this issue Nov 8, 2022 · 2 comments

Comments

@hloeung
Copy link
Contributor

hloeung commented Nov 8, 2022

Checklist

  • Confirmed this is an issue with charm-tools, not charmstore-client
  • Provide versions of tools used
  • Described the feature or ways to replicate the issue

What version am I running?

I ran the following command: snap info charm and got the following ouput:

ubuntu@juju-87625f-hloeung-126:~/haw-test-charm$ snap info charm
name:      charm
summary:   charm-tools
publisher: Canonical✓
store-url: https://snapcraft.io/charm
contact:   https://discourse.juju.is/c/charming
license:   GPL-3.0
description: |
  Tools for building and maintaining reactive charms.
commands:
  - charm
snap-id:      2Rryoc2ylScfbFl4eQtpntHD9iuZuMvt
tracking:     latest/stable
refresh-date: today at 07:30 UTC
channels:
  3.x/stable:       3.0.4               2022-10-09 (687)  28MB classic
  3.x/candidate:    ↑
  3.x/beta:         ↑
  3.x/edge:         ↑
  latest/stable:    3.0.4               2022-10-09 (687)  28MB classic
  latest/candidate: ↑
  latest/beta:      ↑
  latest/edge:      3.0.4               2022-10-09 (687)  28MB classic
  2.x/stable:       2.8.2               2022-09-28 (609) 119MB classic
  2.x/candidate:    ↑
  2.x/beta:         ↑
  2.x/edge:         2.8.4+git-9-98edcd3 2022-09-28 (664) 119MB classic
installed:          3.0.4                          (687)  28MB classic
ubuntu@juju-87625f-hloeung-126:~/haw-test-charm$

I am using: (Your operating system)

Issue/Feature

I expect/expected the following

Charm builds successfully with the chosen wheel python package pinned in wheelhouse.txt.

We'll get a .charm and unzip -l will show a different version of wheel than the latest.

What I got

I get a failure to build. Here's steps to reproduce:

buntu@juju-87625f-hloeung-126:~/haw-test-charm$ cat wheelhouse.tx
# Include python requirements here
# Focal failures - https://github.com/juju-solutions/layer-basic/issues/210
Jinja2==2.10;python_version >= '3.0' and python_version <= '3.4' # py3 trusty
Jinja2==2.11;python_version == '2.7' or python_version == '3.5'  # py27, py35
# Focal failures - https://github.com/juju-solutions/layer-basic/issues/210
Jinja2==2.11;python_version >= '3.6' and python_version <= '3.8' # py38, focal
Jinja2;python_version > '3.8'
# Needed to support Focal - https://github.com/juju-solutions/layer-basic/issues/210 & https://github.com/pypa/setuptools/issues/2029
MarkupSafe<2.0.0;python_version < '3.6'
MarkupSafe<2.1.0;python_version >= '3.6' and python_version <= '3.8' # py38, focal
MarkupSafe;python_version > '3.8'

wheel<0.38
ubuntu@juju-87625f-hloeung-126:~/haw-test-charm$ make clean; charmcraft pack --destructive-mode --verbosity trace
Cleaning files
Removing build/
2022-11-08 07:27:09.714 Starting charmcraft version 2.1.0
2022-11-08 07:27:09.714 Logging execution to '/home/ubuntu/snap/charmcraft/common/cache/charmcraft/log/charmcraft-20221108-072709.712855.log'
2022-11-08 07:27:09.714 Raw pre-parsed sysargs: args={'help': False, 'verbose': False, 'quiet': False, 'verbosity': 'trace', 'project_dir': None} filtered=['pack', '--destructive-mode']
2022-11-08 07:27:09.715 General parsed sysargs: command='pack' args=['--destructive-mode']
2022-11-08 07:27:09.720 Command parsed sysargs: Namespace(bases_index=None, debug=False, destructive_mode=True, force=False, format=None, measure=None, shell=False, shell_after=False)
2022-11-08 07:27:09.721 System details: OSPlatform(system='ubuntu', release='20.04', machine='x86_64'); Environment: None
2022-11-08 07:27:09.721 Packing the charm.
2022-11-08 07:27:09.721 Reading '/home/ubuntu/haw-test-charm/metadata.yaml'
2022-11-08 07:27:09.723 Validating metadata format
2022-11-08 07:27:09.741 Building for 'bases[0]' as host matches 'build-on[0]'.
2022-11-08 07:27:09.742 Skipping 'bases[1].build-on[0]': channel '22.04' does not match host '20.04'.
2022-11-08 07:27:09.742 No suitable 'build-on' environment found in 'bases[1]' configuration.
2022-11-08 07:27:09.742 Building for 'bases[0][0]'.
2022-11-08 07:27:09.743 Building charm in '/home/ubuntu/haw-test-charm/build'
2022-11-08 07:27:09.743 Parts definition: {'charm': {'source': '.', 'reactive-charm-build-arguments': [], 'plugin': 'reactive', 'build-snaps': ['charm']}}
2022-11-08 07:27:09.744 is_snap: True, SNAP_NAME set to charmcraft
2022-11-08 07:27:09.745 Setting target machine to x86_64
2022-11-08 07:27:09.746 Executing parts lifecycle in '/home/ubuntu/haw-test-charm'
2022-11-08 07:27:09.747 process charm:Step.PULL
2022-11-08 07:27:09.747 add action charm:Step.PULL(ActionType.RUN)
2022-11-08 07:27:09.748 process charm:Step.OVERLAY
2022-11-08 07:27:09.749 add action charm:Step.OVERLAY(ActionType.RUN)
2022-11-08 07:27:09.749 process charm:Step.BUILD
2022-11-08 07:27:09.750 add action charm:Step.BUILD(ActionType.RUN)
2022-11-08 07:27:09.750 process charm:Step.STAGE
2022-11-08 07:27:09.751 add action charm:Step.STAGE(ActionType.RUN)
2022-11-08 07:27:09.751 process charm:Step.PRIME
2022-11-08 07:27:09.752 add action charm:Step.PRIME(ActionType.RUN)
2022-11-08 07:27:09.752 Parts actions: [Action(part_name='charm', step=Step.PULL, action_type=ActionType.RUN, reason=None, project_vars=None), Action(part_name='charm', step=Step.OVERLAY, action_type=ActionType.RUN, reason=None, project_vars=None), Action(part_name='charm', step=Step.BUILD, action_type=ActionType.RUN, reason=None, project_vars=None), Action(part_name='charm', step=Step.STAGE, action_type=ActionType.RUN, reason=None, project_vars=None), Action(part_name='charm', step=Step.PRIME, action_type=ActionType.RUN, reason=None, project_vars=None)]
2022-11-08 07:27:09.753 ignore patterns: ['*.charm', 'build']
2022-11-08 07:27:09.754 part build snaps: ['charm']
2022-11-08 07:27:10.118 verify plugin environment for part 'charm'
2022-11-08 07:27:10.121 plugin validation environment: #!/bin/bash
set -euo pipefail
# Environment
## Application environment
## Part environment
export CRAFT_ARCH_TRIPLET="x86_64-linux-gnu"
export CRAFT_TARGET_ARCH="amd64"
export CRAFT_PARALLEL_BUILD_COUNT="1"
export CRAFT_PROJECT_DIR="/home/ubuntu/haw-test-charm"
export CRAFT_OVERLAY="/home/ubuntu/haw-test-charm/build/overlay/overlay"
export CRAFT_STAGE="/home/ubuntu/haw-test-charm/build/stage"
export CRAFT_PRIME="/home/ubuntu/haw-test-charm/build/prime"
export CRAFT_PROJECT_NAME="haw-test"
export CRAFT_PART_NAME="charm"
export CRAFT_STEP_NAME="BUILD"
export CRAFT_PART_SRC="/home/ubuntu/haw-test-charm/build/parts/charm/src"
export CRAFT_PART_SRC_WORK="/home/ubuntu/haw-test-charm/build/parts/charm/src"
export CRAFT_PART_BUILD="/home/ubuntu/haw-test-charm/build/parts/charm/build"
export CRAFT_PART_BUILD_WORK="/home/ubuntu/haw-test-charm/build/parts/charm/build"
export CRAFT_PART_INSTALL="/home/ubuntu/haw-test-charm/build/parts/charm/install"
## Plugin environment
## User environment
2022-11-08 07:27:10.125 plugin validation command: 'charm version --format json'                                                        found charm-tools 3.0.4 (+git-0-977ec1f)

2022-11-08 07:27:11.260 Running step PULL for part 'charm'
2022-11-08 07:27:11.261 Execute action
2022-11-08 07:27:11.262 execute action charm:Action(part_name='charm', step=Step.PULL, action_type=ActionType.RUN, reason=None, project_vars=None)
2022-11-08 07:27:11.289 Running step OVERLAY for part 'charm'
2022-11-08 07:27:11.289 Execute action
2022-11-08 07:27:11.289 execute action charm:Action(part_name='charm', step=Step.OVERLAY, action_type=ActionType.RUN, reason=None, project_vars=None)
2022-11-08 07:27:11.308 Running step BUILD for part 'charm'
2022-11-08 07:27:11.308 Execute action
2022-11-08 07:27:11.309 execute action charm:Action(part_name='charm', step=Step.BUILD, action_type=ActionType.RUN, reason=None, project_vars=None)
2022-11-08 07:27:11.310 remove directory /home/ubuntu/haw-test-charm/build/parts/charm/build
2022-11-08 07:27:11.339 plugin validation environment: #!/bin/bash
set -euo pipefail
# Environment
## Application environment
## Part environment
export CRAFT_ARCH_TRIPLET="x86_64-linux-gnu"
export CRAFT_TARGET_ARCH="amd64"
export CRAFT_PARALLEL_BUILD_COUNT="1"
export CRAFT_PROJECT_DIR="/home/ubuntu/haw-test-charm"
export CRAFT_OVERLAY="/home/ubuntu/haw-test-charm/build/overlay/overlay"
export CRAFT_STAGE="/home/ubuntu/haw-test-charm/build/stage"
export CRAFT_PRIME="/home/ubuntu/haw-test-charm/build/prime"
export CRAFT_PROJECT_NAME="haw-test"
export CRAFT_PART_NAME="charm"
export CRAFT_STEP_NAME="BUILD"
export CRAFT_PART_SRC="/home/ubuntu/haw-test-charm/build/parts/charm/src"
export CRAFT_PART_SRC_WORK="/home/ubuntu/haw-test-charm/build/parts/charm/src"
export CRAFT_PART_BUILD="/home/ubuntu/haw-test-charm/build/parts/charm/build"
export CRAFT_PART_BUILD_WORK="/home/ubuntu/haw-test-charm/build/parts/charm/build"
export CRAFT_PART_INSTALL="/home/ubuntu/haw-test-charm/build/parts/charm/install"
## Plugin environment
## User environment
2022-11-08 07:27:11.341 plugin validation command: 'charm version --format json'                                                        found charm-tools 3.0.4 (+git-0-977ec1f)

2022-11-08 07:27:12.478 :: + /snap/charmcraft/1083/bin/python3 -I /snap/charmcraft/1083/lib/charmcraft/reactive_plugin.py haw-test /home/ubuntu/haw-test-charm/build/parts/charm/build /home/ubuntu/haw-test-charm/build/parts/charm/install
2022-11-08 07:27:14.100 :: I: Unknown root metadata field (issues)
2022-11-08 07:27:14.101 :: I: metadata name (haw-test) must match directory name (build) exactly for local deployment.
2022-11-08 07:27:14.102 :: I: `display-name` not provided, add for custom naming in the UI
2022-11-08 07:27:14.102 :: W: Maintainer format should be "Name <Email>", not "launchpad.net/~hloeung"
2022-11-08 07:27:14.103 :: I: DEPRECATED: series parameter is ignored by charmcraft,use bases in charmcraft.yaml
2022-11-08 07:27:14.103 :: I: No icon.svg file.
2022-11-08 07:27:14.104 :: I: no hooks directory
2022-11-08 07:27:14.104 :: I: all charms should provide at least one thing
2022-11-08 07:27:14.105 :: I: missing recommended hook install
2022-11-08 07:27:14.105 :: I: missing recommended hook start
2022-11-08 07:27:14.106 :: I: missing recommended hook stop
2022-11-08 07:27:14.106 :: I: missing recommended hook config-changed
2022-11-08 07:27:16.354 :: build: The lockfile /home/ubuntu/haw-test-charm/build/parts/charm/build/build.lock was not found; building using latest versions.
2022-11-08 07:27:16.355 :: build: Destination charm directory: /home/ubuntu/haw-test-charm/build/parts/charm/build/haw-test
2022-11-08 07:27:34.008 :: build: Processing layer: layer:options
2022-11-08 07:27:34.155 :: build: Processing layer: layer:basic
2022-11-08 07:27:34.317 :: build: Processing layer: layer:status
2022-11-08 07:27:34.433 :: build: Processing layer: layer:apt
2022-11-08 07:27:34.585 :: build: Processing layer: haw-test (from .)
2022-11-08 07:27:45.423 :: build: Ignoring pip: markers 'python_version < "3.8"' don't match your environment
2022-11-08 07:27:45.423 :: Ignoring PyYAML: markers 'python_version >= "3.0" and python_version <= "3.4"' don't match your environment
2022-11-08 07:27:45.423 :: Ignoring setuptools: markers 'python_version < "3.8"' don't match your environment
2022-11-08 07:27:45.424 :: Ignoring setuptools-scm: markers 'python_version < "3.8"' don't match your environment
2022-11-08 07:27:45.424 :: Ignoring Jinja2: markers 'python_version >= "3.0" and python_version <= "3.4"' don't match your environment
2022-11-08 07:27:45.424 :: Ignoring Jinja2: markers 'python_version == "2.7" or python_version == "3.5"' don't match your environment
2022-11-08 07:27:45.425 :: Ignoring Jinja2: markers 'python_version > "3.8"' don't match your environment
2022-11-08 07:27:45.425 :: Ignoring MarkupSafe: markers 'python_version < "3.6"' don't match your environment
2022-11-08 07:27:45.425 :: Ignoring MarkupSafe: markers 'python_version > "3.8"' don't match your environment
2022-11-08 07:27:45.425 :: Collecting pip<22.1
2022-11-08 07:27:45.425 ::   Using cached pip-22.0.4.tar.gz (2.1 MB)
2022-11-08 07:27:45.426 ::   Installing build dependencies: started
2022-11-08 07:27:45.426 ::   Installing build dependencies: finished with status 'error'
2022-11-08 07:27:45.428 ::   ERROR: Command errored out with exit status 1:
2022-11-08 07:27:45.428 ::    command: /home/ubuntu/snap/charmcraft/common/tmpzgdcio40/bin/python /home/ubuntu/snap/charmcraft/common/tmpzgdcio40/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /home/ubuntu/snap/charmcraft/common/pip-build-env-8l0w3h0p/overlay --no-warn-script-location --no-binary :all: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel
2022-11-08 07:27:45.428 ::        cwd: None
2022-11-08 07:27:45.428 ::   Complete output (71 lines):
2022-11-08 07:27:45.429 ::   Collecting setuptools
2022-11-08 07:27:45.429 ::     Using cached setuptools-65.5.1.tar.gz (2.6 MB)
2022-11-08 07:27:45.429 ::     Getting requirements to build wheel: started
2022-11-08 07:27:45.429 ::     Getting requirements to build wheel: finished with status 'done'
2022-11-08 07:27:45.429 ::     Installing backend dependencies: started
2022-11-08 07:27:45.430 ::     Installing backend dependencies: finished with status 'error'
2022-11-08 07:27:45.430 ::     ERROR: Command errored out with exit status 1:
2022-11-08 07:27:45.430 ::      command: /home/ubuntu/snap/charmcraft/common/tmpzgdcio40/bin/python /home/ubuntu/snap/charmcraft/common/tmpzgdcio40/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /home/ubuntu/snap/charmcraft/common/pip-build-env-fn2au063/normal --no-warn-script-location --no-binary :all: --only-binary :none: -i https://pypi.org/simple -- wheel
2022-11-08 07:27:45.430 ::          cwd: None
2022-11-08 07:27:45.430 ::     Complete output (59 lines):
2022-11-08 07:27:45.431 ::     Collecting wheel
2022-11-08 07:27:45.431 ::       Using cached wheel-0.38.2.tar.gz (66 kB)
2022-11-08 07:27:45.433 ::         ERROR: Command errored out with exit status 1:
2022-11-08 07:27:45.433 ::          command: /home/ubuntu/snap/charmcraft/common/tmpzgdcio40/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/ubuntu/snap/charmcraft/common/pip-install-sgjczqdu/wheel/setup.py'"'"'; __file__='"'"'/home/ubuntu/snap/charmcraft/common/pip-install-sgjczqdu/wheel/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /home/ubuntu/snap/charmcraft/common/pip-install-sgjczqdu/wheel/pip-egg-info
2022-11-08 07:27:45.433 ::              cwd: /home/ubuntu/snap/charmcraft/common/pip-install-sgjczqdu/wheel/
2022-11-08 07:27:45.434 ::         Complete output (51 lines):
2022-11-08 07:27:45.434 ::         running egg_info
2022-11-08 07:27:45.434 ::         creating /home/ubuntu/snap/charmcraft/common/pip-install-sgjczqdu/wheel/pip-egg-info/wheel.egg-info
2022-11-08 07:27:45.434 ::         writing /home/ubuntu/snap/charmcraft/common/pip-install-sgjczqdu/wheel/pip-egg-info/wheel.egg-info/PKG-INFO
2022-11-08 07:27:45.435 ::         writing dependency_links to /home/ubuntu/snap/charmcraft/common/pip-install-sgjczqdu/wheel/pip-egg-info/wheel.egg-info/dependency_links.txt
2022-11-08 07:27:45.435 ::         writing entry points to /home/ubuntu/snap/charmcraft/common/pip-install-sgjczqdu/wheel/pip-egg-info/wheel.egg-info/entry_points.txt
2022-11-08 07:27:45.435 ::         writing requirements to /home/ubuntu/snap/charmcraft/common/pip-install-sgjczqdu/wheel/pip-egg-info/wheel.egg-info/requires.txt
2022-11-08 07:27:45.435 ::         writing top-level names to /home/ubuntu/snap/charmcraft/common/pip-install-sgjczqdu/wheel/pip-egg-info/wheel.egg-info/top_level.txt
2022-11-08 07:27:45.435 ::         writing manifest file '/home/ubuntu/snap/charmcraft/common/pip-install-sgjczqdu/wheel/pip-egg-info/wheel.egg-info/SOURCES.txt'
2022-11-08 07:27:45.436 ::         Traceback (most recent call last):
2022-11-08 07:27:45.436 ::           File "<string>", line 1, in <module>
2022-11-08 07:27:45.436 ::           File "/home/ubuntu/snap/charmcraft/common/pip-install-sgjczqdu/wheel/setup.py", line 5, in <module>
2022-11-08 07:27:45.436 ::             setup()
2022-11-08 07:27:45.437 ::           File "/home/ubuntu/snap/charmcraft/common/tmpzgdcio40/lib/python3.8/site-packages/setuptools/__init__.py", line 145, in setup
2022-11-08 07:27:45.437 ::             return distutils.core.setup(**attrs)
2022-11-08 07:27:45.437 ::           File "/usr/lib/python3.8/distutils/core.py", line 148, in setup
2022-11-08 07:27:45.437 ::             dist.run_commands()
2022-11-08 07:27:45.438 ::           File "/usr/lib/python3.8/distutils/dist.py", line 966, in run_commands
2022-11-08 07:27:45.438 ::             self.run_command(cmd)
2022-11-08 07:27:45.439 ::           File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
2022-11-08 07:27:45.439 ::             cmd_obj.run()
2022-11-08 07:27:45.439 ::           File "/home/ubuntu/snap/charmcraft/common/tmpzgdcio40/lib/python3.8/site-packages/setuptools/command/egg_info.py", line 296, in run
2022-11-08 07:27:45.440 ::             self.find_sources()
2022-11-08 07:27:45.440 ::           File "/home/ubuntu/snap/charmcraft/common/tmpzgdcio40/lib/python3.8/site-packages/setuptools/command/egg_info.py", line 303, in find_sources
2022-11-08 07:27:45.440 ::             mm.run()
2022-11-08 07:27:45.440 ::           File "/home/ubuntu/snap/charmcraft/common/tmpzgdcio40/lib/python3.8/site-packages/setuptools/command/egg_info.py", line 534, in run
2022-11-08 07:27:45.443 ::             self.add_defaults()
2022-11-08 07:27:45.443 ::           File "/home/ubuntu/snap/charmcraft/common/tmpzgdcio40/lib/python3.8/site-packages/setuptools/command/egg_info.py", line 570, in add_defaults
2022-11-08 07:27:45.443 ::             sdist.add_defaults(self)
2022-11-08 07:27:45.444 ::           File "/usr/lib/python3.8/distutils/command/sdist.py", line 226, in add_defaults
2022-11-08 07:27:45.444 ::             self._add_defaults_python()
2022-11-08 07:27:45.444 ::           File "/home/ubuntu/snap/charmcraft/common/tmpzgdcio40/lib/python3.8/site-packages/setuptools/command/sdist.py", line 135, in _add_defaults_python
2022-11-08 07:27:45.444 ::             build_py = self.get_finalized_command('build_py')
2022-11-08 07:27:45.445 ::           File "/usr/lib/python3.8/distutils/cmd.py", line 299, in get_finalized_command
2022-11-08 07:27:45.445 ::             cmd_obj.ensure_finalized()
2022-11-08 07:27:45.445 ::           File "/usr/lib/python3.8/distutils/cmd.py", line 107, in ensure_finalized
2022-11-08 07:27:45.445 ::             self.finalize_options()
2022-11-08 07:27:45.446 ::           File "/home/ubuntu/snap/charmcraft/common/tmpzgdcio40/lib/python3.8/site-packages/setuptools/command/build_py.py", line 34, in finalize_options
2022-11-08 07:27:45.446 ::             orig.build_py.finalize_options(self)
2022-11-08 07:27:45.446 ::           File "/usr/lib/python3.8/distutils/command/build_py.py", line 43, in finalize_options
2022-11-08 07:27:45.446 ::             self.set_undefined_options('build',
2022-11-08 07:27:45.446 ::           File "/usr/lib/python3.8/distutils/cmd.py", line 286, in set_undefined_options
2022-11-08 07:27:45.447 ::             src_cmd_obj = self.distribution.get_command_obj(src_cmd)
2022-11-08 07:27:45.447 ::           File "/usr/lib/python3.8/distutils/dist.py", line 857, in get_command_obj
2022-11-08 07:27:45.447 ::             klass = self.get_command_class(command)
2022-11-08 07:27:45.447 ::           File "/home/ubuntu/snap/charmcraft/common/tmpzgdcio40/lib/python3.8/site-packages/setuptools/dist.py", line 834, in get_command_class
2022-11-08 07:27:45.447 ::             self.cmdclass[command] = cmdclass = ep.load()
2022-11-08 07:27:45.448 ::           File "/home/ubuntu/snap/charmcraft/common/tmpzgdcio40/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2443, in load
2022-11-08 07:27:45.448 ::             return self.resolve()
2022-11-08 07:27:45.448 ::           File "/home/ubuntu/snap/charmcraft/common/tmpzgdcio40/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2449, in resolve
2022-11-08 07:27:45.448 ::             module = __import__(self.module_name, fromlist=['__name__'], level=0)
2022-11-08 07:27:45.448 ::         ModuleNotFoundError: No module named 'setuptools.command.build'
2022-11-08 07:27:45.449 ::         ----------------------------------------
2022-11-08 07:27:45.449 ::     ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
2022-11-08 07:27:45.449 ::     ----------------------------------------
2022-11-08 07:27:45.453 ::   ERROR: Command errored out with exit status 1: /home/ubuntu/snap/charmcraft/common/tmpzgdcio40/bin/python /home/ubuntu/snap/charmcraft/common/tmpzgdcio40/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /home/ubuntu/snap/charmcraft/common/pip-build-env-fn2au063/normal --no-warn-script-location --no-binary :all: --only-binary :none: -i https://pypi.org/simple -- wheel Check the logs for full command output.
2022-11-08 07:27:45.453 ::   ----------------------------------------
2022-11-08 07:27:45.454 :: ERROR: Command errored out with exit status 1: /home/ubuntu/snap/charmcraft/common/tmpzgdcio40/bin/python /home/ubuntu/snap/charmcraft/common/tmpzgdcio40/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /home/ubuntu/snap/charmcraft/common/pip-build-env-8l0w3h0p/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.
2022-11-08 07:27:45.495 :: charm tool execution command=['charm', 'proof']
2022-11-08 07:27:45.496 :: charm tool execution WARNING: returncode=100
2022-11-08 07:27:45.496 :: charm tool execution command=['charm', 'build', '-o', PosixPath('/home/ubuntu/haw-test-charm/build/parts/charm/build')]
2022-11-08 07:27:45.496 :: charm tool execution ERROR: returncode=1
2022-11-08 07:27:45.540 Parts processing error: Failed to run the build script for part 'charm'.
2022-11-08 07:27:45.542 Traceback (most recent call last):
2022-11-08 07:27:45.543   File "/snap/charmcraft/1083/lib/craft_parts/executor/step_handler.py", line 134, in _builtin_build
2022-11-08 07:27:45.543     subprocess.run(
2022-11-08 07:27:45.543   File "/snap/charmcraft/1083/usr/lib/python3.8/subprocess.py", line 516, in run
2022-11-08 07:27:45.543     raise CalledProcessError(retcode, process.args,
2022-11-08 07:27:45.543 subprocess.CalledProcessError: Command '['/home/ubuntu/haw-test-charm/build/parts/charm/run/build.sh']' returned non-zero exit status 1.
2022-11-08 07:27:45.544
2022-11-08 07:27:45.544 The above exception was the direct cause of the following exception:
2022-11-08 07:27:45.544 Traceback (most recent call last):
2022-11-08 07:27:45.544   File "/snap/charmcraft/1083/lib/charmcraft/parts.py", line 397, in run
2022-11-08 07:27:45.545     aex.execute([act], stdout=stream, stderr=stream)
2022-11-08 07:27:45.545   File "/snap/charmcraft/1083/lib/craft_parts/executor/executor.py", line 301, in execute
2022-11-08 07:27:45.545     self._executor.execute(actions, stdout=stdout, stderr=stderr)
2022-11-08 07:27:45.545   File "/snap/charmcraft/1083/lib/craft_parts/executor/executor.py", line 126, in execute
2022-11-08 07:27:45.545     self._run_action(act, stdout=stdout, stderr=stderr)
2022-11-08 07:27:45.546   File "/snap/charmcraft/1083/lib/craft_parts/executor/executor.py", line 189, in _run_action
2022-11-08 07:27:45.546     handler.run_action(action, stdout=stdout, stderr=stderr)
2022-11-08 07:27:45.546   File "/snap/charmcraft/1083/lib/craft_parts/executor/part_handler.py", line 161, in run_action
2022-11-08 07:27:45.546     state = handler(step_info, stdout=stdout, stderr=stderr)
2022-11-08 07:27:45.546   File "/snap/charmcraft/1083/lib/craft_parts/executor/part_handler.py", line 297, in _run_build
2022-11-08 07:27:45.547     self._run_step(
2022-11-08 07:27:45.547   File "/snap/charmcraft/1083/lib/craft_parts/executor/part_handler.py", line 477, in _run_step
2022-11-08 07:27:45.547     return step_handler.run_builtin()
2022-11-08 07:27:45.547   File "/snap/charmcraft/1083/lib/craft_parts/executor/step_handler.py", line 106, in run_builtin
2022-11-08 07:27:45.547     return handler()
2022-11-08 07:27:45.548   File "/snap/charmcraft/1083/lib/craft_parts/executor/step_handler.py", line 142, in _builtin_build
2022-11-08 07:27:45.548     raise errors.PluginBuildError(part_name=self._part.name) from process_error
2022-11-08 07:27:45.548 craft_parts.errors.PluginBuildError: Failed to run the build script for part 'charm'.
2022-11-08 07:27:45.548 Full execution log: '/home/ubuntu/snap/charmcraft/common/cache/charmcraft/log/charmcraft-20221108-072709.712855.log'

Then downgrading and retrying builds successfully:

buntu@juju-87625f-hloeung-126:~/haw-test-charm$ sudo snap refresh charm --channel 2.x/stable
charm (2.x/stable) 2.8.2 from Canonical✓ refreshed
ubuntu@juju-87625f-hloeung-126:~/haw-test-charm$ make clean; charmcraft pack --destructive-mode --verbosity trace
Cleaning files
Removing build/
2022-11-08 07:28:16.678 Starting charmcraft version 2.1.0
2022-11-08 07:28:16.678 Logging execution to '/home/ubuntu/snap/charmcraft/common/cache/charmcraft/log/charmcraft-20221108-072816.677041.log'
2022-11-08 07:28:16.678 Raw pre-parsed sysargs: args={'help': False, 'verbose': False, 'quiet': False, 'verbosity': 'trace', 'project_dir': None} filtered=['pack', '--destructive-mode']
2022-11-08 07:28:16.679 General parsed sysargs: command='pack' args=['--destructive-mode']
2022-11-08 07:28:16.684 Command parsed sysargs: Namespace(bases_index=None, debug=False, destructive_mode=True, force=False, format=None, measure=None, shell=False, shell_after=False)
2022-11-08 07:28:16.684 System details: OSPlatform(system='ubuntu', release='20.04', machine='x86_64'); Environment: None
2022-11-08 07:28:16.685 Packing the charm.
2022-11-08 07:28:16.685 Reading '/home/ubuntu/haw-test-charm/metadata.yaml'
2022-11-08 07:28:16.687 Validating metadata format
2022-11-08 07:28:16.700 Building for 'bases[0]' as host matches 'build-on[0]'.
2022-11-08 07:28:16.701 Skipping 'bases[1].build-on[0]': channel '22.04' does not match host '20.04'.
2022-11-08 07:28:16.701 No suitable 'build-on' environment found in 'bases[1]' configuration.
2022-11-08 07:28:16.701 Building for 'bases[0][0]'.
2022-11-08 07:28:16.702 Building charm in '/home/ubuntu/haw-test-charm/build'
2022-11-08 07:28:16.702 Parts definition: {'charm': {'source': '.', 'reactive-charm-build-arguments': [], 'plugin': 'reactive', 'build-snaps': ['charm']}}
2022-11-08 07:28:16.703 is_snap: True, SNAP_NAME set to charmcraft
2022-11-08 07:28:16.704 Setting target machine to x86_64
2022-11-08 07:28:16.706 Executing parts lifecycle in '/home/ubuntu/haw-test-charm'
2022-11-08 07:28:16.706 process charm:Step.PULL
2022-11-08 07:28:16.706 add action charm:Step.PULL(ActionType.RUN)
2022-11-08 07:28:16.708 process charm:Step.OVERLAY
2022-11-08 07:28:16.708 add action charm:Step.OVERLAY(ActionType.RUN)
2022-11-08 07:28:16.709 process charm:Step.BUILD
2022-11-08 07:28:16.709 add action charm:Step.BUILD(ActionType.RUN)
2022-11-08 07:28:16.710 process charm:Step.STAGE
2022-11-08 07:28:16.710 add action charm:Step.STAGE(ActionType.RUN)
2022-11-08 07:28:16.711 process charm:Step.PRIME
2022-11-08 07:28:16.711 add action charm:Step.PRIME(ActionType.RUN)
2022-11-08 07:28:16.712 Parts actions: [Action(part_name='charm', step=Step.PULL, action_type=ActionType.RUN, reason=None, project_vars=None), Action(part_name='charm', step=Step.OVERLAY, action_type=ActionType.RUN, reason=None, project_vars=None), Action(part_name='charm', step=Step.BUILD, action_type=ActionType.RUN, reason=None, project_vars=None), Action(part_name='charm', step=Step.STAGE, action_type=ActionType.RUN, reason=None, project_vars=None), Action(part_name='charm', step=Step.PRIME, action_type=ActionType.RUN, reason=None, project_vars=None)]
2022-11-08 07:28:16.713 ignore patterns: ['*.charm', 'build']
2022-11-08 07:28:16.713 part build snaps: ['charm']
2022-11-08 07:28:17.080 verify plugin environment for part 'charm'
2022-11-08 07:28:17.083 plugin validation environment: #!/bin/bash
set -euo pipefail
# Environment
## Application environment
## Part environment
export CRAFT_ARCH_TRIPLET="x86_64-linux-gnu"
export CRAFT_TARGET_ARCH="amd64"
export CRAFT_PARALLEL_BUILD_COUNT="1"
export CRAFT_PROJECT_DIR="/home/ubuntu/haw-test-charm"
export CRAFT_OVERLAY="/home/ubuntu/haw-test-charm/build/overlay/overlay"
export CRAFT_STAGE="/home/ubuntu/haw-test-charm/build/stage"
export CRAFT_PRIME="/home/ubuntu/haw-test-charm/build/prime"
export CRAFT_PROJECT_NAME="haw-test"
export CRAFT_PART_NAME="charm"
export CRAFT_STEP_NAME="BUILD"
export CRAFT_PART_SRC="/home/ubuntu/haw-test-charm/build/parts/charm/src"
export CRAFT_PART_SRC_WORK="/home/ubuntu/haw-test-charm/build/parts/charm/src"
export CRAFT_PART_BUILD="/home/ubuntu/haw-test-charm/build/parts/charm/build"
export CRAFT_PART_BUILD_WORK="/home/ubuntu/haw-test-charm/build/parts/charm/build"
export CRAFT_PART_INSTALL="/home/ubuntu/haw-test-charm/build/parts/charm/install"
## Plugin environment
## User environment
2022-11-08 07:28:17.085 plugin validation command: 'charm version --format json' | (2.2s)                                               found charm-tools 2.8.2 (+git-0-edf965a)
2022-11-08 07:28:17.085 plugin validation command: 'charm version --format json'
2022-11-08 07:28:19.329 Running step PULL for part 'charm'
2022-11-08 07:28:19.330 Execute action
2022-11-08 07:28:19.331 execute action charm:Action(part_name='charm', step=Step.PULL, action_type=ActionType.RUN, reason=None, project_vars=None)
2022-11-08 07:28:19.359 Running step OVERLAY for part 'charm'
2022-11-08 07:28:19.359 Execute action
2022-11-08 07:28:19.360 execute action charm:Action(part_name='charm', step=Step.OVERLAY, action_type=ActionType.RUN, reason=None, project_vars=None)
2022-11-08 07:28:19.378 Running step BUILD for part 'charm'
2022-11-08 07:28:19.379 Execute action
2022-11-08 07:28:19.380 execute action charm:Action(part_name='charm', step=Step.BUILD, action_type=ActionType.RUN, reason=None, project_vars=None)
2022-11-08 07:28:19.382 remove directory /home/ubuntu/haw-test-charm/build/parts/charm/build
2022-11-08 07:28:19.438 plugin validation environment: #!/bin/bash
set -euo pipefail
# Environment
## Application environment
## Part environment
export CRAFT_ARCH_TRIPLET="x86_64-linux-gnu"
export CRAFT_TARGET_ARCH="amd64"
export CRAFT_PARALLEL_BUILD_COUNT="1"
export CRAFT_PROJECT_DIR="/home/ubuntu/haw-test-charm"
export CRAFT_OVERLAY="/home/ubuntu/haw-test-charm/build/overlay/overlay"
export CRAFT_STAGE="/home/ubuntu/haw-test-charm/build/stage"
export CRAFT_PRIME="/home/ubuntu/haw-test-charm/build/prime"
export CRAFT_PROJECT_NAME="haw-test"
export CRAFT_PART_NAME="charm"
export CRAFT_STEP_NAME="BUILD"
export CRAFT_PART_SRC="/home/ubuntu/haw-test-charm/build/parts/charm/src"
export CRAFT_PART_SRC_WORK="/home/ubuntu/haw-test-charm/build/parts/charm/src"
export CRAFT_PART_BUILD="/home/ubuntu/haw-test-charm/build/parts/charm/build"
export CRAFT_PART_BUILD_WORK="/home/ubuntu/haw-test-charm/build/parts/charm/build"
export CRAFT_PART_INSTALL="/home/ubuntu/haw-test-charm/build/parts/charm/install"
## Plugin environment
## User environment
2022-11-08 07:28:19.442 plugin validation command: 'charm version --format json'                                                        found charm-tools 2.8.2 (+git-0-edf965a)

2022-11-08 07:28:20.689 :: + /snap/charmcraft/1083/bin/python3 -I /snap/charmcraft/1083/lib/charmcraft/reactive_plugin.py haw-test /home/ubuntu/haw-test-charm/build/parts/charm/build /home/ubuntu/haw-test-charm/build/parts/charm/install
2022-11-08 07:28:23.238 :: I: Unknown root metadata field (issues)
2022-11-08 07:28:23.239 :: I: metadata name (haw-test) must match directory name (build) exactly for local deployment.
2022-11-08 07:28:23.239 :: I: `display-name` not provided, add for custom naming in the UI
2022-11-08 07:28:23.240 :: W: Maintainer format should be "Name <Email>", not "launchpad.net/~hloeung"
2022-11-08 07:28:23.240 :: I: No icon.svg file.
2022-11-08 07:28:23.240 :: I: no hooks directory
2022-11-08 07:28:23.240 :: I: all charms should provide at least one thing
2022-11-08 07:28:23.241 :: I: missing recommended hook install
2022-11-08 07:28:23.241 :: I: missing recommended hook start
2022-11-08 07:28:23.241 :: I: missing recommended hook stop
2022-11-08 07:28:23.242 :: I: missing recommended hook config-changed
2022-11-08 07:28:25.373 :: build: The lockfile /home/ubuntu/haw-test-charm/build/parts/charm/build/build.lock was not found; building using latest versions.
2022-11-08 07:28:25.375 :: build: Destination charm directory: /home/ubuntu/haw-test-charm/build/parts/charm/build/haw-test
2022-11-08 07:28:34.780 :: build: Processing layer: layer:options
2022-11-08 07:28:34.967 :: build: Processing layer: layer:basic
2022-11-08 07:28:35.081 :: build: Processing layer: layer:status
2022-11-08 07:28:35.154 :: build: Processing layer: layer:apt
2022-11-08 07:28:35.211 :: build: Processing layer: haw-test (from .)
2022-11-08 07:29:07.048 :: build:
2022-11-08 07:29:07.050 :: build: ---------------------------------------
2022-11-08 07:29:07.050 :: build:               Build Report
2022-11-08 07:29:07.051 :: build: ---------------------------------------
2022-11-08 07:29:07.051 :: build: New build; all files were modified.
2022-11-08 07:29:07.083 :: proof: I: Unknown root metadata field (issues)
2022-11-08 07:29:07.084 :: proof: I: `display-name` not provided, add for custom naming in the UI
2022-11-08 07:29:07.085 :: proof: W: Maintainer format should be "Name <Email>", not "launchpad.net/~hloeung"
2022-11-08 07:29:07.085 :: proof: I: No icon.svg file.
2022-11-08 07:29:07.086 :: proof: I: all charms should provide at least one thing
2022-11-08 07:29:07.169 :: charm tool execution command=['charm', 'proof']
2022-11-08 07:29:07.170 :: charm tool execution WARNING: returncode=100
2022-11-08 07:29:07.170 :: charm tool execution command=['charm', 'build', '-o', PosixPath('/home/ubuntu/haw-test-charm/build/parts/charm/build')]
2022-11-08 07:29:07.171 :: charm tool execution WARNING: returncode=100
2022-11-08 07:29:08.297 Running step STAGE for part 'charm'
2022-11-08 07:29:08.298 Execute action
2022-11-08 07:29:08.300 execute action charm:Action(part_name='charm', step=Step.STAGE, action_type=ActionType.RUN, reason=None, project_vars=None)
2022-11-08 07:29:08.410 Running step PRIME for part 'charm'
2022-11-08 07:29:08.411 Execute action
2022-11-08 07:29:08.412 execute action charm:Action(part_name='charm', step=Step.PRIME, action_type=ActionType.RUN, reason=None, project_vars=None)
2022-11-08 07:29:08.478 Reading '/home/ubuntu/haw-test-charm/build/prime/metadata.yaml'
2022-11-08 07:29:08.480 Reading '/home/ubuntu/haw-test-charm/build/prime/metadata.yaml'
2022-11-08 07:29:08.482 Validating metadata format
2022-11-08 07:29:08.485 Check result: language [attribute] unknown (The charm is written with Python.; see more at https://juju.is/docs/sdk/charmcraft-analyzers-and-linters#heading--language).
2022-11-08 07:29:08.486 Check result: framework [attribute] unknown (None; see more at https://juju.is/docs/sdk/charmcraft-analyzers-and-linters#heading--framework).
2022-11-08 07:29:08.488 Creating the package itself
2022-11-08 07:29:08.852 Created 'haw-test_ubuntu-20.04-amd64.charm'.
Charms packed:
    haw-test_ubuntu-20.04-amd64.charm

Checking the contents:

ubuntu@juju-87625f-hloeung-126:~/haw-test-charm$ unzip -l haw-test_ubuntu-20.04-amd64.charm | grep wheelhouse | sort -k 4
     2468  2022-11-08 07:28   wheelhouse.txt
   257890  2022-11-08 07:29   wheelhouse/Jinja2-2.11.0.tar.gz
    18596  2022-11-08 07:29   wheelhouse/MarkupSafe-2.0.1.tar.gz
   269377  2022-11-08 07:29   wheelhouse/PyYAML-5.3.1.tar.gz
   610181  2022-11-08 07:29   wheelhouse/charmhelpers-1.2.1.tar.gz
   356307  2022-11-08 07:29   wheelhouse/charms.reactive-1.5.1.tar.gz
  1622835  2022-11-08 07:29   wheelhouse/netaddr-0.7.19.tar.gz
   127505  2022-11-08 07:29   wheelhouse/pbr-5.11.0.tar.gz
  1259370  2022-11-08 07:29   wheelhouse/pip-18.1.tar.gz
    20466  2022-11-08 07:29   wheelhouse/pyaml-21.10.1.tar.gz
   852541  2022-11-08 07:29   wheelhouse/setuptools-41.6.0.zip
    29124  2022-11-08 07:29   wheelhouse/setuptools_scm-1.17.0.tar.gz
    66376  2022-11-08 07:29   wheelhouse/wheel-0.37.1.tar.gz

I need to pin the wheel package for canonical/charmcraft#923 & pypa/wheel#487

@ajkavanagh
Copy link
Collaborator

It's (unfortunately) a known issue that charmtools 3.x can't build focal charms. Please use charmtools 2.x for focal and previous versions. I'll update the README to make this clear. You can specify the charm tools version in the charmcraft as per:

type: charm

parts:
  charm:
    source: src/
    plugin: reactive
    build-snaps:
      - charm/2.x/stable
    build-environment:
      - CHARM_INTERFACES_DIR: /root/project/interfaces/
      - CHARM_LAYERS_DIR: /root/project/layers/
...

Then, in the appropriate branch for the charm version, you can control which version of charm tools is used to build the reactive charm.

Note, closing this, as it's currently not proposed to make the 3.x series of charm-tools be able to build focal charms; however, patches are welcome if this a feature that is really needed.

@fnordahl
Copy link
Collaborator

fnordahl commented Nov 8, 2022

It's (unfortunately) a known issue that charmtools 3.x can't build focal charms. Please use charmtools 2.x for focal and previous versions.

This is a bit odd statement to make. It is true that due to the setuptools version shipped with Focal combined with this Jinja2 issue, it does currently not work without pinning Jinja2 and MarkupSafe or slipping in a newer version of setuptools into the virtualenv used to download/build the Jinja2 wheel ref #646.

The main difference between charm-tools 2.x and 3.x is that 2.x uses the Python version shipped in the core18 snap (i.e. Python 3.6) to build the charm, regardless of which version of the operating system it is run on. In other words it is hard coded to always build the charm on Bionic.

charm-tools 3.x uses the Python from the build environment, so to achieve the same behavior you could always use Ubuntu 18.04 as you charm build-base.

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

3 participants