{"id":44880386,"url":"https://github.com/shopify/cibuildgem","last_synced_at":"2026-02-17T16:02:43.676Z","repository":{"id":327522053,"uuid":"1054920220","full_name":"Shopify/cibuildgem","owner":"Shopify","description":"Assist developers to distribute gems with precompiled binaries.","archived":false,"fork":false,"pushed_at":"2026-02-14T01:33:30.000Z","size":1174,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-14T08:27:52.342Z","etag":null,"topics":["bundle","gems","native-extensions","ruby","rubygem"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Shopify.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-11T14:08:48.000Z","updated_at":"2026-02-14T01:32:46.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Shopify/cibuildgem","commit_stats":null,"previous_names":["shopify/cibuildgem"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/Shopify/cibuildgem","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shopify%2Fcibuildgem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shopify%2Fcibuildgem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shopify%2Fcibuildgem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shopify%2Fcibuildgem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Shopify","download_url":"https://codeload.github.com/Shopify/cibuildgem/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shopify%2Fcibuildgem/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29549224,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T14:33:00.708Z","status":"ssl_error","status_checked_at":"2026-02-17T14:32:58.657Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bundle","gems","native-extensions","ruby","rubygem"],"created_at":"2026-02-17T16:02:39.131Z","updated_at":"2026-02-17T16:02:43.671Z","avatar_url":"https://github.com/Shopify.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e [!NOTE]\n\u003e **This tool is currently in active development.** We are very much looking for your feedback.\n\n## 🗒️ Preamble\n\n#### The problem this tool tries to solve.\n\nA major bottleneck for every Ruby developers when running `bundle install` is the compilation of native gem extensions. To illustrate this issue, running `bundle install` on a new Rails application takes around **25 seconds** on a MacBook Pro M4, and 80% of that time is spent compiling the couple dozens of gems having native extensions. It would take only 5 seconds if it wasn't for the compilation.\n\n#### How we can solve this problem for the Ruby community.\n\nThe Python community had exactly the same issue and came up with the amazing [cibuildwheel](https://github.com/pypa/cibuildwheel) solution to provide a CI based compilation approach to help maintainers ship their libraries will precompiled binaries for various platforms.\n\nThis tool modestly tries to follow the same approach by helping ruby maintainers ship their gems with precompiled binaries.\n\n#### Existing solutions.\n\nPrecompilation isn't new in the Ruby ecosystem and some maintainers have been releasing their gems with precompiled binaries to speedup the installation process since a while (e.g. [nokogiri](https://rubygems.org/gems/nokogiri), [grpc](https://rubygems.org/gems/grpc), [karafka-rdkafka](https://rubygems.org/gems/karafka-rdkafka)). One of the most popular tool that enables to precompile binaries for different platform is the great [rake-compiler-dock](https://github.com/rake-compiler/rake-compiler-dock) toolchain.\nIt uses a cross compilation approach by periodically building docker images for various platforms and spinning up containers to compile the binaries.\n\nAs noted by [@flavorjones](https://github.com/flavorjones), this toolchain works great but it's complex and brittle compared to the more simple process of compiling on the target platform.\n\n## 💻 cibuildgem\n\n\u003e [!NOTE]\n\u003e cibuildgem is for now not able to compile projects that needs to link on external libraries. Unless the project vendors those libraries or uses [mini_portile](https://github.com/flavorjones/mini_portile).\n\n### How to use it\n\nWhile cibuildgem is generally **not** meant to be used locally, it provides a command to generate the right GitHub workflow for your project:\n\n1. Install cibuildgem: `gem install cibuildgem`\n2. Generate the workflow: `cd` in your gem's folder and run `cibuildgem ci_template`\n3. Commit the `.github/workflows/cibuildgem.yaml` file.\n\n### Triggering the workflow\n\nOnce pushed in your repository **default** branch, the workflow that we just generated is actionable manually on the GitHub action page. It will run in sequence:\n\n1. Compile the gem on the target platform (defaults to MacOS ARM, MacOS Intel, Windows, Ubuntu 24)\n2. Once the compilation succeeds on all platform, it proceeds to run the test suite on the target platform. This will trigger many CI steps as the testing matrix is big.\n3. Once the test suite passes for all platforms and all Ruby versions the gem is compatible with, the action proceeds to installing the gem we just packaged. This step ensure that the gem is actually installable.\n4. [OPTIONAL] When trigering the workflow manually, you can tick the box to automatically release the gems that were packaged. This works using the RubyGems trusted publisher feature (documentation to write later). If you do no want the tool to make the release, you can download all the GitHub artifacts that were uploaded. It will contain all the gems with precompiled binaries in the `pkg` folder. You are free to download them locally and release them yourself from your machine.\n\n\n### Changes to make in your gem to support precompiled binaries\n\nDue to the RubyGems specification, we can't release a gem with precompiled binaries for a specific Ruby version. Because the Ruby ABI is incompatible between minor versions, Rake Compiler (the tool underneath cibuildgem), compiles the binary for every minor Ruby versions your gem supports. All those binaries will be packaged in the gem (called a fat gem) in different folder such as `3.0/date.so`, `3.1/date.so` etc...\nAt runtime, your gem need to require the right binary based on the running ruby version.\n\n```ruby\n# Before\n\nrequire 'date_core.so'\n\n# After\n\nbegin\n  ruby_version = /(\\d+\\.\\d+)/.match(::RUBY_VERSION)\n  require \"#{ruby_version}/date_core\"\nrescue LoadError\n  # It's important to leave for users that can not or don't want to use the gem with precompiled binaries.\n  require \"date_core\"\nend\n```\n\n### Supported platforms/Ruby versions\n\n|         | MacOS Intel  | MacOS ARM | Windows x64 UCRT | Linux GNU x86_64|Linux AARCH64 |\n|---------|------------- | --------- | ------------|-----------------|-----------------|\n| Ruby 3.1| 🟢           | 🟢        | 🟢          | 🟢             | 🟢             |\n| Ruby 3.2| 🟢           | 🟢        | 🟢          | 🟢             | 🟢             |\n| Ruby 3.3| 🟢           | 🟢        | 🟢          | 🟢             | 🟢             |\n| Ruby 3.4| 🟢           | 🟢        | 🟢          | 🟢             | 🟢             |\n\n## 🧪 Development\n\nIf you'd like to run a end-to-end test, the `date` gem is vendored in this project. You can trigger a manual run to do the whole compile, test, install dance from the GitHub action menu.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshopify%2Fcibuildgem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshopify%2Fcibuildgem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshopify%2Fcibuildgem/lists"}