-
Notifications
You must be signed in to change notification settings - Fork 21
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
Add os.Rename wrapper for Plan 9 #87
Conversation
Thank you for submitting this PR!
Getting other community members to do a review would be great help too on complex PRs (you can ask in the chats/forums). If you are unsure about something, just leave us a comment.
We currently aim to provide initial feedback/triaging within two business days. Please keep an eye on any labelling actions, as these will indicate priorities and status of your contribution. |
os.Rename documentation says: "OS-specific restrictions may apply when oldpath and newpath are in different directories." On Unix, this means we can't rename across devices. On Plan 9 however, the functionality is even more limited: cross-directory renames are not allowed at all. Add a wrapper around os.Rename for Plan 9, which will copy the file if we're renaming across directory. All tests seems to pass. (Aside: I also had to write this wrapper to get go-git working on Plan 9: https://github.com/go-git/go-billy/blob/v5.0.0/osfs/os_plan9.go#L27 but I notice few issues with that one.) Fixes ipfs#86
I didn't look particularly carefully at this one yet, but the logic seems fine. I'm not fully sure if any of the CIs IPFS has been using have support for plan9 runners. that's probably an assumption to check first before seeing if that's worth doing. |
I don't think any of the CIs IPFS uses supports Plan 9. I would be happy with just checking if cross compiling to |
to confirm though, cross compiling |
Correct. I don't see any easy way of running the tests. The only public Plan 9 CI I know of is the one from sr.ht but I never got it to work correctly. The Go project has a custom solution: https://farmer.golang.org/builders To clarify, I originally found out about the |
agreed - i also don't see a great way to automate keeping this from breaking in the future. Your plan seems reasonable for now. |
os.Rename documentation says: "OS-specific restrictions may apply when
oldpath and newpath are in different directories." On Unix, this means
we can't rename across devices. On Plan 9 however, the functionality is
even more limited: cross-directory renames are not allowed at all.
Add a wrapper around os.Rename for Plan 9, which will copy the file if
we're renaming across directory. All tests seems to pass.
(Aside: I also had to write this wrapper to get go-git working on Plan 9:
https://github.com/go-git/go-billy/blob/v5.0.0/osfs/os_plan9.go#L27
but I notice few issues with that one.)
Fixes #86