Skip to content

Shared: Add stubs for identify-environment scripts #13211

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

Merged
merged 4 commits into from
Jun 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ CODEQL_PLATFORM = osx64
endif
endif

CODEQL_TOOLS = $(addprefix codeql-tools/,autobuild.cmd autobuild.sh pre-finalize.cmd pre-finalize.sh index.cmd index.sh tracing-config.lua)
CODEQL_TOOLS = $(addprefix codeql-tools/,autobuild.cmd autobuild.sh pre-finalize.cmd pre-finalize.sh index.cmd index.sh identify-environment.cmd identify-environment.sh tracing-config.lua)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do these scripts exist? I'd expected them to be added in this PR.

Copy link
Member Author

@mbg mbg May 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They already exist, but the Makefile wasn't changed when they were added (I had mentioned this in this PR's description).

Copy link
Contributor

@owen-mc owen-mc May 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They already exist. They were added in this PR. It was an oversight that I didn't update the Makefile at the same time.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah my bad, I looked in the tools folder instead of the codeql-tools one? Is the tools folder still used in any way?


EXTRACTOR_PACK_OUT = build/codeql-extractor-go

Expand Down
6 changes: 3 additions & 3 deletions go/extractor/cli/go-autobuilder/go-autobuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Build behavior:
to 'false' disables the GOPATH set-up, CODEQL_EXTRACTOR_GO_BUILD_COMMAND (or alternatively
LGTM_INDEX_BUILD_COMMAND), can be set to a newline-separated list of commands to run in order to
install dependencies, and LGTM_INDEX_IMPORT_PATH can be used to override the package import path,
which is otherwise inferred from the SEMMLE_REPO_URL or GITHUB_REPOSITORY environment variables.
which is otherwise inferred from the SEMMLE_REPO_URL or GITHUB_REPOSITORY environment variables.

In resource-constrained environments, the environment variable CODEQL_EXTRACTOR_GO_MAX_GOROUTINES
(or its legacy alias SEMMLE_MAX_GOROUTINES) can be used to limit the number of parallel goroutines
Expand Down Expand Up @@ -931,9 +931,9 @@ func getVersionToInstall(v versionInfo) (msg, version string) {
func outputEnvironmentJson(version string) {
var content string
if version == "" {
content = `{ "include": [] }`
content = `{ "go": {} }`
} else {
content = `{ "include": [ { "go": { "version": "` + version + `" } } ] }`
content = `{ "go": { "version": "` + version + `" } }`
}
_, err := fmt.Fprint(os.Stdout, content)

Expand Down
6 changes: 6 additions & 0 deletions swift/tools/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,15 @@ sh_binary(
srcs = ["autobuild.sh"],
)

sh_binary(
name = "identify-environment",
srcs = ["identify-environment.sh"],
)

pkg_files(
name = "scripts",
srcs = [
":identify-environment",
":autobuild",
":qltest",
],
Expand Down
5 changes: 5 additions & 0 deletions swift/tools/identify-environment.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

set -eu

echo '{ "swift": { "os": { "name": "macOS" } } }'