Skip to content

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

Merged
jglogan merged 2 commits intoapple:mainfrom
jglogan:builder-swiftgrpc2
Mar 16, 2026
Merged

Update builder API to use grpc-swift-2.#1309
jglogan merged 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
@jglogan jglogan merged commit 5090093 into apple:main Mar 16, 2026
3 checks passed
@jglogan jglogan deleted the builder-swiftgrpc2 branch March 16, 2026 17:33
egernst added a commit to egernst/container that referenced this pull request Mar 17, 2026
This reverts commit 5090093,
restoring the grpc-swift-1 based builder API while preserving
build secrets and hidden docker dir support added in a00ec5c.

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
egernst added a commit to egernst/container that referenced this pull request Mar 17, 2026
This reverts commit 5090093,
restoring the grpc-swift-1 based builder API while preserving
build secrets and hidden docker dir support added in a00ec5c.

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
jglogan pushed a commit that referenced this pull request Mar 18, 2026
This reverts commit 5090093, restoring
the grpc-swift-1 based builder API while preserving build secrets and
hidden docker dir support added in a00ec5c.

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
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