Skip to content

fix(build): compile and test the build without Tree-sitter, and check it in CI - #806

Merged
ajianaz merged 1 commit into
developfrom
fix/no-default-features-build
Nov 17, 2026
Merged

ajianaz merged 1 commit into
developfrom
fix/no-default-features-build

Conversation

@ajianaz

@ajianaz ajianaz commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

What

  • AstEdge, EdgeKind and their CallSite conversions move from src/index/ast.rs (only built with the tree-sitter feature) to a new always-built src/index/edge.rs. KgEdge is now one type in both configurations: the separate stub struct for the no-Tree-sitter build is gone, and detect_routes (regex) returns the same edge type in both. cargo build --no-default-features compiles again.
  • Running the test suite in that configuration showed two more problems, both fixed: the regex Rust extractor skipped pub(crate), pub(super) and pub(in ..) items (and so reported nothing for a lot of real code), and read const fn name as a constant called fn. A test (rust_regex_handles_restricted_visibility_and_const_fn) covers every item kind; it was red first.
  • test_index_run_auto_prunes_deleted_files seeded edges rows directly but relied on the extractor for call_graph rows; it now seeds both, since it tests pruning and not extraction.
  • Dead-code warnings that exist only in that configuration (the edge kinds only the Tree-sitter extractor builds) get a narrow cfg_attr(not(feature = "tree-sitter"), allow(dead_code)).
  • The Check job of ci.yml lints (clippy -D warnings) and tests the build without Tree-sitter, so it cannot break unnoticed again. It is the same job, so the list of required checks does not change.

Why

The README and docs/code-intelligence.md document a regex-only build, extract_all has a branch for it, and nothing built it: it failed to compile on develop for a long time. Closes #793.

Testing

  • cargo check, cargo clippy --all-targets -- -D warnings and cargo test pass in both configurations: 1552 tests with --features tree-sitter, 1519 with --no-default-features (the others need Tree-sitter), 0 failures.
  • Verified end to end with a --no-default-features binary: it indexes a small Rust project and cora dead-code finds the unused function.
  • cargo fmt --all -- --check clean; Cora review of the staged diff: no findings.

@ajianaz
ajianaz merged commit 82f90f1 into develop Nov 17, 2026
16 checks passed
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.

build: cargo build --no-default-features does not compile, and CI does not check it

1 participant