sourcegraph / srclib

srclib is a polyglot code analysis library, built for hackability. It consists of language analysis toolchains (currently for Go and Java, with Python, JavaScript, and Ruby in beta) with a common output format, and a CLI tool for running the analysis.
https://srclib.org
Other
942 stars 62 forks source link

robust file-not-found check #248

Closed beyang closed 8 years ago

beyang commented 8 years ago

Sometimes, buildDataFS is a virtual FS (e.g., zipfs), in which case os.IsNotExist(err) == false.

This fixes an issue that causes the import step to fail completely in Sourcegraph if any file is not found (which happens frequently on larger repositories, where srclib might fail on some source units).

sqs commented 8 years ago

Indeed: https://github.com/golang/tools/blob/608d57b3ae930138a65e85b64edf2ba1b3450b06/godoc/vfs/zipfs/zipfs.go#L115. That is surprising.

dmitshur commented 8 years ago

That is unexpected indeed.

I've made https://go-review.googlesource.com/#/c/19503 to fix the issue upstream.

dmitshur commented 8 years ago

That CL has been submitted (accepted) by now, so we can revert this change. Of course, we'd need to update to the latest x/tools revision wherever that package is vendored.