broccolijs / broccoli-funnel

MIT License
66 stars 37 forks source link

[3.0.0] Leading / in destDir is treated as ROOT directory #125

Closed elwayman02 closed 4 years ago

elwayman02 commented 4 years ago

As of v3.0.0, a leading slash in the destDir parameter is now treated as the root directory. In the 2.x series, destDir was sanitized through path.join, but the new approach in 3.x doesn't do this.

In 2.x, it was:

    let namespacedTree = new Funnel(tree, {
      srcDir: '/',
      destDir: `/${this.moduleName()}`,
    });

In 3.x, it needs to be:

    let namespacedTree = new Funnel(tree, {
      srcDir: '/',
      destDir: `${this.moduleName()}`,
    });

Here's a real-world example of this manifesting:

Build Error (Funnel) EROFS: read-only file system, symlink '/Users/jhawker/Projects/GitHub/ember-sinon-qunit/addon-test-support' -> '/ember-sinon-qunit'

https://github.com/elwayman02/ember-sinon-qunit/pull/248 https://travis-ci.org/elwayman02/ember-sinon-qunit/jobs/655610389

rwjblue commented 4 years ago

@SparshithNR - Mind taking a look?

SparshithNR commented 4 years ago

I tried it on my local machine. It couldn't reproduce the issue. I tried CI for the ember-sinon-qunit as well. https://travis-ci.com/SparshithNR/ember-sinon-qunit/jobs/292654282

https://github.com/SparshithNR/ember-sinon-qunit/blob/725ce9cff9941210a292c6b88d07585cedf82204/package.json#L32

elwayman02 commented 4 years ago

You have to revert this commit to test: https://github.com/SparshithNR/ember-sinon-qunit/commit/0ce9352c09df898f6f010c5a2d820005d52599e2

SparshithNR commented 4 years ago

@elwayman02 Oh! I missed it. Thanks :) I will look into it.

SparshithNR commented 4 years ago

Should be fixed by #123 Added test case to check this. https://github.com/broccolijs/broccoli-funnel/blob/197f662ad733ed13a728cf686cdec7db655883bc/tests/index.js#L259-L277