Skip to content
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

Tests are failing on Plan 9 because os.Rename doesn't rename across directory #86

Closed
fhs opened this issue Jul 27, 2020 · 1 comment · Fixed by #87
Closed

Tests are failing on Plan 9 because os.Rename doesn't rename across directory #86

fhs opened this issue Jul 27, 2020 · 1 comment · Fixed by #87
Labels
need/triage Needs initial labeling and prioritization

Comments

@fhs
Copy link
Contributor

fhs commented Jul 27, 2020

Example failure:

cpu% go test -run 'TestMove$'
...
--- FAIL: TestMove (4.24s)
    convert_test.go:216: Put fail: rename /tmp/test-datastore-flatfs-825411366/v1/.temp/temp-030917448 /tmp/test-datastore-flatfs-825411366/v1/XKC/XKCILQAO5ZLD2K===.data: invalid argument
@fhs fhs added the need/triage Needs initial labeling and prioritization label Jul 27, 2020
@welcome
Copy link

welcome bot commented Jul 27, 2020

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment.
Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

  • "Priority" labels will show how urgent this is for the team.
  • "Status" labels will show if this is ready to be worked on, blocked, or in progress.
  • "Need" labels will indicate if additional input or analysis is required.

Finally, remember to use https://discuss.ipfs.io if you just need general support.

fhs added a commit to fhs/go-ds-flatfs that referenced this issue Jul 27, 2020
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 limit: 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
fhs added a commit to fhs/go-ds-flatfs that referenced this issue Jul 27, 2020
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
willscott pushed a commit that referenced this issue Jul 29, 2020
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need/triage Needs initial labeling and prioritization
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant