From 4e32a1c2cdc3e358ce9ffc008d28e8ce2381ea14 Mon Sep 17 00:00:00 2001 From: "Jonathan M. Henson" Date: Fri, 25 Jan 2019 14:35:41 -0800 Subject: [PATCH] =?UTF-8?q?Updated=20git=20tags=20for=20aws-c-common=20and?= =?UTF-8?q?=20aws-c-io,=20added=20lib64=20path=20supp=E2=80=A6=20(#30)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Updated git tags for aws-c-common and aws-c-io, added lib64 path support for python build, added codebuild jobs for manylinux1 builds. * Update s2n for the BSD fixes while we're at it. --- aws-c-common | 2 +- aws-c-io | 2 +- codebuild/ancient-linux-x64.yml | 19 +++++++++++++++++++ codebuild/ancient-linux-x86.yml | 19 +++++++++++++++++++ s2n | 2 +- setup.py | 25 +++++++++++++++---------- 6 files changed, 56 insertions(+), 13 deletions(-) create mode 100644 codebuild/ancient-linux-x64.yml create mode 100644 codebuild/ancient-linux-x86.yml diff --git a/aws-c-common b/aws-c-common index 67262a9a4..5ece8a4a8 160000 --- a/aws-c-common +++ b/aws-c-common @@ -1 +1 @@ -Subproject commit 67262a9a458585400187417d49c39c737507f671 +Subproject commit 5ece8a4a816cbb81e4a0fd55eb13553de25e28ac diff --git a/aws-c-io b/aws-c-io index 3da314e54..711ef5a98 160000 --- a/aws-c-io +++ b/aws-c-io @@ -1 +1 @@ -Subproject commit 3da314e5444614f784a6f6e206999f7255b41078 +Subproject commit 711ef5a981f83d49f96e65eda1b92cef34983869 diff --git a/codebuild/ancient-linux-x64.yml b/codebuild/ancient-linux-x64.yml new file mode 100644 index 000000000..d98961334 --- /dev/null +++ b/codebuild/ancient-linux-x64.yml @@ -0,0 +1,19 @@ +version: 0.2 +#this build spec assumes the manylinux1 image for pypi +#additional packages we installed: cmake 3.5, libcrypto 1.1.0j, gcc 4.8.4 +phases: + install: + commands: + pre_build: + commands: + - export CC=gcc + build: + commands: + - echo Build started on `date` + - git submodule update --init + - /opt/python/cp35-cp35m/bin/python setup.py sdist bdist_wheel + - /opt/python/cp27-cp27m/bin/python setup.py sdist bdist_wheel + post_build: + commands: + - echo Build completed on `date` + diff --git a/codebuild/ancient-linux-x86.yml b/codebuild/ancient-linux-x86.yml new file mode 100644 index 000000000..9ebda0b9a --- /dev/null +++ b/codebuild/ancient-linux-x86.yml @@ -0,0 +1,19 @@ +version: 0.2 +#this build spec assumes the manylinux1 x86 image for pypi +#additional packages we installed: cmake 3.5, libcrypto 1.1.0j, gcc 4.8.4 +phases: + install: + commands: + pre_build: + commands: + - export CC=gcc + build: + commands: + - echo Build started on `date` + - git submodule update --init + - /opt/python/cp35-cp35m/bin/python setup.py sdist bdist_wheel + - /opt/python/cp27-cp27m/bin/python setup.py sdist bdist_wheel + post_build: + commands: + - echo Build completed on `date` + diff --git a/s2n b/s2n index 383586162..e23fb83e8 160000 --- a/s2n +++ b/s2n @@ -1 +1 @@ -Subproject commit 383586162b3ee60bbd75105fcfe583b14bf60d46 +Subproject commit e23fb83e80f567c225279cdeb6c9e271b2ff459c diff --git a/setup.py b/setup.py index 1a51b2ef9..96123c0cb 100644 --- a/setup.py +++ b/setup.py @@ -93,15 +93,19 @@ def determine_generator_string(): os.mkdir(build_dir) os.chdir(build_dir) +lib_dir = 'lib' dep_install_path = os.path.join(build_dir, 'install') if 'AWS_C_INSTALL' in os.environ: dep_install_path = os.getenv('AWS_C_INSTALL') + if os.path.exists(os.path.join(dep_install_path, 'lib64')): + lib_dir = 'lib64' -def build_dependency(lib_name, pass_dversion_libs=True): +def build_dependency(lib_name): lib_source_dir = os.path.join(current_dir, lib_name) - + global lib_dir # Skip library if it wasn't pulled if not os.path.exists(os.path.join(lib_source_dir, 'CMakeLists.txt')): + lib_dir = 'lib' return lib_build_dir = os.path.join(build_dir, lib_name) @@ -116,9 +120,9 @@ def build_dependency(lib_name, pass_dversion_libs=True): '-DCMAKE_PREFIX_PATH={}'.format(dep_install_path), '-DCMAKE_INSTALL_PREFIX={}'.format(dep_install_path), '-DBUILD_SHARED_LIBS=OFF', + '-DCMAKE_INSTALL_LIBDIR={}'.format(lib_dir), ] - if pass_dversion_libs: - cmake_args.append('-DVERSION_LIBS=OFF') + cmake_args.append(lib_source_dir) build_cmd = ['cmake', '--build', './', '--config', 'release', '--target', 'install'] @@ -126,9 +130,10 @@ def build_dependency(lib_name, pass_dversion_libs=True): ret_code = subprocess.check_call(build_cmd, stderr=subprocess.STDOUT, shell=shell) os.chdir(build_dir) + return ret_code if sys.platform != 'darwin' and sys.platform != 'win32': - build_dependency('s2n', pass_dversion_libs=False) + build_dependency('s2n') build_dependency('aws-c-common') build_dependency('aws-c-io') build_dependency('aws-c-mqtt') @@ -145,7 +150,7 @@ def build_dependency(lib_name, pass_dversion_libs=True): include_dirs = [path.join(dep_install_path, 'include')] libraries = list(aws_c_libs) -library_dirs = [path.join(dep_install_path, 'lib')] +library_dirs = [path.join(dep_install_path, lib_dir)] extra_objects = [] if compiler_type == 'msvc': @@ -167,11 +172,11 @@ def build_dependency(lib_name, pass_dversion_libs=True): pass ldflags += ['-framework Security'] include_dirs = ['/usr/local/include'] + include_dirs - library_dirs = ['/usr/local/lib'] + library_dirs - extra_objects = ['{}/lib/lib{}.a'.format(dep_install_path, lib) for lib in aws_c_libs] + library_dirs = ['/usr/local/' + lib_dir] + library_dirs + extra_objects = ['{}/{}/lib{}.a'.format(dep_install_path, lib_dir, lib) for lib in aws_c_libs] else: include_dirs = ['/usr/local/include'] + include_dirs - library_dirs = ['/usr/local/lib'] + library_dirs + library_dirs = ['/usr/local/' + lib_dir] + library_dirs libraries += ['s2n', 'crypto'] aws_c_libs += ['s2n'] try: @@ -194,7 +199,7 @@ def build_dependency(lib_name, pass_dversion_libs=True): ('MINOR_VERSION', '0'), ], include_dirs = ['/usr/local/include', dep_install_path + '/include'], - library_dirs = ['/usr/local/lib', dep_install_path + '/lib'], + library_dirs = ['/usr/local/' + lib_dir, dep_install_path + '/' + lib_dir], libraries = libraries, sources = [ 'source/module.c',