Update with Go custom build options

This commit is contained in:
Ethan P
2021-05-13 17:29:34 -04:00
parent 9b0c24abc2
commit 406fb1e383

View File

@@ -165,13 +165,14 @@ build steps, you may need to explicitly define each step in the command line.
.. pull-quote:: Creating databases for Go
For Go, you should always use the CodeQL autobuilder. Install the Go
toolchain (version 1.11 or later) and, if there are dependencies, the
appropriate dependency manager (such as `dep
For Go, install the Go toolchain (version 1.11 or later) and, if there
are dependencies, the appropriate dependency manager (such as `dep
<https://golang.github.io/dep/>`__).
Do not specify any build commands, as you will override the autobuilder
invocation, which will create an empty database.
The Go autobuilder attempts to automatically detect Go code in a repository,
and only runs build scripts in an attempt to fetch dependencies. To force
CodeQL to use your build script, set the environment variable
`CODEQL_EXTRACTOR_GO_BUILD_TRACING=on` or pass a command.
Specifying build commands
~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -200,6 +201,10 @@ commands that you can specify for compiled languages.
codeql database create csharp-database --language=csharp --command='dotnet build /p:UseSharedCompilation=false /t:rebuild'
- Go project built using a custom build script::
CODEQL_EXTRACTOR_GO_BUILD_TRACING=on codeql database create go-database --language=go --command='./scripts/build.sh'
- Java project built using Gradle::
codeql database create java-database --language=java --command='gradle clean test'