From e00102bbd412be0edd5497948c63ae61c6717c5e Mon Sep 17 00:00:00 2001 From: Adrian Dimech <51220968+agdimech@users.noreply.github.com> Date: Tue, 4 Apr 2023 03:14:35 +1000 Subject: [PATCH] fix: enable dereference when copying module to tmp dir (#4030) When executing the copy command, for symlinked node_modules like in the case of pnpm, the copy will treat nested folders as files which breaks the pack command. De-referencing will make sure any symlinked folders are actually dereferenced. --- By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license]. [Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0 --- packages/jsii-pacmak/lib/packaging.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/jsii-pacmak/lib/packaging.ts b/packages/jsii-pacmak/lib/packaging.ts index 1d75d8a8ea..65a4817014 100644 --- a/packages/jsii-pacmak/lib/packaging.ts +++ b/packages/jsii-pacmak/lib/packaging.ts @@ -68,8 +68,8 @@ export class JsiiModule { args.push('--loglevel=verbose'); } } else { - // Ensure module is copied to tmpdir to ensure parallel execution does not content on generated tarballs - await fs.copy(this.moduleDirectory, tmpdir); + // Ensure module is copied to tmpdir to ensure parallel execution does not contend on generated tarballs + await fs.copy(this.moduleDirectory, tmpdir, { dereference: true }); } const out = await shell(packCommand, args, {