You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 04e44e9
Browse filesBrowse the repository at this point in the historyBrowse files
> If in step 6 you also bump `rules_rust` or the rust toolchain, those changes invalidate _all_ vendored files (including the
44
+
> If in step 5 you also bump `rules_rust` or the Rust toolchain used for building the extractor, those changes invalidate _all_ vendored files (including the
27
45
> Python ones under `misc/bazel/3rdparty/py_deps`), not just the tree-sitter ones. In that case run the umbrella script
28
46
> `misc/bazel/3rdparty/update_cargo_deps.sh` instead (it regenerates both `py_deps` and `tree_sitter_extractors_deps`, and runs
29
47
> `bazel mod tidy`), then commit all the regenerated files.
30
-
5. Run codegen
48
+
49
+
4. Run codegen
31
50
```
32
51
bazel run //rust/codegen
33
52
```
34
-
Take note whether `rust/schema/ast.py` was changed. That might need tweaks, new tests and/or downgrade/upgrade scripts down the line.
35
-
6. Try compiling
53
+
If codegen fails other changes might be neccessary. For instance, adaptions
54
+
to `annotations.py`. Make these changes in separate commits.
55
+
56
+
Once codegen succeeds commit only the changes made by codegen with
57
+
```
58
+
git commit -am 'Rust: Run codegen'
59
+
```
60
+
61
+
Take note whether `rust/schema/ast.py` was changed. That might need tweaks,
62
+
new tests and/or downgrade/upgrade scripts down the line.
63
+
64
+
65
+
5. Try compiling
36
66
```
37
67
bazel run //rust:install
38
68
```
39
69
* if it succeeds: good! You can move on to the next step.
40
-
* if it fails while compiling rust-analyzer dependencies, you need to update the rust toolchain. Sometimes the error will tell you
70
+
* if it fails while compiling rust-analyzer dependencies, you need to update the Rust toolchain. Sometimes the error will tell you
41
71
so explicitly, but it may happen that the error is more obscure. To update the rust toolchain:
42
72
* you will need to open a PR on the internal repo updating `RUST_VERSION` in `MODULE.bazel`. In general you can have this merged
43
73
independently of the changes in `codeql`.
@@ -50,8 +80,13 @@ installing [`cargo-edit`](https://crates.io/crates/cargo-edit) with `cargo insta
50
80
51
81
If you had to do any changes, commit them. If you updated the rust toolchain, running `rust/lint.py` might reformat or apply new
52
82
lints to the code.
53
-
7. Check with CI if everything is in order.
54
-
8. Run DCA with database caching disabled. Iterate on the code if needed.
55
-
9. If in step 5 the schema was updated, add upgrade/downgrade scripts and a change note. This is best done last to reduce the chance of
56
-
merge conflicts (none of the other testing depends on having upgrade and downgrade scripts in place). See
57
-
[Upgrading a language database schema](docs/prepare-db-upgrade.md).
83
+
84
+
6. Check with CI if everything is in order.
85
+
86
+
7. Run DCA with database caching disabled. Iterate on the code if needed.
87
+
88
+
8. If in step 4 the schema was updated, add upgrade/downgrade scripts and a
89
+
change note. This is best done last to reduce the chance of merge conflicts
90
+
(none of the other testing depends on having upgrade and downgrade scripts
0 commit comments