Skip to content

Set GGSQL_SKIP_GENERATE for CRAN/offline builds#6

Closed
cpsievert wants to merge 1 commit into
posit-dev:mainfrom
cpsievert:fix/skip-tree-sitter-generate-cran
Closed

Set GGSQL_SKIP_GENERATE for CRAN/offline builds#6
cpsievert wants to merge 1 commit into
posit-dev:mainfrom
cpsievert:fix/skip-tree-sitter-generate-cran

Conversation

@cpsievert
Copy link
Copy Markdown
Contributor

Summary

  • When building in CRAN mode (NOT_CRAN unset, vendor.tar.xz present), set GGSQL_SKIP_GENERATE=1 in the cargo environment so the tree-sitter-ggsql build script uses the pre-generated parser.c from the vendor tarball instead of trying to run tree-sitter generate
  • Development builds (NOT_CRAN=true) are unchanged — tree-sitter generate still runs as before

Motivation

The vendored tree-sitter-ggsql crate already ships parser.c, but the Rust build.rs unconditionally requires tree-sitter-cli (an npm package) unless GGSQL_SKIP_GENERATE is set. This causes build failures in environments that don't have Node.js/npm — specifically:

  • R-universe binary builds (Linux containers don't have Node.js; macOS strips Homebrew)
  • CRAN build machines

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

  • Verify ggsql-r CI still passes (development builds with NOT_CRAN=true should be unaffected)
  • After merging, confirm R-universe build succeeds once ggsql is added to the registry

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.
@thomasp85
Copy link
Copy Markdown
Collaborator

We never want to regenerate - I fixed this in main

@thomasp85 thomasp85 closed this Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants