Skip to content

Commit 64c8a09

Browse files
author
Justin Boswell
authored
Added aws-lc as a submodule, added it to cmake build (#286)
1 parent 492ff21 commit 64c8a09

File tree

10 files changed

+24
-72
lines changed

10 files changed

+24
-72
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
- '!main'
88

99
env:
10-
BUILDER_VERSION: v0.7.6
10+
BUILDER_VERSION: v0.8.11
1111
BUILDER_SOURCE: releases
1212
BUILDER_HOST: https://d19elf31gohf1l.cloudfront.net
1313
PACKAGE_NAME: aws-crt-java
@@ -34,7 +34,8 @@ jobs:
3434
export DOCKER_IMAGE=docker.pkg.github.com/awslabs/aws-crt-builder/aws-crt-${{ matrix.image }}:${{ env.BUILDER_VERSION }}
3535
docker pull $DOCKER_IMAGE
3636
docker run --mount type=bind,source=$(pwd),target=/root/${{ env.PACKAGE_NAME }} \
37-
--env GITHUB_REF $DOCKER_IMAGE build -p ${{ env.PACKAGE_NAME }} --build-dir=/root/${{ env.PACKAGE_NAME }} --spec=downstream
37+
--env GITHUB_REF $DOCKER_IMAGE \
38+
build -p ${{ env.PACKAGE_NAME }} --build-dir=/root/${{ env.PACKAGE_NAME }} --spec=downstream
3839
- uses: actions/upload-artifact@v2
3940
if: failure()
4041
with:
@@ -57,7 +58,8 @@ jobs:
5758
export DOCKER_IMAGE=docker.pkg.github.com/awslabs/aws-crt-builder/aws-crt-al2-x64:${{ env.BUILDER_VERSION }}
5859
docker pull $DOCKER_IMAGE
5960
docker run --mount type=bind,source=$(pwd),target=/root/${{ env.PACKAGE_NAME }} \
60-
--env GITHUB_REF $DOCKER_IMAGE build -p ${{ env.PACKAGE_NAME }} --build-dir=/root/${{ env.PACKAGE_NAME }} --spec=downstream
61+
--env GITHUB_REF $DOCKER_IMAGE \
62+
build -p ${{ env.PACKAGE_NAME }} --build-dir=/root/${{ env.PACKAGE_NAME }} --spec=downstream
6163
- uses: actions/upload-artifact@v2
6264
if: failure()
6365
with:
@@ -70,7 +72,7 @@ jobs:
7072
runs-on: ubuntu-latest
7173
strategy:
7274
matrix:
73-
version: [3, 6, 8, 9]
75+
version: [3, 6, 8, 9, 10, 11]
7476
steps:
7577
# We can't use the `uses: docker://image` version yet, GitHub lacks authentication for actions -> packages
7678
- name: Checkout Sources
@@ -83,7 +85,8 @@ jobs:
8385
export DOCKER_IMAGE=docker.pkg.github.com/awslabs/aws-crt-builder/aws-crt-${{ env.LINUX_BASE_IMAGE }}:${{ env.BUILDER_VERSION }}
8486
docker pull $DOCKER_IMAGE
8587
docker run --mount type=bind,source=$(pwd),target=/root/${{ env.PACKAGE_NAME }} \
86-
--env GITHUB_REF $DOCKER_IMAGE build -p ${{ env.PACKAGE_NAME }} --build-dir=/root/${{ env.PACKAGE_NAME }} --spec=downstream --compiler=clang-${{ matrix.version }}
88+
--env GITHUB_REF $DOCKER_IMAGE \
89+
build -p ${{ env.PACKAGE_NAME }} --build-dir=/root/${{ env.PACKAGE_NAME }} --spec=downstream --compiler=clang-${{ matrix.version }}
8790
- uses: actions/upload-artifact@v2
8891
if: failure()
8992
with:
@@ -109,7 +112,8 @@ jobs:
109112
export DOCKER_IMAGE=docker.pkg.github.com/awslabs/aws-crt-builder/aws-crt-${{ env.LINUX_BASE_IMAGE }}:${{ env.BUILDER_VERSION }}
110113
docker pull $DOCKER_IMAGE
111114
docker run --mount type=bind,source=$(pwd),target=/root/${{ env.PACKAGE_NAME }} \
112-
--env GITHUB_REF $DOCKER_IMAGE build -p ${{ env.PACKAGE_NAME }} --build-dir=/root/${{ env.PACKAGE_NAME }} --spec=downstream --compiler=gcc-${{ matrix.version }}
115+
--env GITHUB_REF $DOCKER_IMAGE \
116+
build -p ${{ env.PACKAGE_NAME }} --build-dir=/root/${{ env.PACKAGE_NAME }} --spec=downstream --compiler=gcc-${{ matrix.version }}
113117
- uses: actions/upload-artifact@v2
114118
if: failure()
115119
with:

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,6 @@
3232
path = crt/aws-c-s3
3333
url = https://github.com/awslabs/aws-c-s3.git
3434

35+
[submodule "aws-lc"]
36+
path = crt/aws-lc
37+
url = https://github.com/awslabs/aws-lc.git

CMakeLists.txt

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,6 @@ set(AWS_LIBRARY_OUTPUT_DIR "${CMAKE_BINARY_DIR}/lib")
4646

4747
if (ANDROID)
4848
set(ANDROID_DEPS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/target/cmake-build/deps/${ANDROID_ABI})
49-
set(LibCrypto_INCLUDE_DIR "${ANDROID_DEPS_DIR}/libcrypto/include" CACHE INTERNAL "")
50-
set(LibCrypto_STATIC_LIBRARY "${ANDROID_DEPS_DIR}/libcrypto/lib/libcrypto.a" CACHE INTERNAL "")
51-
set(LibCrypto_SHARED_LIBRARY "${ANDROID_DEPS_DIR}/libcrypto/lib/libcrypto.so" CACHE INTERNAL "")
52-
53-
if (NOT EXISTS ${LibCrypto_INCLUDE_DIR}/openssl/crypto.h OR
54-
NOT EXISTS ${LibCrypto_STATIC_LIBRARY})
55-
message(FATAL_ERROR "Could not find libcrypto at ${CMAKE_BINARY_DIR}/deps/libcrypto")
56-
endif()
5749
set(AWS_LIBRARY_OUTPUT_DIR "${CMAKE_BINARY_DIR}/../../../lib")
5850
endif()
5951

@@ -65,6 +57,7 @@ if (BUILD_DEPS)
6557
set(BUILD_TESTING OFF)
6658
add_subdirectory(crt/aws-c-common)
6759
if (UNIX AND NOT APPLE)
60+
include(crt/aws-c-cal/cmake/modules/aws-lc.cmake)
6861
add_subdirectory(crt/s2n)
6962
endif()
7063
add_subdirectory(crt/aws-c-io)
@@ -144,7 +137,6 @@ aws_use_package(aws-c-mqtt)
144137
aws_use_package(aws-c-auth)
145138
aws_use_package(aws-c-event-stream)
146139
aws_use_package(aws-c-s3)
147-
aws_use_package(aws-c-s3)
148140

149141
target_link_libraries(${PROJECT_NAME} ${DEP_AWS_LIBS})
150142
if (NOT MSVC AND NOT APPLE)

builder.json

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,12 @@
3333
},
3434
"targets": {
3535
"linux": {
36-
"imports": [
37-
"s2n"
38-
],
3936
"!build_steps": [
40-
"{source_dir}/gradlew :s3-native-client:build -x test -PlibcryptoPath={source_dir}/{libcrypto_path}",
41-
"mvn -B compile -Dlibcrypto.path={libcrypto_path}"
37+
"{source_dir}/gradlew :s3-native-client:build -x test",
38+
"mvn -B compile"
4239
],
4340
"!test_steps": [
44-
"mvn -B test -DforkCount=0 -Dlibcrypto.path={libcrypto_path} -DrerunFailingTestsCount=5"
41+
"mvn -B test -DforkCount=0 -DrerunFailingTestsCount=5"
4542
],
4643
"architectures": {
4744
"armv6": {
@@ -84,17 +81,13 @@
8481
},
8582
"android": {
8683
"imports": [
87-
"s2n",
8884
"android-sdk"
8985
],
9086
"build_env": {
9187
"ANDROID_SDK_ROOT": "{android_sdk_path}"
9288
},
9389
"!build_steps": [
94-
"mvn -B compile -Dlibcrypto.path={libcrypto_path}"
95-
],
96-
"!test_steps": [
97-
"mvn -B test -Dlibcrypto.path={libcrypto_path} -DrerunFailingTestsCount=5"
90+
"{source_dir}/gradlew assemble"
9891
],
9992
"architectures": {
10093
"armv7": {
@@ -124,20 +117,17 @@
124117
}
125118
},
126119
"freebsd": {
127-
"imports": [
128-
"s2n"
129-
],
130120
"packages": [
131121
"openjdk8"
132122
],
133123
"!build_env": {
134124
"JAVA_HOME": "/usr/local/openjdk8"
135125
},
136126
"!build_steps": [
137-
"mvn -B compile -Dlibcrypto.path={libcrypto_path}"
127+
"mvn -B compile"
138128
],
139129
"!test_steps": [
140-
"mvn -B test -Dlibcrypto.path={libcrypto_path} -DrerunFailingTestsCount=5"
130+
"mvn -B test -DrerunFailingTestsCount=5"
141131
]
142132
}
143133
}

crt/aws-lc

Submodule aws-lc added at 129fc37

pom.xml

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@
3636
<cmake.buildtype>RelWithDebInfo</cmake.buildtype>
3737
<cmake.buildconfig>${cmake.buildtype}</cmake.buildconfig>
3838
<cmake.binaries>target/cmake-build</cmake.binaries>
39-
<cmake.libcrypto_include>-DLIBCRYPTO_NOT_USED=1</cmake.libcrypto_include>
40-
<cmake.libcrypto_shared>-DLIBCRYPTO_NOT_USED=1</cmake.libcrypto_shared>
41-
<cmake.libcrypto_static>-DLIBCRYPTO_NOT_USED=1</cmake.libcrypto_static>
42-
<libcrypto.path></libcrypto.path>
4339
<maven.compiler.source>1.8</maven.compiler.source>
4440
<maven.compiler.target>1.8</maven.compiler.target>
4541
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -113,19 +109,6 @@
113109
<cmake.buildtype>Debug</cmake.buildtype>
114110
</properties>
115111
</profile>
116-
<profile>
117-
<id>use-custom-libcrypto</id>
118-
<activation>
119-
<property>
120-
<name>libcrypto.path</name>
121-
</property>
122-
</activation>
123-
<properties>
124-
<cmake.libcrypto_include>-DLibCrypto_INCLUDE_DIR=${libcrypto.path}/include</cmake.libcrypto_include>
125-
<cmake.libcrypto_shared>-DLibCrypto_SHARED_LIBRARY=${libcrypto.path}/lib/libcrypto.so</cmake.libcrypto_shared>
126-
<cmake.libcrypto_static>-DLibCrypto_STATIC_LIBRARY=${libcrypto.path}/lib/libcrypto.a</cmake.libcrypto_static>
127-
</properties>
128-
</profile>
129112
<!-- native compilation -->
130113
<profile>
131114
<id>build-shared-lib</id>
@@ -162,9 +145,6 @@
162145
<argument>-DCMAKE_INSTALL_PREFIX=${cmake.binaries}/install</argument>
163146
<argument>-DCMAKE_C_FLAGS=${cmake.cflags}</argument>
164147
<argument>-DBUILD_TESTING=OFF</argument>
165-
<argument>${cmake.libcrypto_include}</argument>
166-
<argument>${cmake.libcrypto_shared}</argument>
167-
<argument>${cmake.libcrypto_static}</argument>
168148
<argument>-Wno-unused-variables</argument>
169149
<argument>${cmake.generator}</argument>
170150
<argument>${cmake.toolset}</argument>

src/native/build.gradle.kts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ description = "JNI bindings for the AWS Common Runtime"
77

88
buildDir = File("../../build")
99

10-
var libcryptoPath : String? = null
11-
1210
var buildType = "RelWithDebInfo"
1311
if (project.hasProperty("buildType")) {
1412
buildType = project.property("buildType").toString()
@@ -26,22 +24,6 @@ val cmakeConfigure = tasks.register("cmakeConfigure") {
2624
"-DBUILD_TESTING=OFF"
2725
)
2826

29-
if (org.gradle.internal.os.OperatingSystem.current().isLinux()) {
30-
libcryptoPath = null;
31-
// To set this, add -PlibcryptoPath=/path/to/openssl/home on the command line
32-
if (project.hasProperty("libcryptoPath")) {
33-
libcryptoPath = project.property("libcryptoPath").toString()
34-
logger.info("Using project libcrypto path: ${libcryptoPath}")
35-
}
36-
}
37-
38-
if (libcryptoPath != null) {
39-
cmakeArgs += listOf(
40-
"-DLibCrypto_INCLUDE_DIR=${libcryptoPath}/include",
41-
"-DLibCrypto_STATIC_LIBRARY=${libcryptoPath}/lib/libcrypto.a"
42-
)
43-
}
44-
4527
inputs.file("../../CMakeLists.txt")
4628
outputs.file("${buildDir}/cmake-build/CMakeCache.txt")
4729

0 commit comments

Comments
 (0)