charm build includes trusty dir when building in "." #106

Closed
1stvamp opened this Issue Feb 12, 2016 · 1 comment

Comments

Projects
None yet
3 participants

1stvamp commented Feb 12, 2016

If you don't set a JUJU_REPOSITORY and leave charm build to build in the current layer dir (.), then it picks up previous trusty dir, and then embeds it inside the built charm (inside the previously generated trusty dir), leading to an every growing embedded Inception-esque tree of trusty's, e.g. for the charm I'm working on I had 6 levels deep since my last rm -rf of the build dirs:

$ ls -lah trusty/errbot/trusty/errbot/trusty/errbot/trusty/errbot/trusty/errbot/
total 144K
drwxrwxr-x 9 wes wes 4.0K Feb 12 11:12 .
drwxrwxr-x 3 wes wes 4.0K Feb 12 11:12 ..
-rw-rw-r-- 1 wes wes  66K Feb 12 11:09 .build.manifest
-rw-rw-r-- 1 wes wes 4.8K Feb 12 11:12 config.yaml
-rw-rw-r-- 1 wes wes  265 Feb 12 11:12 copyright
drwxrwxr-x 4 wes wes 4.0K Feb 12 11:12 deps
-rw-rw-r-- 1 wes wes   19 Jan 21 11:09 .gitignore
drwxrwxr-x 3 wes wes 4.0K Feb 12 11:12 hooks
-rw-rw-r-- 1 wes wes  112 Feb 12 11:12 layer.yaml
drwxrwxr-x 3 wes wes 4.0K Feb 12 11:12 lib
-rw-rw-r-- 1 wes wes  501 Feb 12 11:12 Makefile
-rw-rw-r-- 1 wes wes  452 Feb 12 11:01 metadata.yaml
drwxrwxr-x 2 wes wes 4.0K Feb 12 11:12 reactive
-rw-rw-r-- 1 wes wes  450 Feb 10 22:16 README.md
-rw-rw-r-- 1 wes wes   14 Feb 12 11:12 requirements.txt
drwxrwxr-x 2 wes wes 4.0K Feb 12 11:12 templates
drwxrwxr-x 2 wes wes 4.0K Feb 12 11:12 tests
-rw-rw-r-- 1 wes wes  111 Feb 12 11:12 tox.ini
drwxrwxr-x 2 wes wes 4.0K Feb 12 11:12 wheelhouse

The series directory should ideally be blacklisted when building into "." (which takes care of the edge-cases where people include their own trusty/xenail/etc dir, they would need to define JUJU_REPOSITORY for it to work anyway).

@1stvamp 1stvamp changed the title from charm build includes trusty and deps dirs when building in "." to charm build includes trusty dir when building in "." Feb 12, 2016

johnsca added a commit to johnsca/charm-tools that referenced this issue Feb 12, 2016

johnsca added a commit to johnsca/charm-tools that referenced this issue Feb 12, 2016

Fixed #83: Clean up files removed in base layers
Also fixes:

  * Fix #11
  * Fix #19
  * Fix #33
  * Fix #106

@marcoceppi marcoceppi closed this Feb 12, 2016

@marcoceppi marcoceppi added this to the 2.0 milestone Feb 12, 2016

Member

johnsca commented Feb 12, 2016

I would generally discourage building into your charm layer source directory. You end up polluting your clean charm source layer with build artifacts which loses several of the benefits of layering and makes it harder to maintain.

I would also discourage you from rebuilding a generated charm from within the build output directory. You should instead rebuild from the source layer and into the (separate) build output directory.

That said, #114 should fix this, since even with this pattern being discouraged, the current behavior is incorrect.

marcoceppi added a commit that referenced this issue Mar 3, 2016

Fixed #83: Clean up files removed in base layers
Also fixes:

  * Fix #11
  * Fix #19
  * Fix #33
  * Fix #106
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment