Skip to content

Conversation

@harmony7
Copy link
Member

@harmony7 harmony7 commented Dec 19, 2025

This corrects the problem such as the following that occurs during the build among intermediate files when the OS temp directory is not on the same volume as the working directory.

Error: EXDEV: cross-device link not permitted, rename '/home/user/foo/__input_bundled.js' -> '/tmp/zNbuCo/__input_bundled.js'

The problem was due to the use of rename() to move a temporary file to the output directory, which does not work across volumes.

The proposed fix adds a moveFile() function that works by first attempting the rename(), and upon receiving EXDEV, falling back to copyFile() + unlink().

I've also renamed the isFile.ts file to files.ts, turning it into the file that contains file-related utilities.

@harmony7 harmony7 changed the title fix: Handle cross-volume renames fix: Handle cross-volume renames of intermediate files Dec 19, 2025
Copy link
Contributor

@kpfleming kpfleming left a comment

Choose a reason for hiding this comment

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

Confirmed with a local build that this resolves the issue.

@kpfleming kpfleming merged commit 94e5671 into main Dec 19, 2025
27 of 29 checks passed
@kpfleming kpfleming deleted the kats/fix-movefile branch December 19, 2025 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants