Skip to content

skip fallback cache key if no match found - #5479

Merged
outofambit merged 1 commit into
masterfrom
circle-ci-no-default-cache
Aug 27, 2018
Merged

outofambit merged 1 commit into
masterfrom
circle-ci-no-default-cache

Conversation

@shiftkey

Copy link
Copy Markdown
Member

This fixes the scenario where an electron bump like #5462 gets cached in node_modules, and subsequent builds from new branches are unable to roll back to an earlier version of Electron:

#!/bin/bash --login
yarn install --force
yarn install v1.9.4
[1/5] 🔍  Validating package.json...
[2/5] 🔍  Resolving packages...
[3/5] 🚚  Fetching packages...
[4/5] 🔗  Linking dependencies...
[5/5] 📃  Rebuilding all packages...
error /Users/distiller/Desktop/desktop/node_modules/electron: Command failed.
Exit code: 1
Command: node install.js
Arguments: 
Directory: /Users/distiller/Desktop/desktop/node_modules/electron
Output:
/Users/distiller/Desktop/desktop/node_modules/electron/install.js:47
  throw err
  ^

Error: EEXIST: file already exists, symlink 'Versions/Current/Electron Framework' -> '/Users/distiller/Desktop/desktop/node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Electron Framework'
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Exited with code 1

Previously we'd just bust the cache from the admin portal, but they seem to have removed that as part of the Circle CI 2.0 migration, so for the moment let's keep caches scoped to branches and the yarn.lock key.

@shiftkey shiftkey added ready-for-review Pull Requests that are ready to be reviewed by the maintainers infrastructure Issues and pull requests related to scripts and tooling for GitHub Desktop labels Aug 26, 2018

@outofambit outofambit left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i've been wondering about when this might become a problem, thanks for fixing it!

@shiftkey

Copy link
Copy Markdown
Member Author

Some extra context on this - looks like extract-zip (that Electron uses) doesn't handle symlinks as expected on macOS when it has to overwrite an existing archive: max-mapper/extract-zip#20

@outofambit
outofambit merged commit 052d536 into master Aug 27, 2018
@outofambit
outofambit deleted the circle-ci-no-default-cache branch August 27, 2018 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infrastructure Issues and pull requests related to scripts and tooling for GitHub Desktop ready-for-review Pull Requests that are ready to be reviewed by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants