Repository navigation
flow run without Python on the flowc host - #960
Merged
Merged
Conversation
A fresh clone writes compiler/src after compiler/bootstrap, so the mtime check always saw the sources as newer than the bootstrap C and sent the default flowc host down the Python Gen0 roundtrip. Decide staleness from uncommitted edits under compiler/src instead, freshen flowc_bootstrap against the bootstrap C it was built from, and use Python only for real local edits when python3 is on PATH.
Same hunk as the flow-driver part of #956, so either branch rebases cleanly over the other. Without it no example with an import builds on the default host, and the no-Python run check needs some that do.
Every flow run and flow audio called python3 -m flow.package sync, even for programs with no manifest or an empty [dependencies] table. The check now lives in scripts/tools/pkg_sync, a Flow program the driver builds once with the Stage-A flowc driver. It mirrors FlowPackageManager.sync_for_program: no flow.toml, no dependencies, or flow.lock plus every flow_packages/<name> present means nothing to do. A project that must fetch something, or whose manifest uses TOML the reader leaves alone (dotted dependency keys, multi-line strings), still goes to the package manager exactly as before. flow_resolve_flowc now returns an absolute path, so flow run works from any working directory, and no longer sets FLOW_HOST=python around ensure_flowc.
scripts/check_run_without_python.sh puts python and python3 stubs that log and exit 127 first on PATH, clears compiler/build and build/, and runs flow run / flow compile on programs with and without stdlib imports, from the repo root and another directory, plus a project with an empty [dependencies] table and one with an installed registry package. It fails if a program misbehaves or any stub is called. A control removes the installed package and checks the package manager call still happens. The no-Python CI job runs it. flow-driver is added to the workflow path filters, which listed flow but not the driver it delegates to.
The language suite always transpiled with python3 -m flow.transpiler --strict. With FLOW_HOST=flowc set explicitly it now bundles each program with the Stage-A driver (FLOWC_TYPECHECK=1) and compiles with -I tests/lang, needing no Python. The Python strict transpile stays the default: on this tree flowc passes 100 of 126 programs and Python 123. The no-Python check covers one test-lang run.
godofecht
force-pushed
the
port/run-without-python
branch
from
September 27, 2026 21:05
4869fd2 to
7401e51
Compare
This was referenced Sep 27, 2026
godofecht
added a commit
that referenced
this pull request
Sep 27, 2026
) ensure_flowc returns flowc_bootstrap on a clean checkout since #960, and that driver reads FLOWC_IN and FLOWC_OUT. The eight flowc conformance cases now set both.
godofecht
added a commit
that referenced
this pull request
Sep 29, 2026
godofecht
added a commit
that referenced
this pull request
Sep 29, 2026
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.
What
Default
./flow runand./flow compileon the flowc host now work with no Python on PATH.Python calls removed from the default paths:
flow run(andflow audio) calledpython3 -m flow.package sync --programfor every program. The decision is nowscripts/tools/pkg_sync/main.flow, a Flow program that flow-driver builds once with the Stage-A driver. It mirrorsFlowPackageManager.sync_for_program: no flow.toml, an empty[dependencies], or flow.lock plus everyflow_packages/<name>present means nothing to do. A project that must fetch something, or whose manifest uses TOML the reader leaves alone (dotted dependency keys, multi-line strings), still goes topackage.pyexactly as before.compiler/scripts/ensure_flowc.shjudged the bootstrap C stale by mtime. A fresh clone writescompiler/srcaftercompiler/bootstrap, so every clean checkout went to the Python Gen0 roundtrip on its firstflow run(and on this tree that roundtrip fails, so the first run failed). Staleness now means uncommitted edits undercompiler/src(mtime only outside git). Otherwiseflowc_bootstrapis built from the checked-in C with cc. Python is used only for real local edits when python3 exists.flow_resolve_flowcno longer wraps ensure_flowc inFLOW_HOST=python, and returns an absolute path, soflow runworks from any working directory.flow test-langruns on flowc whenFLOW_HOST=flowcis set. The Python strict transpile stays its default: flowc passes 100 of 126 programs, Python 123 (the 3 Python failures also fail on main).Also: the flow-driver hunk from #956 (bundle programs with imports on flowc), copied byte for byte so either PR rebases cleanly over the other. Without it no example with an import builds on the default host.
flow-driveris added to the CI path filters, which listedflowbut not the driver.Proof
scripts/check_run_without_python.shputspython/python3stubs that log and exit 127 first on PATH, clearscompiler/buildandbuild/, and runs:The same script against main's flow-driver and ensure_flowc fails every run case and logs
python3 -m flow.package sync --program ...for each, pluspython3 -c import flow.transpilerfrom the Gen0 fallback. It runs in theflowc self-host (no Python)CI job.Still needs Python
package.py).compiler/src/pkg.flowalso delegates fetching to it; that file is out of scope here.import json.lib): flowc cannot resolve package imports yet, with or without Python. The registry case in the check therefore uses a program that does not import the package.flow testin project mode (flow.project_test_runner),FLOW_RUN_PYTHON=1,FLOW_HOST=python|auto, and non-default commands (MLIR, gfx, audio compile, wasm, pkg subcommands).Docs were not updated in this PR: the repo's pre-commit prose check rejects the existing em dashes in
docs/project/self-hosting.md,python-in-flow.md,package-registry.mdandcompiler/README.md. Note that self-hosting.md Phase D slice 2 saysflow runneeded no Python; that held forflow compileonly, until this change.No Python became dead:
sync_for_programis still the install path.