Skip to content

Commit f1772db

Browse files
committed
Provide MUSL-based build
Fixes #408
1 parent bac42d3 commit f1772db

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

.github/workflows/package.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
name: Build Package
22
on:
3+
pull_request:
34
push:
45
branches:
56
- main
@@ -10,7 +11,7 @@ jobs:
1011
strategy:
1112
fail-fast: false
1213
matrix:
13-
os: [ubuntu-latest, ubuntu-arm, macos-intel, macos-arm, windows-latest]
14+
os: [ubuntu-latest, ubuntu-arm, alpine-latest, macos-intel, macos-arm, windows-latest]
1415
include:
1516
- os: ubuntu-latest
1617
out-file: libtemporal_sdk_bridge.so
@@ -25,6 +26,12 @@ jobs:
2526
# We use the Python manylinux image for glibc compatibility
2627
container: quay.io/pypa/manylinux2014_aarch64
2728
protobuf-url: https://github.com/protocolbuffers/protobuf/releases/download/v22.3/protoc-22.3-linux-aarch_64.zip
29+
- os: alpine-latest
30+
out-file: libtemporal_sdk_bridge.so
31+
out-prefix: linux-musl-x64
32+
# Need Alpine container since GH runner doesn't have one
33+
container: mcr.microsoft.com/dotnet/sdk:8.0-alpine
34+
protobuf-url: https://github.com/protocolbuffers/protobuf/releases/download/v22.3/protoc-22.3-linux-x86_64.zip
2835
- os: macos-intel
2936
out-file: libtemporal_sdk_bridge.dylib
3037
out-prefix: osx-x64
@@ -129,10 +136,12 @@ jobs:
129136
strategy:
130137
fail-fast: false
131138
matrix:
132-
os: [ubuntu-latest, ubuntu-arm, macos-intel, macos-arm, windows-latest]
139+
os: [ubuntu-latest, ubuntu-arm, alpine-latest, macos-intel, macos-arm, windows-latest]
133140
include:
134141
- os: ubuntu-arm
135142
runsOn: buildjet-4vcpu-ubuntu-2204-arm
143+
- os: alpine-latest
144+
container: mcr.microsoft.com/dotnet/sdk:8.0-alpine
136145
- os: macos-intel
137146
runsOn: macos-13
138147
- os: macos-arm

src/Temporalio/Testing/WorkflowEnvironment.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,19 @@ public static async Task<WorkflowEnvironment> StartTimeSkippingAsync(
8585
WorkflowEnvironmentStartTimeSkippingOptions? options = null)
8686
{
8787
options ??= new();
88+
89+
// If they did not provide a binary to use, eagerly fail on musl since musl
90+
// time-skipping is not supported at this time. We can only do this check in .NET 5+,
91+
// otherwise we assume it is not musl for now since this is just a temporary situation.
92+
// TODO(cretz): Remove when musl-support for time-skipping test server is present.
93+
#if NET5_0_OR_GREATER
94+
if (System.Runtime.InteropServices.RuntimeInformation.Contains("-musl", StringComparison.OrdinalIgnoreCase))
95+
{
96+
throw new InvalidOperationException(
97+
"Time-skipping test server not currently supported in musl-based environments");
98+
}
99+
#endif
100+
88101
var runtime = options.Runtime ?? TemporalRuntime.Default;
89102
var server = await Bridge.EphemeralServer.StartTestServerAsync(
90103
runtime.Runtime,

0 commit comments

Comments
 (0)