Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core: Use fs-extra emptyDir so build works on docker volume #13474

Merged
merged 1 commit into from
Dec 20, 2020
Merged

Core: Use fs-extra emptyDir so build works on docker volume #13474

merged 1 commit into from
Dec 20, 2020

Conversation

russellwpatterson
Copy link
Contributor

@russellwpatterson russellwpatterson commented Dec 17, 2020

Issue:
When using a docker volume as an output directory, the build process fails with the following error:

[2020-12-17T18:59:46Z] info @storybook/react v6.1.11
--
  | [2020-12-17T18:59:46Z] info
  | [2020-12-17T18:59:46Z] info => Cleaning outputDir /js-tests/rp-storybook-upgrade-test
  | [2020-12-17T18:59:46Z] ERR! Error: EBUSY: resource busy or locked, rmdir '/js-tests/rp-storybook-upgrade-test'
  | [2020-12-17T18:59:46Z] ERR!  [Error: EBUSY: resource busy or locked, rmdir '/js-tests/rp-storybook-upgrade-test'] {
  | [2020-12-17T18:59:46Z] ERR!   stack: "Error: EBUSY: resource busy or locked, rmdir '/js-tests/rp-storybook-upgrade-test'",
  | [2020-12-17T18:59:46Z] ERR!   errno: -16,
  | [2020-12-17T18:59:46Z] ERR!   code: 'EBUSY',
  | [2020-12-17T18:59:46Z] ERR!   syscall: 'rmdir',
  | [2020-12-17T18:59:46Z] ERR!   path: '/js-tests/rp-storybook-upgrade-test'
  | [2020-12-17T18:59:46Z] ERR! }

What I did

I updated the directory removal to use fs-extra's .emptyDir instead of .remove which empties a folder instead of removing it.

I believe this should be considered for a 6.1.x patch since this bug breaks CI for 6.1.x if that outputDir is a docker volume.

Related issue: #13168

How to test

  • Is this testable with Jest or Chromatic screenshots? no
  • Does this need a new example in the kitchen sink apps? no
  • Does this need an update to the documentation? no

If your answer is yes to any of these, please make sure to include it in your PR.

@shilman shilman changed the title Use fs-extra emptyDir instead of remove so that build works on docker volume Core: Use fs-extra emptyDir so build works on docker volume Dec 20, 2020
@shilman shilman added bug compatibility with other tools core patch:yes Bugfix & documentation PR that need to be picked to main branch run e2e extended test suite Run the e2e extended test suite in CircleCI workflows labels Dec 20, 2020
@shilman shilman merged commit f4cbc0b into storybookjs:next Dec 20, 2020
Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

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

LGTM. thanks @russellwpatterson 💯

@petmat
Copy link

petmat commented Jan 12, 2021

Hey @shilman me and my team have been waiting for this fix since issue #13168 and were hopeful that the next patch release would include it. Now 6.1.12 was just released and this seems not to be in it. Will we not have this as a patch release? Do we have to wait until 6.2?

This was referenced Mar 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug compatibility with other tools core patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch run e2e extended test suite Run the e2e extended test suite in CircleCI workflows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants