4 Star 8 Fork 1

Gitee 极速下载/CodeQL

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
.devcontainer
.github
.vscode
actions
change-notes
config
cpp
csharp
docs
go
java
javascript
misc
python
ql
ruby
rust
ast-generator
autobuild
codegen
downgrades
extractor
ql
schema
tools
BUILD.bazel
README.md
bulk_generation_targets.yml
codegen.conf
codeql-extractor.yml
lint.py
prefix.dbscheme
rust-toolchain.toml
update_cargo_deps.sh
shared
swift
.bazelrc
.bazelrc.internal
.bazelversion
.clang-format
.editorconfig
.git-blame-ignore-revs
.gitattributes
.gitignore
.lfsconfig
.lgtm.yml
.pre-commit-config.yaml
BUILD.bazel
CODEOWNERS
CODE_OF_CONDUCT.md
CONTRIBUTING.md
Cargo.lock
Cargo.toml
LICENSE
MODULE.bazel
README.md
codeql-workspace.yml
conftest.py
defs.bzl
rust-toolchain.toml
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/github/codeql
克隆/下载
README.md 2.04 KB
一键复制 编辑 原始数据 按行查看 历史

Rust on CodeQL

[!WARNING] Rust support for CodeQL is experimental. No support is offered. QL and database interfaces will change and break without notice or deprecation periods.

Development

Dependencies

If you don't have the semmle-code repo you may need to install Bazel manually, e.g. from https://github.com/bazelbuild/bazelisk.

Building the Rust Extractor

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:

bazel run @codeql//rust:install

You can use shorter versions of the above command:

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 and specify the option:

--search-path PATH/TO/semmle-code/ql

(wherever the codeql checkout is on your system)

You can now use the Rust extractor e.g. to run Rust tests from the command line or in VSCode.

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:

./build target/intree/codeql-rust

You can now invoke it directly, for example to run some tests:

./target/intree/codeql-rust/codeql test run ql/rust/ql/test/PATH/TO/TEST/

Building a Database

TODO

Code Generation

If you make changes to either

  • ast-generator/, or
  • schema/*.py

you'll need to regenerate code. You can do so running

bazel run @codeql//rust/codegen

Sometimes, especially if resolving conflicts on generated files, you might need to run

bazel run @codeql//rust/codegen -- --force

for code generation to succeed.

Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/mirrors/CodeQL.git
git@gitee.com:mirrors/CodeQL.git
mirrors
CodeQL
CodeQL
main

搜索帮助