Closed fhs closed 4 years ago
Thank you for submitting this PR! A maintainer will be here shortly to review it. We are super grateful, but we are also overloaded! Help us by making sure that:
The context for this PR is clear, with relevant discussion, decisions and stakeholders linked/mentioned.
Your contribution itself is clear (code comments, self-review for the rest) and in its best form. Follow the code contribution guidelines if they apply.
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. Next steps:
A maintainer will triage and assign priority to this PR, commenting on any missing things and potentially assigning a reviewer for high priority items.
The PR gets reviews, discussed and approvals as needed.
The PR is merged by maintainers when it has been approved and comments addressed.
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. We are very grateful for your contribution!
I didn't look particularly carefully at this one yet, but the logic seems fine. I am wondering if maybe this is impetus for getting tests to run in CI for this repo, so that we don't accidentally break plan9.
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 GOOS=plan9
works. We can do that in the main go-ipfs repo once few more fixes (coming up) lands.
to confirm though, cross compiling GOOS=plan9
would not catch this issue, which would be caught by the test suite, but not by compilation alone.
to confirm though, cross compiling
GOOS=plan9
would not catch this issue, which would be caught by the test suite, but not by compilation alone.
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 os.Rename
issue when ipfs init
was failing. When things are as broken as it is now on Plan 9, we'll find the issues without running the tests. That is of course not a good reason to not set up CI if we can.
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