Skip to content

Commit

Permalink
docs: Update cross-repo docs with debugging info (#448)
Browse files Browse the repository at this point in the history
  • Loading branch information
varungandhi-src authored Dec 15, 2023
1 parent 69668cc commit 12ab13c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ See the [Usage](#usage) section for step-by-step instructions.
```

- **Bazel**: Use either
[hedronvision/bazel-compile-commands-extractor](bazel-compile-commands-extractor)
[hedronvision/bazel-compile-commands-extractor](https://github.com/hedronvision/bazel-compile-commands-extractor)
or [grailbio/bazel-compilation-database](https://github.com/grailbio/bazel-compilation-database).
Caveat: The grailbio generator sometimes accidentally adds
unexpanded Make variables in compilation commands,
Expand Down
29 changes: 29 additions & 0 deletions docs/CrossRepo.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ As an example, you can see [scip-clang's own package map file](/tools/package-ma
(which must be the project root). For example:
- For projects using Bazel, these paths will generally look like:
`./bazel-myproject/external/com_company_libcool`.
However, if the `bazel-myproject` symlink is not present, you can
instead use absolute paths of the form `$(bazel info output_base)/external/com_company_libcool`
after expanding `$(bazel info output_base)`
(`scip-clang` itself will not invoke Bazel).
2. The `package` key consists of a `name` followed by an `@` separator and a `version`.
- The name and version must only contain characters belonging to `[a-zA-Z0-9_\-\.]`.
- The version should be chosen based on release information.
Expand All @@ -53,6 +57,31 @@ using git submodules, then packages in subdirectories will be
recognized correctly if there is a package map entry
pointing to the subdirectory.

<details>
<summary>Optional: Locally verify that the cross-repo information in the SCIP index is correct</summary>

To double-check that the generated SCIP index has the correct cross-repo information,
you can use the [`scip` CLI](https://github.com/sourcegraph/scip/releases/tag/v0.3.2)'s
`snapshot` subcommand like so:

```bash
# Run from project root
scip snapshot --from index.scip --to out
```

The `out` directory will contain a copy of your project
annotated with SCIP data in a visual format.
For example, references to types from `package1` may be marked
as follows:

```cpp
package1::Server server;
// ^^^^^^^^ reference cxx . . $ package1/
// ^^^^^^ reference cxx . package1 v1$ package1/Server#
```

</details>

For cross-repository navigation to work,
`package1` must also be indexed with the same version information:

Expand Down

0 comments on commit 12ab13c

Please sign in to comment.