sourcegraph / scip-python

SCIP indexer for Python
Other
50 stars 23 forks source link

Fatal Error While Indexing: RangeError #76

Open timhirsh opened 1 year ago

timhirsh commented 1 year ago

Issue:

scip-python (v0.3.3) produces a fatal error while indexing our source tree during the "Analyze project and dependencies" phase:

$ scip-python index \
    --project-name=redacted \
    --output="output.scip"
...

Experienced Fatal Error While Indexing:
Please create an issue at github.com/sourcegraph/scip-python: RangeError: Value undefined out of range for undefined options property undefined
    at Map.set (<anonymous>)
    at Ie (/snapshot/scip-python/node_modules/@sourcegraph/scip-python/dist/pyright-internal.js:1:423676)
    at bn (/snapshot/scip-python/node_modules/@sourcegraph/scip-python/dist/pyright-internal.js:1:570870)
    at Object.Yn [as evaluateTypesForStatement] (/snapshot/scip-python/node_modules/@sourcegraph/scip-python/dist/pyright-internal.js:1:609861)
    at /snapshot/scip-python/node_modules/@sourcegraph/scip-python/dist/pyright-internal.js:1:689533
    at s.timeOperation (/snapshot/scip-python/node_modules/@sourcegraph/scip-python/dist/pyright-internal.js:1:895515)
    at o (/snapshot/scip-python/node_modules/@sourcegraph/scip-python/dist/pyright-internal.js:1:688786)
    at Object.evaluateTypesForStatement (/snapshot/scip-python/node_modules/@sourcegraph/scip-python/dist/pyright-internal.js:1:689496)
    at O.visitAssignment (/snapshot/scip-python/node_modules/@sourcegraph/scip-python/dist/pyright-internal.js:1:81983)
    at O.visitNode (/snapshot/scip-python/node_modules/@sourcegraph/scip-python/dist/pyright-internal.js:1:292422)

Background: Our usage is in a bazel based repo (see #45, specifically the workaround described here). I realize this is a non-standard approach, and it's worked well enough in the past. However, over time, there are changes made to python code that break the nightly indexing job and our only option now is to exclude large portions of our source tree from being indexed to avoid the error above (I suspect it has to do with deps on generated code). Ideally the indexer would be able to handle this situation a bit more gracefully. Even printing out some more helpful debug info would be a good start.

tjdevries commented 1 year ago

I just pushed an update to a new version of scip-python (0.4.1). Could you give that a try and see if it solves the problem? If it doesn't solve the problem, we can try some other methods.

Thanks!