Repository navigation
build: precompiled x86_64-linux and aarch64-linux platform gems #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
gmiklos-ltg
wants to merge
27
commits into
master
Choose a base branch
from
build/precompiled-gem-x86_64-linux
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
0d747dd
build: add a precompiled x86_64-linux platform gem task
claude 9d3b4d0
ci: add a manual workflow to build and smoke-test the native gem
claude e6e5592
ci: temporarily also trigger on pull_request to test this workflow on…
claude 1462d3c
ci: install libyaml-0-2 in the smoke-test containers
claude acb091e
build: drop rice/rake-compiler from the precompiled gem's dependencies
claude 3a0e2eb
build+ci: add aarch64-linux as a second precompiled platform
claude 133fe42
ci: keep pull_request trigger permanently, scoped to relevant paths
claude b032ed7
build: pin+verify libpulsar checksums, strip stale RUNPATH, pin Ruby ABI
claude a114581
ci: fix smoke-test to actually test the installed gem, add permissions
claude aaa6f3d
docs: fix version requirement and remove-fallback claim in README
claude dbe4019
build: clean up vendored/compiled .so files, gitignore them too
claude 7247c60
build: support a CI-supplied build number for continuous publish vers…
claude 760de86
ci: add continuous publish on master, gated behind workflow_dispatch …
claude e8318cf
docs: self-contained guide for consuming the precompiled gem
claude 091ddfc
build: make each platform's published version unique per run
claude 4dfc4b6
ci: verify the published gem actually installs from the real registry
claude b4adcff
ci: fix verify-publish to use the scoped Bundler source, not plain ge…
claude 884fdef
ci: merge verify-publish's install/require steps, add Gemfile.lock di…
claude 38c626f
ci: add a temporary diagnostic job for the GitHub Packages platform i…
claude b0763f5
build: publish per-architecture gems under separate names
claude 96ceced
ci: update verify-publish for per-arch gem names, drop diagnose-registry
claude 187358e
docs: document per-architecture gem names, one Gemfile block for both
claude b99508a
docs: fix the Gemfile pattern - install_if, real fallback, require: o…
claude fa4080a
ci: verify-publish now uses the exact install_if Gemfile from the README
claude 5cefa63
ci: flip publish to run automatically on push to master
claude a16a7d5
ci: fix verify-publish being unreachable after the publish rollout flip
claude 557b619
ci: retry apt-get update with backoff in container jobs
claude File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| name: Build precompiled native gem | ||
|
|
||
| # workflow_dispatch needs this file merged to the default branch before | ||
| # GitHub will let it be triggered, so pull_request is here temporarily too: | ||
| # it runs even for a workflow file that only exists on the PR's branch, | ||
| # which is what lets this get a real CI run on PR #6 before anything | ||
| # merges. Remove the pull_request trigger (or keep it, if it proves useful | ||
| # as permanent per-PR coverage) once that run is verified. | ||
| on: | ||
| workflow_dispatch: {} | ||
| pull_request: {} | ||
|
|
||
| jobs: | ||
| build-x86_64-linux: | ||
| runs-on: ubuntu-22.04 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: "3.4.13" | ||
| bundler-cache: true | ||
|
|
||
| - name: Build the precompiled x86_64-linux gem | ||
| run: bundle exec rake gem:native:x86_64-linux | ||
|
|
||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: pulsar-client-x86_64-linux-gem | ||
| path: pkg/*.gem | ||
| if-no-files-found: error | ||
|
|
||
| # Installs the gem built above into a genuinely clean container - no | ||
| # libpulsar, no C++ toolchain - and runs the non-broker specs against it, | ||
| # to prove the *shipped artifact* works, not just the build tree. Runs | ||
| # against both 22.04 (what we build on) and 24.04, as real evidence for | ||
| # the "newer glibc is backwards-compatible" forward-compat claim before | ||
| # also informally relying on it for 26.04. | ||
| smoke-test: | ||
| needs: build-x86_64-linux | ||
| runs-on: ubuntu-22.04 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| image: ["ubuntu:22.04", "ubuntu:24.04"] | ||
| container: | ||
| image: ${{ matrix.image }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: actions/download-artifact@v4 | ||
| with: | ||
| name: pulsar-client-x86_64-linux-gem | ||
| path: pkg | ||
|
|
||
| # Deliberately minimal: curl/ca-certificates only, for setup-ruby's | ||
| # own download. No build-essential, no gcc, no libpulsar - if the gem | ||
| # needed any of those to install or load, this step (or the ones | ||
| # after it) would fail. | ||
| - name: Install only what's needed to fetch Ruby | ||
| run: | | ||
| apt-get update | ||
| apt-get install -y --no-install-recommends curl ca-certificates | ||
|
|
||
| - uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: "3.4.13" | ||
|
|
||
| - name: Install the precompiled gem (no Gemfile/bundler involved) | ||
| run: gem install pkg/*.gem --local --no-document | ||
|
|
||
| - name: Require it and construct a client | ||
| run: | | ||
| ruby -e ' | ||
| require "pulsar/client" | ||
| puts "VERSION=#{Pulsar::Client::VERSION}" | ||
| cfg = Pulsar::ClientConfiguration.new | ||
| client = Pulsar::Client.new("pulsar://localhost:6650", cfg) | ||
| client.close | ||
| puts "Client constructed and closed OK" | ||
| ' | ||
|
|
||
| # Deliberately not `bundle install`: the Gemfile's `gemspec` directive | ||
| # would try to build pulsar-client from the checked-out source, which | ||
| # is exactly what this container has no compiler for. Install rspec | ||
| # directly instead, and run it against the already gem-installed | ||
| # (precompiled) pulsar-client from the previous step. | ||
| - name: Run the non-broker spec suite against the installed gem | ||
| run: | | ||
| gem install rspec --no-document | ||
| installed_lib=$(ruby -e 'puts Gem::Specification.find_by_name("pulsar-client").lib_dirs_glob') | ||
| rspec -I"$installed_lib" spec/pulsar --exclude-pattern "spec/pulsar/ext_spec.rb" | ||
|
gmiklos-ltg marked this conversation as resolved.
Resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.