canonical / charmcraft

Collaborate, build and publish charmed operators for Kubernetes, Linux and Windows.
Apache License 2.0
66 stars 71 forks source link

reactive plugin: call `charm build` with `-v` #924

Open hloeung opened 2 years ago

hloeung commented 2 years ago

Hi,

Trying to debug a build/pack issue, https://github.com/canonical/charmcraft/issues/923, I'm trying to compare output from a failed and previously successful one:

https://launchpadlibrarian.net/631398435/buildlog_charm_ubuntu_focal_amd64_haw-test_BUILDING.txt.gz https://launchpadlibrarian.net/632662139/buildlog_charm_ubuntu_focal_amd64_testing_BUILDING.txt.gz

Unfortunately, there isn't much output from the charm build step when a charm is successfully built so it makes it quite hard:

:: proof: I: all charms should provide at least one thing
:: charm tool execution command=['charm', 'proof']
:: charm tool execution WARNING: returncode=100
:: charm tool execution command=['charm', 'build', '-o', PosixPath('/home/buildd/haw-test/build/parts/charm/build')]
:: charm tool execution WARNING: returncode=100
Running step STAGE for part 'charm'
Execute action
Running step PRIME for part 'charm'
Execute action
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).
Check result: framework [attribute] unknown (None; see more at https://juju.is/docs/sdk/charmcraft-analyzers-and-linters#heading--framework).
Creating the package itself
Created 'haw-test_ubuntu-20.04-amd64.charm'.

Any chance we can call charm build with -v / --verbose when charmcraft pack is called with --verbosity trace?

facundobatista commented 1 year ago

Hello @hloeung ! Thanks for the report! It's a good idea, I'm flagging this as triaged.

In the meantime, note that you can pass any option to the build command through the reactive-charm-build-arguments config (see here for more details).

Thanks again!

lengau commented 1 month ago

This should be done if --verbosity=debug too.

syncronize-issues-to-jira[bot] commented 1 month ago

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/CRAFT-3424.

This message was autogenerated

lengau commented 1 month ago

To anyone wanting to implement this: The location is here: https://github.com/canonical/charmcraft/blob/f7a8be3d8e9ce79c661481ebf35b00d39ef040a2/charmcraft/parts/plugins/_reactive.py#L180

You'll want to check if craft_cli.emit.mode in (craft_cli.EmitterMode.VERBOSE) and if so add --verbosity=debug to all charm calls.