Skip to content

CodeQL: install platform specific CodeQL bundle #12443

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 2 commits into from
Jun 25, 2025

Conversation

aibaars
Copy link
Contributor

@aibaars aibaars commented Jun 23, 2025

This should reduce the size of the CodeQL bundle by only including the platform specific CodeQL CLI and libraries, rather than the full set of CodeQL CLI and libraries for all platforms.

Description

New tool, Bug fixing, or Improvement?
Please include a summary of the change and which issue is fixed. Also include relevant motivation and context.
For new tools, please provide total size and installation time.

Related issue:

Check list

  • Related issue / work item is attached
  • Tests are written (if applicable)
  • Documentation is updated (if applicable)
  • Changes are tested and related VM images are successfully generated

This should reduce the size of the CodeQL bundle by only including the
platform specific CodeQL CLI and libraries, rather than the full set
of CodeQL CLI and libraries for all platforms.
@aibaars aibaars marked this pull request as ready for review June 23, 2025 08:12
@Copilot Copilot AI review requested due to automatic review settings June 23, 2025 08:12
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the platform bundle download scripts to fetch only the OS-specific CodeQL CLI and libraries instead of the full multi-platform archive, reducing overall bundle size.

  • Windows script now downloads and unpacks the win64 bundle.
  • Ubuntu script now downloads the linux64 bundle.
  • macOS script now downloads the osx64 bundle.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
images/windows/scripts/build/Install-CodeQLBundle.ps1 Changed download URL and archive name to codeql-bundle-win64
images/ubuntu/scripts/build/install-codeql-bundle.sh Changed download URL to codeql-bundle-linux64.tar.gz
images/macos/scripts/build/install-codeql-bundle.sh Changed download URL to codeql-bundle-osx64.tar.gz

@@ -31,15 +31,15 @@ $tagName = "codeql-bundle-v" + $cliVersion
Write-Host "Downloading CodeQL bundle $($cliVersion)..."
# Note that this is the all-platforms CodeQL bundle, to support scenarios where customers run
# different operating systems within containers.
$codeQLBundlePath = Invoke-DownloadWithRetry "https://github.com/github/codeql-action/releases/download/$($tagName)/codeql-bundle.tar.gz"
$codeQLBundlePath = Invoke-DownloadWithRetry "https://github.com/github/codeql-action/releases/download/$($tagName)/codeql-bundle-win64.tar.gz"
Copy link
Preview

Copilot AI Jun 23, 2025

Choose a reason for hiding this comment

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

[nitpick] Instead of hardcoding win64, consider parameterizing the platform and architecture suffix (e.g., via an environment variable or script parameter) to support additional architectures like arm64 in the future.

Suggested change
$codeQLBundlePath = Invoke-DownloadWithRetry "https://github.com/github/codeql-action/releases/download/$($tagName)/codeql-bundle-win64.tar.gz"
$architectureSuffix = $env:ARCHITECTURE_SUFFIX
if ([string]::IsNullOrEmpty($architectureSuffix)) {
$architectureSuffix = "win64" # Default to win64 if not specified
}
$codeQLBundlePath = Invoke-DownloadWithRetry "https://github.com/github/codeql-action/releases/download/$($tagName)/codeql-bundle-$($architectureSuffix).tar.gz"

Copilot uses AI. Check for mistakes.

@@ -30,7 +30,7 @@ bundle_tag_name="codeql-bundle-v$bundle_version"
echo "Downloading CodeQL bundle $bundle_version..."
# Note that this is the all-platforms CodeQL bundle, to support scenarios where customers run
# different operating systems within containers.
codeql_archive=$(download_with_retry "https://github.com/github/codeql-action/releases/download/$bundle_tag_name/codeql-bundle.tar.gz")
codeql_archive=$(download_with_retry "https://github.com/github/codeql-action/releases/download/$bundle_tag_name/codeql-bundle-linux64.tar.gz")
Copy link
Preview

Copilot AI Jun 23, 2025

Choose a reason for hiding this comment

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

[nitpick] The variable codeql_archive uses snake_case, while the Windows script uses PascalCase ($codeQLBundlePath). Consider standardizing variable names across scripts for consistency and easier maintenance.

Copilot uses AI. Check for mistakes.

@paveliak paveliak merged commit bc7868f into actions:main Jun 25, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants