Set GGSQL_SKIP_GENERATE for CRAN/offline builds#6
Closed
cpsievert wants to merge 1 commit into
Closed
Conversation
The vendored tree-sitter-ggsql crate includes a pre-generated parser.c, so tree-sitter-cli is not needed for offline builds. Set GGSQL_SKIP_GENERATE=1 in the Makevars when building in CRAN mode (NOT_CRAN unset, vendor.tar.xz present) so the Rust build.rs uses the existing parser.c instead of trying to run `tree-sitter generate`. This is required for R-universe binary builds and future CRAN submission, where tree-sitter-cli is not available.
Collaborator
|
We never want to regenerate - I fixed this in main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
NOT_CRANunset,vendor.tar.xzpresent), setGGSQL_SKIP_GENERATE=1in the cargo environment so thetree-sitter-ggsqlbuild script uses the pre-generatedparser.cfrom the vendor tarball instead of trying to runtree-sitter generateNOT_CRAN=true) are unchanged —tree-sitter generatestill runs as beforeMotivation
The vendored
tree-sitter-ggsqlcrate already shipsparser.c, but the Rustbuild.rsunconditionally requirestree-sitter-cli(an npm package) unlessGGSQL_SKIP_GENERATEis set. This causes build failures in environments that don't have Node.js/npm — specifically:This is a prerequisite for adding ggsql to the posit-dev R-universe (see posit-dev/posit-dev.r-universe.dev#2), which would make pre-built binaries available so downstream packages like querychat don't need a Rust toolchain to install ggsql.
Test plan
NOT_CRAN=trueshould be unaffected)