-
Notifications
You must be signed in to change notification settings - Fork 1k
Chmod fails on Windows #774
Comments
This issue happened with this version https://github.com/prometheus/procfs/tree/f13c2fcbe05e5f76f69fe0d7e3eabc6679347033/sysfs/fixtures.src Reading prometheus/procfs#57 should give some context. |
What does |
This is from our slack conversation: This is the path in git bash:
This is the path in cmd (using cmder)
I am using my dev machine, so the GOPATH is |
I hope we've found the root cause and it doesn't seem to be directly related to @F21 seems to have Currently, I would recommend the following to debug this further:
package main
import (
"fmt"
"os"
"path/filepath"
)
func main() {
path := "D:\\10-workspace\\go\\src\\github.com\\prometheus\\procfs\\fixtures\\26231\\exe"
if _, err := os.Open(path); err != nil {
fmt.Println(err)
}
if _, err := os.Open(filepath.ToSlash(path)); err != nil {
fmt.Println(err)
}
} Assuming |
I am still seeing the same problem. Here's what I did:
The file Running the code produced the following output:
|
Could you check if |
If I turn on file extensions in explorer, it does not have a |
Was this also the case before switching |
Yes, I before switching it off, the |
So I spent a while yesterday installing Windows 10 and trying to see what issues will face me. I'll document these issues here for future reference.
I was getting After these changes, I was able to run I deleted |
@ibrasho Thanks for taking the time to look into it! I noticed that it still fails with long path support enabled and
If you do not clear the cache and run |
I'm already clearing the I'd love to know more about your setup. Disk partitions layout, file systems and anything else you think might help. If anyone else has a Windows machine and can try this, please do and report your results. |
Tested against dep master and still seeing the problem. In my case, my temp dir is located in |
I'm still puzzled by how the ("The system cannot find the path specified") error could happen or what it means. I have one last hypothesis before giving in to not call Could you try adding the following code in |
This is what I get after applying the patch:
The dependencies do not install correctly and the |
Oh, sorry I missed that. You will need to delete these lines too before that works. |
Here are the results after updating those lines and delete the dep cache:
|
Ok, I give up. 😩 I"m not able to replicate this locally and all my guesses of why this error could happen have failed. I suggest that we drop os.Chmod for Windows until we figure out while this error is happening. I would love to hear about it if more people are facing this same issue on Windows. |
Just gave this another attempt and I believe I found the cause and it's not pretty. 💀
According to https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#maxpath, this should not be needed since:
And:
Even though I've already opted-in, these calls still fail if the logic in fixLongPath is not applied to the path. I copied I'll open an issue in @sdboyer How should we deal with this in |
@ibrasho 🎉 🎉 that you get your CL in 😄 given that it's in, and it'll be part of 1.9...well, i'm inclined to just leave it as-is and encourage people to update to Go 1.9 if they experience the problem. But, i'll leave it up to you, i'd say you understand the implications of doing that, or compensating for it in dep, much better than i do. |
🎉 🎉 🎉 I don't have a strong opinion here tbh. If we want to fix it in
We can add build tags and create multiple versions of |
I am suggesting to try "Long Path Tool" program. |
@ibrasho yeah, we want to fix in dep, but I'm fine with the lazier path of not tagging by version and relying on idempotence |
copy the same functions used in os to convert long paths on Windows to the extended-length form. Fixes golang#774 Signed-off-by: Ibrahim AshShohail <[email protected]>
I have a feeling I missed something but I'm not sure what. 😅 |
copy the same functions used in os to convert long paths on Windows to the extended-length form. Fixes golang#774 Signed-off-by: Ibrahim AshShohail <[email protected]>
copy the same functions used in os to convert long paths on Windows to the extended-length form. Fixes golang#774 Signed-off-by: Ibrahim AshShohail <[email protected]>
@ibrasho are there possible long-term harms of making the change and getting it wrong? |
copy the same functions used in os to convert long paths on Windows to the extended-length form. Fixes golang#774 Signed-off-by: Ibrahim AshShohail <[email protected]>
copy the same functions used in os to convert long paths on Windows to the extended-length form. Fixes golang#774 Signed-off-by: Ibrahim AshShohail <[email protected]>
copy the same functions used in os to convert long paths on Windows to the extended-length form. Fixes golang#774 Signed-off-by: Ibrahim AshShohail <[email protected]>
copy the same functions used in os to convert long paths on Windows to the extended-length form. Fixes golang#774 Signed-off-by: Ibrahim AshShohail <[email protected]>
copy the same functions used in os to convert long paths on Windows to the extended-length form. Fixes golang#774 Signed-off-by: Ibrahim AshShohail <[email protected]>
copy the same functions used in os to convert long paths on Windows to the extended-length form. Fixes golang#774 Signed-off-by: Ibrahim AshShohail <[email protected]>
copy the same functions used in os to convert long paths on Windows to the extended-length form. Fixes golang#774 Signed-off-by: Ibrahim AshShohail <[email protected]>
copy the same functions used in os to convert long paths on Windows to the extended-length form. Fixes #774 Signed-off-by: Ibrahim AshShohail <[email protected]>
copy the same functions used in os to convert long paths on Windows to the extended-length form. Fixes golang#774 Signed-off-by: Ibrahim AshShohail <[email protected]> Document generating graph visualizations golang#975
What version of Go (
go version
) anddep
(git describe --tags
) are you using?Go 1.9-Beta1 and dep c79b048 on Windows 10 64-bit
What
dep
command did you run?My projects are in
D:/Work/
. MyGOPATH
is alsoD:/Work
.The dependency causing issues is https://github.com/prometheus/procfs . It contains folders and files with
@colon@
in the path: https://github.com/prometheus/procfs/tree/master/sysfs/fixtures.src/devices/pci0000_%40colon%40_00/0000_%40colon%40_00_%40colon%40_0d.0What did you expect to see?
init
should work correctly without errors.What did you see instead?
init
failed with this error:safe write of manifest and lock: rename fallback failed: cannot rename C:\Users\francis\AppData\Local\Temp\dep915246291\vendor to D:\Work\src\F21\some_project\vendor: copying directory failed: copying directory failed: copying directory failed: copying directory failed: copying directory failed: copying directory failed: copying directory failed: copying directory failed: copying directory failed: copying directory failed: copying directory failed: copying directory failed: copying directory failed: copying directory failed: copying directory failed: copying directory failed: copying file failed: chmod D:\Work\src\F21\some_project\vendor\github.com\prometheus\procfs\sysfs\fixtures.src\devices\pci0000_@colon@_00\0000_@colon@_00_@colon@_0d.0\ata4\host3\target3_@colon@_0_@colon@_0\3_@colon@_0_@colon@_0_@colon@_0\block\sdb\bcache\dirty_data: The system cannot find the path specified.
Inspecting the
vendor
folder of the project, I see that whileD:\Work\src\F21\some_project\vendor\github.com\prometheus\procfs\sysfs\fixtures.src\devices\pci0000_@colon@_00\0000_@colon@_00_@colon@_0d.0\ata4\host3\target3_@colon@_0_@colon@_0\3_@colon@_0_@colon@_0_@colon@_0\block\sdb\bcache\dirty_data
exists, a lot of folders and files underD:\Work\src\F21\some_project\vendor\github.com\prometheus\procfs\sysfs\fixtures.src
are missing.The text was updated successfully, but these errors were encountered: