Repository navigation
refactor: drive compile from a native driver and move scopes and macro analysis to Rust - #1093
Merged
Merged
Conversation
Move the static analysis of project macro modules (exports, project imports, call graph, cycles and the fault-tolerant inventory) from Python's ast to sqlbuild-pysource. CPython still parses each module first and owns syntax errors; module loading stays in Python.
…ookup, placement and projection
…ve resources natively
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.
Why
Phase 1 of the Rust-hosted migration (CHI-589): Rust should own the compile sequence and the static compiler logic, and Python should remain only for user code, adapters and the executor. This milestone moves compile orchestration and several analysis stages to Rust and deletes the Python they replace.
Changes
crates/sqlbuild-python/src/bindings/_helpers/compile_driver/): runssqb compile(analysis, manifest, DAG, artifact writing, reuse recording, output) and builds compiled projects and project graphs. The remaining Python stages are called by module path. Deletes_compile.py, the compilepipeline.py,status.py,collection.py,dag.pyand the pipelinecompiled_project.py,selected_graph.pyandgraph.py.sqlbuild-pysourcecrate (ruff parser) for static reading of project Python. Macro module analysis now runs there. CPython still parses each module first, so syntax errors are unchanged.python-boundary.toml).Verification
sqb compileoutput is identical tomainon a generated 1k-model project and on a private project (cold and one-model edit).make test,make check-ciand the hygiene scan pass.