Skip to content

Commit 1e20a12

Browse files
authored
reduce the package size (awslabs#653)
1 parent 4696607 commit 1e20a12

File tree

3 files changed

+33
-9
lines changed

3 files changed

+33
-9
lines changed

MANIFEST.in

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,39 @@ global-exclude .git*
44
global-exclude .git*/**
55
global-exclude .travis*
66
global-exclude .travis/**
7+
global-exclude .builder/**
8+
global-exclude format-check.py
9+
global-exclude builder.json
710
global-exclude codebuild/**
11+
global-exclude .clang-format
12+
global-exclude .clang-tidy
813
global-exclude crt/*/verification/**
914
global-exclude crt/*/docs/**
15+
global-exclude crt/*/bin/**
16+
global-exclude crt/*/scripts/**
1017
global-exclude docker-images/**
18+
global-exclude crt/aws-lc/**/test/**
19+
global-exclude crt/aws-lc/**/crypto_test_data*
20+
# aws-lc includes some files from tests during build
21+
global-include crt/aws-lc/**/trampoline-*
22+
global-exclude README*
1123
prune crt/**/AWSCRTAndroidTestRunner
12-
prune crt/aws-c-auth/tests/aws-sig-v4-test-suite
13-
prune crt/aws-c-auth/tests/fuzz/corpus
24+
prune crt/aws-c-auth/tests
25+
prune crt/aws-c-cal/tests
26+
prune crt/aws-c-common/tests
27+
prune crt/aws-c-compression/tests
28+
prune crt/aws-c-io/tests
29+
prune crt/aws-c-mqtt/tests
30+
prune crt/aws-c-s3/tests
31+
prune crt/aws-c-sdkutils/tests
1432
prune crt/aws-c-cal/ecdsa-fuzz-corpus
1533
prune crt/aws-c-s3/benchmarks
1634
prune crt/s2n/tests
17-
# s2n's cmake relies on a some files under test/ for compile time feature tests
18-
graft crt/s2n/tests/features
35+
prune crt/s2n/compliance/specs
1936
exclude crt/aws-lc/**/*test*.go
2037
exclude crt/aws-lc/**/*test*.json
2138
exclude crt/aws-lc/**/*test*.py
2239
exclude crt/aws-lc/**/*test*.txt
23-
prune crt/aws-lc/crypto/cipher_extra/test
2440
prune crt/aws-lc/fuzz
2541
prune crt/aws-lc/ssl
2642
prune crt/aws-lc/tests

continuous-delivery/update-version.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@
44
import re
55
import subprocess
66

7-
tag = subprocess.check_output(['git', 'describe', '--tags'])
8-
# strip the leading v
9-
version = str(tag[1:].strip(), 'utf8')
7+
tag = subprocess.run(['git', 'describe', '--tags'],
8+
capture_output=True, check=True,
9+
text=True).stdout.strip()
10+
# convert v0.2.12-2-g50254a9 to 0.2.12
11+
# test-version-exists will ensure to not include non-tagged commits
12+
version = tag.split('-', 1)[0]
1013
init_path = os.path.join(os.path.dirname(__file__), '..', 'awscrt', '__init__.py')
1114
print("Updating awscrt.__version__ to version {}".format(version))
1215
contents = None

crt/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ include(CTest)
2828

2929
option(AWS_USE_LIBCRYPTO_TO_SUPPORT_ED25519_EVERYWHERE "Set this if you want to use libcrypto to support ed25519 on Window/Apple" ON)
3030

31+
# Use minimal debug info to reduce binary size.
32+
string(REPLACE "-g" "-g1" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
33+
string(REPLACE "-g" "-g1" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
34+
3135
# On Unix we use S2N for TLS and AWS-LC crypto.
3236
# (On Windows and Apple we use the default OS libraries)
3337
if ((UNIX AND NOT APPLE) OR AWS_USE_LIBCRYPTO_TO_SUPPORT_ED25519_EVERYWHERE)
@@ -41,11 +45,12 @@ if ((UNIX AND NOT APPLE) OR AWS_USE_LIBCRYPTO_TO_SUPPORT_ED25519_EVERYWHERE)
4145
-DDISABLE_PERL=ON # Build without using Perl, we don't want the extra dependency
4246
-DBUILD_LIBSSL=OFF # Don't need libssl, only need libcrypto
4347
-DBUILD_TESTING=OFF
48+
-DCMAKE_BUILD_TYPE=RelWithDebInfo # Use the same build type as the rest of the project
4449
)
4550

4651
if (APPLE OR WIN32)
4752
# Libcrypto implementations typically have several chunky pregenerated tables that add a lot
48-
# to artifact size. We dont really need them for ed25519 case on win/mac, so favor
53+
# to artifact size. We dont really need them for ed25519 case on win/mac, so favor
4954
# smaller binary over perf here.
5055
# In future if there is more usage of lc on win/mac consider removing this
5156
list(APPEND AWSLC_CMAKE_ARGUMENTS -DOPENSSL_SMALL=1)

0 commit comments

Comments
 (0)