From Fedora Project Wiki
This is a proposed Change for Fedora Linux.
This document represents a proposed Change. As part of the Changes process, proposals are publicly announced in order to receive community feedback. This proposal will only be implemented if approved by the Fedora Engineering Steering Committee.

Summary

This proposal introduces official native support for the Crystal programming language compiler (source package crystal-lang, producing binary crystal), its dependency manager (shards), an automated spec generator (cr2rpm), and standard RPM packaging macros (crystal-rpm-macros) into Fedora Linux. Shard libraries will be packaged following the Shard-as-RPM model, enabling offline, secure, and reproducible compilation across the distribution.

Owner

Current status

Detailed Description

Crystal ([1]) is a statically typed compiled language designed for developer productivity and systems-level execution performance.

The Fedora implementation uses the Shard-as-RPM model:

  • Each shard library is packaged as an independent RPM package installing source trees to %{_datadir}/crystal/shards/<name>-<version>.
  • Parallel coexistence of multiple shard versions is supported without filesystem collisions, enabling applications to build against specific SemVer versions.
  • Network access during package builds is prohibited; dependencies are provided locally by installed RPMs.
  • The compiler discovers installed shard libraries offline via CRYSTAL_PATH="lib:%{crystal_shards_dir}:%{_datadir}/crystal/src".
  • Spec generation, license mapping (SPDX), and topological mock build ordering are automated via cr2rpm.
  • Compiler bootstrapping complies with Fedora's No Pre-compiled Binaries Policy via a standard transient Koji side-tag bootstrap.

Feedback

Community feedback and architectural planning have been discussed on Fedora Discussion at Bringing Crystal to Fedora Linux.

Benefit to Fedora

  • Air-Gapped & High-Security Deployments: Enables building and deploying Crystal software in isolated or air-gapped environments without external internet access or dynamic Git downloads.
  • Supply Chain Integrity: Protects against upstream Git repository tampering, branch deletion, and dependency confusion by anchoring all dependencies to cryptographic RPM package checksums.
  • Centralized Security Auditing & Patching: System administrators and security scanners (OpenSCAP, DNF, RPM) can track, audit, and patch Crystal libraries system-wide without inspecting ad-hoc vendor directories.
  • Hermetic & Reproducible Builds: Conforms strictly with Fedora release engineering standards, ensuring deterministic builds in Koji and Mock.
  • Modern Systems Language: Provides a high-performance compiled language with native LLVM optimization, green threads concurrency, and seamless C ABI interoperability.

Scope

  • Proposal owners:
  • Other developers: No direct impact on existing packages. Developers can begin packaging Crystal applications and shard libraries.
  • Release engineering: Coordinate initial bootstrap build and provide a staging side-tag if required (RelEng Ticket #13511).
  • Policies and guidelines: Fedora Packaging Guidelines updated with dedicated Crystal section (FPC PR #1568, FPC Issue #1567, Discussion #200733).
  • Trademark approval: N/A (not needed for this Change)
  • Alignment with the Fedora Strategy: Expands Fedora's ecosystem of modern, memory-efficient compiled systems languages.

Upgrade/compatibility impact

No impact on existing packages or system upgrades. This change introduces new packages and does not modify existing system defaults or libraries.

How To Test

Hardware/Environment Requirements

Standard x86_64 or aarch64 Fedora Linux system (or Mock chroot).

System Preparation

sudo dnf install crystal shards cr2rpm crystal-rpm-macros

Verification Steps

Generate a spec file from a shard repository:

cr2rpm generate --path ./my-shard

Analyze dependency tree and build order:

cr2rpm deps --path ./my-shard --format mock

Build and verify an application binary:

crystal build --release -o hello src/hello.cr
./hello

Run package tests in an isolated mock chroot:

mock -r fedora-rawhide-x86_64 rebuild my-package.src.rpm

User Experience

Fedora users and developers can install the Crystal compiler and shards package manager directly via standard package management:

sudo dnf install crystal shards

Crystal binaries compile with full Fedora hardening flags (PIE, Full RELRO, Stack Protection) and integrate with GDB and LLDB out of the box.

Dependencies

Contingency Plan

  • Contingency mechanism: Retarget for Fedora N+1. Crystal packages remain available via Copr and staging repos.
  • Contingency deadline: Beta freeze.
  • Blocks release? No.

Documentation

Release Notes

Fedora now includes official support for the Crystal programming language, including the compiler (source package crystal-lang, producing binary crystal), dependency manager (shards), and full RPM packaging macros (crystal-rpm-macros). Developers can build native, high-performance Crystal applications and package shards offline using standard Fedora tooling.