Remove the `migrate-mphf` tool entirely, as its functionality is no longer needed or has been superseded. Update the `phylo` sibling annex logic to build missing annexes on demand under an exclusive lock, ensuring safe concurrent access. Adjust documentation and CI workflows to reflect the removal of the migration tool and clarify sibling annex behavior. - Delete the entire `tools/migrate-mphf` directory, including `Cargo.toml`, `Cargo.lock`, and source files (`main.rs`, `layer.rs`, `plan.rs`, `data.rs`, `commit.rs`, `old.rs`, `verify.rs`, `util.rs`), removing functions such as `convert`, `build`, `permute_all`, `finish`, and `check`. - Update `.gitignore` to remove patterns for `tools/migrate-mphf/target`, `data-stress`, `*.fasta`, and `*.fasta.gz`. - Modify `Makefile` to remove the `migrate-mphf` and `clean-migrate-mphf` phony targets and associated build commands. - Update `.gitea/workflows/release.yml` to remove the "Build migrate-mph (static)" job and the artifact upload step, and adjust the `linux-musl-cargo` job key to hash only `src/Cargo.lock`. - Refactor `src/obikphylo/src/siblings/extensions/sibling_builder.rs` to update `build_family_annexes` documentation, noting that it builds the sibling annex from `siblings.psib` if missing and runs under the index's exclusive lock. - Update `src/obikphylo/src/siblings/siblingannex.rs` documentation to clarify that `open` reports absent files differently when annexes were set aside by `migrate-mphf` or never built. - Update `UserDocMD/usage/phylo.md` to clarify that `--sibling-annex` prepares the quartet annex on demand under an exclusive lock, and update descriptions for `--sibling-stats` and `--sibling-hist` to specify output file formats and contents. - Update `DevDocMD/implementation/mphf_batch_queries.md` to reflect changes in batched query logic, `ptr_hash` versioning, and benchmark descriptions, noting that stale indexes with `ptr_hash` 1.x MPHFs fail on current binaries. - Add `prompts/obi-migration.md` to document the context, decisions, and required actions for the `obikmer` project migration. - Bump `obikmer` package version from 1.4.7 to 1.4.8 in `src/obikmer/Cargo.toml` and update `src/Cargo.lock` accordingly.
129 lines
4.4 KiB
Makefile
129 lines
4.4 KiB
Makefile
VENV := .venv
|
|
PYTHON := $(VENV)/bin/python
|
|
PIP := $(VENV)/bin/pip
|
|
MKDOCS := $(VENV)/bin/mkdocs
|
|
|
|
CARGO_DIR := src
|
|
|
|
DOC_DIR := DevDocMD
|
|
DOC_FILE := mkdocs.yml
|
|
DOC_SITE := DevDoc
|
|
DOC_PORT := 8001
|
|
|
|
DOC_USER_DIR := UserDocMD
|
|
DOC_USER_FILE := mkdocs-user.yml
|
|
DOC_USER_SITE := doc
|
|
DOC_USER_PORT := 8002
|
|
|
|
# ── virtualenv ────────────────────────────────────────────────────────────────
|
|
|
|
$(VENV)/bin/activate:
|
|
python3 -m venv $(VENV)
|
|
|
|
$(MKDOCS): $(VENV)/bin/activate
|
|
$(PIP) install --quiet --upgrade pip
|
|
$(PIP) install --quiet \
|
|
livereload watchdog \
|
|
mkdocs mkdocs-material \
|
|
mkdocs-mermaid2-plugin \
|
|
mkdocs-bibtex
|
|
$(PIP) install --quiet --upgrade InSilicoSeq
|
|
|
|
# ── obikmer binary ───────────────────────────────────────────────────────────
|
|
|
|
PROFILE_FILE := profile.pb
|
|
PPROF_PORT := 8081
|
|
|
|
.PHONY: obikmer
|
|
obikmer:
|
|
cargo build --release --manifest-path $(CARGO_DIR)/Cargo.toml --bin obikmer
|
|
|
|
.PHONY: debug
|
|
debug:
|
|
cargo build --manifest-path $(CARGO_DIR)/Cargo.toml --bin obikmer
|
|
|
|
.PHONY: profile-build
|
|
profile-build:
|
|
cargo build --release --manifest-path $(CARGO_DIR)/Cargo.toml \
|
|
--bin obikmer --features obikmer/profiling
|
|
|
|
.PHONY: profile-view
|
|
profile-view:
|
|
go tool pprof -http=127.0.0.1:$(PPROF_PORT) $(PROFILE_FILE)
|
|
# ── documentation ─────────────────────────────────────────────────────────────
|
|
|
|
.PHONY: doc
|
|
doc: $(MKDOCS)
|
|
$(MKDOCS) build -f $(DOC_FILE)
|
|
|
|
.PHONY: doc-serve
|
|
doc-serve: $(MKDOCS)
|
|
$(MKDOCS) serve -f $(DOC_FILE) \
|
|
--dev-addr=127.0.0.1:$(DOC_PORT) \
|
|
--livereload
|
|
.PHONY: clean-doc
|
|
clean-doc:
|
|
rm -rf $(DOC_SITE)/
|
|
|
|
.PHONY: doc-user
|
|
doc-user: $(MKDOCS)
|
|
$(MKDOCS) build -f $(DOC_USER_FILE)
|
|
|
|
.PHONY: doc-user-serve
|
|
doc-user-serve: $(MKDOCS)
|
|
$(MKDOCS) serve -f $(DOC_USER_FILE) \
|
|
--dev-addr=127.0.0.1:$(DOC_USER_PORT) \
|
|
--livereload
|
|
|
|
.PHONY: clean-doc-user
|
|
clean-doc-user:
|
|
rm -rf $(DOC_USER_SITE)/
|
|
|
|
# Regenerates the Gitea/Forgejo wiki (a separate repository, checked out next
|
|
# to this one) from the user documentation. Only rewrites its working tree:
|
|
# committing and pushing it stays a manual step. Not part of `clean`.
|
|
DOC_WIKI_DIR := ../obikmer.wiki
|
|
|
|
.PHONY: wiki
|
|
wiki:
|
|
@command -v pmotransdoc >/dev/null || { echo "pmotransdoc not found in PATH" >&2; exit 1; }
|
|
@test -d $(DOC_WIKI_DIR)/.git || { echo "$(DOC_WIKI_DIR) is not a git checkout of the wiki" >&2; exit 1; }
|
|
pmotransdoc $(DOC_USER_DIR) $(DOC_WIKI_DIR)
|
|
|
|
.PHONY: clean
|
|
clean: clean-doc clean-doc-user
|
|
rm -rf $(VENV)
|
|
|
|
# ── release ───────────────────────────────────────────────────────────────────
|
|
|
|
CARGO_TOML := $(CARGO_DIR)/obikmer/Cargo.toml
|
|
|
|
.PHONY: bump-version
|
|
bump-version:
|
|
@current=$$(grep '^version = ' $(CARGO_TOML) | head -n 1 | sed 's/version = "\(.*\)"/\1/'); \
|
|
if [ -n "$(RELEASE)" ]; then \
|
|
new_version="$(RELEASE)"; \
|
|
else \
|
|
major=$$(echo $$current | cut -d. -f1); \
|
|
minor=$$(echo $$current | cut -d. -f2); \
|
|
patch=$$(echo $$current | cut -d. -f3); \
|
|
new_patch=$$((patch + 1)); \
|
|
new_version="$$major.$$minor.$$new_patch"; \
|
|
fi; \
|
|
echo "Version: $$current -> $$new_version"; \
|
|
sed -i.bak "s/^version = \"$$current\"/version = \"$$new_version\"/" $(CARGO_TOML) && \
|
|
rm $(CARGO_TOML).bak
|
|
|
|
.PHONY: release
|
|
release: bump-version
|
|
@jj auto-doc
|
|
@jj git push --change @
|
|
@new_version=$$(grep '^version = ' $(CARGO_TOML) | head -n 1 | sed 's/version = "\(.*\)"/\1/'); \
|
|
git_hash=$$(jj log -r @ --no-graph -T 'commit_id'); \
|
|
commits=$$(jj log -r 'latest(tags())..@' --no-graph -T 'description ++ "\n"' 2>/dev/null || \
|
|
jj log --no-graph -T 'description ++ "\n"' --limit 30); \
|
|
notes=$$(printf 'Write concise markdown release notes for obikmer (a Rust kmer genomics tool). Be technical and direct. Base them strictly on these commit messages:\n\n%s' "$$commits" | aichat 2>/dev/null); \
|
|
tag_msg="$${notes:-Release v$$new_version}"; \
|
|
git tag -a "v$$new_version" -m "$$tag_msg" "$$git_hash" && \
|
|
git push origin "v$$new_version"
|