charm-tools icon indicating copy to clipboard operation
charm-tools copied to clipboard

charm-build incorrectly picks up layers from $JUJU_REPOSITORY

Open johnsca opened this issue 8 years ago • 2 comments

If a directory with the same name as a base or interface layer exists under the $JUJU_REPOSITORY path, it will be picked up, even when $LAYER_PATH or $INTERFACE_PATH is set and even if there is a matching layer under those paths. We probably shouldn't search $JUJU_REPOSITORY at all for layers, and if $LAYER_PATH or $INTERFACE_PATH are not set, we should default to never using local layers.

[johnsca@murdoch:~ … layers/prometheus] $ charm build
build: Destination charm directory: /home/johnsca/juju/envs/dev/builds/prometheus
build: Processing layer: layer:basic (from ../basic)
build: Processing layer: layer:snap (from ../layer-snap)
build: Processing layer: prometheus (from .)
build: Processing interface: http (from ../../interfaces/http)
build: Processing interface: http (from ../../interfaces/http)                                                                                                             build: Processing interface: http (from ../../interfaces/http)
build: Processing interface: http (from ../../interfaces/http)                                                                                                             build: Processing interface: http (from ../../interfaces/http)
build: Processing interface: nrpe-external-master                                                                                                                          build: Processing interface: grafana-source
build: Processing interface: prometheus
proof: OK!
[johnsca@murdoch:~ … layers/prometheus] $ mkdir $JUJU_REPOSITORY/{http,snap}
[johnsca@murdoch:~ … layers/prometheus] $ charm build
build: Destination charm directory: /home/johnsca/juju/envs/dev/builds/prometheus
build: Processing layer: layer:basic (from ../basic)
build: Processing layer: layer:snap (from ../../snap)
build: Processing layer: prometheus (from .)
build: Processing interface: http (from ../../http)
build: Processing interface: http (from ../../http)
build: Processing interface: http (from ../../http)
build: Processing interface: http (from ../../http)
build: Processing interface: http (from ../../http)
build: Processing interface: nrpe-external-master
build: Processing interface: grafana-source
build: Processing interface: prometheus
charmtools.build.tactics: Missing implementation for interface role: provides.py

johnsca avatar Oct 10 '17 19:10 johnsca

@mitechie

johnsca avatar Oct 10 '17 19:10 johnsca

There are some improvements we could make to the above output, as well. The interface error should indicate which relation endpoint and / or interface name it failed on. The "Processing interface" lines should indicate which relation endpoint / endpoint type they are for, so it's clear why they're being repeated. It would also be helpful for bug reporting, at least, to also report the source directory for the build.

johnsca avatar Oct 10 '17 19:10 johnsca