-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
feat: Add cp
builtin to shell for Windows
#10174
Conversation
❌ @zackradisic 4 files with test failures on bun-darwin-aarch64:
|
❌ @zackradisic 3 files with test failures on linux-x64: |
❌ @zackradisic 4 files with test failures on linux-x64-baseline: |
I'm assuming this PR should probably reference #9716 |
❌ @zackradisic 9 files with test failures on bun-windows-x86_64-haswell
|
❌ @zackradisic 3 files with test failures on bun-darwin-x64:
|
✅ lint failures have been resolved. Thank you. |
I don't think we can ship this without |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This segfaults when copying directories.
That means:
- The automated tests are not nearly comprehensive enough
- You didn't manually test copying directories
Please test your code both manually and through automated means.
PS C:\bun> bun-10174 exec 'cp -R node_modules C:\temp\node_mods'
Segmentation fault at address 0xb0
???:?:?: 0x7ff6b7deebc3 in ??? (bun-10174.exe)
???:?:?: 0x7ffd56de257c in ??? (KERNEL32.DLL)
???:?:?: 0x7ffd5840aa47 in ??? (ntdll.dll)
many test failures |
// There is only one path buffer for both paths. 2 extra bytes are the nulls at the end of each | ||
bun.default_allocator.free(this.src.ptr[0 .. this.src.len + this.dest.len + 2]); | ||
|
||
bun.destroy(this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure why this is using bun.destroy
/ bun.new
instead of usingnamespace bun.New
and ThisSingleTask.new / this.destroy
const dest = args.dest.osPath(@ptrCast(&dest_buf)); | ||
|
||
if (Environment.isWindows) { | ||
const attributes = windows.GetFileAttributesW(src); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm surprised we don't have a helper for this
What does this PR do?
This adds the
cp
shell builtin to Bun shellNot all options are supported so it is only enabled on Windows right now
How did you verify your code works?
bun-debug test test-file-name.test
)