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

not working for mac os #144

Closed ranjiao closed 9 years ago

ranjiao commented 9 years ago

tried using srclib with atom editor, end up missing cython while trying to run command like

src tool --methods program "sourcegraph.com/sourcegraph/srclib-python" "graph" ...

I added cython in ~/.srclib/sourcegraph.com/sourcegraph/srclib-python/requirements.txt, and removed .tmp folder, but still got errors like this:

/Users/raymond/bin/src api describe --file="/Users/raymond/repos/xxx.py" --start-byte=8011 --no-examples
command failed: src tool --methods program "sourcegraph.com/sourcegraph/srclib-python" "graph" < .srclib-cache/305504b80fbc900bb6176d8fa31a3545dd06baff/PipPackage.unit.json | src internal normalize-graph-data --unit-type "PipPackage" --dir . 1> .srclib-cache/305504b80fbc900bb6176d8fa31a3545dd06baff/PipPackage.graph.json (exit status 1)
MaikuMori commented 9 years ago

Any chance you could provide the code you ran the tool on? Or at least simplified case?

Does is it have requirements.txt or setup.py in the module? srclib-python uses either of those files to figure out what your code is depending on. srclib-python doesn't use cython anywhere.

My guess is that your project uses cython and you don't have requirements.txt or setup.py, or you're missing some dependencies there, I could be wrong though.

From your output it's hard to figure out where the issue is.

ranjiao commented 9 years ago

tried another small project and no such issues, turned out to be the dependencies problem of my project.

thanks for the quick reply :)