Skip to content

GH-34157: [C++] Configure bundled AWS SDK to use aws-lc instead of OpenSSL#34159

Merged
kou merged 19 commits intoapache:masterfrom
js8544:jinshang/use_aws_lc
Feb 15, 2023
Merged

GH-34157: [C++] Configure bundled AWS SDK to use aws-lc instead of OpenSSL#34159
kou merged 19 commits intoapache:masterfrom
js8544:jinshang/use_aws_lc

Conversation

@js8544
Copy link
Copy Markdown
Contributor

@js8544 js8544 commented Feb 13, 2023

Using OpenSSL causes various issues like #33808 (comment) and #34111. We should try to use aws-lc for libcrypto and libssl. We need to hide them inside s2n-tls to avoid name conflicts with OpenSSL used by other libraries.

Some notes:

  1. Only linux needs s2n-tls and aws-lc.
  2. Because aws-c-http requires curl which requires libcrypto from OpenSSL, we need to hide Aws::libcrypto by S2N_INTERN_LIBCRYPTO=ON.
  3. aws-c-cal also uses libcrypto, but it can't hide it. So we need to use OpenSSL instead of aws-lc for it.
  4. Mac and windows don't need s2n-tls, but do need some security libs from system, like -framework Security and ncrypt.lib.
  5. arrow-s3fs-test is re-enabled.
  6. Force Java Gandiva to use static protobuf lib.

@github-actions
Copy link
Copy Markdown

@js8544
Copy link
Copy Markdown
Contributor Author

js8544 commented Feb 13, 2023

@github-actions crossbow submit -g cpp -g r

@js8544
Copy link
Copy Markdown
Contributor Author

js8544 commented Feb 13, 2023

@github-actions crossbow submit java-jars

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@js8544
Copy link
Copy Markdown
Contributor Author

js8544 commented Feb 13, 2023

@github-actions crossbow submit -g cpp -g r

@js8544
Copy link
Copy Markdown
Contributor Author

js8544 commented Feb 13, 2023

@github-actions crossbow submit java-jars

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@js8544 js8544 force-pushed the jinshang/use_aws_lc branch from cb07ab5 to 2f77681 Compare February 13, 2023 11:23
@js8544
Copy link
Copy Markdown
Contributor Author

js8544 commented Feb 13, 2023

@github-actions crossbow submit java-jars

@js8544
Copy link
Copy Markdown
Contributor Author

js8544 commented Feb 13, 2023

@github-actions crossbow submit -g cpp -g r

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@js8544
Copy link
Copy Markdown
Contributor Author

js8544 commented Feb 13, 2023

@github-actions crossbow submit java-jars

@js8544
Copy link
Copy Markdown
Contributor Author

js8544 commented Feb 13, 2023

@github-actions crossbow submit -g cpp -g r

@github-actions

This comment was marked as outdated.

@js8544 js8544 force-pushed the jinshang/use_aws_lc branch from 561a147 to e4dcae8 Compare February 13, 2023 14:32
@js8544
Copy link
Copy Markdown
Contributor Author

js8544 commented Feb 13, 2023

@github-actions crossbow submit java-jars

@js8544
Copy link
Copy Markdown
Contributor Author

js8544 commented Feb 13, 2023

@github-actions crossbow submit -g cpp -g r

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@js8544 js8544 force-pushed the jinshang/use_aws_lc branch from e4dcae8 to 09bb8b5 Compare February 13, 2023 14:37
@js8544
Copy link
Copy Markdown
Contributor Author

js8544 commented Feb 13, 2023

@github-actions crossbow submit java-jars

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@js8544
Copy link
Copy Markdown
Contributor Author

js8544 commented Feb 15, 2023

Ah, this is caused by Homebrew/homebrew-core#122277 . Homebrew stopped providing libprotobuf.a.

We need to prepare libprotobuf.a for us. But it is not related to this pull request. Could you open a new issue for it?

Nice find! I thought of this reason but didn't find this change. I created a new issue #34189 for this.

@js8544
Copy link
Copy Markdown
Contributor Author

js8544 commented Feb 15, 2023

CI failures are unrelated. I think this is ready to to merged. cc @kou

@kou
Copy link
Copy Markdown
Member

kou commented Feb 15, 2023

@github-actions crossbow submit -g cpp -g r java-jars

@github-actions

This comment was marked as outdated.

@js8544 js8544 force-pushed the jinshang/use_aws_lc branch from d33a98f to f44c1bf Compare February 15, 2023 07:07
@js8544
Copy link
Copy Markdown
Contributor Author

js8544 commented Feb 15, 2023

@github-actions crossbow submit -g cpp -g r java-jars
I just rebased to fix the zstd version issue.

@github-actions

This comment was marked as outdated.

@github-actions
Copy link
Copy Markdown

Revision: f44c1bf

Submitted crossbow builds: ursacomputing/crossbow @ actions-7b13f07b9d

Task Status
conda-linux-aarch64-cpu-r41 Azure
conda-linux-aarch64-cpu-r42 Azure
conda-linux-x64-cpu-r41 Azure
conda-linux-x64-cpu-r42 Azure
conda-osx-arm64-cpu-r41 Azure
conda-osx-arm64-cpu-r42 Azure
conda-osx-x64-cpu-r41 Azure
conda-osx-x64-cpu-r42 Azure
conda-win-x64-cpu-r41 Azure
homebrew-r-autobrew Github Actions
homebrew-r-brew Github Actions
java-jars Github Actions
r-binary-packages Github Actions
test-alpine-linux-cpp Github Actions
test-build-cpp-fuzz Github Actions
test-conda-cpp Github Actions
test-conda-cpp-valgrind Azure
test-cuda-cpp Github Actions
test-debian-10-cpp-amd64 Github Actions
test-debian-10-cpp-i386 Github Actions
test-debian-11-cpp-amd64 Github Actions
test-debian-11-cpp-i386 Github Actions
test-fedora-35-cpp Github Actions
test-fedora-r-clang-sanitizer Azure
test-r-arrow-backwards-compatibility Github Actions
test-r-depsource-bundled Azure
test-r-depsource-system Github Actions
test-r-dev-duckdb Github Actions
test-r-devdocs Github Actions
test-r-gcc-11 Github Actions
test-r-gcc-12 Github Actions
test-r-install-local Github Actions
test-r-install-local-minsizerel Github Actions
test-r-library-r-base-latest Azure
test-r-linux-as-cran Github Actions
test-r-linux-rchk Github Actions
test-r-linux-valgrind Azure
test-r-minimal-build Azure
test-r-offline-maximal Github Actions
test-r-offline-minimal Azure
test-r-rhub-debian-gcc-devel-lto-latest Azure
test-r-rhub-debian-gcc-release-custom-ccache Azure
test-r-rhub-ubuntu-gcc-release-latest Azure
test-r-rstudio-r-base-4.1-opensuse153 Azure
test-r-rstudio-r-base-4.2-centos7-devtoolset-8 Azure
test-r-rstudio-r-base-4.2-focal Azure
test-r-ubuntu-22.04 Github Actions
test-r-versions Github Actions
test-ubuntu-18.04-cpp Github Actions
test-ubuntu-18.04-cpp-release Github Actions
test-ubuntu-18.04-cpp-static Github Actions
test-ubuntu-18.04-r-sanitizer Azure
test-ubuntu-20.04-cpp Github Actions
test-ubuntu-20.04-cpp-20 Github Actions
test-ubuntu-20.04-cpp-bundled Github Actions
test-ubuntu-20.04-cpp-thread-sanitizer Github Actions
test-ubuntu-22.04-cpp Github Actions

@kou
Copy link
Copy Markdown
Member

kou commented Feb 15, 2023

Sorry. Can we try this?

diff --git a/ci/scripts/java_jni_macos_build.sh b/ci/scripts/java_jni_macos_build.sh
index 391d05642..37bbe1283 100755
--- a/ci/scripts/java_jni_macos_build.sh
+++ b/ci/scripts/java_jni_macos_build.sh
@@ -109,6 +109,7 @@ fi
 popd
 
 
+export JAVA_JNI_CMAKE_ARGS="-DProtobuf_ROOT=${build_dir}/cpp/protobuf_ep-install"
 ${arrow_dir}/ci/scripts/java_jni_build.sh \
   ${arrow_dir} \
   ${install_dir} \

@js8544
Copy link
Copy Markdown
Contributor Author

js8544 commented Feb 15, 2023

@github-actions crossbow submit java-jars

@github-actions
Copy link
Copy Markdown

Revision: 89c547c

Submitted crossbow builds: ursacomputing/crossbow @ actions-4bf574a4e3

Task Status
java-jars Github Actions

@js8544
Copy link
Copy Markdown
Contributor Author

js8544 commented Feb 15, 2023

Sorry. Can we try this?

diff --git a/ci/scripts/java_jni_macos_build.sh b/ci/scripts/java_jni_macos_build.sh
index 391d05642..37bbe1283 100755
--- a/ci/scripts/java_jni_macos_build.sh
+++ b/ci/scripts/java_jni_macos_build.sh
@@ -109,6 +109,7 @@ fi
 popd
 
 
+export JAVA_JNI_CMAKE_ARGS="-DProtobuf_ROOT=${build_dir}/cpp/protobuf_ep-install"
 ${arrow_dir}/ci/scripts/java_jni_build.sh \
   ${arrow_dir} \
   ${install_dir} \

It works. Thanks for suggesting this!

Copy link
Copy Markdown
Member

@kou kou left a comment

Choose a reason for hiding this comment

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

+1

Thanks!

@kou kou merged commit 798b417 into apache:master Feb 15, 2023
@kou
Copy link
Copy Markdown
Member

kou commented Feb 15, 2023

@github-actions crossbow submit -g wheel

@github-actions
Copy link
Copy Markdown

Revision: 89c547c

Submitted crossbow builds: ursacomputing/crossbow @ actions-5407ab76c8

Task Status
wheel-macos-big-sur-cp310-arm64 Github Actions
wheel-macos-big-sur-cp311-arm64 Github Actions
wheel-macos-big-sur-cp38-arm64 Github Actions
wheel-macos-big-sur-cp39-arm64 Github Actions
wheel-macos-mojave-cp310-amd64 Github Actions
wheel-macos-mojave-cp311-amd64 Github Actions
wheel-macos-mojave-cp37-amd64 Github Actions
wheel-macos-mojave-cp38-amd64 Github Actions
wheel-macos-mojave-cp39-amd64 Github Actions
wheel-manylinux2014-cp310-amd64 Github Actions
wheel-manylinux2014-cp310-arm64 Travis CI
wheel-manylinux2014-cp311-amd64 Github Actions
wheel-manylinux2014-cp311-arm64 Travis CI
wheel-manylinux2014-cp37-amd64 Github Actions
wheel-manylinux2014-cp37-arm64 Travis CI
wheel-manylinux2014-cp38-amd64 Github Actions
wheel-manylinux2014-cp38-arm64 Travis CI
wheel-manylinux2014-cp39-amd64 Github Actions
wheel-manylinux2014-cp39-arm64 Travis CI
wheel-windows-cp310-amd64 Github Actions
wheel-windows-cp311-amd64 Github Actions
wheel-windows-cp37-amd64 Github Actions
wheel-windows-cp38-amd64 Github Actions
wheel-windows-cp39-amd64 Github Actions

@kou
Copy link
Copy Markdown
Member

kou commented Feb 15, 2023

@js8544 It seems that we need more work for manylinux wheels. Could you open a new issue for it?

@ursabot
Copy link
Copy Markdown

ursabot commented Feb 15, 2023

Benchmark runs are scheduled for baseline = b955da0 and contender = 798b417. 798b417 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Finished ⬇️0.0% ⬆️0.0%] ec2-t3-xlarge-us-east-2
[Failed ⬇️0.18% ⬆️0.03%] test-mac-arm
[Finished ⬇️0.0% ⬆️0.0%] ursa-i9-9960x
[Finished ⬇️0.22% ⬆️0.03%] ursa-thinkcentre-m75q
Buildkite builds:
[Finished] 798b417e ec2-t3-xlarge-us-east-2
[Finished] 798b417e test-mac-arm
[Finished] 798b417e ursa-i9-9960x
[Finished] 798b417e ursa-thinkcentre-m75q
[Finished] b955da05 ec2-t3-xlarge-us-east-2
[Failed] b955da05 test-mac-arm
[Finished] b955da05 ursa-i9-9960x
[Finished] b955da05 ursa-thinkcentre-m75q
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

@ursabot
Copy link
Copy Markdown

ursabot commented Feb 15, 2023

['Python', 'R'] benchmarks have high level of regressions.
test-mac-arm

kou pushed a commit that referenced this pull request Feb 17, 2023
…ed AWS (#34215)

To fix build failures such as #34159 (comment), we need to help it find OpenSSL.
* Closes: #34214

Authored-by: Jin Shang <shangjin1997@gmail.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
pribor pushed a commit to GlobalWebIndex/arrow that referenced this pull request Oct 24, 2025
… of OpenSSL (apache#34159)

Using OpenSSL causes various issues like apache#33808 (comment) and apache#34111. We should try to use aws-lc for libcrypto and libssl. We need to hide them inside s2n-tls to avoid name conflicts with OpenSSL used by other libraries.

Some notes:
1. Only linux needs s2n-tls and aws-lc.
2. Because aws-c-http requires curl which requires libcrypto from OpenSSL, we need to hide Aws::libcrypto by S2N_INTERN_LIBCRYPTO=ON. 
3. aws-c-cal also uses libcrypto, but it can't hide it. So we need to use OpenSSL instead of aws-lc for it.
4. Mac and windows don't need s2n-tls, but do need some security libs from system, like `-framework Security` and `ncrypt.lib`. 
5. arrow-s3fs-test is re-enabled.
6. Force Java Gandiva to use static protobuf lib.

* Closes: apache#34157

Lead-authored-by: Jin Shang <shangjin1997@gmail.com>
Co-authored-by: jinshang <jinshang@tencent.com>
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[C++] Configure bundled AWS SDK to use aws-lc instead of OpenSSL

3 participants