Skip to content

Conversation

justice-adams-apple
Copy link
Contributor

Our build jobs won't work unless we detect and add the https proxy into the HTTP client prior to downloading the lib archive dependency. We can reuse the HTTPRequestExecutorImpl to detect and use the proxy correctly

}
}

public func shutdown() async throws {
Copy link
Member

Choose a reason for hiding this comment

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

question: why is this explicit shutdown required? I think that the deinit above should shut the http client down when an executor goes out of scope.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed the explicit shutdown. Got my wires crossed, you are correct the deinit should take care of this

// Download libarchive
let httpExecutor = HTTPRequestExecutorImpl()
defer {
Task {
Copy link
Member

Choose a reason for hiding this comment

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

suggestion: If you leverage the deinit of the httpExecutor then this defer shouldn't be needed here. If an explicit shutdown is needed then it should probably use the syncShutdown() of the http client so that this defer doesn't need to launch an unstructured task that may or may not be run when expected since it is asynchronous.

}

let libarchiveRequest = HTTPClientRequest(url: "https://github.com/libarchive/libarchive/releases/download/v\(libArchiveVersion)/libarchive-\(libArchiveVersion).tar.gz")
let libarchiveResponse = try await HTTPClient.shared.execute(libarchiveRequest, timeout: .seconds(60))
Copy link
Member

Choose a reason for hiding this comment

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

praise: this looks good for cases where the build script is run in a http proxy environment.

thought: Maybe we should have a workflow that verifies that this build script works in such an environment. I'm not quite sure how to configure Linux so that the network traffic will be blocked unless it goes through a proxy.

@justice-adams-apple justice-adams-apple force-pushed the jadams/release-1.1/fix-proxy branch from 27a2534 to 6a69f8d Compare September 17, 2025 15:56
@justice-adams-apple justice-adams-apple merged commit 3545a9e into release/1.1 Sep 17, 2025
47 of 48 checks passed
@justice-adams-apple justice-adams-apple deleted the jadams/release-1.1/fix-proxy branch September 17, 2025 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants