Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
6ee6c4c
feat(compiler): add Swift gRPC service generation
yash-agarwa-l Jun 19, 2026
9d15a1b
feat(compiler): preflight Swift gRPC collisions
yash-agarwa-l Jun 19, 2026
e78e79e
test(compiler): cover Swift gRPC codegen
yash-agarwa-l Jun 19, 2026
b554dae
test(compiler): build and run the Swift gRPC fixture
yash-agarwa-l Jun 19, 2026
e865db5
test(grpc): generate Swift companions in the interop harness
yash-agarwa-l Jun 19, 2026
efdcad2
docs: document Swift gRPC support
yash-agarwa-l Jun 20, 2026
034861b
style(compiler): wrap long Swift gRPC handler closures
yash-agarwa-l Jun 20, 2026
7f3d888
style(compiler): make Swift gRPC companions swiftlint-clean
yash-agarwa-l Jun 20, 2026
1ab4cf8
test(compiler): document the Swift common-root package limit
yash-agarwa-l Jun 20, 2026
f746c2c
fix(compiler): use a per-thread Fory in Swift gRPC marshaller
yash-agarwa-l Jun 20, 2026
00f2657
docs: note Swift gRPC client and interceptor limits
yash-agarwa-l Jun 21, 2026
3c93b3e
test(compiler): prove Swift marshaller thread-safety under TSan
yash-agarwa-l Jun 21, 2026
dd40171
test(compiler): gate the Swift TSan test behind FORY_SWIFT_TSAN
yash-agarwa-l Jun 21, 2026
4922f77
feat(compiler): reserve inherited member names in Swift gRPC
yash-agarwa-l Jun 21, 2026
9cf3cee
Merge remote-tracking branch 'upstream/main' into grpc-swift
yash-agarwa-l Jun 21, 2026
4b5278e
refactor(grpc): move Swift toolchain tests into integration_tests
yash-agarwa-l Jun 21, 2026
6d44772
fix(compiler): make the Swift gRPC wire wrapper Sendable
yash-agarwa-l Jun 21, 2026
5c5c15c
test(grpc): run Swift toolchain gRPC tests in their package
yash-agarwa-l Jun 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .agents/languages/swift.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Load this file when changing `swift/` or Swift xlang behavior.
- Swift code must compile without compiler warnings. Treat warnings as blockers, including warnings in generated Swift code.
- Swift lint uses `swift/.swiftlint.yml`.
- Use `ENABLE_FORY_DEBUG_OUTPUT=1` when debugging Swift tests.
- Generated Swift gRPC companions are compiler-owned files targeting grpc-swift 1.x. Keep grpc-swift out of the `swift/` runtime package; it belongs only to generated user code and the compiler build fixture.
- Prefer the user-requested or existing Foundation public value type when it is the intended Swift surface; do not invent Fory-prefixed wrappers only to avoid import ambiguity.
- Preserve distinct temporal semantics. Timestamp values and day-only local dates should have protocol-accurate helper names and no stale aliases after a refactor.
- When temporal or public-type refactors touch generated Swift code, sweep message fields, union payloads, macros, xlang harnesses, and integration fixtures together.
Expand Down
27 changes: 27 additions & 0 deletions compiler/fory_compiler/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
from fory_compiler.generators.base import GeneratorOptions
from fory_compiler.generators import GENERATORS
from fory_compiler.generators.csharp import validate_csharp_generation
from fory_compiler.generators.swift import validate_swift_generation
from fory_compiler.generators.kotlin import (
kotlin_output_paths,
kotlin_package_for_schema,
Expand Down Expand Up @@ -342,6 +343,27 @@ def validate_csharp_files(
return False


def validate_swift_files(
files: List[Path],
import_paths: List[Path],
namespace_style: Optional[str] = None,
grpc: bool = False,
) -> bool:
"""Preflight Swift output paths and top-level symbols before writing output."""
cache: Dict[Path, Schema] = {}
graph: List[Tuple[Path, Schema]] = []
for file_path in files:
file_graph = collect_schema_graph(file_path, import_paths, cache, set())
if file_graph is None:
return False
graph.extend(file_graph)
try:
return validate_swift_generation(graph, namespace_style, grpc=grpc)
except ValueError as e:
print(f"Error: {e}", file=sys.stderr)
return False


def validate_scala_import_packages(graph: List[Tuple[Path, Schema]]) -> bool:
"""Check package combinations that Scala source cannot compile."""
packages = {scala_package_for_schema(schema) for _, schema in graph}
Expand Down Expand Up @@ -1022,6 +1044,11 @@ def cmd_compile(args: argparse.Namespace) -> int:
if "scala" in lang_output_dirs:
if not validate_scala_generation(args.files, import_paths, grpc=args.grpc):
return 1
if "swift" in lang_output_dirs:
if not validate_swift_files(
args.files, import_paths, args.swift_namespace_style, grpc=args.grpc
):
return 1

if args.grpc_web and "javascript" not in lang_output_dirs:
print(
Expand Down
Loading
Loading