Skip to content

build: control/Version is stuck at 0.1.0 and does not track git tags #30

Description

@tkgstrator

Problem

control carries a hand-edited Version: field that Theos bakes verbatim into the produced .deb:

Package: work.tkgstrator.kioukifexporter
Version: 0.1.0

deployment.yaml then derives the dylib filename stem from the produced .deb (work.tkgstrator.kioukifexporter_<ver>-1_iphoneos-arm64.deb), so the release artifacts inherit whatever is in control rather than the git tag that triggered the workflow.

Result: cutting a v0.2.0 git tag today ships artifacts named work.tkgstrator.kioukifexporter_0.1.0-1_* — silently wrong, with no CI failure to catch it.

Sibling already solved this

IPA-Patch/KiouEditor Makefile derives the dpkg Version: from git describe:

KIOU_EDITOR_VERSION      ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
KIOU_EDITOR_DEB_VERSION  := $(patsubst v%,%,$(KIOU_EDITOR_VERSION))
KIOU_EDITOR_DEB_VERSION  := $(shell echo "$(KIOU_EDITOR_DEB_VERSION)" | sed -E 's/^([^0-9])/0.0.0+\1/')
THEOS_PACKAGE_BASE_VERSION := $(KIOU_EDITOR_DEB_VERSION)

THEOS_PACKAGE_BASE_VERSION overrides the Version: line from control at packaging time, so the .deb filename always tracks the tag (or vX.Y.Z-N-gHASH-dirty between tags / for dirty trees), with the leading v stripped for dpkg compatibility and a 0.0.0+ prefix prepended if the describe output starts with a non-digit (lone short hash).

Proposed fix

Port that block (with rename: KIOU_KIF_EXPORTER_VERSION / KIOU_KIF_EXPORTER_DEB_VERSION) into KiouKifExporter's Makefile, and also bake -DKIOU_KIF_EXPORTER_VERSION=... into $(TWEAK_NAME)_CFLAGS so a future about/version surface inside the dylib can reference it the same way KiouEditor does.

Optionally drop the Version: line from control (or leave it as a fallback for git describe failing).

Acceptance criteria

  • make package on a clean tag produces _<tagver>-1_*.deb (no leading v).
  • make package between tags produces _<tagver>-N-gHASH-1_*.deb.
  • make package on a dirty worktree appends -dirty.
  • deployment.yaml artifact filenames track the triggering git tag without further changes.
  • KIOU_KIF_EXPORTER_VERSION macro is available to C code (parity with KIOU_KIF_EXPORTER_COMMIT).

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions