Skip to content

feat(cpp): add standard installation layout and native packaging support - #914

Open
ColinLeeo wants to merge 3 commits into
developfrom
feature/cpp-packaging
Open

feat(cpp): add standard installation layout and native packaging support#914
ColinLeeo wants to merge 3 commits into
developfrom
feature/cpp-packaging

Conversation

@ColinLeeo

Copy link
Copy Markdown
Contributor

Background

The TsFile C++ build currently places its outputs primarily in the build directory. It does not provide a standard installation layout or sufficient metadata for downstream consumers and native package managers.

This pull request introduces a unified installation and packaging mechanism for the TsFile C++ library, command-line tools, headers, and development metadata.

Changes

  • Add a standard CMake installation layout:
    • include/tsfile
    • lib
    • bin
    • lib/cmake/TsFile
    • lib/pkgconfig
  • Export the TsFile::tsfile CMake target.
  • Add TsFileConfig.cmake and package version metadata.
  • Add the libtsfile.pc pkg-config file.
  • Install the current C++ compatibility header closure while preserving the existing include relationships.
    • This pull request does not redefine the stable public C++ API boundary.
    • Public header cleanup will be handled separately.
  • Add shared-library versioning:
    • Package version: 2.3.2
    • ABI/SOVERSION: 1
  • Add a relative runtime path for tsfile-cli, allowing an installed prefix to be relocated.
  • Fix static-library installation exports so they do not expose internal object-library targets.
  • Restrict compatible system ANTLR4 versions to:
    • 4.9.3 <= version < 4.10.0
    • Incompatible system versions fall back to the verified bundled runtime when the dependency policy is AUTO.
  • Add optional CPack configuration for TGZ, DEB, and RPM packages.
  • Add a Homebrew Formula:
    • packaging/homebrew/tsfile.rb
  • Add packaging documentation:
    • packaging/README.md
  • Add installed CMake and pkg-config consumer tests.
  • Add native Linux packaging CI:
    • Ubuntu generates DEB packages.
    • Fedora generates RPM packages.

Package Layout

The native packages are divided into three components:

  • tsfile
    • Runtime shared library.
  • tsfile-dev / tsfile-devel
    • C++ headers, CMake package files, and pkg-config metadata.
  • tsfile-tools
    • Command-line tools.
    • Installs the tsfile-cli executable.

CI Artifacts

Debian/Ubuntu packages:

tsfile_2.3.2_<arch>.deb
tsfile-dev_2.3.2_<arch>.deb
tsfile-tools_2.3.2_<arch>.deb

Fedora/RHEL packages:

tsfile-2.3.2-1.<arch>.rpm
tsfile-devel-2.3.2-1.<arch>.rpm
tsfile-tools-2.3.2-1.<arch>.rpm

GitHub Actions artifact names:

tsfile-deb
tsfile-rpm

Verification

The following checks have been completed:

  • An installed CMake consumer builds and runs successfully.
  • An installed pkg-config C consumer builds and runs successfully.
  • An installed pkg-config C++ consumer builds and runs successfully.
  • ANTLR4 dependency resolution tests pass.
  • A CPack TGZ archive is generated successfully on macOS.
  • The Homebrew Formula passes Ruby syntax and style checks.
  • The packaging workflow YAML is valid.
  • git diff --check passes.
  • tsfile-cli --version works from the installed prefix.
  • The installed CLI continues to work after relocating the installation prefix.
  • Installed CMake metadata does not expose source paths, build paths, or internal object-library targets.

Follow-up Work

This pull request deliberately preserves the current compatibility header closure to avoid breaking existing C++ and Python consumers.

A separate C++ public API cleanup will introduce a stable cpp/include/tsfile boundary and gradually remove internal implementation headers from the installation package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant