Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gopackagesdriver: separates "s" files in pkg info (#3165)
We kept running into weird issues with the gopackagesdriver tool because it would often run into "cannot parse non-Go file", and point to a .s file. After some digging I decided to compare the output of the driver vs the output for `go list -json` (continue reading for full comparison). As it turns out, the driver includes all srcs in both the `GoFiles` and `CompiledGoFiles` pkg info output. However ".s" files have their own section (because they're not Go files) in the regular go list JSON output. This commit modifies the aspect to account for that. Somewhat (trimmed for readability) full output for the package github.com/dgraph-io/ristretto/z: ```jsonc // go list -json github.com/dgraph-io/ristretto/z { "GoFiles": [ "allocator.go", "bbloom.go", "btree.go", "buffer.go", "calloc.go", "calloc_64bit.go", "calloc_nojemalloc.go", "file.go", "file_default.go", "flags.go", "histogram.go", "mmap.go", "mmap_darwin.go", "rtutil.go", "z.go" ], "SFiles": [ "rtutil.s" ], // CompileGoFiles not is not here } ``` ```jsonc // from the driver { "GoFiles": [ "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/allocator.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/bbloom.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/btree.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/buffer.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/calloc.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/calloc_64bit.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/calloc_nojemalloc.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/file.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/file_default.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/flags.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/histogram.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/mmap.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/mmap_darwin.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/rtutil.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/rtutil.s", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/z.go" ], "CompiledGoFiles": [ "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/allocator.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/bbloom.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/btree.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/buffer.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/calloc.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/calloc_64bit.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/calloc_nojemalloc.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/file.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/file_default.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/flags.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/histogram.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/mmap.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/mmap_darwin.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/rtutil.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/rtutil.s", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/z.go" ], } ``` ```jsonc // driver after this change { "ID": "@com_github_dgraph_io_ristretto//z:z", "Name": "z", "PkgPath": "github.com/dgraph-io/ristretto/z", "GoFiles": [ "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/allocator.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/bbloom.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/btree.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/buffer.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/calloc.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/calloc_64bit.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/calloc_nojemalloc.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/file.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/file_default.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/flags.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/histogram.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/mmap.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/mmap_darwin.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/rtutil.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/z.go" ], "CompiledGoFiles": [ "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/allocator.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/bbloom.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/btree.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/buffer.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/calloc.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/calloc_64bit.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/calloc_nojemalloc.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/file.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/file_default.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/flags.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/histogram.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/mmap.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/mmap_darwin.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/rtutil.go", "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/z.go" ], "SFiles": [ "/private/var/tmp/_bazel_ricard.sole/b0012d46b327274ba1a89c748dd78c0b/external/com_github_dgraph_io_ristretto/z/rtutil.s" ], } ```
- Loading branch information