Skip to content

Commit e096bdb

Browse files
authoredJan 23, 2025··
Merge pull request #18468 from github/redsun82/rust-readme
Rust: give more options for building in `README.md`
2 parents d60a81d + bd2e819 commit e096bdb

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed
 

‎rust/README.md

+23-2
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,18 @@ If you don't have the `semmle-code` repo you may need to install Bazel manually,
1111

1212
### Building the Rust Extractor
1313

14-
This approach uses a released `codeql` version and is simpler to use for QL development. From your `semmle-code` directory run:
14+
This approach uses a released `codeql` version and is simpler to use for QL development. From anywhere under your `semmle-code` or `codeql` directory you can run:
1515
```bash
1616
bazel run @codeql//rust:install
1717
```
18+
19+
You can use shorter versions of the above command:
20+
```bash
21+
bazel run //rust:install # if under the `codeql` checkout
22+
bazel run rust:install # if at the root of the `codeql` checkout
23+
bazel run :install # if at the `rust` directory of the `codeql` checkout
24+
```
25+
1826
You now need to create a [per-user CodeQL configuration file](https://docs.github.com/en/code-security/codeql-cli/using-the-advanced-functionality-of-the-codeql-cli/specifying-command-options-in-a-codeql-configuration-file#using-a-codeql-configuration-file) and specify the option:
1927
```
2028
--search-path PATH/TO/semmle-code/ql
@@ -40,4 +48,17 @@ TODO
4048

4149
### Code Generation
4250

43-
TODO
51+
If you make changes to either
52+
* `ast-generator/`, or
53+
* `schema/*.py`
54+
55+
you'll need to regenerate code. You can do so running
56+
```sh
57+
bazel run @codeql//rust/codegen
58+
```
59+
60+
Sometimes, especially if resolving conflicts on generated files, you might need to run
61+
```sh
62+
bazel run @codeql//rust/codegen -- --force
63+
```
64+
for code generation to succeed.

0 commit comments

Comments
 (0)
Please sign in to comment.