Skip to content
This repository was archived by the owner on Aug 22, 2024. It is now read-only.

Commit bf26105

Browse files
authored
Build fixes (aws#355)
* Make sure AWS_CRYPTOSDK_PRIVATE_GITVERSION is defined in version.h When build system couldn't detect a git version, this variable was unset and causing build failures * Don't run any network tests if AWS_ENC_SDK_END_TO_END_TESTS is FALSE * Small fix to test to allow it to work on old Red Hat versions MAP_ANONYMOUS is not defined without it on some older systems * Update patch version number and changelog
1 parent a69cee8 commit bf26105

File tree

6 files changed

+24
-14
lines changed

6 files changed

+24
-14
lines changed

CHANGELOG.rst

+6
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,9 @@ Changelog
1010
===================
1111
* Fixed cmake bug regarding git version of KMS user agent
1212
* Added CBMC header file needed by newer aws-c-common versions
13+
14+
0.1.2 -- 2019-02-28
15+
===================
16+
* Fixed empty string bug on git version of KMS user agent
17+
* Local tests only by default
18+
* Fix of MAP_ANONYMOUS issue for older Linuxes

CMakeLists.txt

+5-3
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,7 @@ include(TestLibraryPath)
4444
include(CheckLibraryExists)
4545
include(CodeCoverageFlags)
4646

47-
# TODO: Static link?
4847
include(FindOpenSSL)
49-
# For tests
50-
include(FindCURL)
5148

5249
set(PROJECT_NAME aws-encryption-sdk)
5350

@@ -61,6 +58,11 @@ set(REDUCE_TEST_ITERATIONS FALSE
6158
set(BUILD_SHARED_LIBS FALSE
6259
CACHE BOOL "Build aws-encryption-sdk-c as a shared library")
6360

61+
option(AWS_ENC_SDK_END_TO_END_TESTS "Enable end-to-end tests. If set to FALSE (the default), runs local tests only.")
62+
if(AWS_ENC_SDK_END_TO_END_TESTS)
63+
include(FindCURL)
64+
endif()
65+
6466
option(PERFORM_HEADER_CHECK "Performs compile-time checks that each header can be included independently. Requires a C++ compiler.")
6567

6668
option(VALGRIND_TEST_SUITE "Run the test suite under valgrind")

aws-encryption-sdk-cpp/CMakeLists.txt

-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
# limitations under the License.
1414
#
1515

16-
# End-to-End tests might require special permissions
17-
option(AWS_ENC_SDK_END_TO_END_TESTS "Enable End-to-End tests")
18-
1916
file(GLOB AWS_CRYPTOSDK_CPP_HEADERS
2017
# Headers subject to API/ABI stability guarantees
2118
"${CMAKE_CURRENT_SOURCE_DIR}/include/aws/cryptosdk/cpp/*.h"

include/aws/cryptosdk/version.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,13 @@
5050
* @{
5151
*/
5252

53+
#ifndef AWS_CRYPTOSDK_PRIVATE_GITVERSION
54+
# define AWS_CRYPTOSDK_PRIVATE_GITVERSION ""
55+
#endif
56+
5357
#define AWS_CRYPTOSDK_VERSION_MAJOR 0
5458
#define AWS_CRYPTOSDK_VERSION_MINOR 1
55-
#define AWS_CRYPTOSDK_VERSION_PATCH 1
59+
#define AWS_CRYPTOSDK_VERSION_PATCH 2
5660

5761
#ifndef AWS_CRYPTOSDK_DOXYGEN // undocumented private helpers
5862
# define AWS_CRYPTOSDK_PRIVATE_QUOTEARG(a) # a

tests/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ if (REDUCE_TEST_ITERATIONS)
7171
target_compile_definitions(test_decryption_vectors PRIVATE REDUCE_TEST_ITERATIONS)
7272
endif()
7373

74-
if(CURL_FOUND)
74+
if(AWS_ENC_SDK_END_TO_END_TESTS AND CURL_FOUND)
7575
add_executable(t_encrypt_compat integration/t_encrypt_compat.c)
7676
set_target_properties(t_encrypt_compat PROPERTIES
7777
C_STANDARD 99
@@ -81,7 +81,7 @@ if(CURL_FOUND)
8181
target_sources(t_encrypt_compat PRIVATE ${UNIT_TEST_SRC_CPP})
8282
target_include_directories(t_encrypt_compat PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/lib)
8383
aws_add_test(integration_encrypt_compatibility ${VALGRIND} ${CMAKE_CURRENT_BINARY_DIR}/t_encrypt_compat)
84-
endif(CURL_FOUND)
84+
endif(AWS_ENC_SDK_END_TO_END_TESTS AND CURL_FOUND)
8585

8686
aws_add_test(cipher ${VALGRIND} ${CMAKE_CURRENT_BINARY_DIR}/unit-test-suite cipher)
8787
aws_add_test(header ${VALGRIND} ${CMAKE_CURRENT_BINARY_DIR}/unit-test-suite header)

tests/unit/t_header.c

+6-5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
* limitations under the License.
1414
*/
1515

16+
#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
17+
# define _BSD_SOURCE
18+
# include <sys/mman.h>
19+
# include <unistd.h>
20+
#endif
21+
1622
#include <aws/common/hash_table.h>
1723
#include <aws/common/string.h>
1824
#include <aws/cryptosdk/edk.h>
@@ -24,11 +30,6 @@
2430
#include "testing.h"
2531
#include "testutil.h"
2632

27-
#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
28-
# include <sys/mman.h>
29-
# include <unistd.h>
30-
#endif
31-
3233
#ifdef _MSC_VER
3334
# include <malloc.h>
3435
# define alloca _alloca

0 commit comments

Comments
 (0)