@@ -54,6 +54,7 @@ Notably missing from this SDK:
5454 - [ Platform Support] ( #platform-support )
5555- [ Development] ( #development )
5656 - [ Build] ( #build )
57+ - [ Build Platform-specific Gem] ( #build-platform-specific-gem )
5758 - [ Testing] ( #testing )
5859 - [ Code Formatting and Type Checking] ( #code-formatting-and-type-checking )
5960 - [ Proto Generation] ( #proto-generation )
@@ -76,12 +77,14 @@ Or via `gem install` like:
7677gem install temporalio
7778```
7879
80+ ** NOTE** : Only macOS ARM/x64 and Linux ARM/x64 are supported, and the platform-specific gem chosen is based on when the
81+ gem/bundle install is performed. A source gem is published but cannot be used directly and will fail to build if tried.
82+ MinGW-based Windows and Linux MUSL do not have gems. See the [ Platform Support] ( #platform-support ) section for more
83+ information.
84+
7985** NOTE** : Due to [ an issue] ( https://github.com/temporalio/sdk-ruby/issues/162 ) , fibers (and ` async ` gem) are only
8086supported on Ruby versions 3.3 and newer.
8187
82- ** NOTE** : MinGW-based Windows, Linux MUSL, and pure source based gems are not currently published. See the
83- [ Platform Support] ( #platform-support ) section for more information.
84-
8588### Implementing an Activity
8689
8790Implementing workflows is not yet supported in the Ruby SDK, but implementing activities is.
@@ -465,9 +468,9 @@ This means Linux and macOS for ARM and x64 have published gems. Currently, a gem
465468Due to [ an issue] ( https://github.com/temporalio/sdk-ruby/issues/172 ) with Windows and multi-threaded Rust, MinGW-based
466469Windows (i.e. ` x64-mingw-ucrt ` ) is not supported. But WSL is supported using the normal Linux gem.
467470
468- At this time a pure source gem is not published, which means that when trying to install the gem on an unsupported
469- platform, you may get an error that it is not available. Building from source requires many files across submodules and
470- requires Rust to be installed. See the [ Build ] ( #build ) section for how to build a gem from the repository.
471+ At this time a pure source gem is published for documentation reasons, but it cannot be built and will fail if tried.
472+ Building from source requires many files across submodules and requires Rust to be installed. See the [ Build ] ( #build )
473+ section for how to build a the repository.
471474
472475The SDK works on Ruby 3.1+, but due to [ an issue] ( https://github.com/temporalio/sdk-ruby/issues/162 ) , fibers (and
473476` async ` gem) are only supported on Ruby versions 3.3 and newer.
@@ -491,13 +494,32 @@ To build shared library for development use:
491494
492495 bundle exec rake compile
493496
494- Note, this is not ` compile:dev ` because debug-mode in Rust has
497+ ** NOTE** : This will make the current directory usable for the current Ruby version by putting the shared library
498+ ` lib/temporalio/internal/bridge/temporalio_bridge.<ext> ` in the proper place. But this development shared library may
499+ not work for other Ruby versions or other OS/arch combinations. For that, see "Build Platform-specific Gem" below.
500+
501+ ** NOTE** : This is not ` compile:dev ` because debug-mode in Rust has
495502[ an issue] ( https://github.com/rust-lang/rust/issues/34283 ) that causes runtime stack size problems.
496503
497- To lint, build, and test release :
504+ To lint, build, and test:
498505
499506 bundle exec rake
500507
508+ #### Build Platform-specific Gem
509+
510+ The standard ` bundle exec rake build ` will produce a gem in the ` pkg ` directory, but that gem will not be usable because
511+ the shared library is not present (neither the Rust code nor the compiled form). To create a platform-specific gem that
512+ can be used, ` rb-sys-dock ` must be run. See the
513+ [ Cross-Compilation documentation] ( https://oxidize-rb.github.io/rb-sys/tutorial/publishing/cross-compilation.html ) in the
514+ ` rb-sys ` repository. For example, running:
515+
516+ bundle exec rb-sys-dock --platform x86_64-linux --ruby-versions 3.2,3.3 --build
517+
518+ Will create a ` pkg/temporalio-<version>-x86_64-linux.gem ` file that can be used in x64 Linux environments on both Ruby
519+ 3.2 and Ruby 3.3 because it contains the shared libraries. For this specific example, the shared libraries are inside
520+ the gem at ` lib/temporalio/internal/bridge/3.2/temporalio_bridge.<ext> ` and
521+ ` lib/temporalio/internal/bridge/3.3/temporalio_bridge.<ext> ` .
522+
501523### Testing
502524
503525This project uses ` minitest ` . To test:
0 commit comments