def _resolve_squash_cache(self, client):
from .staging import BUILD_CACHEDIR<EOL>history = client.api.history(self.buildname)<EOL>comment = history[<NUM_LIT:0>].get('<STR_LIT>', '<STR_LIT>').split()<EOL>if len(comment) != <NUM_LIT:4> or comment[<NUM_LIT:0>] != '<STR_LIT>' or comment[<NUM_LIT:2>] != '<STR_LIT:to>':<EOL><INDENT>print('<STR_LIT>'<EOL>'<STR_LIT>')<EOL>return<EOL><DEDENT>squashed_sha = history[<NUM_LIT:0>]['<STR_LIT>']<EOL>start_squash_sha = comment[<NUM_LIT:1>]<EOL>end_squash_sha = comment[<NUM_LIT:3>]<EOL>cprint('<STR_LIT>' % (start_squash_sha, end_squash_sha), '<STR_LIT>')<EOL>squashcache = os.path.join(BUILD_CACHEDIR, '<STR_LIT>')<EOL>if not os.path.exists(squashcache):<EOL><INDENT>os.makedirs(squashcache)<EOL><DEDENT>cachepath = os.path.join(BUILD_CACHEDIR,<EOL>'<STR_LIT>', '<STR_LIT>' % (start_squash_sha, end_squash_sha))<EOL>if os.path.exists(cachepath):<EOL><INDENT>self._get_squashed_layer_cache(client, squashed_sha, cachepath)<EOL><DEDENT>else:<EOL><INDENT>self._cache_squashed_layer(squashed_sha, cachepath)<EOL><DEDENT>
Currently doing a "squash" basically negates the cache for any subsequent layers.
But we can work around this by A) checking if the cache was successful for the _unsquashed_
version of the image, and B) if so, re-using an older squashed version of the image.

Three ways to do this:
    1. get the shas of the before/after images from `image.history` comments
        OR the output stream (or both). Both are extremely brittle, but also easy to access
   2. Build the image without squash first. If the unsquashed image sha matches
          a cached one, substitute the unsuqashed image for the squashed one.
          If no match, re-run the steps with squash=True and store the resulting pair
          Less brittle than 1., but harder and defs not elegant
   3. Use docker-squash as a dependency - this is by far the most preferable solution,
      except that they don't yet support the newest docker sdk version.

Currently option 1 is implemented - we parse the comment string in the image history
to figure out which layers the image was squashed from