-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rust: give more options for building in README.md
#18468
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -11,10 +11,18 @@ If you don't have the `semmle-code` repo you may need to install Bazel manually, | |||||
|
||||||
### Building the Rust Extractor | ||||||
|
||||||
This approach uses a released `codeql` version and is simpler to use for QL development. From your `semmle-code` directory run: | ||||||
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: | ||||||
```bash | ||||||
bazel run @codeql//rust:install | ||||||
``` | ||||||
|
||||||
You can use shorter versions of the above command: | ||||||
```bash | ||||||
bazel run //rust:install # if under the `codeql` checkout | ||||||
bazel run rust:install # if at the root of the `codeql` checkout | ||||||
bazel run :install # if at the `rust` directory of the `codeql` checkout | ||||||
``` | ||||||
|
||||||
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: | ||||||
``` | ||||||
--search-path PATH/TO/semmle-code/ql | ||||||
|
@@ -40,4 +48,17 @@ TODO | |||||
|
||||||
### Code Generation | ||||||
|
||||||
TODO | ||||||
If you do changes to either | ||||||
* `ast-generator`, or | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps this will make it a bit clearer that it's talking about a directory?
Suggested change
|
||||||
* `schema/*.py` | ||||||
|
||||||
you'll need to regenerate code. You can do so running | ||||||
```bash | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mega nitpick, but I think it's cleaner to use
Suggested change
|
||||||
bazel run @codeql//rust/codegen | ||||||
``` | ||||||
|
||||||
Sometimes, especially if resolving conflicts on generated files, you might need to run | ||||||
```bash | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
bazel run @codeql//rust/codegen -- --force | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Really great to have this documented 👍. I struggled with that until I found the |
||||||
``` | ||||||
for code generation to succeed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.