Skip to content

Add local command layout helper#24

Open
caomengxuan666 wants to merge 1 commit into
microsoft:mainfrom
caomengxuan666:winuxcmd/dev-link-layout
Open

Add local command layout helper#24
caomengxuan666 wants to merge 1 commit into
microsoft:mainfrom
caomengxuan666:winuxcmd/dev-link-layout

Conversation

@caomengxuan666

Copy link
Copy Markdown
Contributor

Adds a small PowerShell helper for local development/testing. It creates a per-command layout from a built coreutils.exe without running the installer:

  • artifacts\dev-layout\bin\<utility>.exe
  • artifacts\dev-layout\cmd\<utility>.cmd

The script uses NTFS hard links first, since they do not require elevation. If hard links are unavailable, it copies the binary by default.

Validation run locally:

.\scripts\create-dev-links.ps1 -Force
.\artifacts\dev-layout\bin\cat.exe --version
.\artifacts\dev-layout\cmd\grep.cmd --version
.\artifacts\dev-layout\bin\find.exe --version

This produced 77 .exe and 77 .cmd entries from the current coreutils.exe --list output, skipping [ to match the existing installer behavior.

@lhecker lhecker added the C-feature Feature requests and any other major tasks. label Jun 9, 2026

@IDisposable IDisposable left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

:shipit:

Comment on lines +14 to +15
[ValidateSet('Copy', 'Symlink', 'None')]
[string]$Fallback = 'Copy',

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.

Why would hardlinks ever not work?

@whindsaks whindsaks Jul 22, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

There is technically a limit of 1023 hardlinks per file. And of course they don't exist on FAT32/ExFAT (and early ReFS?).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-feature Feature requests and any other major tasks.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants