diff --git a/.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml b/.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml new file mode 100644 index 0000000000..d316c01f1e --- /dev/null +++ b/.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml @@ -0,0 +1,96 @@ +# Warning: This file is generated automatically, and should not be modified. +# Instead, please modify the template in the pr-checks directory and run: +# (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py) +# to regenerate this file. + +name: 'PR Check - Go: diagnostic when Go is changed after init step' +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GO111MODULE: auto + CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true' +on: + push: + branches: + - main + - releases/v2 + pull_request: + types: + - opened + - synchronize + - reopened + - ready_for_review + workflow_dispatch: {} +jobs: + go-indirect-tracing-workaround-diagnostic: + strategy: + matrix: + include: + - os: ubuntu-latest + version: stable-v2.14.6 + name: 'Go: diagnostic when Go is changed after init step' + permissions: + contents: read + security-events: write + timeout-minutes: 45 + runs-on: ${{ matrix.os }} + steps: + - name: Check out repository + uses: actions/checkout@v4 + - name: Prepare test + id: prepare-test + uses: ./.github/actions/prepare-test + with: + version: ${{ matrix.version }} + use-all-platform-bundle: 'false' + - name: Set environment variable for Swift enablement + if: >- + runner.os != 'Windows' && ( + matrix.version == '20220908' || + matrix.version == '20221211' + ) + shell: bash + run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV + - uses: actions/setup-go@v4 + with: + # We need a Go version that ships with statically linked binaries on Linux + go-version: '>=1.21.0' + - uses: ./../action/init + with: + languages: go + tools: ${{ steps.prepare-test.outputs.tools-url }} + # Deliberately change Go after the `init` step + - uses: actions/setup-go@v4 + with: + go-version: '1.20' + - name: Build code + shell: bash + run: go build main.go + - uses: ./../action/analyze + with: + output: ${{ runner.temp }}/results + upload-database: false + - name: Check diagnostic appears in SARIF + uses: actions/github-script@v6 + env: + SARIF_PATH: ${{ runner.temp }}/results/go.sarif + with: + script: | + const fs = require('fs'); + + const sarif = JSON.parse(fs.readFileSync(process.env['SARIF_PATH'], 'utf8')); + const run = sarif.runs[0]; + + const toolExecutionNotifications = run.invocations[0].toolExecutionNotifications; + const statusPageNotifications = toolExecutionNotifications.filter(n => + n.descriptor.id === 'go/workflow/go-installed-after-codeql-init' && n.properties?.visibility?.statusPage + ); + if (statusPageNotifications.length !== 1) { + core.setFailed( + 'Expected exactly one status page reporting descriptor for this diagnostic in the ' + + `'runs[].invocations[].toolExecutionNotifications[]' SARIF property, but found ` + + `${statusPageNotifications.length}. All notification reporting descriptors: ` + + `${JSON.stringify(toolExecutionNotifications)}.` + ); + } + env: + CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__go-indirect-tracing-workaround.yml b/.github/workflows/__go-indirect-tracing-workaround.yml new file mode 100644 index 0000000000..417d2deb40 --- /dev/null +++ b/.github/workflows/__go-indirect-tracing-workaround.yml @@ -0,0 +1,94 @@ +# Warning: This file is generated automatically, and should not be modified. +# Instead, please modify the template in the pr-checks directory and run: +# (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py) +# to regenerate this file. + +name: 'PR Check - Go: workaround for indirect tracing' +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GO111MODULE: auto + CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true' +on: + push: + branches: + - main + - releases/v2 + pull_request: + types: + - opened + - synchronize + - reopened + - ready_for_review + workflow_dispatch: {} +jobs: + go-indirect-tracing-workaround: + strategy: + matrix: + include: + - os: ubuntu-latest + version: stable-v2.14.6 + name: 'Go: workaround for indirect tracing' + permissions: + contents: read + security-events: write + timeout-minutes: 45 + runs-on: ${{ matrix.os }} + steps: + - name: Check out repository + uses: actions/checkout@v4 + - name: Prepare test + id: prepare-test + uses: ./.github/actions/prepare-test + with: + version: ${{ matrix.version }} + use-all-platform-bundle: 'false' + - name: Set environment variable for Swift enablement + if: >- + runner.os != 'Windows' && ( + matrix.version == '20220908' || + matrix.version == '20221211' + ) + shell: bash + run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV + - uses: actions/setup-go@v4 + with: + # We need a Go version that ships with statically linked binaries on Linux + go-version: '>=1.21.0' + - uses: ./../action/init + with: + languages: go + tools: ${{ steps.prepare-test.outputs.tools-url }} + - name: Build code + shell: bash + run: go build main.go + - uses: ./../action/analyze + with: + upload-database: false + - shell: bash + run: | + if [[ -z "${CODEQL_ACTION_GO_BINARY}" ]]; then + echo "Expected the workaround for indirect tracing of static binaries to trigger, but the" \ + "CODEQL_ACTION_GO_BINARY environment variable is not set." + exit 1 + fi + if [[ ! -f "${CODEQL_ACTION_GO_BINARY}" ]]; then + echo "CODEQL_ACTION_GO_BINARY is set, but the corresponding script does not exist." + exit 1 + fi + + + # Once we start running Bash 4.2 in all environments, we can replace the + # `! -z` flag with the more elegant `-v` which confirms that the variable + # is actually unset and not potentially set to a blank value. + if [[ ! -z "${CODEQL_ACTION_DID_AUTOBUILD_GOLANG}" ]]; then + echo "Expected the Go autobuilder not to be run, but the" \ + "CODEQL_ACTION_DID_AUTOBUILD_GOLANG environment variable was set." + exit 1 + fi + cd "$RUNNER_TEMP/codeql_databases" + if [[ ! -d go ]]; then + echo "Did not find a Go database" + exit 1 + fi + env: + CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__go-tracing-autobuilder.yml b/.github/workflows/__go-tracing-autobuilder.yml index 79055cc913..4958ca41ab 100644 --- a/.github/workflows/__go-tracing-autobuilder.yml +++ b/.github/workflows/__go-tracing-autobuilder.yml @@ -80,6 +80,9 @@ jobs: ) shell: bash run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV + - uses: actions/setup-go@v4 + with: + go-version: ~1.21.1 - uses: ./../action/init with: languages: go diff --git a/.github/workflows/__go-tracing-custom-build-steps.yml b/.github/workflows/__go-tracing-custom-build-steps.yml index 96b34dc106..8a75074211 100644 --- a/.github/workflows/__go-tracing-custom-build-steps.yml +++ b/.github/workflows/__go-tracing-custom-build-steps.yml @@ -80,6 +80,9 @@ jobs: ) shell: bash run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV + - uses: actions/setup-go@v4 + with: + go-version: ~1.21.1 - uses: ./../action/init with: languages: go diff --git a/.github/workflows/__go-tracing-legacy-workflow.yml b/.github/workflows/__go-tracing-legacy-workflow.yml index 237e079c32..8d67b966b5 100644 --- a/.github/workflows/__go-tracing-legacy-workflow.yml +++ b/.github/workflows/__go-tracing-legacy-workflow.yml @@ -80,6 +80,9 @@ jobs: ) shell: bash run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV + - uses: actions/setup-go@v4 + with: + go-version: ~1.21.1 - uses: ./../action/init with: languages: go diff --git a/lib/actions-util.js b/lib/actions-util.js index b53683ff28..7dbb411a52 100644 --- a/lib/actions-util.js +++ b/lib/actions-util.js @@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.getWorkflowRunAttempt = exports.getWorkflowRunID = exports.getUploadValue = exports.printDebugLogs = exports.isAnalyzingDefaultBranch = exports.getRelativeScriptPath = exports.isRunningLocalAction = exports.getWorkflowEventName = exports.getActionVersion = exports.getRef = exports.determineMergeBaseCommitOid = exports.getCommitOid = exports.getTemporaryDirectory = exports.getOptionalInput = exports.getRequiredInput = void 0; +exports.getFileType = exports.getWorkflowRunAttempt = exports.getWorkflowRunID = exports.getUploadValue = exports.printDebugLogs = exports.isAnalyzingDefaultBranch = exports.getRelativeScriptPath = exports.isRunningLocalAction = exports.getWorkflowEventName = exports.getActionVersion = exports.getRef = exports.determineMergeBaseCommitOid = exports.getCommitOid = exports.getTemporaryDirectory = exports.getOptionalInput = exports.getRequiredInput = void 0; const fs = __importStar(require("fs")); const path = __importStar(require("path")); const core = __importStar(require("@actions/core")); @@ -380,4 +380,34 @@ function getWorkflowRunAttempt() { return workflowRunAttempt; } exports.getWorkflowRunAttempt = getWorkflowRunAttempt; +/** + * Tries to obtain the output of the `file` command for the file at the specified path. + * The output will vary depending on the type of `file`, which operating system we are running on, etc. + */ +const getFileType = async (filePath) => { + let stderr = ""; + let stdout = ""; + try { + // The `file` command will output information about the type of file pointed at by `filePath`. + // For binary files, this may include e.g. whether they are static of dynamic binaries. + // The `-L` switch instructs the command to follow symbolic links. + await new toolrunner.ToolRunner(await safeWhich.safeWhich("file"), ["-L", filePath], { + silent: true, + listeners: { + stdout: (data) => { + stdout += data.toString(); + }, + stderr: (data) => { + stderr += data.toString(); + }, + }, + }).exec(); + return stdout.trim(); + } + catch (e) { + core.info(`Could not determine type of ${filePath} from ${stdout}. ${stderr}`); + throw e; + } +}; +exports.getFileType = getFileType; //# sourceMappingURL=actions-util.js.map \ No newline at end of file diff --git a/lib/actions-util.js.map b/lib/actions-util.js.map index 83d443ec2e..776a9be7c9 100644 --- a/lib/actions-util.js.map +++ b/lib/actions-util.js.map @@ -1 +1 @@ -{"version":3,"file":"actions-util.js","sourceRoot":"","sources":["../src/actions-util.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAE7B,oDAAsC;AACtC,yEAA2D;AAC3D,kEAAoD;AAIpD,iCAKgB;AAEhB,8CAA8C;AAC9C,MAAM,GAAG,GAAG,OAAO,CAAC,iBAAiB,CAAqC,CAAC;AAE3E;;;;;GAKG;AACI,MAAM,gBAAgB,GAAG,UAAU,IAAY;IACpD,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAClC,IAAI,CAAC,KAAK,EAAE;QACV,MAAM,IAAI,gBAAS,CAAC,oCAAoC,IAAI,EAAE,CAAC,CAAC;KACjE;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;A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I,EAAE,CAAC;KACtB;IAAC,OAAO,CAAC,EAAE;QACV,IAAI,CAAC,IAAI,CACP,+BAA+B,QAAQ,SAAS,MAAM,KAAK,MAAM,EAAE,CACpE,CAAC;QAEF,MAAM,CAAC,CAAC;KACT;AACH,CAAC,CAAC;AA9BW,QAAA,WAAW,eA8BtB"} \ No newline at end of file diff --git a/lib/analyze-action.js b/lib/analyze-action.js index 004e318e04..6edeb9f068 100644 --- a/lib/analyze-action.js +++ b/lib/analyze-action.js @@ -31,6 +31,7 @@ const fs = __importStar(require("fs")); const path_1 = __importDefault(require("path")); const perf_hooks_1 = require("perf_hooks"); const core = __importStar(require("@actions/core")); +const safe_which_1 = require("@chrisgavin/safe-which"); const actionsUtil = __importStar(require("./actions-util")); const analyze_1 = require("./analyze"); const api_client_1 = require("./api-client"); @@ -38,6 +39,7 @@ const autobuild_1 = require("./autobuild"); const codeql_1 = require("./codeql"); const config_utils_1 = require("./config-utils"); const database_upload_1 = require("./database-upload"); +const diagnostics_1 = require("./diagnostics"); const environment_1 = require("./environment"); const feature_flags_1 = require("./feature-flags"); const languages_1 = require("./languages"); @@ -159,6 +161,26 @@ async function run() { const gitHubVersion = await (0, api_client_1.getGitHubVersion)(); const features = new feature_flags_1.Features(gitHubVersion, repositoryNwo, actionsUtil.getTemporaryDirectory(), logger); const memory = util.getMemoryFlag(actionsUtil.getOptionalInput("ram") || process.env["CODEQL_RAM"], logger); + // Check that `which go` still points at the wrapper script we installed in the `init` Action, + // if the corresponding environment variable is set. This is to ensure that there isn't a step + // in the workflow after the `init` step which installs a different version of Go and takes + // precedence in the PATH, thus potentially circumventing our workaround that allows tracing to work. + const goWrapperPath = process.env[environment_1.EnvVar.GO_BINARY_LOCATION]; + if (goWrapperPath !== undefined) { + const goBinaryPath = await (0, safe_which_1.safeWhich)("go"); + if (goWrapperPath !== goBinaryPath) { + core.warning(`Expected \`which go\` to return ${goWrapperPath}, but got ${goBinaryPath}: please ensure that the correct version of Go is installed before the \`codeql-action/init\` Action is used.`); + (0, diagnostics_1.addDiagnostic)(config, languages_1.Language.go, (0, diagnostics_1.makeDiagnostic)("go/workflow/go-installed-after-codeql-init", "Go was installed after the `codeql-action/init` Action was run", { + markdownMessage: "To avoid interfering with the CodeQL analysis, perform all installation steps before calling the `github/codeql-action/init` Action.", + visibility: { + statusPage: true, + telemetry: true, + cliSummaryTable: true, + }, + severity: "warning", + })); + } + } await runAutobuildIfLegacyGoWorkflow(config, logger); dbCreationTimings = await (0, analyze_1.runFinalize)(outputDir, threads, memory, config, logger, features); if (actionsUtil.getRequiredInput("skip-queries") !== "true") { diff --git a/lib/analyze-action.js.map b/lib/analyze-action.js.map index 94d861e070..3f9c048b8a 100644 --- a/lib/analyze-action.js.map +++ b/lib/analyze-action.js.map @@ -1 +1 @@ -{"version":3,"file":"analyze-action.js","sourceRoot":"","sources":["../src/analyze-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,gDAAwB;AACxB,2CAAyC;AAEzC,oDAAsC;AAEtC,4DAA8C;AAC9C,uCAOmB;AACnB,6CAA+D;AAC/D,2CAA2C;AAC3C,qCAAqC;AACrC,iDAAmD;AACnD,uDAAoD;AACpD,+CAAuC;AACvC,mDAA2C;AAC3C,2CAAuC;AACvC,uCAAqD;AACrD,6CAAkD;AAClD,8DAAgD;AAChD,mDAKyB;AACzB,iDAAqE;AACrE,wDAA0C;AAE1C,6CAA+B;AAC/B,iCAAoD;AAkBpD,KAAK,UAAU,gBAAgB,CAC7B,SAAe,EACf,MAA0B,EAC1B,KAAuC,EACvC,KAAwB,EACxB,mBAAuC,EACvC,iBAAsD,EACtD,mBAA4B,EAC5B,MAAc;IAEd,MAAM,MAAM,GAAG,IAAA,gCAAgB,EAAC,KAAK,EAAE,KAAK,EAAE,wBAAwB,CAAC,CAAC;IACxE,MAAM,gBAAgB,GAAG,MAAM,IAAA,sCAAsB,EACnD,QAAQ,EACR,MAAM,EACN,SAAS,EACT,M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AAE,EACf,SAAS,EACT,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,MAAM,CACP,CAAC;KACH;SAAM;QACL,MAAM,gBAAgB,CACpB,SAAS,EACT,MAAM,EACN,SAAS,EACT,SAAS,EACT,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,MAAM,CACP,CAAC;KACH;AACH,CAAC;AAEY,QAAA,UAAU,GAAG,GAAG,EAAE,CAAC;AAEhC,KAAK,UAAU,UAAU;IACvB,IAAI;QACF,MAAM,kBAAU,CAAC;KAClB;IAAC,OAAO,KAAK,EAAE;QACd,IAAI,CAAC,SAAS,CAAC,0BAA0B,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;KACtE;IACD,MAAM,IAAA,sBAAe,GAAE,CAAC;AAC1B,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"} \ No newline at end of file +{"version":3,"file":"analyze-action.js","sourceRoot":"","sources":["../src/analyze-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,gDAAwB;AACxB,2CAAyC;AAEzC,oDAAsC;AACtC,uDAAmD;AAEnD,4DAA8C;AAC9C,uCAOmB;AACnB,6CAA+D;AAC/D,2CAA2C;AAC3C,qCAAqC;AACrC,iDAAmD;AACnD,uDAAoD;AACpD,+CAA8D;AAC9D,+CAAuC;AACvC,mDAA2C;AAC3C,2CAAuC;AACvC,uCAAqD;AACrD,6CAAkD;AAClD,8DAAgD;AAChD,mDAKyB;AACzB,iDAAqE;AACrE,wDAA0C;AAE1C,6CAA+B;AAC/B,iCAAoD;AAkBpD,KAAK,UAAU,gBAAgB,CAC7B,SAAe,EACf,MAA0B,EAC1B,KAAuC,EACvC,KAAwB,EACxB,mBAAuC,EACvC,iBAAsD,EACtD,mBAA4B,EAC5B,MAAc;IAEd,MAAM,MAAM,GAAG,IAAA,gCAAgB,EAAC,KAAK,EAAE,KAAK,EAAE,wB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tE;IACD,MAAM,IAAA,sBAAe,GAAE,CAAC;AAC1B,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"} \ No newline at end of file diff --git a/lib/autobuild-action.js b/lib/autobuild-action.js index 1aa8303893..c3a415df3a 100644 --- a/lib/autobuild-action.js +++ b/lib/autobuild-action.js @@ -28,8 +28,6 @@ const actions_util_1 = require("./actions-util"); const api_client_1 = require("./api-client"); const autobuild_1 = require("./autobuild"); const configUtils = __importStar(require("./config-utils")); -const environment_1 = require("./environment"); -const languages_1 = require("./languages"); const logging_1 = require("./logging"); const status_report_1 = require("./status-report"); const util_1 = require("./util"); @@ -69,9 +67,6 @@ async function run() { for (const language of languages) { currentLanguage = language; await (0, autobuild_1.runAutobuild)(language, config, logger); - if (language === languages_1.Language.go) { - core.exportVariable(environment_1.EnvVar.DID_AUTOBUILD_GOLANG, "true"); - } } } } diff --git a/lib/autobuild-action.js.map b/lib/autobuild-action.js.map index df0265211b..15bdffa997 100644 --- a/lib/autobuild-action.js.map +++ b/lib/autobuild-action.js.map @@ -1 +1 @@ -{"version":3,"file":"autobuild-action.js","sourceRoot":"","sources":["../src/autobuild-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AAEtC,iDAIwB;AACxB,6CAAgD;AAChD,2CAAwE;AACxE,4DAA8C;AAC9C,+CAAuC;AACvC,2CAAuC;AACvC,uCAAqD;AACrD,mDAKyB;AACzB,iCAKgB;AAShB,KAAK,UAAU,yBAAyB,CACtC,MAAc,EACd,SAAe,EACf,YAAsB,EACtB,eAAwB,EACxB,KAAa;IAEb,IAAA,4BAAqB,EAAC,IAAA,+BAAgB,GAAE,CAAC,CAAC;IAE1C,MAAM,MAAM,GAAG,IAAA,gCAAgB,EAAC,KAAK,EAAE,eAAe,CAAC,CAAC;IACxD,MAAM,gBAAgB,GAAG,MAAM,IAAA,sCAAsB,EACnD,WAAW,EACX,MAAM,EACN,SAAS,EACT,MAAM,IAAA,qBAAc,EAAC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E,CAChE,CAAC;gBACF,OAAO,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;aACjC;YACD,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE;gBAChC,eAAe,GAAG,QAAQ,CAAC;gBAC3B,MAAM,IAAA,wBAAY,EAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;gBAC7C,IAAI,QAAQ,KAAK,oBAAQ,CAAC,EAAE,EAAE;oBAC5B,IAAI,CAAC,cAAc,CAAC,oBAAM,CAAC,oBAAoB,EAAE,MAAM,CAAC,CAAC;iBAC1D;aACF;SACF;KACF;IAAC,OAAO,cAAc,EAAE;QACvB,MAAM,KAAK,GAAG,IAAA,gBAAS,EAAC,cAAc,CAAC,CAAC;QACxC,IAAI,CAAC,SAAS,CACZ,kIAAkI,KAAK,CAAC,OAAO,EAAE,CAClJ,CAAC;QACF,MAAM,yBAAyB,CAC7B,MAAM,EACN,SAAS,EACT,SAAS,IAAI,EAAE,EACf,eAAe,EACf,KAAK,CACN,CAAC;QACF,OAAO;KACR;IAED,MAAM,yBAAyB,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,IAAI,EAAE,CAAC,CAAC;AACtE,CAAC;AAED,KAAK,UAAU,UAAU;IACvB,IAAI;QACF,MAAM,GAAG,EAAE,CAAC;KACb;IAAC,OAAO,KAAK,EAAE;QACd,IAAI,CAAC,SAAS,CAAC,4BAA4B,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;KACxE;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"} \ No newline at end of file +{"version":3,"file":"autobuild-action.js","sourceRoot":"","sources":["../src/autobuild-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AAEtC,iDAIwB;AACxB,6CAAgD;AAChD,2CAAwE;AACxE,4DAA8C;AAE9C,uCAAqD;AACrD,mDAKyB;AACzB,iCAKgB;AAShB,KAAK,UAAU,yBA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obuild.js +++ b/lib/autobuild.js @@ -28,6 +28,7 @@ const core = __importStar(require("@actions/core")); const actions_util_1 = require("./actions-util"); const api_client_1 = require("./api-client"); const codeql_1 = require("./codeql"); +const environment_1 = require("./environment"); const feature_flags_1 = require("./feature-flags"); const languages_1 = require("./languages"); const repository_1 = require("./repository"); @@ -132,6 +133,9 @@ async function runAutobuild(language, config, logger) { await setupCppAutobuild(codeQL, logger); } await codeQL.runAutobuild(language); + if (language === languages_1.Language.go) { + core.exportVariable(environment_1.EnvVar.DID_AUTOBUILD_GOLANG, "true"); + } logger.endGroup(); } exports.runAutobuild = runAutobuild; diff --git a/lib/autobuild.js.map b/lib/autobuild.js.map index f730e71540..33b61ea447 100644 --- a/lib/autobuild.js.map +++ b/lib/autobuild.js.map @@ -1 +1 @@ -{"version":3,"file":"autobuild.js","sourceRoot":"","sources":["../src/autobuild.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AAEtC,iDAA6E;AAC7E,6CAAgD;AAChD,qCAA6C;AAE7C,mDAAmE;AACnE,2CAAyD;AAEzD,6CAAkD;AAClD,iCAA6C;AAEtC,KAAK,UAAU,2BAA2B,CAC/C,MAA0B,EAC1B,MAAc;IAEd,0CAA0C;IAC1C,mFAAmF;IACnF,oFAAoF;IACpF,4EAA4E;IAC5E,MAAM,kBAAkB,GAAG,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CACvD,IAAA,4BAAgB,EAAC,CAAC,CAAC,CACpB,CAAC;IAEF,IAAI,CAAC,kBAAkB,EAAE;QACvB,MAAM,CAAC,IAAI,CACT,iEAAiE,CAClE,CAAC;QACF,OAAO,SAAS,CAAC;KAClB;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,MAAM,2BAA2B,GAAG,kBAAkB,CAAC,MAAM,CAC3D,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,oBAAQ,CAAC,EAAE,CAC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AAA,mCAAoB,GAAE,KAAK,SAAS;gBAClC,CAAC,CAAC,8BAA8B,MAAM,yDAAyD,MAAM,IAAI;gBACzG,CAAC,CAAC,EACN,EAAE,CACH,CAAC;YACF,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;SACtC;aAAM;YACL,MAAM,CAAC,IAAI,CACT,YAAY,WAAW,yCAAyC,MAAM,yCAAyC,MAAM,IAAI,CAC1H,CAAC;YACF,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;SACrC;KACF;SAAM;QACL,MAAM,CAAC,IAAI,CAAC,aAAa,WAAW,GAAG,CAAC,CAAC;QACzC,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACtC;AACH,CAAC;AAEM,KAAK,UAAU,YAAY,CAChC,QAAkB,EAClB,MAA0B,EAC1B,MAAc;IAEd,MAAM,CAAC,UAAU,CAAC,qCAAqC,QAAQ,OAAO,CAAC,CAAC;IACxE,MAAM,MAAM,GAAG,MAAM,IAAA,kBAAS,EAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACjD,IAAI,QAAQ,KAAK,oBAAQ,CAAC,GAAG,EAAE;QAC7B,MAAM,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KACzC;IACD,MAAM,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IACpC,IAAI,QAAQ,KAAK,oBAAQ,CAAC,EAAE,EAAE;QAC5B,IAAI,CAAC,cAAc,CAAC,oBAAM,CAAC,oBAAoB,EAAE,MAAM,CAAC,CAAC;KAC1D;IACD,MAAM,CAAC,QAAQ,EAAE,CAAC;AACpB,CAAC;AAfD,oCAeC"} \ No newline at end of file diff --git a/lib/diagnostics.js b/lib/diagnostics.js new file mode 100644 index 0000000000..20ee8270eb --- /dev/null +++ b/lib/diagnostics.js @@ -0,0 +1,47 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.addDiagnostic = exports.makeDiagnostic = void 0; +const fs_1 = require("fs"); +const path_1 = __importDefault(require("path")); +const logging_1 = require("./logging"); +const util_1 = require("./util"); +/** + * Constructs a new diagnostic message with the specified id and name, as well as optional additional data. + * + * @param id An identifier under which it makes sense to group this diagnostic message. + * @param name Display name for the ID. + * @param data Optional additional data to initialize the diagnostic with. + * @returns Returns the new diagnostic message. + */ +function makeDiagnostic(id, name, data = undefined) { + return { + ...data, + timestamp: data?.timestamp ?? new Date().toISOString(), + source: { ...data?.source, id, name }, + }; +} +exports.makeDiagnostic = makeDiagnostic; +/** + * Writes the given diagnostic to the database. + * + * @param config The configuration that tells us where to store the diagnostic. + * @param diagnostic The diagnostic message to add to the database. + */ +function addDiagnostic(config, language, diagnostic) { + const logger = (0, logging_1.getActionsLogger)(); + const diagnosticsPath = path_1.default.resolve((0, util_1.getCodeQLDatabasePath)(config, language), "diagnostic", "codeql-action"); + try { + // Create the directory if it doesn't exist yet. + (0, fs_1.mkdirSync)(diagnosticsPath, { recursive: true }); + const jsonPath = path_1.default.resolve(diagnosticsPath, `codeql-action-${diagnostic.timestamp}.json`); + (0, fs_1.writeFileSync)(jsonPath, JSON.stringify(diagnostic)); + } + catch (err) { + logger.warning(`Unable to write diagnostic message to database: ${err}`); + } +} +exports.addDiagnostic = addDiagnostic; +//# sourceMappingURL=diagnostics.js.map \ No newline at end of file diff --git a/lib/diagnostics.js.map b/lib/diagnostics.js.map new file mode 100644 index 0000000000..91439c5a41 --- /dev/null +++ b/lib/diagnostics.js.map @@ -0,0 +1 @@ +{"version":3,"file":"diagnostics.js","sourceRoot":"","sources":["../src/diagnostics.ts"],"names":[],"mappings":";;;;;;AAAA,2BAA8C;AAC9C,gDAAwB;AAIxB,uCAA6C;AAC7C,iCAA+C;AAmD/C;;;;;;;GAOG;AACH,SAAgB,cAAc,CAC5B,EAAU,EACV,IAAY,EACZ,OAA+C,SAAS;IAExD,OAAO;QACL,GAAG,IAAI;QACP,SAAS,EAAE,IAAI,EAAE,SAAS,IAAI,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACtD,MAAM,EAAE,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE;KACtC,CAAC;AACJ,CAAC;AAVD,wCAUC;AAED;;;;;GAKG;AACH,SAAgB,aAAa,CAC3B,MAAc,EACd,QAAkB,EAClB,UAA6B;IAE7B,MAAM,MAAM,GAAG,IAAA,0BAAgB,GAAE,CAAC;IAClC,MAAM,eAAe,GAAG,cAAI,CAAC,OAAO,CAClC,IAAA,4BAAqB,EAAC,MAAM,EAAE,QAAQ,CAAC,EACvC,YAAY,EACZ,eAAe,CAChB,CAAC;IAEF,IAAI;QACF,gDAAgD;QAChD,IAAA,cAAS,EAAC,eAAe,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAEhD,MAAM,QAAQ,GAAG,cAAI,CAAC,OAAO,CAC3B,eAAe,EACf,iBAAiB,UAAU,CAAC,SAAS,OAAO,CAC7C,CAAC;QAEF,IAAA,kBAAa,EAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC;KACrD;IAAC,OAAO,GAAG,EAAE;QACZ,MAAM,CAAC,OAAO,CAAC,mDAAmD,GAAG,EAAE,CAAC,CAAC;KAC1E;AACH,CAAC;AAzBD,sCAyBC"} \ No newline at end of file diff --git a/lib/environment.js b/lib/environment.js index 131e35bb3e..04c22ece22 100644 --- a/lib/environment.js +++ b/lib/environment.js @@ -51,5 +51,11 @@ var EnvVar; * rather that the init action. */ EnvVar["WORKFLOW_STARTED_AT"] = "CODEQL_WORKFLOW_STARTED_AT"; + /** + * The path where we initially discovered the Go binary in the system path + * before replacing it with a wrapper script. We check this later to ensure + * that it hasn't been tampered with by a late e.g. `setup-go` step. + */ + EnvVar["GO_BINARY_LOCATION"] = "CODEQL_ACTION_GO_BINARY"; })(EnvVar || (exports.EnvVar = EnvVar = {})); //# sourceMappingURL=environment.js.map \ No newline at end of file diff --git a/lib/environment.js.map b/lib/environment.js.map index b8bb30086b..cc19640994 100644 --- a/lib/environment.js.map +++ b/lib/environment.js.map @@ -1 +1 @@ -{"version":3,"file":"environment.js","sourceRoot":"","sources":["../src/environment.ts"],"names":[],"mappings":";;;AAAA,IAAY,MAgEX;AAhED,WAAY,MAAM;IAChB,2DAA2D;IAC3D,+FAAqF,CAAA;IAErF,gEAAgE;IAChE,qEAA2D,CAAA;IAE3D;;;OAGG;IACH,yFAA+E,CAAA;IAE/E;;;OAGG;IACH,yEAA+D,CAAA;IAE/D,gFAAgF;IAChF,6DAAmD,CAAA;IAEnD;;;OAGG;IACH,uEAA6D,CAAA;IAE7D,gEAAgE;IAChE,mEAAyD,CAAA;IAEzD,kFAAkF;IAClF,mFAAyE,CAAA;IAEzE,6CAA6C;IAC7C,uCAA6B,CAAA;IAE7B,mEAAyD,CAAA;IAEzD;;;OAGG;IACH,2FAAiF,CAAA;IAEjF,mFAAmF;IACnF,6FAAmF,CAAA;IAEnF,qFAAqF;IACrF,+CAAqC,CAAA;IAErC,mEAAyD,CAAA;IAEzD,kEAAkE;IAClE,2CAAiC,CAAA;IAEjC;;;;;;OAMG;IACH,4DAAkD,CAAA;AACpD,CAAC,EAhEW,MAAM,sBAAN,MAAM,QAgEjB"} \ No newline at end of file +{"version":3,"file":"environment.js","sourceRoot":"","sources":["../src/environment.ts"],"names":[],"mappings":";;;AAAA,IAAY,MAuEX;AAvED,WAAY,MAAM;IAChB,2DAA2D;IAC3D,+FAAqF,CAAA;IAErF,gEAAgE;IAChE,qEAA2D,CAAA;IAE3D;;;OAGG;IACH,yFAA+E,CAAA;IAE/E;;;OAGG;IACH,yEAA+D,CAAA;IAE/D,gFAAgF;IAChF,6DAAmD,CAAA;IAEnD;;;OAGG;IACH,uEAA6D,CAAA;IAE7D,gEAAgE;IAChE,mEAAyD,CAAA;IAEzD,kFAAkF;IAClF,mFAAyE,CAAA;IAEzE,6CAA6C;IAC7C,uCAA6B,CAAA;IAE7B,mEAAyD,CAAA;IAEzD;;;OAGG;IACH,2FAAiF,CAAA;IAEjF,mFAAmF;IACnF,6FAAmF,CAAA;IAEnF,qFAAqF;IACrF,+CAAqC,CAAA;IAErC,mEAAyD,CAAA;IAEzD,kEAAkE;IAClE,2CAAiC,CAAA;IAEjC;;;;;;OAMG;IACH,4DAAkD,CAAA;IAElD;;;;OAIG;IACH,wDAA8C,CAAA;AAChD,CAAC,EAvEW,MAAM,sBAAN,MAAM,QAuEjB"} \ No newline at end of file diff --git a/lib/init-action.js b/lib/init-action.js index f4839d066e..6ee84aef80 100644 --- a/lib/init-action.js +++ b/lib/init-action.js @@ -23,8 +23,10 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", { value: true }); +const fs = __importStar(require("fs")); const path = __importStar(require("path")); const core = __importStar(require("@actions/core")); +const safe_which_1 = require("@chrisgavin/safe-which"); const uuid_1 = require("uuid"); const actions_util_1 = require("./actions-util"); const api_client_1 = require("./api-client"); @@ -36,6 +38,7 @@ const logging_1 = require("./logging"); const repository_1 = require("./repository"); const setup_codeql_1 = require("./setup-codeql"); const status_report_1 = require("./status-report"); +const tools_features_1 = require("./tools-features"); const trap_caching_1 = require("./trap-caching"); const util_1 = require("./util"); const workflow_1 = require("./workflow"); @@ -159,12 +162,43 @@ async function run() { return; } try { + // Query CLI for supported features + const versionInfo = await codeql.getVersion(); // Forward Go flags const goFlags = process.env["GOFLAGS"]; if (goFlags) { core.exportVariable("GOFLAGS", goFlags); core.warning("Passing the GOFLAGS env parameter to the init action is deprecated. Please move this to the analyze action."); } + // Go 1.21 and above ships with statically linked binaries on Linux. CodeQL cannot currently trace custom builds + // where the entry point is a statically linked binary. Until that is fixed, we work around the problem by + // replacing the `go` binary with a shell script that invokes the actual `go` binary. Since the shell is typically + // dynamically linked, this provides a suitable entry point for the CodeQL tracer. + if (config.languages.includes(languages_1.Language.go) && + process.platform === "linux" && + !(0, tools_features_1.isSupportedToolsFeature)(versionInfo, tools_features_1.ToolsFeature.IndirectTracingSupportsStaticBinaries)) { + try { + const goBinaryPath = await (0, safe_which_1.safeWhich)("go"); + const fileOutput = await (0, actions_util_1.getFileType)(goBinaryPath); + if (fileOutput.includes("statically linked")) { + logger.debug(`Applying static binary workaround for Go`); + // Create a directory that we can add to the system PATH. + const tempBinPath = path.resolve((0, actions_util_1.getTemporaryDirectory)(), "codeql-action-go-tracing", "bin"); + fs.mkdirSync(tempBinPath, { recursive: true }); + core.addPath(tempBinPath); + // Write the wrapper script to the directory we just added to the PATH. + const goWrapperPath = path.resolve(tempBinPath, "go"); + fs.writeFileSync(goWrapperPath, `#!/bin/bash\n\nexec ${goBinaryPath} "$@"`); + fs.chmodSync(goWrapperPath, "755"); + // Store the original location of our wrapper script somewhere where we can + // later retrieve it from and cross-check that it hasn't been changed. + core.exportVariable(environment_1.EnvVar.GO_BINARY_LOCATION, goWrapperPath); + } + } + catch (e) { + logger.warning(`Analyzing Go on Linux, but failed to install wrapper script. Tracing custom builds may fail: ${e}`); + } + } // Limit RAM and threads for extractors. When running extractors, the CodeQL CLI obeys the // CODEQL_RAM and CODEQL_THREADS environment variables to decide how much RAM and how many // threads it would ask extractors to use. See help text for the "--ram" and "--threads" diff --git a/lib/init-action.js.map b/lib/init-action.js.map index 27cef17f7d..f786cbfdef 100644 --- a/lib/init-action.js.map +++ b/lib/init-action.js.map @@ -1 +1 @@ -{"version":3,"file":"init-action.js","sourceRoot":"","sources":["../src/init-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA6B;AAE7B,oDAAsC;AACtC,+BAAoC;AAEpC,iDAKwB;AACxB,6CAAgD;AAGhD,+CAAuC;AACvC,mDAAoD;AACpD,iCAA4E;AAC5E,2CAAuC;AACvC,uCAAqD;AACrD,6CAAkD;AAClD,iDAA6C;AAC7C,mDAKyB;A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ACjD;IAAC,OAAO,cAAc,EAAE;QACvB,MAAM,KAAK,GAAG,IAAA,gBAAS,EAAC,cAAc,CAAC,CAAC;QACxC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC9B,MAAM,yBAAyB,CAC7B,SAAS,EACT,MAAM,EACN,uBAAuB,EACvB,sBAAsB,EACtB,WAAW,EACX,YAAY,EACZ,MAAM,EACN,KAAK,CACN,CAAC;QACF,OAAO;KACR;IACD,MAAM,yBAAyB,CAC7B,SAAS,EACT,MAAM,EACN,uBAAuB,EACvB,sBAAsB,EACtB,WAAW,EACX,YAAY,EACZ,MAAM,CACP,CAAC;AACJ,CAAC;AAED,SAAS,qBAAqB;IAC5B,0DAA0D;IAC1D,MAAM,WAAW,GAAG,IAAA,+BAAgB,EAAC,cAAc,CAAC,CAAC;IACrD,IAAI,WAAW,KAAK,SAAS;QAAE,OAAO,WAAW,KAAK,MAAM,CAAC;IAE7D,6FAA6F;IAC7F,IAAI,CAAC,IAAA,qBAAc,GAAE;QAAE,OAAO,KAAK,CAAC;IAEpC,oDAAoD;IACpD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,KAAK,UAAU,UAAU;IACvB,IAAI;QACF,MAAM,GAAG,EAAE,CAAC;KACb;IAAC,OAAO,KAAK,EAAE;QACd,IAAI,CAAC,SAAS,CAAC,uBAAuB,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;KACnE;IACD,MAAM,IAAA,sBAAe,GAAE,CAAC;AAC1B,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"} \ No newline at end of file +{"version":3,"file":"init-action.js","sourceRoot":"","sources":["../src/init-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAE7B,oDAAsC;AACtC,uDAAmD;AACnD,+BAAoC;AAEpC,iDAMwB;AACxB,6CAAgD;AAGhD,+CAAuC;AACvC,mDAAoD;A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AC,GAAG,CAAC,EAAE;gBAC3D,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;aACjC;SACF;QAED,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;KACjD;IAAC,OAAO,cAAc,EAAE;QACvB,MAAM,KAAK,GAAG,IAAA,gBAAS,EAAC,cAAc,CAAC,CAAC;QACxC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC9B,MAAM,yBAAyB,CAC7B,SAAS,EACT,MAAM,EACN,uBAAuB,EACvB,sBAAsB,EACtB,WAAW,EACX,YAAY,EACZ,MAAM,EACN,KAAK,CACN,CAAC;QACF,OAAO;KACR;IACD,MAAM,yBAAyB,CAC7B,SAAS,EACT,MAAM,EACN,uBAAuB,EACvB,sBAAsB,EACtB,WAAW,EACX,YAAY,EACZ,MAAM,CACP,CAAC;AACJ,CAAC;AAED,SAAS,qBAAqB;IAC5B,0DAA0D;IAC1D,MAAM,WAAW,GAAG,IAAA,+BAAgB,EAAC,cAAc,CAAC,CAAC;IACrD,IAAI,WAAW,KAAK,SAAS;QAAE,OAAO,WAAW,KAAK,MAAM,CAAC;IAE7D,6FAA6F;IAC7F,IAAI,CAAC,IAAA,qBAAc,GAAE;QAAE,OAAO,KAAK,CAAC;IAEpC,oDAAoD;IACpD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,KAAK,UAAU,UAAU;IACvB,IAAI;QACF,MAAM,GAAG,EAAE,CAAC;KACb;IAAC,OAAO,KAAK,EAAE;QACd,IAAI,CAAC,SAAS,CAAC,uBAAuB,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;KACnE;IACD,MAAM,IAAA,sBAAe,GAAE,CAAC;AAC1B,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"} \ No newline at end of file diff --git a/lib/tools-features.js b/lib/tools-features.js new file mode 100644 index 0000000000..31e53d70be --- /dev/null +++ b/lib/tools-features.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isSupportedToolsFeature = exports.ToolsFeature = void 0; +var ToolsFeature; +(function (ToolsFeature) { + ToolsFeature["IndirectTracingSupportsStaticBinaries"] = "indirectTracingSupportsStaticBinaries"; +})(ToolsFeature || (exports.ToolsFeature = ToolsFeature = {})); +/** + * Determines if the given feature is supported by the CLI. + * + * @param versionInfo Version information, including features, returned by the CLI. + * @param feature The feature to check for. + * @returns True if the feature is supported or false otherwise. + */ +function isSupportedToolsFeature(versionInfo, feature) { + return !!versionInfo.features && versionInfo.features[feature]; +} +exports.isSupportedToolsFeature = isSupportedToolsFeature; +//# sourceMappingURL=tools-features.js.map \ No newline at end of file diff --git a/lib/tools-features.js.map b/lib/tools-features.js.map new file mode 100644 index 0000000000..0a5c4aee64 --- /dev/null +++ b/lib/tools-features.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tools-features.js","sourceRoot":"","sources":["../src/tools-features.ts"],"names":[],"mappings":";;;AAEA,IAAY,YAEX;AAFD,WAAY,YAAY;IACtB,+FAA+E,CAAA;AACjF,CAAC,EAFW,YAAY,4BAAZ,YAAY,QAEvB;AAED;;;;;;GAMG;AACH,SAAgB,uBAAuB,CACrC,WAAwB,EACxB,OAAqB;IAErB,OAAO,CAAC,CAAC,WAAW,CAAC,QAAQ,IAAI,WAAW,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AACjE,CAAC;AALD,0DAKC"} \ No newline at end of file diff --git a/lib/tools-features.test.js b/lib/tools-features.test.js new file mode 100644 index 0000000000..47bd71fc8a --- /dev/null +++ b/lib/tools-features.test.js @@ -0,0 +1,15 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const ava_1 = __importDefault(require("ava")); +const testing_utils_1 = require("./testing-utils"); +const tools_features_1 = require("./tools-features"); +(0, ava_1.default)("isSupportedToolsFeature", async (t) => { + const versionInfo = (0, testing_utils_1.makeVersionInfo)("1.0.0"); + t.false((0, tools_features_1.isSupportedToolsFeature)(versionInfo, tools_features_1.ToolsFeature.IndirectTracingSupportsStaticBinaries)); + versionInfo.features = { indirectTracingSupportsStaticBinaries: true }; + t.true((0, tools_features_1.isSupportedToolsFeature)(versionInfo, tools_features_1.ToolsFeature.IndirectTracingSupportsStaticBinaries)); +}); +//# sourceMappingURL=tools-features.test.js.map \ No newline at end of file diff --git a/lib/tools-features.test.js.map b/lib/tools-features.test.js.map new file mode 100644 index 0000000000..cb7f78ced1 --- /dev/null +++ b/lib/tools-features.test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tools-features.test.js","sourceRoot":"","sources":["../src/tools-features.test.ts"],"names":[],"mappings":";;;;;AAAA,8CAAuB;AAEvB,mDAAkD;AAClD,qDAAyE;AAEzE,IAAA,aAAI,EAAC,yBAAyB,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;IAC1C,MAAM,WAAW,GAAG,IAAA,+BAAe,EAAC,OAAO,CAAC,CAAC;IAE7C,CAAC,CAAC,KAAK,CACL,IAAA,wCAAuB,EACrB,WAAW,EACX,6BAAY,CAAC,qCAAqC,CACnD,CACF,CAAC;IAEF,WAAW,CAAC,QAAQ,GAAG,EAAE,qCAAqC,EAAE,IAAI,EAAE,CAAC;IAEvE,CAAC,CAAC,IAAI,CACJ,IAAA,wCAAuB,EACrB,WAAW,EACX,6BAAY,CAAC,qCAAqC,CACnD,CACF,CAAC;AACJ,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/pr-checks/checks/go-indirect-tracing-workaround-diagnostic.yml b/pr-checks/checks/go-indirect-tracing-workaround-diagnostic.yml new file mode 100644 index 0000000000..4a36199eca --- /dev/null +++ b/pr-checks/checks/go-indirect-tracing-workaround-diagnostic.yml @@ -0,0 +1,49 @@ +name: "Go: diagnostic when Go is changed after init step" +description: "Checks that we emit a diagnostic if Go is changed after the init step" +# only Linux is affected +operatingSystems: ["ubuntu"] +# pinned to a version which does not support statically linked binaries for indirect tracing +versions: ["stable-v2.14.6"] +steps: + - uses: actions/setup-go@v4 + with: + # We need a Go version that ships with statically linked binaries on Linux + go-version: ">=1.21.0" + - uses: ./../action/init + with: + languages: go + tools: ${{ steps.prepare-test.outputs.tools-url }} + # Deliberately change Go after the `init` step + - uses: actions/setup-go@v4 + with: + go-version: "1.20" + - name: Build code + shell: bash + run: go build main.go + - uses: ./../action/analyze + with: + output: "${{ runner.temp }}/results" + upload-database: false + - name: Check diagnostic appears in SARIF + uses: actions/github-script@v6 + env: + SARIF_PATH: "${{ runner.temp }}/results/go.sarif" + with: + script: | + const fs = require('fs'); + + const sarif = JSON.parse(fs.readFileSync(process.env['SARIF_PATH'], 'utf8')); + const run = sarif.runs[0]; + + const toolExecutionNotifications = run.invocations[0].toolExecutionNotifications; + const statusPageNotifications = toolExecutionNotifications.filter(n => + n.descriptor.id === 'go/workflow/go-installed-after-codeql-init' && n.properties?.visibility?.statusPage + ); + if (statusPageNotifications.length !== 1) { + core.setFailed( + 'Expected exactly one status page reporting descriptor for this diagnostic in the ' + + `'runs[].invocations[].toolExecutionNotifications[]' SARIF property, but found ` + + `${statusPageNotifications.length}. All notification reporting descriptors: ` + + `${JSON.stringify(toolExecutionNotifications)}.` + ); + } diff --git a/pr-checks/checks/go-indirect-tracing-workaround.yml b/pr-checks/checks/go-indirect-tracing-workaround.yml new file mode 100644 index 0000000000..9fb11fed68 --- /dev/null +++ b/pr-checks/checks/go-indirect-tracing-workaround.yml @@ -0,0 +1,47 @@ +name: "Go: workaround for indirect tracing" +description: "Checks that our workaround for indirect tracing for Go 1.21+ on Linux works" +# only Linux is affected +operatingSystems: ["ubuntu"] +# pinned to a version which does not support statically linked binaries for indirect tracing +versions: ["stable-v2.14.6"] +steps: + - uses: actions/setup-go@v4 + with: + # We need a Go version that ships with statically linked binaries on Linux + go-version: ">=1.21.0" + - uses: ./../action/init + with: + languages: go + tools: ${{ steps.prepare-test.outputs.tools-url }} + - name: Build code + shell: bash + run: go build main.go + - uses: ./../action/analyze + with: + upload-database: false + - shell: bash + run: | + if [[ -z "${CODEQL_ACTION_GO_BINARY}" ]]; then + echo "Expected the workaround for indirect tracing of static binaries to trigger, but the" \ + "CODEQL_ACTION_GO_BINARY environment variable is not set." + exit 1 + fi + if [[ ! -f "${CODEQL_ACTION_GO_BINARY}" ]]; then + echo "CODEQL_ACTION_GO_BINARY is set, but the corresponding script does not exist." + exit 1 + fi + + + # Once we start running Bash 4.2 in all environments, we can replace the + # `! -z` flag with the more elegant `-v` which confirms that the variable + # is actually unset and not potentially set to a blank value. + if [[ ! -z "${CODEQL_ACTION_DID_AUTOBUILD_GOLANG}" ]]; then + echo "Expected the Go autobuilder not to be run, but the" \ + "CODEQL_ACTION_DID_AUTOBUILD_GOLANG environment variable was set." + exit 1 + fi + cd "$RUNNER_TEMP/codeql_databases" + if [[ ! -d go ]]; then + echo "Did not find a Go database" + exit 1 + fi diff --git a/pr-checks/checks/go-tracing-autobuilder.yml b/pr-checks/checks/go-tracing-autobuilder.yml index 87fe3120eb..cf7ec79361 100644 --- a/pr-checks/checks/go-tracing-autobuilder.yml +++ b/pr-checks/checks/go-tracing-autobuilder.yml @@ -4,6 +4,9 @@ operatingSystems: ["ubuntu", "macos"] env: DOTNET_GENERATE_ASPNET_CERTIFICATE: "false" steps: + - uses: actions/setup-go@v4 + with: + go-version: "~1.21.1" - uses: ./../action/init with: languages: go diff --git a/pr-checks/checks/go-tracing-custom-build-steps.yml b/pr-checks/checks/go-tracing-custom-build-steps.yml index bc6ce396ab..16a0ab15cf 100644 --- a/pr-checks/checks/go-tracing-custom-build-steps.yml +++ b/pr-checks/checks/go-tracing-custom-build-steps.yml @@ -2,6 +2,9 @@ name: "Go: tracing with custom build steps" description: "Checks that Go tracing traces the build when using custom build steps" operatingSystems: ["ubuntu", "macos"] steps: + - uses: actions/setup-go@v4 + with: + go-version: "~1.21.1" - uses: ./../action/init with: languages: go diff --git a/pr-checks/checks/go-tracing-legacy-workflow.yml b/pr-checks/checks/go-tracing-legacy-workflow.yml index e6f91d0802..19142e714b 100644 --- a/pr-checks/checks/go-tracing-legacy-workflow.yml +++ b/pr-checks/checks/go-tracing-legacy-workflow.yml @@ -4,6 +4,9 @@ operatingSystems: ["ubuntu", "macos"] env: DOTNET_GENERATE_ASPNET_CERTIFICATE: "false" steps: + - uses: actions/setup-go@v4 + with: + go-version: "~1.21.1" - uses: ./../action/init with: languages: go diff --git a/src/actions-util.ts b/src/actions-util.ts index c6428f4874..ab0bdbe445 100644 --- a/src/actions-util.ts +++ b/src/actions-util.ts @@ -425,3 +425,39 @@ export function getWorkflowRunAttempt(): number { } return workflowRunAttempt; } + +/** + * Tries to obtain the output of the `file` command for the file at the specified path. + * The output will vary depending on the type of `file`, which operating system we are running on, etc. + */ +export const getFileType = async (filePath: string): Promise => { + let stderr = ""; + let stdout = ""; + try { + // The `file` command will output information about the type of file pointed at by `filePath`. + // For binary files, this may include e.g. whether they are static of dynamic binaries. + // The `-L` switch instructs the command to follow symbolic links. + await new toolrunner.ToolRunner( + await safeWhich.safeWhich("file"), + ["-L", filePath], + { + silent: true, + listeners: { + stdout: (data) => { + stdout += data.toString(); + }, + stderr: (data) => { + stderr += data.toString(); + }, + }, + }, + ).exec(); + return stdout.trim(); + } catch (e) { + core.info( + `Could not determine type of ${filePath} from ${stdout}. ${stderr}`, + ); + + throw e; + } +}; diff --git a/src/analyze-action.ts b/src/analyze-action.ts index 22a35ff104..456aa0e91c 100644 --- a/src/analyze-action.ts +++ b/src/analyze-action.ts @@ -3,6 +3,7 @@ import path from "path"; import { performance } from "perf_hooks"; import * as core from "@actions/core"; +import { safeWhich } from "@chrisgavin/safe-which"; import * as actionsUtil from "./actions-util"; import { @@ -18,6 +19,7 @@ import { runAutobuild } from "./autobuild"; import { getCodeQL } from "./codeql"; import { Config, getConfig } from "./config-utils"; import { uploadDatabases } from "./database-upload"; +import { addDiagnostic, makeDiagnostic } from "./diagnostics"; import { EnvVar } from "./environment"; import { Features } from "./feature-flags"; import { Language } from "./languages"; @@ -231,6 +233,41 @@ async function run() { logger, ); + // Check that `which go` still points at the wrapper script we installed in the `init` Action, + // if the corresponding environment variable is set. This is to ensure that there isn't a step + // in the workflow after the `init` step which installs a different version of Go and takes + // precedence in the PATH, thus potentially circumventing our workaround that allows tracing to work. + const goWrapperPath = process.env[EnvVar.GO_BINARY_LOCATION]; + + if (goWrapperPath !== undefined) { + const goBinaryPath = await safeWhich("go"); + + if (goWrapperPath !== goBinaryPath) { + core.warning( + `Expected \`which go\` to return ${goWrapperPath}, but got ${goBinaryPath}: please ensure that the correct version of Go is installed before the \`codeql-action/init\` Action is used.`, + ); + + addDiagnostic( + config, + Language.go, + makeDiagnostic( + "go/workflow/go-installed-after-codeql-init", + "Go was installed after the `codeql-action/init` Action was run", + { + markdownMessage: + "To avoid interfering with the CodeQL analysis, perform all installation steps before calling the `github/codeql-action/init` Action.", + visibility: { + statusPage: true, + telemetry: true, + cliSummaryTable: true, + }, + severity: "warning", + }, + ), + ); + } + } + await runAutobuildIfLegacyGoWorkflow(config, logger); dbCreationTimings = await runFinalize( diff --git a/src/autobuild-action.ts b/src/autobuild-action.ts index 3f90b5bce9..3ab2297b57 100644 --- a/src/autobuild-action.ts +++ b/src/autobuild-action.ts @@ -8,7 +8,6 @@ import { import { getGitHubVersion } from "./api-client"; import { determineAutobuildLanguages, runAutobuild } from "./autobuild"; import * as configUtils from "./config-utils"; -import { EnvVar } from "./environment"; import { Language } from "./languages"; import { Logger, getActionsLogger } from "./logging"; import { @@ -98,9 +97,6 @@ async function run() { for (const language of languages) { currentLanguage = language; await runAutobuild(language, config, logger); - if (language === Language.go) { - core.exportVariable(EnvVar.DID_AUTOBUILD_GOLANG, "true"); - } } } } catch (unwrappedError) { diff --git a/src/autobuild.ts b/src/autobuild.ts index 4585a8288f..bf44462386 100644 --- a/src/autobuild.ts +++ b/src/autobuild.ts @@ -4,6 +4,7 @@ import { getTemporaryDirectory, getWorkflowEventName } from "./actions-util"; import { getGitHubVersion } from "./api-client"; import { CodeQL, getCodeQL } from "./codeql"; import * as configUtils from "./config-utils"; +import { EnvVar } from "./environment"; import { Feature, featureConfig, Features } from "./feature-flags"; import { isTracedLanguage, Language } from "./languages"; import { Logger } from "./logging"; @@ -150,5 +151,8 @@ export async function runAutobuild( await setupCppAutobuild(codeQL, logger); } await codeQL.runAutobuild(language); + if (language === Language.go) { + core.exportVariable(EnvVar.DID_AUTOBUILD_GOLANG, "true"); + } logger.endGroup(); } diff --git a/src/diagnostics.ts b/src/diagnostics.ts new file mode 100644 index 0000000000..76cc4c98a0 --- /dev/null +++ b/src/diagnostics.ts @@ -0,0 +1,109 @@ +import { mkdirSync, writeFileSync } from "fs"; +import path from "path"; + +import { Config } from "./config-utils"; +import { Language } from "./languages"; +import { getActionsLogger } from "./logging"; +import { getCodeQLDatabasePath } from "./util"; + +/** Represents a diagnostic message for the tool status page, etc. */ +export interface DiagnosticMessage { + /** ISO 8601 timestamp */ + timestamp: string; + source: { + /** + * An identifier under which it makes sense to group this diagnostic message. + * This is used to build the SARIF reporting descriptor object. + */ + id: string; + /** Display name for the ID. This is used to build the SARIF reporting descriptor object. */ + name: string; + /** + * Name of the CodeQL extractor. This is used to identify which tool component the reporting + * descriptor object should be nested under in SARIF. + */ + extractorName?: string; + }; + /** GitHub flavored Markdown formatted message. Should include inline links to any help pages. */ + markdownMessage?: string; + /** Plain text message. Used by components where the string processing needed to support Markdown is cumbersome. */ + plaintextMessage?: string; + /** List of help links intended to supplement the `plaintextMessage`. */ + helpLinks?: string[]; + /** SARIF severity */ + severity?: "error" | "warning" | "note"; + visibility?: { + /** True if the message should be displayed on the status page (defaults to false) */ + statusPage?: boolean; + /** + * True if the message should be counted in the diagnostics summary table printed by `codeql database analyze` + * (defaults to false) + */ + cliSummaryTable?: boolean; + /** True if the message should be sent to telemetry (defaults to false) */ + telemetry?: boolean; + }; + location?: { + /** Path to the affected file if appropriate, relative to the source root */ + file?: string; + startLine?: number; + startColumn?: number; + endLine?: number; + endColumn?: number; + }; + /** Structured metadata about the diagnostic message */ + attributes?: { [key: string]: any }; +} + +/** + * Constructs a new diagnostic message with the specified id and name, as well as optional additional data. + * + * @param id An identifier under which it makes sense to group this diagnostic message. + * @param name Display name for the ID. + * @param data Optional additional data to initialize the diagnostic with. + * @returns Returns the new diagnostic message. + */ +export function makeDiagnostic( + id: string, + name: string, + data: Partial | undefined = undefined, +): DiagnosticMessage { + return { + ...data, + timestamp: data?.timestamp ?? new Date().toISOString(), + source: { ...data?.source, id, name }, + }; +} + +/** + * Writes the given diagnostic to the database. + * + * @param config The configuration that tells us where to store the diagnostic. + * @param diagnostic The diagnostic message to add to the database. + */ +export function addDiagnostic( + config: Config, + language: Language, + diagnostic: DiagnosticMessage, +) { + const logger = getActionsLogger(); + const diagnosticsPath = path.resolve( + getCodeQLDatabasePath(config, language), + "diagnostic", + "codeql-action", + ); + + try { + // Create the directory if it doesn't exist yet. + mkdirSync(diagnosticsPath, { recursive: true }); + + const jsonPath = path.resolve( + diagnosticsPath, + `codeql-action-${diagnostic.timestamp}.json`, + ); + + writeFileSync(jsonPath, JSON.stringify(diagnostic)); + } catch (err) { + logger.warning(`Unable to write diagnostic message to database: ${err}`); + } +} diff --git a/src/environment.ts b/src/environment.ts index cd65f68ee2..33dcab76bc 100644 --- a/src/environment.ts +++ b/src/environment.ts @@ -62,4 +62,11 @@ export enum EnvVar { * rather that the init action. */ WORKFLOW_STARTED_AT = "CODEQL_WORKFLOW_STARTED_AT", + + /** + * The path where we initially discovered the Go binary in the system path + * before replacing it with a wrapper script. We check this later to ensure + * that it hasn't been tampered with by a late e.g. `setup-go` step. + */ + GO_BINARY_LOCATION = "CODEQL_ACTION_GO_BINARY", } diff --git a/src/init-action.ts b/src/init-action.ts index 4e1af53f2d..4040e6b068 100644 --- a/src/init-action.ts +++ b/src/init-action.ts @@ -1,10 +1,13 @@ +import * as fs from "fs"; import * as path from "path"; import * as core from "@actions/core"; +import { safeWhich } from "@chrisgavin/safe-which"; import { v4 as uuidV4 } from "uuid"; import { getActionVersion, + getFileType, getOptionalInput, getRequiredInput, getTemporaryDirectory, @@ -25,6 +28,7 @@ import { getActionsStatus, sendStatusReport, } from "./status-report"; +import { ToolsFeature, isSupportedToolsFeature } from "./tools-features"; import { getTotalCacheSize } from "./trap-caching"; import { checkDiskUsage, @@ -312,6 +316,9 @@ async function run() { } try { + // Query CLI for supported features + const versionInfo = await codeql.getVersion(); + // Forward Go flags const goFlags = process.env["GOFLAGS"]; if (goFlags) { @@ -321,6 +328,53 @@ async function run() { ); } + // Go 1.21 and above ships with statically linked binaries on Linux. CodeQL cannot currently trace custom builds + // where the entry point is a statically linked binary. Until that is fixed, we work around the problem by + // replacing the `go` binary with a shell script that invokes the actual `go` binary. Since the shell is typically + // dynamically linked, this provides a suitable entry point for the CodeQL tracer. + if ( + config.languages.includes(Language.go) && + process.platform === "linux" && + !isSupportedToolsFeature( + versionInfo, + ToolsFeature.IndirectTracingSupportsStaticBinaries, + ) + ) { + try { + const goBinaryPath = await safeWhich("go"); + const fileOutput = await getFileType(goBinaryPath); + + if (fileOutput.includes("statically linked")) { + logger.debug(`Applying static binary workaround for Go`); + + // Create a directory that we can add to the system PATH. + const tempBinPath = path.resolve( + getTemporaryDirectory(), + "codeql-action-go-tracing", + "bin", + ); + fs.mkdirSync(tempBinPath, { recursive: true }); + core.addPath(tempBinPath); + + // Write the wrapper script to the directory we just added to the PATH. + const goWrapperPath = path.resolve(tempBinPath, "go"); + fs.writeFileSync( + goWrapperPath, + `#!/bin/bash\n\nexec ${goBinaryPath} "$@"`, + ); + fs.chmodSync(goWrapperPath, "755"); + + // Store the original location of our wrapper script somewhere where we can + // later retrieve it from and cross-check that it hasn't been changed. + core.exportVariable(EnvVar.GO_BINARY_LOCATION, goWrapperPath); + } + } catch (e) { + logger.warning( + `Analyzing Go on Linux, but failed to install wrapper script. Tracing custom builds may fail: ${e}`, + ); + } + } + // Limit RAM and threads for extractors. When running extractors, the CodeQL CLI obeys the // CODEQL_RAM and CODEQL_THREADS environment variables to decide how much RAM and how many // threads it would ask extractors to use. See help text for the "--ram" and "--threads" diff --git a/src/tools-features.test.ts b/src/tools-features.test.ts new file mode 100644 index 0000000000..95195f5f54 --- /dev/null +++ b/src/tools-features.test.ts @@ -0,0 +1,24 @@ +import test from "ava"; + +import { makeVersionInfo } from "./testing-utils"; +import { ToolsFeature, isSupportedToolsFeature } from "./tools-features"; + +test("isSupportedToolsFeature", async (t) => { + const versionInfo = makeVersionInfo("1.0.0"); + + t.false( + isSupportedToolsFeature( + versionInfo, + ToolsFeature.IndirectTracingSupportsStaticBinaries, + ), + ); + + versionInfo.features = { indirectTracingSupportsStaticBinaries: true }; + + t.true( + isSupportedToolsFeature( + versionInfo, + ToolsFeature.IndirectTracingSupportsStaticBinaries, + ), + ); +}); diff --git a/src/tools-features.ts b/src/tools-features.ts new file mode 100644 index 0000000000..97f0a50168 --- /dev/null +++ b/src/tools-features.ts @@ -0,0 +1,19 @@ +import { VersionInfo } from "./codeql"; + +export enum ToolsFeature { + IndirectTracingSupportsStaticBinaries = "indirectTracingSupportsStaticBinaries", +} + +/** + * Determines if the given feature is supported by the CLI. + * + * @param versionInfo Version information, including features, returned by the CLI. + * @param feature The feature to check for. + * @returns True if the feature is supported or false otherwise. + */ +export function isSupportedToolsFeature( + versionInfo: VersionInfo, + feature: ToolsFeature, +): boolean { + return !!versionInfo.features && versionInfo.features[feature]; +}