-
Notifications
You must be signed in to change notification settings - Fork 94
Extract Calcite build to standalone script and pre-build in Copilot setup #5473
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
base: main
Are you sure you want to change the base?
Conversation
… setup Co-authored-by: Karakatiza666 <8537259+Karakatiza666@users.noreply.github.com>
Co-authored-by: Karakatiza666 <8537259+Karakatiza666@users.noreply.github.com>
There was a problem hiding this 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 pull request extracts Calcite build logic from the SQL compiler build script into a standalone script and adds a Copilot setup step to pre-build Calcite from source. This eliminates the ~12-minute delay Copilot experiences when discovering version mismatches during SQL compiler development.
Changes:
- Extracted Calcite build logic into standalone
build_calcite.shscript (100 lines) that can be run independently - Simplified
build.shfrom 77 to 42 lines by delegating tobuild_calcite.shwhile maintaining identical CLI interface - Added Calcite pre-build step to Copilot setup workflow after Java installation
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| sql-to-dbsp-compiler/build_calcite.sh | New standalone script that handles Calcite cloning, building, and Maven installation with command-line flags to override environment settings |
| sql-to-dbsp-compiler/build.sh | Simplified script that delegates Calcite building to build_calcite.sh while preserving the same command-line interface |
| .github/workflows/copilot-setup-steps.yml | Added step to pre-build Calcite from source after Java setup, eliminating discovery delays for Copilot |
| 19* | 20* | 21*) ;; | ||
| 2[5-9]*) | ||
| echo >&2 "*** ERROR *** Java version 25+ does not work with Calcite" | ||
| exit 1 | ||
| ;; | ||
| *) | ||
| echo "*** WARNING *** Only Java versions 19, 20, and 21 are known to work with Calcite but you have $jvm_version" | ||
| ;; |
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indentation in this case statement uses tabs instead of spaces, which is inconsistent with the rest of the file. The file uses spaces elsewhere (4 spaces for the main if block, etc.), but this section uses tabs. This should be standardized to use spaces for consistency.
| 19* | 20* | 21*) ;; | |
| 2[5-9]*) | |
| echo >&2 "*** ERROR *** Java version 25+ does not work with Calcite" | |
| exit 1 | |
| ;; | |
| *) | |
| echo "*** WARNING *** Only Java versions 19, 20, and 21 are known to work with Calcite but you have $jvm_version" | |
| ;; | |
| 19* | 20* | 21*) ;; | |
| 2[5-9]*) | |
| echo >&2 "*** ERROR *** Java version 25+ does not work with Calcite" | |
| exit 1 | |
| ;; | |
| *) | |
| echo "*** WARNING *** Only Java versions 19, 20, and 21 are known to work with Calcite but you have $jvm_version" | |
| ;; |
| if [ "${CALCITE_BUILD_NEXT}" = "y" ]; then | ||
| update_pom "${CALCITE_NEXT}" | ||
|
|
||
| if [ ! -d "${CALCITE_BUILD_DIR}" ]; then | ||
| echo "Cloning Calcite into ${CALCITE_BUILD_DIR}" | ||
| git clone --depth 1 --quiet --single-branch --branch "${CALCITE_BRANCH}" ${GIT_ARGS} "${CALCITE_REPO}" "${CALCITE_BUILD_DIR}" |
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The script uses environment variables (CALCITE_NEXT, CALCITE_BRANCH, CALCITE_REPO) that are not defined with default values. If the calcite_version.env file is missing or incomplete, and someone runs this script with the -n flag or if CALCITE_BUILD_NEXT is set to "y", the script will fail with undefined variable errors. These variables should have default values defined at the beginning of the script, similar to CALCITE_BUILD_DIR and CALCITE_CURRENT.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot document at the beginning of build_calcite.sh that these environment variables do not have a default and need to be defined if using the -n flag or whatever
Copilot was spending 12 minutes discovering it needs to build Calcite from source when working on SQL compiler features. The build instructions were embedded in
build.sh, making them non-discoverable during environment setup.Changes
New
sql-to-dbsp-compiler/build_calcite.sh-n/-c) overridecalcite_version.envsettingsUpdated
sql-to-dbsp-compiler/build.shbuild_calcite.sh)Updated
.github/workflows/copilot-setup-steps.ymlExample
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.