failsafe boot mode

This commit is contained in:
2026-02-15 11:44:33 -06:00
parent ff80e0d30d
commit ee646db394
22 changed files with 290669 additions and 594234 deletions

View File

@@ -9,22 +9,41 @@ var fold = use("fold")
var mcode = use("mcode")
var streamline = use("streamline")
var files = [
// Pipeline files (tokenize/parse/fold/mcode/streamline) are only regenerated
// with --all flag since they require a self-consistent compiler to bootstrap.
var pipeline_files = [
{src: "tokenize.cm", name: "tokenize", out: "boot/tokenize.cm.mcode"},
{src: "parse.cm", name: "parse", out: "boot/parse.cm.mcode"},
{src: "fold.cm", name: "fold", out: "boot/fold.cm.mcode"},
{src: "mcode.cm", name: "mcode", out: "boot/mcode.cm.mcode"},
{src: "streamline.cm", name: "streamline", out: "boot/streamline.cm.mcode"},
{src: "streamline.cm", name: "streamline", out: "boot/streamline.cm.mcode"}
]
var files = [
{src: "qbe.cm", name: "qbe", out: "boot/qbe.cm.mcode"},
{src: "qbe_emit.cm", name: "qbe_emit", out: "boot/qbe_emit.cm.mcode"},
{src: "verify_ir.cm", name: "verify_ir", out: "boot/verify_ir.cm.mcode"},
{src: "internal/bootstrap.cm", name: "bootstrap", out: "boot/bootstrap.cm.mcode"},
{src: "internal/engine.cm", name: "engine", out: "boot/engine.cm.mcode"},
{src: "boot/seed_bootstrap.cm", name: "seed_bootstrap", out: "boot/seed_bootstrap.cm.mcode"}
{src: "boot/seed_bootstrap.cm", name: "seed_bootstrap", out: "boot/seed_bootstrap.cm.mcode"},
{src: "fd.cm", name: "fd", out: "boot/fd.cm.mcode"},
{src: "time.cm", name: "time", out: "boot/time.cm.mcode"},
{src: "pronto.cm", name: "pronto", out: "boot/pronto.cm.mcode"},
{src: "toml.cm", name: "toml", out: "boot/toml.cm.mcode"},
{src: "link.cm", name: "link", out: "boot/link.cm.mcode"},
{src: "toolchains.cm", name: "toolchains", out: "boot/toolchains.cm.mcode"},
{src: "package.cm", name: "package", out: "boot/package.cm.mcode"},
{src: "internal/shop.cm", name: "internal_shop", out: "boot/internal_shop.cm.mcode"}
]
// Resolve shop_path for cache writes
// Include pipeline files with --all flag
var os = use('os')
var regen_all = args != null && length(args) > 0 && args[0] == "--all"
if (regen_all) {
files = array(pipeline_files, files)
}
// Resolve shop_path for cache writes
var shop = os.getenv('CELL_SHOP')
var home = null
var cache_dir = null