Charm fails to build

Bug #1987404 reported by Tilman Baumann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL Router Charm
Triaged
Low
Unassigned

Bug Description

I suspect the override-stage: workaround in charmcraft.yaml is no longer working

```
:: charmtools.build.tactics: Copying mysql-router: /root/parts/charm/build/build/builds/mysql-router/HACKING.md
:: charmtools.build.tactics: Copying Interface tls-certificates: /root/parts/charm/build/build/builds/mysql-router/hooks/relations/tls-certificates
:: charmtools.build.tactics: Copying Interface mysql-shared: /root/parts/charm/build/build/builds/mysql-router/hooks/relations/mysql-shared
:: charmtools.build.tactics: Copying Interface mysql-router: /root/parts/charm/build/build/builds/mysql-router/hooks/relations/mysql-router
:: charmtools.build.tactics: Trying to determine version with: git
:: utils: b'3728340\n'
:: utils: process: git describe --dirty --always (0)
:: charmtools.build.tactics: Got version: 3728340
:: build:
:: build: ---------------------------------------
:: build: Build Report
:: build: ---------------------------------------
:: build: New build; all files were modified.
:: build: Cleaning up /root/.cache/charm/407
:: proof: I: `display-name` not provided, add for custom naming in the UI
:: proof: I: config.yaml: option ssl_cert has no default value
:: proof: I: config.yaml: option ssl_key has no default value
:: proof: I: config.yaml: option ssl_ca has no default value
:: ___________________________________ summary ____________________________________
:: build-reactive: commands succeeded
:: congratulations :)
Running step STAGE for part 'charm'
Execute action
:: /bin/bash: line 30: CHARMCRAFT_STAGE: unbound variable
Parts processing error: 'override-stage' in part 'charm' failed with code 1.
Review the scriptlet and make sure it's correct.
Failed to build charm for bases index '0'.
```

I have seen the same workaround in other charms as well. I'm sure they will all fail.

But why are the overrides even necessary? charmcraft has a reactive plugin.

Revision history for this message
Tilman Baumann (tilmanbaumann) wrote :

CHARMCRAFT_PART_BUILD is also unbound

Revision history for this message
Tilman Baumann (tilmanbaumann) wrote :

This works

```
type: charm

parts:
  charm:
    build-packages:
      - tox
      - git
      - python3-dev
      - libmysqlclient-dev
    source: ./src/
    plugin: reactive
    build-snaps: [charm]

...
```

Based on https://juju.is/docs/sdk/pack-your-reactive-based-charm-with-charmcraft

Revision history for this message
Alex Kavanagh (ajkavanagh) wrote :

> But why are the overrides even necessary? charmcraft has a reactive plugin.

Because it didn't work properly when we set this up, and it still doesn't have a way of passing parameters to the build (which we need for stable branches when setting up lock files). We're working on that bit.

We've fixed this on master for charm-mysql-innodb-cluster. If you need to build the charm locally at present, just switch your charmcraft to 1.5/stable.

Changed in charm-mysql-router:
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Tilman Baumann (tilmanbaumann) wrote :

I would submit a quick patch. But gerrit refuses my ssh key. No time :D

Revision history for this message
Tilman Baumann (tilmanbaumann) wrote :

Yes it's all still a bit of a mess. But I can't wait for the build tools to be unified again. It will make it a lot cleaner. (Especially for build dependencies)

Unfortunately I need to build from source. But I can fall back to using `charm build` in any case...

Revision history for this message
Billy Olsen (billy-olsen) wrote (last edit ):

@Tilman - change CHARMCRAFT_* vars to CRAFT_* vars or ensure that you sudo snap install --channel 1.5/stable before building it. The charms currently reliably build for us on 1.5, and will soon be moving to 2.0 series.

The reason we have overrides is that we want to pin the dependencies for stable reactive charms, which requires that we use a build.lock file. However, charmcraft does not understand the build.lock arguments in the reactive plugin.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.