-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
cli: do ToSlash after EvalSymlinks to remove platform specific slashes #3023
Conversation
d2446aa
to
e0fbac8
Compare
fpath, err := filepath.EvalSymlinks(fpath) | ||
if err != nil { | ||
return nil, err | ||
} | ||
// Repeat ToSlash after EvalSymlinks as it truns path to platform specific |
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.
typo here truns
@Kubuxu what is a repro for the original problem? Since this is a windows issue and we don't have windows CI, i will manually verify this fixes the problem on a windows server box |
e0fbac8
to
69b52e4
Compare
@Kubuxu why does this contain changelog updates? |
because I screwed up my local master sorry |
License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
69b52e4
to
40741ea
Compare
This is a subset of the problem outlined in issue #1922 and pr #1933 Absolute paths are added but mangled fake directories are also added to the root directory of the ipfs object, if I remember correctly it always returns a directory object as well even when -r and -w are not supplied. Sans the comment this patch mirrors my own (djdv@31b4cbb) which works on my machine to fix this issue, I believe @liliuhai is saying the same in the previous pr as well (#3010 (comment)). Adding any Windows file via its absolute path will result in these malformed directory objects. i.e. `ipfs add "C:\somewhere\file.ext" Would result in a structure like this:
Assuring that paths are / standardized prevents this from happening. |
Following up to #3010 (comment) here @whyrusleeping |
Tested this branch on my windows box. adding a dir using an absolute path creates the same object as using a relative path now. This LGTM |
This should have test cases-- we will have a regression otherwise. @djdv what is a good way to setup test cases in windows?
|
@jbenet Long form: Testing the resulting hash of an add via an absolute path such as At one point go-ipfs was building and testing with Appveyor on Windows but I don't think that's the case anymore. Relevant: #1982 Testing with go via Maybe an issue should be raised on this and we can make an effort towards making those scripts more Windows aware. |
@djdv we disabled the appveyor tests because they were always failing and none of the devs had windows boxes to test any of this with. I have an AWS windows server box right now but thats still far from ideal for developing on. If you're interested, we would love some help getting things running nicely on windows (CI and all). We're also looking into a better CI solution over at ipfs/infra#100 |
@whyrusleeping |
Resolves #3010
License: MIT
Signed-off-by: Jakub Sztandera kubuxu@protonmail.ch