Skip to content

feat: set default import method in Win to hardlink#7564

Merged
zkochan merged 4 commits intomainfrom
default-import-hardlink-win
Jan 24, 2024
Merged

feat: set default import method in Win to hardlink#7564
zkochan merged 4 commits intomainfrom
default-import-hardlink-win

Conversation

@nachoaldamav
Copy link
Copy Markdown
Contributor

@nachoaldamav nachoaldamav commented Jan 24, 2024

Set default package-import-method to hardlinks in Windows to avoid performance errors in systems without Dev Drives.

Close #7524
Close #7547
Close #7492

@nachoaldamav nachoaldamav requested a review from zkochan as a code owner January 24, 2024 11:27
Comment thread fs/indexed-pkg-importer/src/index.ts Outdated
Comment on lines +30 to +35
// Set default import method to hardlinking on Windows
if (process.platform === 'win32') {
packageImportMethodLogger.debug({ method: 'hardlink' })
return hardlinkPkg.bind(null, linkOrCopy)
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It might be not always possible to create a hard link. For instance, if the store is not on the same drive as the node_modules. It should still fall back to copying in that case.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Maybe I should revert the refactor and use 74f770e?

@zkochan zkochan merged commit a516ba0 into main Jan 24, 2024
@zkochan zkochan deleted the default-import-hardlink-win branch January 24, 2024 12:42
zkochan added a commit that referenced this pull request Jan 24, 2024
Close #7524
Close #7547
Close #7492

---------

Co-authored-by: Zoltan Kochan <z@kochan.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants