webiny / webiny-js

Open-source serverless enterprise CMS. Includes a headless CMS, page builder, form builder, and file manager. Easy to customize and expand. Deploys to AWS.
https://www.webiny.com
Other
7.32k stars 603 forks source link

Windows 11 build fails #4181

Closed will-fagerstrom closed 1 month ago

will-fagerstrom commented 3 months ago

Version

0.0.0

Operating System

windows 11

Browser

No response

What are the steps to reproduce this bug?

clean clone then run

yarn
yarn build

What is the expected behavior?

Build to be successful

What do you see instead?

D:\webiny-js\node_modules\fs-extra\lib\copy-sync\copy-sync.js:185
    throw new Error('Source and destination must not be the same.')
          ^
Error: Source and destination must not be the same.
    at checkPaths (D:\webiny-js\node_modules\fs-extra\lib\copy-sync\copy-sync.js:185:11)
    at Object.copySync (D:\webiny-js\node_modules\fs-extra\lib\copy-sync\copy-sync.js:25:20)
    at D:\webiny-js\scripts\buildPackages\src\getBatches.ts:87:16
    at Generator.next (<anonymous>)
    at fulfilled (D:\webiny-js\scripts\buildPackages\src\getBatches.ts:5:58)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

Additional information

No response

Possible solution

There are two issues at play. 1 is rimraf and the other is fs-extra.

rimraf

In version 4 they disabled globing in file paths by default and that has to be enabled as an option.

fs-extra

Windows 11 has a new file system with their 'dev drives' feature. It uses ReFS. The older version of fs-extra that's being used for builds does some interesting things when trying to compare source and destinations can fails. Its comparing inodes of the source and destination. This is where the issues is being surfaced.

Bumping versions of 'fs-extra' to version 11.2.0 fixes that issues.

I would put up a pull request but I am not sure the best way to do that

adrians5j commented 1 month ago

Fix was merged.