Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
9042576
Add flake.nix for Nix packaging and Docker image
jupblb May 18, 2026
94a5c6a
scip-rust: prefer bundled rust-analyzer, validate rustup toolchain
jupblb May 18, 2026
5a553a0
release: publish per-OS tarballs bundling rust-analyzer
jupblb May 18, 2026
a86ee5e
jupblb May 18, 2026
b462cc9
ci: remove pr-auditor workflow
jupblb May 18, 2026
f149ab0
Build container image with Nix, drop Dockerfile
jupblb May 18, 2026
6d5f217
scip-rust: prefer rust-analyzer on PATH over bundled fallback
jupblb May 19, 2026
97eea4d
scip-rust: use plain if/else for rust-analyzer lookup
jupblb May 19, 2026
00b731a
scip-rust: replace command -v one-liner with explicit if
jupblb May 19, 2026
d827338
scip-rust: shorten rust-analyzer lookup comment
jupblb May 19, 2026
823b6c0
scip-rust: drop set -x
jupblb May 19, 2026
c703f9e
ci: replace Dependabot with Renovate
jupblb May 19, 2026
5bbd3f1
flake: add nixfmt check
jupblb May 19, 2026
02a95e1
release: drop tarballs, point at upstream rust-analyzer
jupblb May 19, 2026
14686f7
gitignore: ignore /result, drop scratch/
jupblb May 19, 2026
2eeff87
scip-rust: fall back to bundled tools only when missing from PATH
jupblb May 19, 2026
4ef6e0e
flake: add renovate config check
jupblb May 19, 2026
7f7bce3
flake: add nixfmt and shellcheck to devshell
jupblb May 19, 2026
fec096b
flake: extend formatting check with shfmt, add to devshell
jupblb May 19, 2026
599fb35
ci: add flake-check, docker, and index jobs
jupblb May 19, 2026
a024d66
scip-rust: probe tool with --version to detect broken rustup proxies
jupblb May 19, 2026
611c53e
gitignore: ignore result* symlinks, drop stray result-1
jupblb May 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions .github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

6 changes: 0 additions & 6 deletions .github/dependabot.yml

This file was deleted.

25 changes: 25 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:recommended"],
"customManagers": [
{
"customType": "regex",
"fileMatch": ["^\\.github/workflows/ci\\.yaml$"],
"matchStrings": [
"(?:repo|repository): (?<depName>[^\\s${]+)\\s+ref: (?<currentValue>[^\\s${]+)"
],
"datasourceTemplate": "github-releases"
}
],
"packageRules": [
{
"matchManagers": ["custom.regex"],
"matchFileNames": [".github/workflows/ci.yaml"],
"schedule": ["* * 1 */3 *"]
},
{
"matchPackageNames": ["tokio-rs/tokio"],
"extractVersion": "^tokio-(?<version>\\d+\\.\\d+\\.\\d+)$"
}
]
}
131 changes: 131 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
name: ci

on:
push:
branches: [main]
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
flake-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: DeterminateSystems/nix-installer-action@v22
with:
summarize: false
- uses: DeterminateSystems/magic-nix-cache-action@v13
- run: nix flake check

docker:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v6
- uses: DeterminateSystems/nix-installer-action@v22
with:
summarize: false
- uses: DeterminateSystems/magic-nix-cache-action@v13

- name: Build docker image
run: nix build .#docker

- name: Load image into Docker
run: docker load < result

- name: Checkout target repo
uses: actions/checkout@v6
with:
repository: BurntSushi/ripgrep
ref: 15.1.0
path: target

- name: Index target via Docker
run: docker run --rm -v "$PWD/target:/work" scip-rust:latest

- name: Check index size
run: |
size=$(stat --format='%s' target/index.scip)
echo "Index size: $size bytes"
[ "$size" -ge 102400 ] || { echo "FAIL: index too small"; exit 1; }

index:
strategy:
fail-fast: false
matrix:
include:
- name: ripgrep
repo: BurntSushi/ripgrep
ref: 15.1.0
expect_file: crates/core/main.rs
- name: tokio
repo: tokio-rs/tokio
ref: tokio-1.52.3
expect_file: tokio/src/lib.rs
- name: serde
repo: serde-rs/serde
ref: v1.0.228
expect_file: serde/src/lib.rs
- name: ruff
repo: astral-sh/ruff
ref: 0.15.13
expect_file: crates/ruff/src/main.rs

runs-on: ubuntu-latest
name: ${{ matrix.name }}
timeout-minutes: 60

steps:
- uses: actions/checkout@v6
- uses: DeterminateSystems/nix-installer-action@v22
with:
summarize: false
- uses: DeterminateSystems/magic-nix-cache-action@v13

- name: Build scip-rust
run: nix build .#scip-rust

- name: Download scip CLI
run: |
curl -fsSL https://github.com/sourcegraph/scip/releases/latest/download/scip-linux-amd64.tar.gz \
| tar -xz -C /usr/local/bin scip

- name: Checkout target repo
uses: actions/checkout@v6
with:
repository: ${{ matrix.repo }}
ref: ${{ matrix.ref }}
path: target

- name: Fetch dependencies
working-directory: target
run: cargo fetch

- name: Run scip-rust
run: ./result/bin/scip-rust --output index.scip target

- name: Validate index
run: |
size=$(stat --format='%s' index.scip)
echo "Index size: $size bytes"
[ "$size" -ge 1024 ] || { echo "FAIL: index too small"; exit 1; }

scip stats --from index.scip --project-root target \
| jq -e '.documents > 0 and .occurrences > 0 and .definitions > 0'

scip print --json index.scip \
| jq -e --arg f "${{ matrix.expect_file }}" \
'any(.documents[]; .relative_path == $f)'

ci-pass:
if: always()
needs: [flake-check, docker, index]
runs-on: ubuntu-latest
steps:
- if: >-
contains(needs.*.result, 'failure') ||
contains(needs.*.result, 'cancelled')
run: exit 1
22 changes: 0 additions & 22 deletions .github/workflows/container-test.yml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/pr-auditor.yml

This file was deleted.

26 changes: 13 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@ jobs:
release-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: docker/setup-buildx-action@v1
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@v22
- run: echo "PATCH=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
- run: echo "MINOR=${PATCH%.*}" >> $GITHUB_ENV
- run: echo "MAJOR=${MINOR%.*}" >> $GITHUB_ENV
- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: |
sourcegraph/scip-rust:latest
sourcegraph/scip-rust:${{ env.PATCH }}
sourcegraph/scip-rust:${{ env.MINOR }}
sourcegraph/scip-rust:${{ env.MAJOR }}
- name: Build image with Nix
run: nix build .#docker
- name: Tag and push
run: |
set -eux
docker load < result
for TAG in latest "$PATCH" "$MINOR" "$MAJOR"; do
docker tag scip-rust:latest "sourcegraph/scip-rust:$TAG"
docker push "sourcegraph/scip-rust:$TAG"
done
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
scratch/
/result*
7 changes: 0 additions & 7 deletions Dockerfile

This file was deleted.

19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,24 @@
At the moment, this is just a tiny wrapper around `rust-analyzer` to generate SCIP data,
with the configuration set up for use by Sourcegraph.

## Usage

Install [`rust-analyzer`](https://rust-analyzer.github.io/book/installation.html) (any recent
release works), make sure `cargo` and `rustc` are on `PATH`, then from the root of your
workspace run:

```sh
rust-analyzer scip .
```

The [`scip-rust`](./scip-rust) script in this repo is the same one-liner with a few
preflight checks; you can drop it into `PATH` if you prefer a stable command name.

For CI, the `sourcegraph/scip-rust` Docker image bundles everything:

```sh
docker run --rm -v "$PWD:/work" sourcegraph/scip-rust
```

If you want to upload LSIF to Sourcegraph.com in CI, check out
[lsif-rust-action](https://github.com/sourcegraph/lsif-rust-action) instead.
61 changes: 61 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading