diff --git a/Cargo.lock b/Cargo.lock index 73196f0..b12961a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -505,7 +505,7 @@ dependencies = [ [[package]] name = "comline-catalog" version = "0.11.0" -source = "git+https://github.com/ComlineProject/specification?rev=6d39fc363ab3dce9d1c4876b0d414edb375e25e9#6d39fc363ab3dce9d1c4876b0d414edb375e25e9" +source = "git+https://github.com/ComlineProject/specification?rev=16dfe40d835b85b45de07131181339fe3e9f0ccb#16dfe40d835b85b45de07131181339fe3e9f0ccb" [[package]] name = "comline-catalog" @@ -515,7 +515,7 @@ source = "git+https://github.com/ComlineProject/runtime?rev=8f8c0cb6fb0bc3a734aa [[package]] name = "comline-codegen" version = "0.1.0" -source = "git+https://github.com/ComlineProject/generation?rev=922847b608764687b9d75020ff46a3f24d43b5bd#922847b608764687b9d75020ff46a3f24d43b5bd" +source = "git+https://github.com/ComlineProject/generation?rev=e22109e1a6ca3c8e5a63338e2fe9acda44123ee1#e22109e1a6ca3c8e5a63338e2fe9acda44123ee1" dependencies = [ "comline-core", "eyre", @@ -529,7 +529,7 @@ dependencies = [ [[package]] name = "comline-codegen-rust" version = "0.1.0" -source = "git+https://github.com/ComlineProject/comline-rust?rev=ac7fd8b3deaa334d353485414264eb9336500bb9#ac7fd8b3deaa334d353485414264eb9336500bb9" +source = "git+https://github.com/ComlineProject/comline-rust?rev=2d2c8853727929a7b350b3017c9ff86cb2ec8911#2d2c8853727929a7b350b3017c9ff86cb2ec8911" dependencies = [ "comline-codegen", "comline-core", @@ -539,7 +539,7 @@ dependencies = [ [[package]] name = "comline-codegen-typescript" version = "0.1.0" -source = "git+https://github.com/ComlineProject/comline-typescript?rev=4db92c26b00211aabf90e4ef1b2f55977274d761#4db92c26b00211aabf90e4ef1b2f55977274d761" +source = "git+https://github.com/ComlineProject/comline-typescript?rev=c44b39d68035bd968cec0cd75afb6c6230c4ab76#c44b39d68035bd968cec0cd75afb6c6230c4ab76" dependencies = [ "comline-codegen", "comline-core", @@ -549,14 +549,15 @@ dependencies = [ [[package]] name = "comline-core" version = "0.1.0" -source = "git+https://github.com/ComlineProject/core?rev=868e8310e33df317e3cba4f76b81fbcd8639c1c2#868e8310e33df317e3cba4f76b81fbcd8639c1c2" +source = "git+https://github.com/ComlineProject/core?rev=14ce54658455206d639ddc4fbe6d609d20292587#14ce54658455206d639ddc4fbe6d609d20292587" dependencies = [ "ariadne", "blake3", "chumsky", "ciborium", - "comline-catalog 0.11.0 (git+https://github.com/ComlineProject/specification?rev=6d39fc363ab3dce9d1c4876b0d414edb375e25e9)", + "comline-catalog 0.11.0 (git+https://github.com/ComlineProject/specification?rev=16dfe40d835b85b45de07131181339fe3e9f0ccb)", "comline-core-stdlib", + "comline-ir-formats", "downcast-rs", "eyre", "glob", @@ -579,12 +580,12 @@ dependencies = [ [[package]] name = "comline-core-stdlib" version = "0.1.0" -source = "git+https://github.com/ComlineProject/core?rev=868e8310e33df317e3cba4f76b81fbcd8639c1c2#868e8310e33df317e3cba4f76b81fbcd8639c1c2" +source = "git+https://github.com/ComlineProject/core?rev=14ce54658455206d639ddc4fbe6d609d20292587#14ce54658455206d639ddc4fbe6d609d20292587" [[package]] name = "comline-doc-html" version = "0.1.0" -source = "git+https://github.com/ComlineProject/generation?rev=922847b608764687b9d75020ff46a3f24d43b5bd#922847b608764687b9d75020ff46a3f24d43b5bd" +source = "git+https://github.com/ComlineProject/generation?rev=e22109e1a6ca3c8e5a63338e2fe9acda44123ee1#e22109e1a6ca3c8e5a63338e2fe9acda44123ee1" dependencies = [ "comline-codegen", "eyre", @@ -595,7 +596,7 @@ dependencies = [ [[package]] name = "comline-doc-markdown" version = "0.1.0" -source = "git+https://github.com/ComlineProject/generation?rev=922847b608764687b9d75020ff46a3f24d43b5bd#922847b608764687b9d75020ff46a3f24d43b5bd" +source = "git+https://github.com/ComlineProject/generation?rev=e22109e1a6ca3c8e5a63338e2fe9acda44123ee1#e22109e1a6ca3c8e5a63338e2fe9acda44123ee1" dependencies = [ "comline-codegen", "eyre", @@ -603,6 +604,16 @@ dependencies = [ "serde_json", ] +[[package]] +name = "comline-ir-formats" +version = "0.0.0" +source = "git+https://github.com/ComlineProject/core?rev=14ce54658455206d639ddc4fbe6d609d20292587#14ce54658455206d639ddc4fbe6d609d20292587" +dependencies = [ + "ciborium", + "serde", + "serde_derive", +] + [[package]] name = "comline-runtime" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index 5b6abed..9045adb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -47,20 +47,20 @@ eyre = "0.6.8" # needs real I/O (git fetch, filesystem), so it's off by default for # `comline-core`'s wasm32 consumers (the playground editor, the language # server); the CLI is the one consumer that actually runs `comline build`. -comline-core = { git = "https://github.com/ComlineProject/core", rev = "868e8310e33df317e3cba4f76b81fbcd8639c1c2", features = ["deps"] } +comline-core = { git = "https://github.com/ComlineProject/core", rev = "14ce54658455206d639ddc4fbe6d609d20292587", features = ["deps"] } # All three pinned to revs that agree on one `comline-codegen`, and bumped # together: comline-rust and comline-typescript's codegen crates consume # `comline-codegen`'s types, so the rev below must be byte-identical to the # one *they* pin - Cargo only unifies a git dependency across identical rev # strings, and two copies of `GenRequest` are two incompatible types. -comline-codegen = { git = "https://github.com/ComlineProject/generation", rev = "922847b608764687b9d75020ff46a3f24d43b5bd" } +comline-codegen = { git = "https://github.com/ComlineProject/generation", rev = "e22109e1a6ca3c8e5a63338e2fe9acda44123ee1" } # The official Markdown and HTML documentation renderers (`comline doc`), # linked in like the official generators. Same generation rev as # `comline-codegen`. -comline-doc-markdown = { git = "https://github.com/ComlineProject/generation", rev = "922847b608764687b9d75020ff46a3f24d43b5bd" } -comline-doc-html = { git = "https://github.com/ComlineProject/generation", rev = "922847b608764687b9d75020ff46a3f24d43b5bd" } -comline-codegen-rust = { git = "https://github.com/ComlineProject/comline-rust", rev = "ac7fd8b3deaa334d353485414264eb9336500bb9", optional = true } -comline-codegen-typescript = { git = "https://github.com/ComlineProject/comline-typescript", rev = "4db92c26b00211aabf90e4ef1b2f55977274d761", optional = true } +comline-doc-markdown = { git = "https://github.com/ComlineProject/generation", rev = "e22109e1a6ca3c8e5a63338e2fe9acda44123ee1" } +comline-doc-html = { git = "https://github.com/ComlineProject/generation", rev = "e22109e1a6ca3c8e5a63338e2fe9acda44123ee1" } +comline-codegen-rust = { git = "https://github.com/ComlineProject/comline-rust", rev = "2d2c8853727929a7b350b3017c9ff86cb2ec8911", optional = true } +comline-codegen-typescript = { git = "https://github.com/ComlineProject/comline-typescript", rev = "c44b39d68035bd968cec0cd75afb6c6230c4ab76", optional = true } # `comline conformance`: the conformance runner (corpus loading, judging, # profile proofs) and its case format, a public spec. Pinned by git rev. comline-runtime-conformance = { git = "https://github.com/ComlineProject/runtime", rev = "8f8c0cb6fb0bc3a734aafbdbbf187fb9da73e00d" } diff --git a/src/commands/build.rs b/src/commands/build.rs index 98aaf8b..b9abde5 100644 --- a/src/commands/build.rs +++ b/src/commands/build.rs @@ -10,7 +10,9 @@ use std::path::Path; use comline_core::package::build::cas::object_store::StoreError; use comline_core::package::build::cas::objects::Commit; use comline_core::package::build::cas::reconcile::{self, Heads}; -use comline_core::package::build::cas::{main_ref, read_ref, ref_exists, Hash, ObjectStore}; +use comline_core::package::build::cas::{ + read_ref, ref_exists, Hash, ObjectStore, REF_HEAD_MAIN_FILENAME, +}; use comline_core::package::build::{self, VersionBump}; use miette::Result; @@ -53,7 +55,7 @@ fn mark_diverged(work_dir: &Path, other: &str) -> Result<()> { /// The two heads a Git merge left in `.comline/refs/heads/main`, if it holds /// two: this build reconciles them. fn diverged_heads(work_dir: &Path) -> Option<(Hash, Hash)> { - if !ref_exists(work_dir, main_ref()) { + if !ref_exists(work_dir, REF_HEAD_MAIN_FILENAME) { return None; } match reconcile::read_heads(work_dir) { @@ -65,10 +67,12 @@ fn diverged_heads(work_dir: &Path) -> Option<(Hash, Hash)> { /// Say how a build joined two heads: which one the line continued from, /// and which one it recorded as the second parent. fn report_reconciled(work_dir: &Path, (ours, theirs): (Hash, Hash)) { - let parents = read_ref(work_dir, main_ref()).ok().and_then(|head| { - let bytes = ObjectStore::new(work_dir).read(&head).ok()?; - Some((head, Commit::from_bytes(&bytes).ok()?.parents)) - }); + let parents = read_ref(work_dir, REF_HEAD_MAIN_FILENAME) + .ok() + .and_then(|head| { + let bytes = ObjectStore::new(work_dir).read(&head).ok()?; + Some((head, Commit::from_bytes(&bytes).ok()?.parents)) + }); let message = match parents { Some((_, parents)) if parents.len() == 2 => format!( "reconciled the diverged history: continued from {}, recorded {} as the second parent", diff --git a/src/commands/doc.rs b/src/commands/doc.rs index e266a72..53926d4 100644 --- a/src/commands/doc.rs +++ b/src/commands/doc.rs @@ -583,7 +583,7 @@ fn latest(versions: &[Version]) -> &Version { fn every_version(work_dir: &Path, select: Option<&DocVersions>) -> Result> { let mut versions = vec![]; let mut head: Option<(Vec>, FrozenDocs)> = None; - if refs::ref_exists(work_dir, refs::main_ref()) { + if refs::ref_exists(work_dir, refs::REF_HEAD_MAIN_FILENAME) { let history = history::load(work_dir)?; let mut seen = std::collections::BTreeSet::new(); for entry in &history { diff --git a/src/commands/inspect.rs b/src/commands/inspect.rs index 59a9ef1..7e4577a 100644 --- a/src/commands/inspect.rs +++ b/src/commands/inspect.rs @@ -136,8 +136,8 @@ fn render_unchecked(unchecked: &[(String, String)], plain: bool) -> String { /// The latest build's facts, if the package was built. Read-only: the /// store is never created here. fn latest_facts(work_dir: &Path) -> Option { - use comline_core::package::build::cas::{main_ref, ref_exists}; - if !ref_exists(work_dir, main_ref()) { + use comline_core::package::build::cas::{ref_exists, REF_HEAD_MAIN_FILENAME}; + if !ref_exists(work_dir, REF_HEAD_MAIN_FILENAME) { return None; } compat::facts(work_dir, None).ok() diff --git a/src/history.rs b/src/history.rs index 954150f..69a0d53 100644 --- a/src/history.rs +++ b/src/history.rs @@ -54,11 +54,11 @@ pub fn open_store(work_dir: &Path) -> Result { /// and with [`CliError::Store`] if its store can't be used. pub fn load(work_dir: &Path) -> Result> { ensure_readable(work_dir)?; - if !refs::ref_exists(work_dir, refs::main_ref()) { + if !refs::ref_exists(work_dir, refs::REF_HEAD_MAIN_FILENAME) { return Err(CliError::NothingBuilt(work_dir.to_path_buf()).into()); } let store = open_store(work_dir)?; - let head = refs::read_ref(work_dir, refs::main_ref()) + let head = refs::read_ref(work_dir, refs::REF_HEAD_MAIN_FILENAME) .map_err(|e| miette::miette!("failed to read HEAD ref: {e:#}"))?; walk(&store, head) }