Skip to content

Commit 8e94382

Browse files
authored
Moved C Bridge from dotnet-sdk to core-sdk repo (💥 BREAKING CHANGE) (#494)
1 parent d1fedb0 commit 8e94382

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+8046
-10942
lines changed

‎.github/workflows/ci.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
- name: Regen confirm unchanged
6666
if: ${{ matrix.checkTarget }}
6767
run: |
68-
dotnet tool install --global --version 18.1.0 ClangSharpPInvokeGenerator
68+
dotnet tool install --global --version '[20.1.2.1]' ClangSharpPInvokeGenerator
6969
ClangSharpPInvokeGenerator @src/Temporalio/Bridge/GenerateInterop.rsp
7070
dotnet run --project src/Temporalio.Api.Generator
7171
npx doctoc README.md

‎.github/workflows/package.yml‎

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
branches:
55
- main
66
- "releases/*"
7+
workflow_dispatch: {}
78

89
jobs:
910
build-bridge-libraries:
@@ -13,35 +14,35 @@ jobs:
1314
os: [ubuntu-latest, ubuntu-arm, alpine-latest, macos-intel, macos-arm, windows-latest]
1415
include:
1516
- os: ubuntu-latest
16-
out-file: libtemporal_sdk_bridge.so
17+
out-file: libtemporal_sdk_core_c_bridge.so
1718
out-prefix: linux-x64
1819
# We use the Python manylinux image for glibc compatibility
1920
container: quay.io/pypa/manylinux2014_x86_64
2021
protobuf-url: https://github.com/protocolbuffers/protobuf/releases/download/v22.3/protoc-22.3-linux-x86_64.zip
2122
- os: ubuntu-arm
22-
out-file: libtemporal_sdk_bridge.so
23+
out-file: libtemporal_sdk_core_c_bridge.so
2324
out-prefix: linux-arm64
2425
runsOn: ubuntu-24.04-arm64-2-core
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
2829
- os: alpine-latest
29-
out-file: libtemporal_sdk_bridge.so
30+
out-file: libtemporal_sdk_core_c_bridge.so
3031
out-prefix: linux-musl-x64
3132
# Need Alpine container since GH runner doesn't have one
3233
container: mcr.microsoft.com/dotnet/sdk:8.0-alpine
3334
protobuf-url: https://github.com/protocolbuffers/protobuf/releases/download/v22.3/protoc-22.3-linux-x86_64.zip
3435
runsOn: ubuntu-latest
3536
- os: macos-intel
36-
out-file: libtemporal_sdk_bridge.dylib
37+
out-file: libtemporal_sdk_core_c_bridge.dylib
3738
out-prefix: osx-x64
3839
runsOn: macos-13
3940
- os: macos-arm
40-
out-file: libtemporal_sdk_bridge.dylib
41+
out-file: libtemporal_sdk_core_c_bridge.dylib
4142
out-prefix: osx-arm64
4243
runsOn: macos-14
4344
- os: windows-latest
44-
out-file: temporal_sdk_bridge.dll
45+
out-file: temporal_sdk_core_c_bridge.dll
4546
out-prefix: win-x64
4647
runs-on: ${{ matrix.runsOn || matrix.os }}
4748
steps:
@@ -73,7 +74,7 @@ jobs:
7374

7475
- name: Build (non-Docker)
7576
if: ${{ !matrix.container }}
76-
run: cargo build --manifest-path src/Temporalio/Bridge/Cargo.toml --release
77+
run: cargo build --manifest-path src/Temporalio/Bridge/sdk-core/core-c-bridge/Cargo.toml --profile release-lto
7778

7879
- name: Build (Docker non-Alpine)
7980
if: ${{ matrix.container && matrix.os != 'alpine-latest' }}
@@ -86,7 +87,7 @@ jobs:
8687
&& curl -LO ${{ matrix.protobuf-url }} \
8788
&& unzip protoc-*.zip -d /usr/local/protobuf \
8889
&& export PATH="$PATH:/usr/local/protobuf/bin" \
89-
&& cargo build --manifest-path src/Temporalio/Bridge/Cargo.toml --release \
90+
&& cargo build --manifest-path src/Temporalio/Bridge/sdk-core/core-c-bridge/Cargo.toml --profile release-lto \
9091
'
9192
9293
- name: Build (Docker Alpine)
@@ -101,14 +102,14 @@ jobs:
101102
&& curl -LO ${{ matrix.protobuf-url }} \
102103
&& unzip protoc-*.zip -d /usr/local/protobuf \
103104
&& export PATH="$PATH:/usr/local/protobuf/bin" \
104-
&& RUSTFLAGS="-C target-feature=-crt-static" cargo build --manifest-path src/Temporalio/Bridge/Cargo.toml --release \
105+
&& RUSTFLAGS="-C target-feature=-crt-static" cargo build --manifest-path src/Temporalio/Bridge/sdk-core/core-c-bridge/Cargo.toml --profile release-lto \
105106
'
106107
107108
- name: Upload bridge library
108109
uses: actions/upload-artifact@v4
109110
with:
110111
name: ${{ matrix.out-prefix }}-bridge
111-
path: src/Temporalio/Bridge/target/release/${{ matrix.out-file }}
112+
path: src/Temporalio/Bridge/sdk-core/target/release-lto/${{ matrix.out-file }}
112113
if-no-files-found: error
113114

114115
build-nuget-package:

‎README.md‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,10 +1128,11 @@ See the
11281128
11291129
### Built-in Native Shared Library
11301130

1131-
This SDK requires a built-in unmanaged, native shared library built in Rust. It is named `temporal_sdk_bridge.dll` on
1132-
Windows, `libtemporal_sdk_bridge.so` on Linux, and `libtemporal_sdk_bridge.dylib` on macOS. This is automatically
1133-
included when using modern versions of .NET on a common platform. If you are using .NET framework, you may have to
1134-
explicitly set the platform to `x64` or `arm64` because `AnyCPU` will not choose the proper library.
1131+
This SDK requires a built-in unmanaged, native shared library built in Rust. It is named
1132+
`temporal_sdk_core_c_bridge.dll` on Windows, `libtemporal_sdk_core_c_bridge.so` on Linux, and
1133+
`libtemporal_sdk_core_c_bridge.dylib` on macOS. This is automatically included when using modern versions of .NET
1134+
on a common platform. If you are using .NET framework, you may have to explicitly set the platform to `x64` or `arm64`
1135+
because `AnyCPU` will not choose the proper library.
11351136

11361137
Currently we only support [RIDs](https://learn.microsoft.com/en-us/dotnet/core/rid-catalog) `linux-arm64`,
11371138
`linux-x64`, `linux-musl-x64`, `osx-arm64`, `osx-x64`, and `win-x64`. Any other platforms needed (e.g. `linux-musl-x64`
@@ -1144,8 +1145,8 @@ Redistributable installation).
11441145

11451146
If the native shared library is not loading for whatever reason, the following error may appear:
11461147

1147-
> System.DllNotFoundException: Unable to load DLL 'temporal_sdk_bridge' or one of its dependencies: The specified module
1148-
could not be found.
1148+
> System.DllNotFoundException: Unable to load DLL 'temporal_sdk_core_c_bridge' or one of its dependencies: The specified
1149+
> module could not be found.
11491150

11501151
See the earlier part of this section for details on what environments are supported.
11511152

‎src/Temporalio/Api/Batch/V1/Message.cs‎

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -43,29 +43,29 @@ static MessageReflection() {
4343
"bW1vbi52MS5QYXlsb2FkcxIuCgZoZWFkZXIYAyABKAsyHi50ZW1wb3JhbC5h",
4444
"cGkuY29tbW9uLnYxLkhlYWRlchIQCghpZGVudGl0eRgEIAEoCSIuChpCYXRj",
4545
"aE9wZXJhdGlvbkNhbmNlbGxhdGlvbhIQCghpZGVudGl0eRgBIAEoCSIqChZC",
46-
"YXRjaE9wZXJhdGlvbkRlbGV0aW9uEhAKCGlkZW50aXR5GAEgASgJIqYCChNC",
46+
"YXRjaE9wZXJhdGlvbkRlbGV0aW9uEhAKCGlkZW50aXR5GAEgASgJIq4CChNC",
4747
"YXRjaE9wZXJhdGlvblJlc2V0EhAKCGlkZW50aXR5GAMgASgJEjUKB29wdGlv",
4848
"bnMYBCABKAsyJC50ZW1wb3JhbC5hcGkuY29tbW9uLnYxLlJlc2V0T3B0aW9u",
49-
"cxI0CgpyZXNldF90eXBlGAEgASgOMiAudGVtcG9yYWwuYXBpLmVudW1zLnYx",
50-
"LlJlc2V0VHlwZRJDChJyZXNldF9yZWFwcGx5X3R5cGUYAiABKA4yJy50ZW1w",
51-
"b3JhbC5hcGkuZW51bXMudjEuUmVzZXRSZWFwcGx5VHlwZRJLChVwb3N0X3Jl",
52-
"c2V0X29wZXJhdGlvbnMYBSADKAsyLC50ZW1wb3JhbC5hcGkud29ya2Zsb3cu",
53-
"djEuUG9zdFJlc2V0T3B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+
"YXRjaC52MUIMTWVzc2FnZVByb3RvUAFaIWdvLnRlbXBvcmFsLmlvL2FwaS9i",
67+
"YXRjaC92MTtiYXRjaKoCF1RlbXBvcmFsaW8uQXBpLkJhdGNoLlYx6gIaVGVt",
68+
"cG9yYWxpbzo6QXBpOjpCYXRjaDo6VjFiBnByb3RvMw=="));
6969
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
7070
new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.DurationReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.FieldMaskReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.TimestampReflection.Descriptor, global::Temporalio.Api.Common.V1.MessageReflection.Descriptor, global::Temporalio.Api.Enums.V1.BatchOperationReflection.Descriptor, global::Temporalio.Api.Enums.V1.ResetReflection.Descriptor, global::Temporalio.Api.Rules.V1.MessageReflection.Descriptor, global::Temporalio.Api.Workflow.V1.MessageReflection.Descriptor, },
7171
new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
@@ -1474,8 +1474,9 @@ public string Identity {
14741474
public const int ResetTypeFieldNumber = 1;
14751475
private global::Temporalio.Api.Enums.V1.ResetType resetType_ = global::Temporalio.Api.Enums.V1.ResetType.Unspecified;
14761476
/// <summary>
1477-
/// Reset type (deprecated, use `options`).
1477+
/// Deprecated. Use `options`.
14781478
/// </summary>
1479+
[global::System.ObsoleteAttribute]
14791480
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
14801481
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
14811482
public global::Temporalio.Api.Enums.V1.ResetType ResetType {
@@ -1489,8 +1490,9 @@ public string Identity {
14891490
public const int ResetReapplyTypeFieldNumber = 2;
14901491
private global::Temporalio.Api.Enums.V1.ResetReapplyType resetReapplyType_ = global::Temporalio.Api.Enums.V1.ResetReapplyType.Unspecified;
14911492
/// <summary>
1492-
/// History event reapply options (deprecated, use `options`).
1493+
/// Deprecated. Use `options`.
14931494
/// </summary>
1495+
[global::System.ObsoleteAttribute]
14941496
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
14951497
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
14961498
public global::Temporalio.Api.Enums.V1.ResetReapplyType ResetReapplyType {

0 commit comments

Comments
 (0)