Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: NotSameFileSystem at clonefile #546

Merged
merged 1 commit into from
Jul 11, 2022

Conversation

adi-g15
Copy link
Contributor

@adi-g15 adi-g15 commented Jul 10, 2022

Fixes #531

Before this, using 'bun install' on a directory in different filesystem
such as tmpfs (/tmp) would have caused "Error: NotSameFileSystem".

This commit fixes that by handling this error, and at end of function it
will fall back to use copyfile (same as --backend=copyfile).

The discussion is in #531 (comment).

Credit due to @Beamnawap, who suggested me about --backend=copyfile as a fix.

Note: I think this error (NotSameFileSystem) may occur in case of clonefile_each_dir too, and should be handled there similarly:

bun/src/install/install.zig

Lines 1085 to 1087 in f5d8965

error.NotSupported => {
supported_method = .copyfile;
},

changed to:

-error.NotSupported => {
+error.NotSameFileSystem, error.NotSupported => {
     supported_method = .copyfile;
},

Does it seem okay, should I add that in this PR?

Fixes issue oven-sh#531

Before this, using 'bun install' on a directory in different filesystem
such as tmpfs (/tmp) would have caused "Error: NotSameFileSystem".

This commit fixes that by handling this error, and at end of function it
will fall back to use copyfile (same as --backend=copyfile)
@Jarred-Sumner
Copy link
Collaborator

I don't think this actually fixes it because the error is not generated, but it would be worth making the returned error consistent here anyway

@Jarred-Sumner Jarred-Sumner merged commit 2659feb into oven-sh:main Jul 11, 2022
@addy
Copy link
Contributor

addy commented Jul 11, 2022

FYI this just broke the build

Jarred-Sumner added a commit that referenced this pull request Jul 11, 2022
Jarred-Sumner added a commit that referenced this pull request Jul 11, 2022
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.

Projects on different file system: error: NotSameFileSystem
3 participants