-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Rust: Add a README.md #17426
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: Add a README.md #17426
Conversation
rust/README.md
Outdated
|
||
At present you need to be in the `rust-experiment` branch (or a branch on top of that) in both the `semmle-code` and `codeql` repos. | ||
|
||
TODO: are there any dependencies that aren't already CodeQL dependencies? bazel and rustc? |
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.
for bazel if one has the internal repo they can use tools/bazel
. Otherwise bazelisk can be used as well. When building with this command no dependency on rust/cargo is there (everything is provided for by bazel
)
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.
And tools/bazel
is found automatically?
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.
I've added the link to Bazelisk.
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.
And
tools/bazel
is found automatically?
In the dev environment setup internal doc it is recommended to add tools
to PATH
, so in that case yes, bazel
(and some other dev goodies) are indeed found automatically 🙂
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.
I'm never quite sure which bits of dev env setup are required vs optional, but we'll go with it. Thanks.
@@ -0,0 +1,42 @@ | |||
# Rust on CodeQL | |||
|
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.
I'd put a warning about this being experimental and unsupported, just in case
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.
Done.
rust/README.md
Outdated
|
||
### Dependencies | ||
|
||
At present you need to be in the `rust-experiment` branch (or a branch on top of that) in both the `semmle-code` and `codeql` repos. |
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.
I'd scratch this: in any case this README is on this branch, so this information seems redundant. And once we merge to main
, we've got nothing to update if this line is not present 🙂
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.
True, but I was hit by the gotcha of having only checked out the right branch on codeql
this morning.
When do we plan to merge to main
?
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.
Soon(TM) 🙂 I just need to double check that some changes I've done on the internal repo do not interfere with other rust compilation. And I would wait for this PR
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.
I've removed the note.
rust/README.md
Outdated
``` | ||
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 Users/YOURUSERNAME/semmle-code/ql |
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.
I'm guessing this does not need an absolute path and gets joined with the home directory?
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.
It's a bit fussy. --search-path ./ql
works, I have a distaste for using the "current working directory" in a context like this where I'm not in control of it, but if someone can promise it will always be semmle-code
then I'm OK with it. --search-path ~/semmle-code/ql
and a few other variations of that I tried do not work.
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.
yeah, I think I always used full absolute paths. Maybe I'd just put a generic /path/to/semmle-code/ql
? Users
is macos only, and in any case my local checkout for example is at /workspaces/semmle-code
in codespace style
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.
Updated.
Co-authored-by: Paolo Tranquilli <redsun82@github.com>
|
||
### Building the Rust Extractor (as a sembuild target) | ||
|
||
This approach allows you to build a Rust extractor with a CLI built from source. From your `semmle-code` directory run: |
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.
Presumably one needs to be on the rust-experiment
branch?
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.
yes, but we opted to not mention that as we'll all be in main
pretty soon, I promise! 😉
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.
Many thanks!
Add a
README.md
for Rust, explaining how developers can get started.I'm happy to take suggestions for the
TODO
s I've left in the doc; alternatively we can merge this as-is and come back to them later.