Skip to content

fix: add --backend=copyfile flag to bun add command - #4674

Closed
junmediatek wants to merge 1 commit into
anomalyco:devfrom
junmediatek:fix/bun-add-backend-copyfile
Closed

junmediatek wants to merge 1 commit into
anomalyco:devfrom
junmediatek:fix/bun-add-backend-copyfile

Conversation

@junmediatek

Copy link
Copy Markdown
Contributor

Use copyfile backend for bun add operations to improve compatibility and avoid potential issues with hardlink-based backends.

Use copyfile backend for bun add operations to improve compatibility
and avoid potential issues with hardlink-based backends.
@Jarred-Sumner

Copy link
Copy Markdown

hmmmm this sounds like a bug in bun? we're supposed to automatically fallback to copyfile when hardlink fails.

@junmediatek

Copy link
Copy Markdown
Contributor Author

hmmmm this sounds like a bug in bun? we're supposed to automatically fallback to copyfile when hardlink fails.
@Jarred-Sumner
how to check the hardlink fails for bun?

@junmediatek

Copy link
Copy Markdown
Contributor Author

@rekram1-node
Please help to check this PR, thank you.


// Build command arguments
const args = ["add", "--force", "--exact", "--cwd", Global.Path.cache, pkg + "@" + version]
const args = ["add", "--force", "--exact", "--backend=copyfile", "--cwd", Global.Path.cache, pkg + "@" + version]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This hardcodes bun installs to use the slowest possible method, we don't want to do that

@rekram1-node rekram1-node Nov 25, 2025 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think Jarred was saying that this should be done as a fallback by default anyways so if that isn't happening then there is a bug in bun

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.

4 participants