Skip to content

Commit

Permalink
Merge pull request #92 from Bit-Quill/lyndon/AT-866-Linux-segfaults
Browse files Browse the repository at this point in the history
AT-867/866/871 - Linux segfault fix, 32-bit linker issue fix, and build instructions
  • Loading branch information
lyndonbauto authored Jul 6, 2021
2 parents 2dee30b + 9c6e2ce commit 85222d2
Show file tree
Hide file tree
Showing 32 changed files with 357 additions and 354 deletions.
265 changes: 132 additions & 133 deletions .github/workflows/linux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,136 +148,135 @@ jobs:
with:
name: linux64-installer-deb
path: installer-deb
# TODO AT-864: Fix linker build issue for 32-bit build.
#build-linux32:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - name: run-cppcheck
# run: |
# sudo apt install cppcheck
# sh run_cppcheck.sh
# - name: upload-cppcheck-results
# if: failure()
# uses: actions/upload-artifact@v2
# with:
# name: cppcheck-results
# path: cppcheck-results.log
# - name: get-dependencies
# run: |
# # Need to install i386 versions
# sudo dpkg --add-architecture i386
# sudo apt update
# sudo apt install unixodbc-dev:i386 odbcinst1debian2:i386 libodbc1:i386 libcurl4-openssl-dev:i386 libssl-dev:i386 uuid-dev:i386 cpp:i386 cpp-9:i386 gcc:i386 g++:i386 zlib1g-dev:i386 linux-headers-$(uname -r) gcc-multilib:i386 g++-multilib:i386 cmake g++-9:i386 gcc-9:i386 gcc-9-multilib:i386 g++-9-multilib:i386 binutils:i386 make:i386
# - name: prepare-dsn
# run: |
# # TODO: This is broken, needs to be
# sudo mv ./src/IntegrationTests/ITODBCConnection/odbc-linux.ini /home/runner/odbc.ini
# sudo mv ./src/IntegrationTests/ITODBCConnection/odbcinst-linux.ini /home/runner/odbcinst.ini
# mkdir ${{ github.workspace }}/odbc-logs
# export ODBCSYSINI=/home/runner
# export ODBCINSTINI=odbcinst.ini
# export ODBCINI=/home/runner/odbc.ini
# printenv ODBCSYSINI ODBCINSTINI ODBCINI
# odbcinst -q -d
# odbcinst -q -s
# odbcinst -j
# cat /home/runner/odbc.ini
# cat /home/runner/odbcinst.ini
# - name: configure-and-build-driver
# run: |
# ./build_linux_release32_rpm.sh
# - name: configure-aws-credentials
# uses: aws-actions/configure-aws-credentials@v1
# with:
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# aws-region: us-east-1
# - name: run-connection-unit-test
# run: |
# ./build/odbc/bin/ut_conn
# - name: run-integration-connection-tests
# if: always()
# run: |
# ./build/odbc/bin/itodbc_connection
# - name: run-integration-execution-tests
# if: always()
# run: |
# ./build/odbc/bin/itodbc_execution
# - name: run-integration-results-tests
# if: always()
# run: |
# ./build/odbc/bin/itodbc_results
# - name: run-integration-descriptors-tests
# if: always()
# run: |
# ./build/odbc/bin/itodbc_descriptors
# - name: run-integration-catalog-tests
# if: always()
# run: |
# ./build/odbc/bin/itodbc_catalog
# - name: run-integration-info-tests
# if: always()
# run: |
# ./build/odbc/bin/itodbc_info
# - name: run-integration-pagination-tests
# if: always()
# run: |
# ./build/odbc/bin/itodbc_pagination
# - name: prepare-test-results
# if: always()
# run: |
# cp /tmp/timestreamodbc_*.log ${{ github.workspace }}/odbc-logs/
# - name: upload-integration-test-results
# if: always()
# uses: actions/upload-artifact@v2
# with:
# name: integration-test-results-linux32
# path: |
# ${{ github.workspace }}/odbc-logs/
# - name: build-installer-rpm
# if: always()
# run: |
# cd cmake-build32
# cmake ../src
# make
# cpack .
# cd ..
# - name: build-installer-deb
# if: always()
# run: |
# ./build_linux_release32_deb.sh
# cd cmake-build32
# cmake ../src
# make
# cpack .
# cd ..
# - name: create-output
# if: success()
# run: |
# mkdir build-output
# mkdir test-output
# mkdir rpm-installer
# mkdir deb-installer
# cp ./build/odbc/lib/*.so build-output/
# cp ./build/odbc/lib/*.a build-output/
# cp ./cmake-build32/*.rpm rpm-installer/
# cp ./cmake-build32/*.deb deb-installer/
# - name: upload-build
# if: success()
# uses: actions/upload-artifact@v2
# with:
# name: linux32-build
# path: build-output
# - name: upload-linux32-installer-rpm
# if: success()
# uses: actions/upload-artifact@v2
# with:
# name: linux32-installer-rpm
# path: installer-rpm
# - name: upload-linux32-installer-deb
# if: success()
# uses: actions/upload-artifact@v2
# with:
# name: linux32-installer-deb
# path: installer-deb
build-linux32:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: run-cppcheck
run: |
sudo apt install cppcheck
sh run_cppcheck.sh
- name: upload-cppcheck-results
if: failure()
uses: actions/upload-artifact@v2
with:
name: cppcheck-results
path: cppcheck-results.log
- name: get-dependencies
run: |
# Need to install i386 versions
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install unixodbc-dev:i386 odbcinst1debian2:i386 libodbc1:i386 libcurl4-openssl-dev:i386 libssl-dev:i386 uuid-dev:i386 cpp:i386 cpp-9:i386 gcc:i386 g++:i386 zlib1g-dev:i386 linux-headers-$(uname -r) gcc-multilib:i386 g++-multilib:i386 cmake g++-9:i386 gcc-9:i386 gcc-9-multilib:i386 g++-9-multilib:i386 binutils:i386 make:i386
- name: prepare-dsn
run: |
# TODO: This is broken, needs to be
sudo mv ./src/IntegrationTests/ITODBCConnection/odbc-linux.ini /home/runner/odbc.ini
sudo mv ./src/IntegrationTests/ITODBCConnection/odbcinst-linux.ini /home/runner/odbcinst.ini
mkdir ${{ github.workspace }}/odbc-logs
export ODBCSYSINI=/home/runner
export ODBCINSTINI=odbcinst.ini
export ODBCINI=/home/runner/odbc.ini
printenv ODBCSYSINI ODBCINSTINI ODBCINI
odbcinst -q -d
odbcinst -q -s
odbcinst -j
cat /home/runner/odbc.ini
cat /home/runner/odbcinst.ini
- name: configure-aws-credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: configure-and-build-driver
run: |
./build_linux_release32_rpm.sh
- name: run-connection-unit-test
run: |
./build/odbc/bin/ut_conn
- name: run-integration-connection-tests
if: always()
run: |
./build/odbc/bin/itodbc_connection
- name: run-integration-execution-tests
if: always()
run: |
./build/odbc/bin/itodbc_execution
- name: run-integration-results-tests
if: always()
run: |
./build/odbc/bin/itodbc_results
- name: run-integration-descriptors-tests
if: always()
run: |
./build/odbc/bin/itodbc_descriptors
- name: run-integration-catalog-tests
if: always()
run: |
./build/odbc/bin/itodbc_catalog
- name: run-integration-info-tests
if: always()
run: |
./build/odbc/bin/itodbc_info
- name: run-integration-pagination-tests
if: always()
run: |
./build/odbc/bin/itodbc_pagination
- name: prepare-test-results
if: always()
run: |
cp /tmp/timestreamodbc_*.log ${{ github.workspace }}/odbc-logs/
- name: upload-integration-test-results
if: always()
uses: actions/upload-artifact@v2
with:
name: integration-test-results-linux32
path: |
${{ github.workspace }}/odbc-logs/
- name: build-installer-rpm
if: always()
run: |
cd cmake-build32
cmake ../src
make
cpack .
cd ..
- name: build-installer-deb
if: always()
run: |
./build_linux_release32_deb.sh
cd cmake-build32
cmake ../src
make
cpack .
cd ..
- name: create-output
if: success()
run: |
mkdir build-output
mkdir test-output
mkdir rpm-installer
mkdir deb-installer
cp ./build/odbc/lib/*.so build-output/
cp ./build/odbc/lib/*.a build-output/
cp ./cmake-build32/*.rpm rpm-installer/
cp ./cmake-build32/*.deb deb-installer/
- name: upload-build
if: success()
uses: actions/upload-artifact@v2
with:
name: linux32-build
path: build-output
- name: upload-linux32-installer-rpm
if: success()
uses: actions/upload-artifact@v2
with:
name: linux32-installer-rpm
path: installer-rpm
- name: upload-linux32-installer-deb
if: success()
uses: actions/upload-artifact@v2
with:
name: linux32-installer-deb
path: installer-deb
10 changes: 0 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,6 @@ jobs:
if: success()
run: |
.\scripts\build_installer.ps1 Release Win32 .\src $Env:ODBC_BUILD_PATH $Env:AWS_SDK_INSTALL_PATH
#- name: test
# run: |
# cp .\\libraries\\VisualLeakDetector\\bin32\\*.* .\\bin32\\Release
# cp .\\libraries\\VisualLeakDetector\\lib32\\*.lib .\\lib32\\Release
# .\run_test_runner.bat
- name: prepare-output
if: always()
run: |
Expand Down Expand Up @@ -163,11 +158,6 @@ jobs:
if: success()
run: |
.\scripts\build_installer.ps1 Release x64 .\src $Env:ODBC_BUILD_PATH $Env:AWS_SDK_INSTALL_PATH
#- name: test
# run: |
# cp .\\libraries\\VisualLeakDetector\\bin64\\*.* .\\bin64\\Release
# cp .\\libraries\\VisualLeakDetector\\lib64\\*.lib .\\lib64\\Release
# .\run_test_runner.bat
- name: prepare-output
if: always()
run: |
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/release-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ jobs:
cp ./build/odbc/lib/*.dylib build-output/
cp ./build/odbc/lib/*.a build-output/
cp ./cmake-build64/*.pkg installer/
# cp $(ls -d bin64/* | grep -v "\.") build
- name: upload-build
if: success()
uses: actions/upload-artifact@v2
Expand Down
7 changes: 4 additions & 3 deletions build_linux_release32_deb.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
# Build AWS SDK
# $BITNESS=32

TOOLCHAIN="$(pwd)/src/linux_32bit_toolchain.cmake"
cd src
git clone --recurse-submodules -b "1.8.186" "https://github.com/aws/aws-sdk-cpp.git"
cd aws-sdk-cpp
mkdir install
mkdir build
cd build
cmake ../ -DCMAKE_BUILD_TYPE="Release" -DBUILD_ONLY="core;sts;timestream-query" -DCUSTOM_MEMORY_MANAGEMENT="OFF" -DENABLE_TESTING="OFF" -DBUILD_SHARED_LIBS="OFF" -DCMAKE_CXX_FLAGS="-m32" -DCMAKE_C_FLAGS="-m32" -DCMAKE_SHARED_LINKER_FLAGS="-m32"
cmake ../ -DCMAKE_BUILD_TYPE="Release" -DBUILD_ONLY="core;sts;timestream-query" -DCUSTOM_MEMORY_MANAGEMENT="OFF" -DENABLE_TESTING="OFF" -DCMAKE_TOOLCHAIN_FILE="${TOOLCHAIN}"
# Rerun to set the install prefix (https://github.com/aws/aws-sdk-cpp/issues/1156)
cmake ../ -DCMAKE_INSTALL_PREFIX="../install" -DCMAKE_BUILD_TYPE="Release" -DBUILD_ONLY="core;sts;timestream-query" -DCUSTOM_MEMORY_MANAGEMENT="OFF" -DENABLE_TESTING="OFF" -DBUILD_SHARED_LIBS="OFF" -DCMAKE_CXX_FLAGS="-m32" -DCMAKE_C_FLAGS="-m32" -DCMAKE_SHARED_LINKER_FLAGS="-m32"
cmake ../ -DCMAKE_INSTALL_PREFIX="../install" -DCMAKE_BUILD_TYPE="Release" -DBUILD_ONLY="core;sts;timestream-query" -DCUSTOM_MEMORY_MANAGEMENT="OFF" -DENABLE_TESTING="OFF" -DCMAKE_TOOLCHAIN_FILE="${TOOLCHAIN}"
make -j 4
make install
cd ../../../

PREFIX_PATH=$(pwd)
mkdir cmake-build32
cd cmake-build32
cmake ../src -DCMAKE_BUILD_TYPE="Release" -DBUILD_WITH_TESTS="ON" -DCODE_COVERAGE="OFF" -DBUILD_SHARED_LIBS="OFF" -DINSTALLER_TYPE="DEB" -DCMAKE_TOOLCHAIN_FILE="linux_32bit_toolchain.cmake"
cmake ../src -DCMAKE_BUILD_TYPE="Release" -DBUILD_WITH_TESTS="ON" -DCODE_COVERAGE="OFF" -DBUILD_SHARED_LIBS="OFF" -DINSTALLER_TYPE="DEB" -DCMAKE_TOOLCHAIN_FILE="${TOOLCHAIN}"
make -j 4
cd ..
7 changes: 4 additions & 3 deletions build_linux_release32_rpm.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
# Build AWS SDK
# $BITNESS=32

TOOLCHAIN="$(pwd)/src/linux_32bit_toolchain.cmake"
cd src
git clone --recurse-submodules -b "1.8.186" "https://github.com/aws/aws-sdk-cpp.git"
cd aws-sdk-cpp
mkdir install
mkdir build
cd build
cmake ../ -DCMAKE_BUILD_TYPE="Release" -DBUILD_ONLY="core;sts;timestream-query" -DCUSTOM_MEMORY_MANAGEMENT="OFF" -DENABLE_TESTING="OFF" -DBUILD_SHARED_LIBS="OFF" -DCMAKE_CXX_FLAGS="-m32" -DCMAKE_C_FLAGS="-m32" -DCMAKE_SHARED_LINKER_FLAGS="-m32"
cmake ../ -DCMAKE_BUILD_TYPE="Release" -DBUILD_ONLY="core;sts;timestream-query" -DCUSTOM_MEMORY_MANAGEMENT="OFF" -DENABLE_TESTING="OFF" -DCMAKE_TOOLCHAIN_FILE="${TOOLCHAIN}"
# Rerun to set the install prefix (https://github.com/aws/aws-sdk-cpp/issues/1156)
cmake ../ -DCMAKE_INSTALL_PREFIX="../install" -DCMAKE_BUILD_TYPE="Release" -DBUILD_ONLY="core;sts;timestream-query" -DCUSTOM_MEMORY_MANAGEMENT="OFF" -DENABLE_TESTING="OFF" -DBUILD_SHARED_LIBS="OFF" -DCMAKE_CXX_FLAGS="-m32" -DCMAKE_C_FLAGS="-m32" -DCMAKE_SHARED_LINKER_FLAGS="-m32"
cmake ../ -DCMAKE_INSTALL_PREFIX="../install" -DCMAKE_BUILD_TYPE="Release" -DBUILD_ONLY="core;sts;timestream-query" -DCUSTOM_MEMORY_MANAGEMENT="OFF" -DENABLE_TESTING="OFF" -DBUILD_SHARED_LIBS="OFF" -DCMAKE_TOOLCHAIN_FILE="${TOOLCHAIN}"
make -j 4
make install
cd ../../../

PREFIX_PATH=$(pwd)
mkdir cmake-build32
cd cmake-build32
cmake ../src -DCMAKE_BUILD_TYPE="Release" -DBUILD_WITH_TESTS="ON" -DCODE_COVERAGE="OFF" -DBUILD_SHARED_LIBS="OFF" -DINSTALLER_TYPE="RPM" -DCMAKE_TOOLCHAIN_FILE="linux_32bit_toolchain.cmake"
cmake ../src -DCMAKE_BUILD_TYPE="Release" -DBUILD_WITH_TESTS="ON" -DCODE_COVERAGE="OFF" -DBUILD_SHARED_LIBS="OFF" -DINSTALLER_TYPE="RPM" -DCMAKE_TOOLCHAIN_FILE="${TOOLCHAIN}"
make -j 4
cd ..
Loading

0 comments on commit 85222d2

Please sign in to comment.