Skip to content

Commit da7cbd6

Browse files
authored
Merge pull request #40797 from github/repo-sync
Repo sync
2 parents 04cec74 + 64f24ee commit da7cbd6

File tree

11 files changed

+65
-12
lines changed

11 files changed

+65
-12
lines changed

content/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ You can use dependency caching with {% data variables.product.prodname_codeql %}
4949
The {% data variables.product.prodname_codeql %} action supports three different build modes for compiled languages:
5050

5151
* `none` - the {% data variables.product.prodname_codeql %} database is created directly from the codebase without building the codebase (supported for all interpreted languages, and additionally supported for {% data variables.code-scanning.no_build_support %}).
52-
* `autobuild` - {% data variables.product.prodname_codeql %} detects the most likely build method and uses this to attempt to build the codebase and create a database for analysis (supported for all compiled languages).
53-
* `manual` - you define the build steps to use for the codebase in the workflow (supported for all compiled languages{% ifversion codeql-rust-public-preview %}, except Rust{% endif %}).
52+
* `autobuild` - {% data variables.product.prodname_codeql %} detects the most likely build method and uses this to attempt to build the codebase and create a database for analysis (supported for {% data variables.code-scanning.autobuild_support %}).
53+
* `manual` - you define the build steps to use for the codebase in the workflow (supported for {% data variables.code-scanning.manual_build_support %}).
5454

5555
### Comparison of the build modes
5656

@@ -251,6 +251,9 @@ If you added manual build steps for compiled languages and {% data variables.pro
251251
* [Building C#](#building-c)
252252
* [Building Go](#building-go)
253253
* [Building Java and Kotlin](#building-java-and-kotlin)
254+
{% ifversion codeql-rust-available %}
255+
* [Building Rust](#building-rust)
256+
{% endif %}
254257
* [Building Swift](#building-swift)
255258

256259
> [!NOTE]
@@ -494,6 +497,22 @@ You will also need to install the build system (for example `make`, `cmake`, `ba
494497

495498
Windows runners require `powershell.exe` to be on the `PATH`.
496499

500+
{% ifversion codeql-rust-available %}
501+
502+
## Building Rust
503+
504+
{% data variables.product.prodname_codeql %} supports build mode `none` for Rust code.
505+
506+
### No build for Rust
507+
508+
{% data variables.product.prodname_codeql %} uses `rust-analyzer` to compile and run build scripts (`build.rs` files) and compile macro code, but does not invoke a full build. A database is created from all Rust files present. A `Cargo.toml` or `rust-project.json` file must be present.
509+
510+
### Runner requirements for Rust
511+
512+
Rust analysis requires `rustup` and `cargo` to be installed.
513+
514+
{% endif %}
515+
497516
## Building Swift
498517

499518
{% data variables.product.prodname_codeql %} supports build modes `autobuild` or `manual` for Swift code.

content/code-security/codeql-cli/getting-started-with-the-codeql-cli/preparing-your-code-for-codeql-analysis.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ In addition, for {% data variables.code-scanning.no_build_support %}, there is a
199199

200200
### Automatically detecting the build system
201201

202-
The {% data variables.product.prodname_codeql_cli %} includes autobuilders for {% data variables.code-scanning.compiled_languages %} code. {% data variables.product.prodname_codeql %} autobuilders allow you to build projects for compiled languages without specifying any build commands. When an autobuilder is invoked, {% data variables.product.prodname_codeql %} examines the source for evidence of a build system and attempts to run the optimal set of commands required to extract a database. For more information, see [AUTOTITLE](/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages#about-autobuild).
202+
The {% data variables.product.prodname_codeql_cli %} includes autobuilders for {% data variables.code-scanning.autobuild_support %} code. {% data variables.product.prodname_codeql %} autobuilders allow you to build projects for compiled languages without specifying any build commands. When an autobuilder is invoked, {% data variables.product.prodname_codeql %} examines the source for evidence of a build system and attempts to run the optimal set of commands required to extract a database. For more information, see [AUTOTITLE](/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages#about-autobuild).
203203

204204
An autobuilder is invoked automatically when you execute `codeql database create` for a compiled language if you don’t include a
205205
`--command` option or set `--build-mode none`. For example, for a Swift codebase, you could simply run:
@@ -268,6 +268,16 @@ The following examples are designed to give you an idea of some of the build com
268268
codeql database create java-database --language=java-kotlin --command='ant -f build.xml'
269269
```
270270

271+
{% ifversion codeql-rust-available %}
272+
273+
* Rust project built using Cargo:
274+
275+
```shell
276+
codeql database create rust-database --language=rust
277+
```
278+
279+
{% endif %}
280+
271281
* Swift project built from an Xcode project or workspace. By default, the largest Swift target is built:
272282

273283
It's a good idea to ensure that the project is in a clean state and that there are no build artifacts available.

content/get-started/learning-about-github/github-language-support.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@ Some features are supported for additional languages or package managers. If you
5555
> {% ifversion fpt or ghec %}The language support for {% data variables.product.prodname_copilot %} varies depending on the volume and diversity of training data for that language.{% endif %}
5656
> The support of Gradle for the dependency graph and {% data variables.product.prodname_dependabot_alerts %} is limited to the upload of data obtained using the {% data variables.dependency-submission-api.name %}.
5757
58-
[^1]: {% ifversion codeql-rust-public-preview %}PHP and Scala {% else %}PHP, Rust, and Scala {% endif %}are supported for code scanning by third-party actions, but not by {% data variables.product.prodname_codeql %}.
58+
[^1]: {% ifversion codeql-rust-available %}PHP and Scala {% elsif codeql-rust-public-preview %}PHP and Scala {% else %}PHP, Rust, and Scala {% endif %}are supported for code scanning by third-party actions, but not by {% data variables.product.prodname_codeql %}.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
versions:
2+
fpt: '*'
3+
ghec: '*'
4+
ghes: '>=3.20'

data/reusables/code-scanning/autobuild-add-build-steps.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ If `autobuild` fails, or you want to analyze a different set of source files fro
33
* If your workflow specifies a build mode for the language, change the build mode to `manual`.
44
* If your workflow contains an `autobuild` step, remove or comment out the `autobuild` step in the workflow.
55

6-
Then uncomment the `run` step and manually specify the build process to use. For {% data variables.code-scanning.compiled_languages %}, {% data variables.product.prodname_codeql %} will analyze whatever source code is built by your specified build steps.
6+
Then uncomment the `run` step and manually specify the build process to use. For {% data variables.code-scanning.manual_build_support %}, {% data variables.product.prodname_codeql %} will analyze whatever source code is built by your specified build steps.

data/reusables/code-scanning/codeql-language-identifiers-table.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,9 @@
1111
| JavaScript/TypeScript | `javascript-typescript` | `javascript` or `typescript` |
1212
| Python | `python` |
1313
| Ruby | `ruby` |
14+
| {% ifversion codeql-rust-available %} |
15+
Rust | `rust`
16+
| {% else ifversion codeql-rust-public-preview %}
17+
| Rust (public preview) | `rust` |
18+
| {% endif %}
1419
| Swift | `swift` |

data/reusables/code-scanning/codeql-languages-bullets.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
* Java/Kotlin
66
* JavaScript/TypeScript
77
* Python
8-
* Ruby{% ifversion codeql-rust-public-preview %}
8+
* Ruby{% ifversion codeql-rust-available %}
9+
* Rust{% else ifversion codeql-rust-public-preview %}
910
* Rust (public preview){% endif %}
1011
* Swift
1112
{% ifversion code-scanning-actions-language %}* {% data variables.product.prodname_actions %} workflows{% endif %}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
`c-cpp`, `csharp`, `go`, `java-kotlin`, `javascript-typescript`, `python`, `ruby`, and `swift`
1+
`c-cpp`, `csharp`, `go`, `java-kotlin`, `javascript-typescript`, `python`, `ruby`{% ifversion codeql-rust-available %}, `rust`{% endif %} and `swift`
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
| Rust {% ifversion fpt or ghec %}| {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | {% ifversion codeql-rust-public-preview %} {% octicon "check" aria-label="Supported" %}<br>(Public preview) {% else %}{% octicon "check" aria-label="Supported" %}<br>third-party [^1] {% endif %}| {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Unsupported" %} |{% elsif ghes %} | {% octicon "check" aria-label="Supported" %}<br>third-party [^1] | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Unsupported" %} |{% endif %}
1+
| Rust {% ifversion fpt or ghec %}| {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | {% ifversion codeql-rust-available %} {% octicon "check" aria-label="Supported" %} {% else ifversion codeql-rust-public-preview %} {% octicon "check" aria-label="Supported" %}<br>(Public preview) {% else %}{% octicon "check" aria-label="Supported" %}<br>third-party [^1] {% endif %}| {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Unsupported" %} |{% elsif ghes %} | {% octicon "check" aria-label="Supported" %}<br>third-party [^1] | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Unsupported" %} |{% endif %}

data/tables/supported-code-languages.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,14 @@ languages:
119119
depUpdates: 'RubyGems'
120120
actions: 'supported'
121121
packages: 'RubyGems'
122+
Rust:
123+
copilot: 'supported'
124+
codeNavigation: 'supported'
125+
codeScanning: 'supported'
126+
depGraph: 'supported'
127+
depUpdates: 'supported'
128+
actions: 'supported'
129+
packages: 'not-supported'
122130
Scala:
123131
copilot: 'supported'
124132
codeNavigation: 'not-supported'

0 commit comments

Comments
 (0)