Skip to content

Calling symlinkOrCopySync on a path with existing file 💥 #43

@twokul

Description

@twokul

https://embercommunity.slack.com/archives/dev-ember-cli/p1481157690003118

input node includes files foo.js and foo.hbs

  • using a broccoli-filter that takes .hbs -> .js
  • 💥

This is because we unconditionally call symlinkOrCopySync from srcPath to destPath. But since we copy forward all files, the output path already includes foo.js when we attempt to symlink the output of transpiling foo.hbs. I think step one would be to setup a failing test in broccoli-filter with ^ as a minimal reproduction.

The solution likely either includes:

  • tracking when we have already written to a given dest path and just call fs.unlinkSync(destPath) before calling symlinkOrCopy.sync
  • use try/catch and auto-retry upon EEXIST error after unlinking

cc @rwjblue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions