Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 20 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
16 changes: 10 additions & 6 deletions src/commands/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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) {
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/commands/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ fn latest(versions: &[Version]) -> &Version {
fn every_version(work_dir: &Path, select: Option<&DocVersions>) -> Result<Vec<Version>> {
let mut versions = vec![];
let mut head: Option<(Vec<Vec<FrozenUnit>>, 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 {
Expand Down
4 changes: 2 additions & 2 deletions src/commands/inspect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<PackageFacts> {
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()
Expand Down
4 changes: 2 additions & 2 deletions src/history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ pub fn open_store(work_dir: &Path) -> Result<ObjectStore> {
/// and with [`CliError::Store`] if its store can't be used.
pub fn load(work_dir: &Path) -> Result<Vec<Entry>> {
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)
}
Expand Down
Loading