Skip to content

Update builder API to use grpc-swift-2.#1309

Open
jglogan wants to merge 2 commits intoapple:mainfrom
jglogan:builder-swiftgrpc2
Open

Update builder API to use grpc-swift-2.#1309
jglogan wants to merge 2 commits intoapple:mainfrom
jglogan:builder-swiftgrpc2

Conversation

@jglogan
Copy link
Contributor

@jglogan jglogan commented Mar 12, 2026

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Motivation and Context

The new library is more actively maintained

Testing

  • Tested locally
  • Added/updated tests
  • Added/updated docs

- Closes apple#1308.
- Applies dependency and code changes similar
  to apple/containerization#578.
- Upgrades hawkeye to latest version.
- Update StderrLogHandler not to create a
  (non-Sendable) Swift time formatter object
  for every log message.
@jglogan jglogan requested a review from dcantah March 12, 2026 20:44
@github-actions github-actions bot added the cli label Mar 12, 2026
@jglogan jglogan marked this pull request as draft March 12, 2026 20:45
@jglogan jglogan marked this pull request as ready for review March 12, 2026 20:45
@jglogan jglogan marked this pull request as draft March 12, 2026 20:45
initialBackoff: TimeInterval(1),
maximumBackoff: TimeInterval(10)

let channel = try ClientBootstrap(group: group)
Copy link
Contributor Author

@jglogan jglogan Mar 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace grpc-swift client setup with the grpc-swift-2 approach, initializing our buffering handler in place to deal with the server sending the SETTINGS frame before the pipeline can handle it.

try channel.pipeline.syncOperations.addHandler(HTTP2ConnectBufferingHandler())
})
}
.withConnectedSocket(socket.fileDescriptor)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the fd for the vsock between us and the buildkit container

}
}
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've already reviewed this approach in apple/containerization#578

switch logLevel {
case .debug, .trace:
let timestamp = ISO8601DateFormatter().string(from: Date())
let timestamp = isoTimestamp()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not construct a non-Sendable date formatter every log message.

@jglogan jglogan requested review from JaewonHur March 13, 2026 23:02
@jglogan jglogan marked this pull request as ready for review March 14, 2026 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Request]: Upgrade builder API to use grpc-swift-2.

2 participants