Skip to content
This repository has been archived by the owner on May 29, 2018. It is now read-only.

Srcfile Globs field fails #240

Open
beyang opened this issue Jan 20, 2016 · 2 comments
Open

Srcfile Globs field fails #240

beyang opened this issue Jan 20, 2016 · 2 comments
Assignees
Labels

Comments

@beyang
Copy link
Member

beyang commented Jan 20, 2016

Attempting to use the Globs field in the Srcfile specification (in lieu of the Files field) fails for both srclib-go and srclib-java. The files aren't selected by the glob and there is also an assumption that the Files field is non-empty, leading to a nil-pointer/array-out-of-bounds error for both srclib-go and srclib-java.

Repro-able with this Srcfile:

{
"SourceUnits": [{
 "Name": "com.sourcegraph\/srclib-java",
 "Type": "JavaArtifact",
 "Files": [],
 "Globs": ["**/*.java"],
 "Dependencies": [
  {
   "artifactID": "aether-api",
   "file": ".gradle-srclib\/caches\/modules-2\/files-2.1\/org.eclipse.aether\/aether-api\/0.9.0.M4\/55124b465ca433e9a954b8501eb332a75f132a3e\/aether-api-0.9.0.M4.jar",
   "groupID": "org.eclipse.aether",
   "scope": "compile",
   "version": "0.9.0.M4"
  },
  {
   "artifactID": "aether-api",
   "file": ".gradle-srclib\/caches\/modules-2\/files-2.1\/org.eclipse.aether\/aether-api\/0.9.0.M4\/55124b465ca433e9a954b8501eb332a75f132a3e\/aether-api-0.9.0.M4.jar",
   "groupID": "org.eclipse.aether",
   "scope": "testCompile",
   "version": "0.9.0.M4"
  },
  {
   "artifactID": "slf4j-api",
   "file": ".gradle-srclib\/caches\/modules-2\/files-2.1\/org.slf4j\/slf4j-api\/1.7.12\/8e20852d05222dc286bf1c71d78d0531e177c317\/slf4j-api-1.7.12.jar",
   "groupID": "org.slf4j",
   "scope": "compile",
   "version": "1.7.12"
  },
  {
   "artifactID": "slf4j-api",
   "file": ".gradle-srclib\/caches\/modules-2\/files-2.1\/org.slf4j\/slf4j-api\/1.7.12\/8e20852d05222dc286bf1c71d78d0531e177c317\/slf4j-api-1.7.12.jar",
   "groupID": "org.slf4j",
   "scope": "testCompile",
   "version": "1.7.12"
  }
 ],
 "Data": {
  "ClassPath": [
   ".gradle-srclib\/caches\/modules-2\/files-2.1\/com.beust\/jcommander\/1.30\/c440b30a944ba199751551aee393f8aa03b3c327\/jcommander-1.30.jar",
   ".gradle-srclib\/caches\/modules-2\/files-2.1\/org.apache.maven\/maven-settings-builder\/3.2.3\/affc67a5b0b9c3cfc149898a15fe6c373f499882\/maven-settings-builder-3.2.3.jar"
  ],
  "Description": "",
  "GradleFile": "build.gradle",
  "SourcePath": [
   [
    "com.sourcegraph\/srclib-java",
    "0.0.1-SNAPSHOT",
    "src\/main\/java"
   ],
   [
    "com.sourcegraph\/srclib-java",
    "0.0.1-SNAPSHOT",
    "src\/test\/java"
   ]
  ],
  "SourceVersion": "1.8"
 }
}]
}
@beyang
Copy link
Member Author

beyang commented Jan 21, 2016

Update: now works in srclib-java

@alexsaveliev
Copy link
Contributor

@beyang could you please provide test case for srclib-go? I was unable to reproduce it using Go project with Srcfile (https://github.com/sgtest/go-with-srcfile), probably I'm doing something wrong...

beyang pushed a commit to sourcegraph/srclib-java that referenced this issue Mar 5, 2016
- Dealing with the case when unit contains "Globs" data and no (or null) "Files", in this case graph command should scan for matching files using globs. See sourcegraph/srclib#240
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants