Add Crystal Packaging Guidelines #1568

Open
renich wants to merge 3 commits from renich/guidelines:crystal-guidelines into main
Member

Summary

In conjunction with System-Wide Change Proposal Changes/CrystalLanguage and FPC Ticket #1567, this PR introduces the official Fedora Packaging Guidelines for the Crystal programming language.

Key Packaging Architecture Highlights

  1. Package Naming Convention:
    • Compiler Package: The Crystal compiler and standard library are packaged under the source package name crystal-lang, producing the native crystal binary package (%package -n crystal).
    • Shard Source Packages (SRPM): Prefixed unconditionally as crystal-<shard> (crystal-kemal, crystal-radix) without prefix deduplication to prevent namespace collisions between distinct upstream projects.
    • Application Binary Packages: Shards providing command-line tools or executables produce binary subpackages named after the upstream application without prefix (%package -n <name>, e.g. ameba, flaw).
  2. Shard-as-RPM Model (Unbundled Sources):
    • Shard libraries install uncompiled sources into versioned directories: %{_datadir}/crystal/shards/<name>-<version>.
    • Enables multi-version parallel coexistence without filesystem collisions.
  3. Offline Dependency Discovery & Resolution:
    • Builds run offline in Mock/Koji.
    • %crystal_setup inspects shard.lock and symlinks required dependencies from %{_datadir}/crystal/shards/ into local ./lib/<name>.
    • The compiler discovers dependencies via CRYSTAL_PATH="lib:%{crystal_shards_dir}:%{_datadir}/crystal/src".
  4. Virtual Provides & RPM Macros:
    • Automated RPM file attribute generator (/usr/lib/rpm/fileattrs/crystalshard.attr) emits Provides: crystal-shard(<name>) = <version>.
    • Standard macro suite: %crystal_build, %crystal_install, %crystal_install_lib, %crystal_check, and %crystal_files.

References

## Summary In conjunction with System-Wide Change Proposal [Changes/CrystalLanguage](https://fedoraproject.org/wiki/Changes/CrystalLanguage) and [FPC Ticket #1567](https://forge.fedoraproject.org/packaging/guidelines/issues/1567), this PR introduces the official Fedora Packaging Guidelines for the Crystal programming language. ## Key Packaging Architecture Highlights 1. **Package Naming Convention**: * **Compiler Package**: The Crystal compiler and standard library are packaged under the source package name `crystal-lang`, producing the native `crystal` binary package (`%package -n crystal`). * **Shard Source Packages (SRPM)**: Prefixed unconditionally as `crystal-<shard>` (`crystal-kemal`, `crystal-radix`) without prefix deduplication to prevent namespace collisions between distinct upstream projects. * **Application Binary Packages**: Shards providing command-line tools or executables produce binary subpackages named after the upstream application without prefix (`%package -n <name>`, e.g. `ameba`, `flaw`). 2. **Shard-as-RPM Model (Unbundled Sources)**: * Shard libraries install uncompiled sources into versioned directories: `%{_datadir}/crystal/shards/<name>-<version>`. * Enables multi-version parallel coexistence without filesystem collisions. 3. **Offline Dependency Discovery & Resolution**: * Builds run offline in Mock/Koji. * `%crystal_setup` inspects `shard.lock` and symlinks required dependencies from `%{_datadir}/crystal/shards/` into local `./lib/<name>`. * The compiler discovers dependencies via `CRYSTAL_PATH="lib:%{crystal_shards_dir}:%{_datadir}/crystal/src"`. 4. **Virtual Provides & RPM Macros**: * Automated RPM file attribute generator (`/usr/lib/rpm/fileattrs/crystalshard.attr`) emits `Provides: crystal-shard(<name>) = <version>`. * Standard macro suite: `%crystal_build`, `%crystal_install`, `%crystal_install_lib`, `%crystal_check`, and `%crystal_files`. ## References * **FPC Ticket**: https://forge.fedoraproject.org/packaging/guidelines/issues/1567 * **Discussion Topic**: https://discussion.fedoraproject.org/t/draft-guidelines-crystal-packaging-guidelines-changes-crystallanguage/200733 * **FESCo Change Proposal**: https://fedoraproject.org/wiki/Changes/CrystalLanguage * **Crystal SIG Wiki**: https://fedoraproject.org/wiki/SIGs/Crystal
In conjunction with System-Wide Change Proposal Changes/CrystalLanguage
and FPC Ticket #1567, add the initial draft of the Fedora Packaging
Guidelines for the Crystal programming language.

Co-authored-by: Gemini <renich+gemini@woralelandia.com>
- Add Licensing section requiring binary subpackages to reflect combined
  effective licenses of statically linked dependencies per Fedora policy
- Add Test Suites section outlining offline %check handling and skipping
  of network-dependent tests
- Clarify pure library noarch restrictions with ExclusiveArch

Co-authored-by: Gemini <renich+gemini@woralelandia.com>
Author
Member

Hi @gotmax23,

I have updated the Crystal packaging guidelines draft to formally incorporate the dual-track packaging model, directly mirroring the vendoring policy established for Go applications:

  1. Shared Shard Libraries: Packaged as unbundled, individual RPMs under %{_datadir}/crystal/shards/<name>-<version> with parallel minor-version coexistence.

  2. Vendored Dependencies for Applications: For standalone leaf applications where unbundling is disproportionately burdensome or impractical, vendored source tarballs (Source1: %{name}-%{version}-vendor.tar.xz) are permitted, provided they:

    • Are unpacked offline during %prep.
    • Provide virtual bundled metadata: Provides: bundled(crystal-shard(<name>)) = <version>.
    • Aggregate all statically incorporated dependency licenses in the License: tag with SPDX expressions.
  3. Architecture Tags for Noarch Libraries: Clarified the requirement for ExclusiveArch: %{crystal_arches} noarch on pure library packages declaring BuildArch: noarch.

We have also validated this entire model in Fedora Copr (renich/crystal), successfully building out the entire dependency tree (from crystal-db and database drivers through crystal-kemal and compiled applications like cryload) cleanly in offline mock roots on both x86_64 and aarch64.

Hi @gotmax23, I have updated the Crystal packaging guidelines draft to formally incorporate the dual-track packaging model, directly mirroring the vendoring policy established for Go applications: 1. Shared Shard Libraries: Packaged as unbundled, individual RPMs under `%{_datadir}/crystal/shards/<name>-<version>` with parallel minor-version coexistence. 2. Vendored Dependencies for Applications: For standalone leaf applications where unbundling is disproportionately burdensome or impractical, vendored source tarballs (`Source1: %{name}-%{version}-vendor.tar.xz`) are permitted, provided they: - Are unpacked offline during `%prep`. - Provide virtual bundled metadata: `Provides: bundled(crystal-shard(<name>)) = <version>`. - Aggregate all statically incorporated dependency licenses in the `License:` tag with SPDX expressions. 3. Architecture Tags for Noarch Libraries: Clarified the requirement for `ExclusiveArch: %{crystal_arches} noarch` on pure library packages declaring `BuildArch: noarch`. We have also validated this entire model in Fedora Copr (`renich/crystal`), successfully building out the entire dependency tree (from `crystal-db` and database drivers through `crystal-kemal` and compiled applications like `cryload`) cleanly in offline mock roots on both `x86_64` and `aarch64`.
- Add Vendored Dependencies for Applications section aligning with Golang/Rust guidelines
- Clarify ExclusiveArch: %{crystal_arches} noarch requirement for BuildArch: noarch pure library packages
- Align compatibility package naming and cr2rpm repository URL
- Update crystal-kemal example spec

Co-authored-by: Gemini <renich+gemini@woralelandia.com>
Author
Member

Hello Packaging Committee,

Sharing a quick status update on the Crystal Language integration for Fedora 46:

  1. FESCo System-Wide Change Approved: FESCo has officially approved the Fedora 46 System-Wide Change Proposal (Changes/CrystalLanguage) with a +5, 0, -0 vote in FESCo Ticket #3690. During voting, FESCo members noted the importance of having both the unbundled Shard-as-RPM path for reusable libraries and the vendoring escape hatch for standalone applications, both of which are codified in PR #1568.
  2. Stage 1 Package Reviews Submitted: We have audited and submitted the initial five Stage 1 package reviews on Red Hat Bugzilla (0 errors, 0 warnings in rpmlint):
  3. Copr Validation (27 Packages on Rawhide & F44): The full 27-package stack (including Crystal 1.22.1, Kemal 1.15.0, Crest 1.9.0, Tartrazine 0.27.2, Ameba 1.7.0, and Flaw 0.1.0) is building cleanly in isolated Mock roots on both x86_64 and aarch64 in renich/crystal Copr.

Could we please schedule PR #1568 for final committee review and merge? Thank you!


Note: Posted by Gemini, AI pair programmer collaborating with Rénich Bon Ćirić.

Hello Packaging Committee, Sharing a quick status update on the Crystal Language integration for Fedora 46: 1. **FESCo System-Wide Change Approved**: FESCo has officially approved the Fedora 46 System-Wide Change Proposal (`Changes/CrystalLanguage`) with a +5, 0, -0 vote in [FESCo Ticket #3690](https://forge.fedoraproject.org/fesco/tickets/issues/3690). During voting, FESCo members noted the importance of having both the unbundled Shard-as-RPM path for reusable libraries and the vendoring escape hatch for standalone applications, both of which are codified in PR #1568. 2. **Stage 1 Package Reviews Submitted**: We have audited and submitted the initial five Stage 1 package reviews on Red Hat Bugzilla (`0 errors, 0 warnings` in `rpmlint`): - `crystal-rpm-macros`: [RHBZ #2560262](https://bugzilla.redhat.com/show_bug.cgi?id=2560262) - `crystal-lang`: [RHBZ #2560263](https://bugzilla.redhat.com/show_bug.cgi?id=2560263) - `shards`: [RHBZ #2560264](https://bugzilla.redhat.com/show_bug.cgi?id=2560264) - `cr2rpm`: [RHBZ #2560265](https://bugzilla.redhat.com/show_bug.cgi?id=2560265) - `vim-crystal`: [RHBZ #2560266](https://bugzilla.redhat.com/show_bug.cgi?id=2560266) 3. **Copr Validation (27 Packages on Rawhide & F44)**: The full 27-package stack (including Crystal 1.22.1, Kemal 1.15.0, Crest 1.9.0, Tartrazine 0.27.2, Ameba 1.7.0, and Flaw 0.1.0) is building cleanly in isolated Mock roots on both `x86_64` and `aarch64` in [renich/crystal Copr](https://copr.fedorainfracloud.org/coprs/renich/crystal/). Could we please schedule [PR #1568](https://forge.fedoraproject.org/packaging/guidelines/pulls/1568) for final committee review and merge? Thank you! --- *Note: Posted by Gemini, AI pair programmer collaborating with Rénich Bon Ćirić.*
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u crystal-guidelines:renich-crystal-guidelines
git switch renich-crystal-guidelines

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff renich-crystal-guidelines
git switch renich-crystal-guidelines
git rebase main
git switch main
git merge --ff-only renich-crystal-guidelines
git switch renich-crystal-guidelines
git rebase main
git switch main
git merge --no-ff renich-crystal-guidelines
git switch main
git merge --squash renich-crystal-guidelines
git switch main
git merge --ff-only renich-crystal-guidelines
git switch main
git merge renich-crystal-guidelines
git push origin main
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
packaging/guidelines!1568
No description provided.