Skip to content

Ship with BoringSSL #135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 5 additions & 10 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ let package = Package(
],
dependencies: [
.package(url: "https://github.com/apple/swift-nio.git", from: "2.55.0"),
.package(url: "https://github.com/swift-server/swift-service-lifecycle.git", from: "2.0.0-beta.1"),
.package(url: "https://github.com/apple/swift-nio-ssl", from: "2.25.0"),
.package(url: "https://github.com/swift-server/swift-service-lifecycle.git", from: "2.1.0"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"),
// The zstd Swift package produces warnings that we cannot resolve:
// https://github.com/facebook/zstd/issues/3328
Expand All @@ -56,7 +57,7 @@ let package = Package(
.target(
name: "Crdkafka",
dependencies: [
"COpenSSL",
.product(name: "NIOSSL", package: "swift-nio-ssl"),
.product(name: "libzstd", package: "zstd"),
],
exclude: rdkafkaExclude,
Expand All @@ -65,7 +66,9 @@ let package = Package(
cSettings: [
// dummy folder, because config.h is included as "../config.h" in librdkafka
.headerSearchPath("./custom/config/dummy"),
.headerSearchPath("./custom/include"),
.headerSearchPath("./librdkafka/src"),
.define("_GNU_SOURCE", to: "1"), // Fix build error for Swift 5.9 onwards
],
linkerSettings: [
.linkedLibrary("curl"),
Expand All @@ -88,14 +91,6 @@ let package = Package(
"Kafka",
]
),
.systemLibrary(
name: "COpenSSL",
pkgConfig: "openssl",
providers: [
.brew(["libressl"]),
.apt(["libssl-dev"]),
]
),
.testTarget(
name: "KafkaTests",
dependencies: ["Kafka"]
Expand Down
Empty file removed Sources/COpenSSL/module.modulemap
Empty file.
15 changes: 15 additions & 0 deletions Sources/Crdkafka/custom/include/openssl/err.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the swift-kafka-client open source project
//
// Copyright (c) 2023 Apple Inc. and the swift-kafka-client project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of swift-kafka-client project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

#include "CNIOBoringSSL_err.h"
15 changes: 15 additions & 0 deletions Sources/Crdkafka/custom/include/openssl/evp.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the swift-kafka-client open source project
//
// Copyright (c) 2023 Apple Inc. and the swift-kafka-client project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of swift-kafka-client project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

#include "CNIOBoringSSL_evp.h"
15 changes: 15 additions & 0 deletions Sources/Crdkafka/custom/include/openssl/hmac.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the swift-kafka-client open source project
//
// Copyright (c) 2023 Apple Inc. and the swift-kafka-client project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of swift-kafka-client project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

#include "CNIOBoringSSL_hmac.h"
15 changes: 15 additions & 0 deletions Sources/Crdkafka/custom/include/openssl/pkcs12.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the swift-kafka-client open source project
//
// Copyright (c) 2023 Apple Inc. and the swift-kafka-client project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of swift-kafka-client project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

#include "CNIOBoringSSL_pkcs12.h"
15 changes: 15 additions & 0 deletions Sources/Crdkafka/custom/include/openssl/sha.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the swift-kafka-client open source project
//
// Copyright (c) 2023 Apple Inc. and the swift-kafka-client project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of swift-kafka-client project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

#include "CNIOBoringSSL_sha.h"
15 changes: 15 additions & 0 deletions Sources/Crdkafka/custom/include/openssl/ssl.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the swift-kafka-client open source project
//
// Copyright (c) 2023 Apple Inc. and the swift-kafka-client project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of swift-kafka-client project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

#include "CNIOBoringSSL_ssl.h"
15 changes: 15 additions & 0 deletions Sources/Crdkafka/custom/include/openssl/x509.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the swift-kafka-client open source project
//
// Copyright (c) 2023 Apple Inc. and the swift-kafka-client project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of swift-kafka-client project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

#include "CNIOBoringSSL_x509.h"
15 changes: 15 additions & 0 deletions Sources/Crdkafka/custom/include/openssl/x509_vfy.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the swift-kafka-client open source project
//
// Copyright (c) 2023 Apple Inc. and the swift-kafka-client project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of swift-kafka-client project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

#include "CNIOBoringSSL_x509_vfy.h"
1 change: 0 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ ENV LANGUAGE en_US.UTF-8
# Dependencies
RUN apt-get update
RUN apt-get install libsasl2-dev -y
RUN apt-get install libssl-dev -y

# tools
RUN mkdir -p $HOME/.tools
Expand Down