-
-
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
Windows initiative 2018 #4808
Comments
Back-referencing other Windows related patches that are helpful to look at. Building on Windows documentation [wip] Building with
Windows was returning an ambiguous "Access is denied" when trying to fetch |
So, on Linux, the lockfile is automatically released when the process closes (by the OS). Unfortunately, windows appears to use the fallback which needs to be manually released. We may not be doing that somewhere. Personally, I'd add some Windows specific logic to the lock package (https://github.com/camlistore/go4/tree/master/lock). Make it "succeed" if it can open the lock file with exclusive access, regardless of whether or not it already existed. Even better, have it mark the lock file for deletion on close. |
As @Stebalien said, it is same on Linux. The root of the issue is that shells start all processes in the pipe at the same time, no matter the pipe order so |
Personally, I'd like to fix this by starting the daemon in the background in a special mode that:
|
I've modified the go4 lock library, adding Windows calls to flag the lock for deletion by the OS when all handles are closed, and to not fail immediately when a lock file exists, but I'm having trouble blocking on successive lock attempts after that. |
Lock reference: go4org/go4#31 |
Making an effort to deal with file system restrictions: |
I'm going to collect information on #3971 here. In addition sometimes this happens: #4527
Instigating this while running ProcMon is causing ProcMon to crash for me which isn't helping. Finding out why and where filenames are getting corrupted seems like the current goal as it may be the root cause of this. |
I believe this was fixed (accidentally) by ipfs/go-ds-flatfs#34. go-os-rename wasn't properly keeping a temporary UTF16 buffers alive here: https://github.com/jbenet/go-os-rename/blob/3ac97f61ef67a6b87b95c1282f6c317ed0e693c2/rename_windows.go#L21-L40 Basically, it was taking the src and dst paths, converting them to UTF16 paths, and then converting those to uintptrs. However, this is only safe in two cases:
Othewise, go will consider these buffers "free" after these lines: Congrats @djdv, you managed to fix a bug before looking into it (probably)! |
Woohoo. I knew that lib was bad news. I was testing go-ipfs with updated gx deps and not encountering the issue on that branch master...djdv:big-deps but trying to find out which lib (out of at least 10) and which revision (some were multiple major revisions ahead) out of the bunch solved the issue, eluded me. |
An inconsistency in Windows specific behaviour in/on Go is being discussed here: golang/go#24482 |
The previous Go patch has resolved the case-sensitive |
Creation of symlinks is proving to be a problem in Decisions are going to have to be made in whyrusleeping/tar-utils#2 on how best to handle this. On Windows, users can't create symlinks without special privileges (see section below if interested in details), but we don't want to require users to have these privileges for normal operations. Since symlinks are restricted for normal users on Windows, the current plan is to simply warn the user and skip symlinks if we don't have permission to create them, but still extract everything else as normal. Requiring symlink privileges instead of opting to skip symlinks, prevents unprivileged users from being able to Starting with Windows 10-1703(14972), users can enable "Developer Mode" in their system settings, this allows normal users to create symlinks in Windows 10-aware applications, without elevated process rights. Prior to Go 1.11 and for users below Windows version 10-1703, users will need to hold the SeCreateSymbolicLinkPrivilege right in their access token. More information about symlinks on Windows can be found here |
On Vista+, as long as the user has the privilege to create links, they should now be able to. How the warning will look isn't finalized yet, it may be shorter or contain a link to documentation telling users how to enable symlinks if they need them. Unprivileged link creation via Windows 10's Developer Mode, still relies on golang/go#24307, if you have this patch, link creation should work as expected. Edit: PR is up |
|
With the closing of the year I will also close this issue. There are only 2 outstanding issues mentioned above:
This will require some discussion that is more relevant to spec and reference implementations, rather than Windows specifically.
Originally, the goal was to have an independent (Windows specific) read-only implementation of mount for IPFS and IPNS on Windows. Ultimately, I'm glad this was the direction that was decided on. We're nearing a state where this can be put into a PR, with only 1 critical problem related to writes today. In addition, effort on the CI front will continue. Finding platform specific edge cases and implimenting tests for them, no only to prevent unnecessary regressions, but also to strengthen our test workflow in general across repos. I look forward to collaborating more with everyone in the coming year and appreciate all the assistance and reports from everyone. |
This issue serves as an anchor to monitor the broader topic of
go-ipfs
on Windows.Here I will be highlighting the current issues being focused on and the PR efforts to resolve them. Feel free to add anything to this topic that relates to
go-ipfs
on Windows as a whole.Build problems
make
Fails to detect
gx
andgx-go
properlymake: check_gx & dist_get issues on Windows #4510
Resolved in: Fix/win make #4682
gx
Fails to detect subtools properly (gx installs deps to wrong directory)
inconsistent argument handling whyrusleeping/gx#153
Resolved in: Fix/windows subtool suffix whyrusleeping/gx#154
Build documentation
A lot of people seem to have trouble building on Windows with the current document. I've proposed a revision here: Change Windows build documentation #4691
interface problems
Pipes
Commands like
add
andfiles write
don't detect pipes on Windows #3266Resolved in: allow stdin on Windows go-ipfs-cmds#74
get
doesn't support NULcurrently not tracked
This will require fixes in Go itself and the tar-utils package
os: Stat returns error with 'nul' on Windows golang/go#24482
os: MkdirAll returns error with 'NUL' on Windows golang/go#24556
Sanitize output paths whyrusleeping/tar-utils#2
Resolved in: get: Handle symlink creation and sanitize paths on Windows #4956 (not yet merged)Resolved independently in tar-utils, rolled in via Extract: thirdparty/tar #4857
Color/Colour output
cli: Color on windows doesn't work #3068
Windows: cli colour codes #2124
Resolved in: Fix color output on Windows go-log#21 + routing fixes/refactor #5007
File system character restrictions
ipfs get cross platform paths #2013
Resolved on Windows with: Sanitize output paths whyrusleeping/tar-utils#2 (merged) + get: Handle symlink creation and sanitize paths on Windows #4956 (not yet merged)
Windows Tests & CI
We need to pass tests on Windows so new issues can be caught by the CI before becoming a problem.
When Windows is skipped for testing, we suffer from regressions such as:
#4750
#4512
#3676
In addition to fixing existing tests, new tests should be made for testing platform specific behaviors.
Please comment about platform specific edge cases that should be considered.
For example, considering UNC paths (#1933 (comment))
Long prefix paths (https://github.com/ipfs/go-ipfs/pull/3328/files#diff-7ba0a8b1e26b8ed185c4824d4ee84164R503)
How
:.
behaves (#3328)File system restrictions (#2013)
etc.
Feature parity with other platforms
The inability to pipe data, get certain data, mount IPFS, have readable output, etc. only pertain to Windows, platform native solutions for these features will have to be thought about, discussed, and implemented. The future issues and PRs will back-reference this issue so that development and discussion can be easily followed.
mount
is not implementedWindows mount support #5003
pubsub sometimes hangs on Windows #4778
This ended up being a js-ipfs issue.
As of 2018.12.31 I have not personally experienced or heard reports of instability in regards to pubsub in go-ipfs.
Everything else
There are many outstanding and outdated issues
https://github.com/ipfs/go-ipfs/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+amd64%2Fwindows+
They need to be reviewed and tagged
https://github.com/ipfs/go-ipfs/issues?q=is%3Aissue+is%3Aopen+label%3Awindows
Ones that are no longer relevant (already fixed) need to be marked as closed.
The text was updated successfully, but these errors were encountered: