Skip to content

[self-hosting E] Package self-hosted flowc + release fixed-point CI #154

Closed

Description

@godofecht

Phase E — Packaging & polish

Plan: docs/project/self-hosting.md

Work

  • Homebrew / release artifacts from self-hosted builds
  • Optional MLIR/GPU as separate tracks (not blocking cutover)
  • Release CI: three consecutive gen fixed-points (self / g2 / g3)

Exit

Published flowc binary users can install without cloning Python sources.

Activity

  1. added
    enhancement
    self-hosting
    on Aug 5, 2026
  2. godofecht commented on Aug 6, 2026

    @godofecht
    ContributorAuthor

    Fixed-point CI done, packaging done, publishing left

    Branch flowc/self-hosting-chain.

    Three consecutive generation fixed-points

    compiler/scripts/self_host_full.sh, run by roundtrip.sh and by CI. It bundles all of compiler/src into one ~195 KB translation unit; that binary is a complete flowc, so each generation is checked twice — it must pass flowc's own front-end self-tests and it must compile an ordinary program.

    === gen1: bootstrap driver compiles all of compiler/src ===
    gen1 C: 195561 bytes
    PASS gen1 self-tests (flowc: PASS)
    PASS gen1 compiles stage_a_sum (exit 45)
    PASS fixed point: gen1.c == gen2.c
    PASS gen2 self-tests (flowc: PASS)
    PASS fixed point: gen2.c == gen3.c
    PASS gen3 self-tests (flowc: PASS)
    PASS fixed point: gen2.o == gen3.o
    ALL PASS self_host_full (three consecutive generations, byte-identical)
    

    About three seconds once a driver exists. Objects rather than linked binaries for the byte compare — Mach-O carries a build UUID.

    This is success metric #1 in docs/project/self-hosting.md, and it is stronger than the existing self.o == g2.o frontend check: it closes the loop on the whole compiler, driver included.

    The distributable

    compiler/scripts/package_flowc.sh → dist/flowc-<version>-<os>-<arch>.tar.gz:

    bin/flowc                  the Stage-A driver
    bootstrap/flowc_stage_a.c  the compiler, emitted by itself as one C file
    build.sh                   cc bootstrap/flowc_stage_a.c -o bin/flowc
    examples/                  stage_a_sum.flow, fibonacci.flow
    LICENSE, README.md
    

    The shipped binary is a convenience. The archive rebuilds itself from the C with a C compiler and nothing else, which is what makes it installable without cloning Python sources. Checked by unpacking into a scratch directory with python/python3 shimmed to exit 127: build.sh rebuilds, and both examples compile to the right exit codes (45, 55).

    Release workflow

    .github/workflows/flowc-release.yml, triggered on flowc-v* tags or manual dispatch. Linux and macOS, each running: build from the bootstrap C, bootstrap_from_c.sh --verify, the self-compile audit, the three-generation fixed point, package, then unpack and use the archive as a user would. Publishes with per-file and combined checksums. No setup-python step anywhere in it.

    I did not push a tag or trigger a run. Both job bodies were executed locally step by step out of the YAML instead.

    Remaining

    • No published release yet — needs a flowc-v* tag when you want one.
    • No Homebrew formula.
    • MLIR/GPU tracks untouched, as planned.

    Gates: roundtrip.sh ALL PASS; ./flow test --strict --tier2 516/516.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementself-hosting

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions