bazel + syntax highlighter = pin cargo dep to revisions (#49895)

Pin the dependencies to a revision. This silences DEBUG log lines in the
bazel build when rust things are built.

```
(09:47:09) DEBUG: Rule 'crate_index__tree-sitter-nickel-0.0.1' indicated that a canonical reproducible form can be obtained by modifying arguments commit = "d6c7eeb751038f934b5b1aa7ff236376d0235c56", shallow_since = "1674811898 +0100" and dropping ["branch"]
--
  | (09:47:09) DEBUG: Repository crate_index__tree-sitter-nickel-0.0.1 instantiated at:
  | /buildkite/builds/buildkite-agent-bazel-757d44d5f4-7ws2m-1/sourcegraph/sourcegraph/WORKSPACE:263:19: in <toplevel>
  | /root/.cache/bazel/_bazel_root/c3f83cc3da7c0b8efa0ad475ecb21664/external/crate_index/defs.bzl:2703:10: in crate_repositories
  | /root/.cache/bazel/_bazel_root/c3f83cc3da7c0b8efa0ad475ecb21664/external/bazel_tools/tools/build_defs/repo/utils.bzl:233:18: in maybe
  | Repository rule git_repository defined at:
  | /root/.cache/bazel/_bazel_root/c3f83cc3da7c0b8efa0ad475ecb21664/external/bazel_tools/tools/build_defs/repo/git.bzl:176:33: in <toplevel>
  | (09:47:10) DEBUG: Rule 'crate_index__tree-sitter-perl-0.0.1' indicated that a canonical reproducible form can be obtained by modifying arguments commit = "e1b4844afd17b7dc019a436b1ac890568d79a1f2", shallow_since = "1678975708 -0400" and dropping ["branch"]
  | (09:47:10) DEBUG: Repository crate_index__tree-sitter-perl-0.0.1 instantiated at:
  | /buildkite/builds/buildkite-agent-bazel-757d44d5f4-7ws2m-1/sourcegraph/sourcegraph/WORKSPACE:263:19: in <toplevel>
  | /root/.cache/bazel/_bazel_root/c3f83cc3da7c0b8efa0ad475ecb21664/external/crate_index/defs.bzl:2712:10: in crate_repositories
  | /root/.cache/bazel/_bazel_root/c3f83cc3da7c0b8efa0ad475ecb21664/external/bazel_tools/tools/build_defs/repo/utils.bzl:233:18: in maybe
  | Repository rule git_repository defined at:
  | /root/.cache/bazel/_bazel_root/c3f83cc3da7c0b8efa0ad475ecb21664/external/bazel_tools/tools/build_defs/repo/git.bzl:176:33: in <toplevel>
  | (09:47:11) DEBUG: Rule 'crate_index__tree-sitter-scala-0.20.7' indicated that a canonical reproducible form can be obtained by modifying arguments commit = "6cd3cb6074624dd3d88e458343475ca4c701cb06", shallow_since = "1675786901 +0100" and dropping ["branch"]
  | (09:47:11) DEBUG: Repository crate_index__tree-sitter-scala-0.20.7 instantiated at:
  | /buildkite/builds/buildkite-agent-bazel-757d44d5f4-7ws2m-1/sourcegraph/sourcegraph/WORKSPACE:263:19: in <toplevel>
  | /root/.cache/bazel/_bazel_root/c3f83cc3da7c0b8efa0ad475ecb21664/external/crate_index/defs.bzl:2760:10: in crate_repositories
  | /root/.cache/bazel/_bazel_root/c3f83cc3da7c0b8efa0ad475ecb21664/external/bazel_tools/tools/build_defs/repo/utils.bzl:233:18: in maybe
  | Repository rule git_repository defined at:
  | /root/.cache/bazel/_bazel_root/c3f83cc3da7c0b8efa0ad475ecb21664/external/bazel_tools/tools/build_defs/repo/git.bzl:176:33: in <toplevel>
  | (09:47:12) DEBUG: Rule 'crate_index__syntect-4.7.0' indicated that a canonical reproducible form can be obtained by modifying arguments commit = "7e02c5b4085e6d935b960b8106cdd85da04532d2", shallow_since = "1661336187 +0800" and dropping ["branch"]
  | (09:47:12) DEBUG: Repository crate_index__syntect-4.7.0 instantiated at:
  | /buildkite/builds/buildkite-agent-bazel-757d44d5f4-7ws2m-1/sourcegraph/sourcegraph/WORKSPACE:263:19: in <toplevel>
  | /root/.cache/bazel/_bazel_root/c3f83cc3da7c0b8efa0ad475ecb21664/external/crate_index/defs.bzl:2395:10: in crate_repositories
  | /root/.cache/bazel/_bazel_root/c3f83cc3da7c0b8efa0ad475ecb21664/external/bazel_tools/tools/build_defs/repo/utils.bzl:233:18: in maybe
```



## Test plan
Green CI with no DEBUG log lines
<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->
This commit is contained in:
William Bezuidenhout 2023-03-23 13:40:40 +02:00 committed by GitHub
parent 0372a11e2a
commit da6c749e36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 25 deletions

View File

@ -1,5 +1,5 @@
{
"checksum": "75577b9b5a017805673ca98bd2226be6ba90724e1628869e5c55de6e6cfd5c28",
"checksum": "b0e33cbb50771e246788b9121ca0bfd8f1ca2b55bb2acc8bec8932fd72f5487f",
"crates": {
"adler 1.0.2": {
"name": "adler",
@ -8143,7 +8143,7 @@
"Git": {
"remote": "https://github.com/sourcegraph/scip",
"commitish": {
"Branch": "main"
"Rev": "3856df76147ca4b86df7821a881594358d4ba870"
},
"strip_prefix": "bindings/rust"
}
@ -9844,7 +9844,7 @@
"Git": {
"remote": "https://github.com/sourcegraph/syntect",
"commitish": {
"Branch": "main"
"Rev": "7e02c5b4085e6d935b960b8106cdd85da04532d2"
}
}
},
@ -11827,7 +11827,7 @@
"Git": {
"remote": "https://github.com/nickel-lang/tree-sitter-nickel",
"commitish": {
"Branch": "main"
"Rev": "d6c7eeb751038f934b5b1aa7ff236376d0235c56"
}
}
},
@ -11895,7 +11895,7 @@
"Git": {
"remote": "https://github.com/sourcegraph/tree-sitter-perl",
"commitish": {
"Branch": "master"
"Rev": "e1b4844afd17b7dc019a436b1ac890568d79a1f2"
}
}
},
@ -11963,7 +11963,7 @@
"Git": {
"remote": "https://github.com/sourcegraph/tree-sitter-pod",
"commitish": {
"Branch": "main"
"Rev": "f422a0dca6847c692e811f06fd92c6a75d647222"
}
}
},
@ -12229,7 +12229,7 @@
"Git": {
"remote": "https://github.com/sourcegraph/tree-sitter-scala",
"commitish": {
"Branch": "master"
"Rev": "6cd3cb6074624dd3d88e458343475ca4c701cb06"
}
}
},
@ -12297,7 +12297,7 @@
"Git": {
"remote": "https://github.com/sourcegraph/tree-sitter-sql",
"commitish": {
"Branch": "main"
"Rev": "6ea62b8d33c9e39f6de8a398a6885d1873ed7e91"
}
}
},
@ -12431,7 +12431,7 @@
"Git": {
"remote": "https://github.com/sourcegraph/tree-sitter-xlsg",
"commitish": {
"Branch": "master"
"Rev": "d956b54ea151b12f19c945f7be421c3dcd3a77ba"
}
}
},

View File

@ -1467,7 +1467,7 @@ dependencies = [
[[package]]
name = "scip"
version = "0.1.1"
source = "git+https://github.com/sourcegraph/scip?branch=main#3856df76147ca4b86df7821a881594358d4ba870"
source = "git+https://github.com/sourcegraph/scip?rev=3856df76147ca4b86df7821a881594358d4ba870#3856df76147ca4b86df7821a881594358d4ba870"
dependencies = [
"protobuf",
]
@ -1788,7 +1788,7 @@ dependencies = [
[[package]]
name = "syntect"
version = "4.7.0"
source = "git+https://github.com/sourcegraph/syntect?branch=main#7e02c5b4085e6d935b960b8106cdd85da04532d2"
source = "git+https://github.com/sourcegraph/syntect?rev=7e02c5b4085e6d935b960b8106cdd85da04532d2#7e02c5b4085e6d935b960b8106cdd85da04532d2"
dependencies = [
"bincode",
"bitflags 1.3.2",
@ -2164,7 +2164,7 @@ dependencies = [
[[package]]
name = "tree-sitter-nickel"
version = "0.0.1"
source = "git+https://github.com/nickel-lang/tree-sitter-nickel?branch=main#d6c7eeb751038f934b5b1aa7ff236376d0235c56"
source = "git+https://github.com/nickel-lang/tree-sitter-nickel?rev=d6c7eeb751038f934b5b1aa7ff236376d0235c56#d6c7eeb751038f934b5b1aa7ff236376d0235c56"
dependencies = [
"cc",
"tree-sitter",
@ -2173,7 +2173,7 @@ dependencies = [
[[package]]
name = "tree-sitter-perl"
version = "0.0.1"
source = "git+https://github.com/sourcegraph/tree-sitter-perl#98bd94b172221c8816d74a6bb7866c53d01f18da"
source = "git+https://github.com/sourcegraph/tree-sitter-perl?rev=e1b4844afd17b7dc019a436b1ac890568d79a1f2#e1b4844afd17b7dc019a436b1ac890568d79a1f2"
dependencies = [
"cc",
"tree-sitter",
@ -2182,7 +2182,7 @@ dependencies = [
[[package]]
name = "tree-sitter-pod"
version = "0.0.1"
source = "git+https://github.com/sourcegraph/tree-sitter-pod?branch=main#f422a0dca6847c692e811f06fd92c6a75d647222"
source = "git+https://github.com/sourcegraph/tree-sitter-pod?rev=f422a0dca6847c692e811f06fd92c6a75d647222#f422a0dca6847c692e811f06fd92c6a75d647222"
dependencies = [
"cc",
"tree-sitter",
@ -2221,7 +2221,7 @@ dependencies = [
[[package]]
name = "tree-sitter-scala"
version = "0.20.7"
source = "git+https://github.com/sourcegraph/tree-sitter-scala#6cd3cb6074624dd3d88e458343475ca4c701cb06"
source = "git+https://github.com/sourcegraph/tree-sitter-scala?rev=6cd3cb6074624dd3d88e458343475ca4c701cb06#6cd3cb6074624dd3d88e458343475ca4c701cb06"
dependencies = [
"cc",
"tree-sitter",
@ -2230,7 +2230,7 @@ dependencies = [
[[package]]
name = "tree-sitter-sql"
version = "0.0.2"
source = "git+https://github.com/sourcegraph/tree-sitter-sql?branch=main#6ea62b8d33c9e39f6de8a398a6885d1873ed7e91"
source = "git+https://github.com/sourcegraph/tree-sitter-sql?rev=6ea62b8d33c9e39f6de8a398a6885d1873ed7e91#6ea62b8d33c9e39f6de8a398a6885d1873ed7e91"
dependencies = [
"cc",
"tree-sitter",
@ -2249,7 +2249,7 @@ dependencies = [
[[package]]
name = "tree-sitter-xlsg"
version = "0.0.1"
source = "git+https://github.com/sourcegraph/tree-sitter-xlsg#945a7290bf211c57b43bed044c6d73092ca0484b"
source = "git+https://github.com/sourcegraph/tree-sitter-xlsg?rev=d956b54ea151b12f19c945f7be421c3dcd3a77ba#d956b54ea151b12f19c945f7be421c3dcd3a77ba"
dependencies = [
"cc",
"tree-sitter",

View File

@ -47,11 +47,13 @@ clap = { version = "4.1.11", features = [ "derive" ] }
rocket = { version = "0.5.0-rc.1", features = ["json"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
syntect = { git = "https://github.com/sourcegraph/syntect", branch = "main" }
# Since there is no version tag, we pin the dependency to a specific revision
syntect = { git = "https://github.com/sourcegraph/syntect", rev = "7e02c5b4085e6d935b960b8106cdd85da04532d2" }
tree-sitter = "0.20.9"
tree-sitter-highlight = "0.20"
scip = { git = "https://github.com/sourcegraph/scip", branch = "main" }
# Since there is no version tag, we pin the dependency to a specific revision
scip = { git = "https://github.com/sourcegraph/scip", rev="3856df76147ca4b86df7821a881594358d4ba870" }
protobuf = "3"

View File

@ -21,20 +21,23 @@ tree-sitter-cpp = "0.20.0"
tree-sitter-go = "0.19.1"
tree-sitter-java = "0.20.0"
tree-sitter-javascript = "0.20.0"
# Since there is no version tag, we pin the dependency to a specific revision
tree-sitter-jsonnet = { git = "https://github.com/sourcegraph/tree-sitter-jsonnet", rev = "009e6f06266f46ae07077dd6c8026ded56ab7dd8" }
tree-sitter-nickel = { git = "https://github.com/nickel-lang/tree-sitter-nickel", branch = "main" }
tree-sitter-nickel = { git = "https://github.com/nickel-lang/tree-sitter-nickel", rev = "d6c7eeb751038f934b5b1aa7ff236376d0235c56" }
tree-sitter-python = "0.20.2"
tree-sitter-perl = { git = "https://github.com/sourcegraph/tree-sitter-perl" }
tree-sitter-pod = { git = "https://github.com/sourcegraph/tree-sitter-pod", branch = "main"}
# Since there is no version tag, we pin the dependency to a specific revision
tree-sitter-perl = { git = "https://github.com/sourcegraph/tree-sitter-perl", rev = "e1b4844afd17b7dc019a436b1ac890568d79a1f2" }
tree-sitter-pod = { git = "https://github.com/sourcegraph/tree-sitter-pod", rev = "f422a0dca6847c692e811f06fd92c6a75d647222" }
tree-sitter-ruby = "0.20.0"
tree-sitter-rust = "0.20.3"
tree-sitter-typescript = "0.20.2"
tree-sitter-xlsg = { git = "https://github.com/sourcegraph/tree-sitter-xlsg" }
# Since there is no version tag, we pin the dependency to a specific revision
tree-sitter-xlsg = { git = "https://github.com/sourcegraph/tree-sitter-xlsg", rev = "d956b54ea151b12f19c945f7be421c3dcd3a77ba" }
# Using a fork of tree-sitter-scala because upstream Rust crate didn't compile.
tree-sitter-scala = { git = "https://github.com/sourcegraph/tree-sitter-scala" }
tree-sitter-scala = { git = "https://github.com/sourcegraph/tree-sitter-scala", rev = "6cd3cb6074624dd3d88e458343475ca4c701cb06" }
# As of 2022 Apr 06, the upstream crate seems to have paused development,
# and it relies to tree-sitter 0.19.x creating a type mismatch. So depend
# on our own fork.
tree-sitter-sql = { git = "https://github.com/sourcegraph/tree-sitter-sql", branch = "main" }
tree-sitter-sql = { git = "https://github.com/sourcegraph/tree-sitter-sql", rev = "6ea62b8d33c9e39f6de8a398a6885d1873ed7e91" }