Haemoglobin/GitHub-Source-Indexer

Github servers expect case sensitive file paths

Closed this issue · 1 comments

jay commented

Github servers expect case sensitive file paths but the script relies on the case of paths in the PDB which from at least my experience here are all lowercase. This is a big problem because a lot of PDB info is inaccessible.

For example here is how I was writing source server info to the PDB files:

X:\j\github\GitHub-Source-Indexer\github-sourceindexer.ps1 -symbolsFolder '.' -userId jay -repository workrave -branch 6d93e4cf780d87e06ee404fd63d7abac5f8da008 -sourcesRoot 'x:\workrave\workrave' -verbose -dbgToolsPath 'C:\WinDDK\7600.16385.1\Debuggers' -ignoreUnknown -serverIsRaw -gitHubUrl https://raw.github.com

Which gives output like this:

VERBOSE: Indexing source to
https://raw.github.com/jay/workrave/6d93e4cf780d87e06ee404fd63d7abac5f8da008/backend/src/socketdriver.cc

But that is incorrect. It's relying on what's already in the PDB which is all lowercase:

x:\workrave\workrave\backend\src\socketdriver.cc*jay*workrave*6d93e4cf780d87e06ee404fd63d7abac5f8da008*backend/src/socketdriver.cc

So the URL doesn't work and the file won't be retrieved. In the workrave git repo I have the file in the tree as backend/src/SocketDriver.cc. I'm submitting a patch that adds a switch -verifyLocalRepo to get the filenames from the git repo (sourcesRoot) using ls-tree on the commit and then using those filenames instead. Here's what happens when I run with the -verifyLocalRepo switch (implies -ignoreUnknown).

X:\j\github\GitHub-Source-Indexer\github-sourceindexer.ps1 -symbolsFolder '.' -userId jay -repository workrave -branch 6d93e4cf780d87e06ee404fd63d7abac5f8da008 -sourcesRoot 'x:\workrave\workrave' -verbose -dbgToolsPath 'C:\WinDDK\7600.16385.1\Debuggers' -verifyLocalRepo -serverIsRaw -gitHubUrl https://raw.github.com
VERBOSE: Indexing source to
https://raw.github.com/jay/workrave/6d93e4cf780d87e06ee404fd63d7abac5f8da008/backend/src/SocketDriver.cc
x:\workrave\workrave\backend\src\socketdriver.cc*jay*workrave*6d93e4cf780d87e06ee404fd63d7abac5f8da008*backend/src/SocketDriver.cc

and the url now works. I'm not sure if that is the best way to solve this issue. I wrote it to verify locally because I thought it would be less likely to cause problems than something like -verifyRemoteRepo which would be possible using the api and doing something like
https://api.github.com/repos/jay/workrave/contents/backend/src
then read the directory trees that way

Thanks Jay