Open pauljz opened 9 years ago
Hey @pauljz,
Windows support sounds great! The easy parts like using filepath.SplitList
should definitely be done regardless, since it's more correct. I've recently made a PR https://github.com/sourcegraph/srclib-go/pull/35 to fix some of those. There are likely more things like that remaining.
I don't have a Windows machine to test on, but I can try to assist in other ways. I'll keep an eye on this and help review your future PRs.
This round of changes should be ready to review now, @shurcooL. I took out the changes to toolchain_cmd that were breaking the build, changed all refs to os.PathSeparator
to filepath.Separator
for consistency, and changed erroneous path.Join
s to filepath.Join
s.
Travis build passes, all tests pass locally now on OS X for me. Windows tests... well, still a long way to go there, but it's better than it was.
It'd be great to have Windows support in srclib for cross-platform editors.
Go itself supports Windows just fine, so most of the fixes that need to take place for this are oriented around taking advantage of Go's standard library. Most of the fixes are really simple things:
filepath.SplitList(paths)
instead ofstrings.Split(paths, ":")
os.PathSeparator
andos.PathListSeparator
instead of":"
and"/"
os.TempDir()
to get temp paths instead of hardcoded/tmp/
paths.There are some more complex issues:
sh -c
for executing certain commands.sudo
to symlink, ugh). We may need to provide a fallback that uses directory copies./methods:program
instead of--methods=program
.I've started on some fixes for a lot of these issues and will put a PR together soon once I'm sure the tests pass. I'll probably need a lot of help from folks that are more experienced with the srclib ecosystem, since this is all new to me.