-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CMake build improvements #441
base: develop-pre-1.5.3
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #441 +/- ##
===========================================
- Coverage 63.93% 63.76% -0.18%
===========================================
Files 32 32
Lines 5077 5078 +1
===========================================
- Hits 3246 3238 -8
- Misses 1831 1840 +9 ☔ View full report in Codecov by Sentry. |
* Added 1-20% jitter to expiration value stored by AwsCredentials struct. This is part of a larger effort to help customers with large fleets distribute the timings of their attempts to reconnect to our servers. * reduced clumped distribution between 1-2% * fix auth query template, used by signAwsRequestInfoQueryParam * aws service configurable for presigned urls, eg s3 * Update PIC to include modified threadpool teardown * use git tag commit from pic-develop * Update PIC to include modified threadpool teardown * use git tag commit from pic-develop * Set newly added timeouts to default value * Expose CONSTRAINED_DEVICE option * use develop tag * Add logging section (#417) * Introduce M1 build in the CI (#419) * m1 build * cmake update * run tests in m1 * Add setting of fragment meta to the sample * Formatting + style * More style * Small optimization * Update readme * Clang format * Clang format, again * Add gcc paths (#420) * spotaws PR #226 (#423) * proper versioned shared libs * Fix version * Update to latest version * Exclude shared builds from windows --------- Co-authored-by: Tom spot Callaway <[email protected]> Co-authored-by: Divya Sampath Kumar <[email protected]> Co-authored-by: Hassan Sahibzada <[email protected]> * Revert "Pr 323" * Added Iot credential usage to producer c samples (#220) * Added Iot credential usage to producer c samples * Refactor samples to include IoT usage and update readme --------- Co-authored-by: delaplan <[email protected]> Co-authored-by: Divya Sampath Kumar <[email protected]> * Update thing name length to be 128 as per AWS docs (#426) * Release build for producer C (#428) * Release build for producer C * Fix assert failure * Handle aws special regions (#430) * run windows tests with debug logging (#431) * run windows tests with debug logging * zero out frame buffer to avoid invalid mkv * fix tsan related issues (#427) fix tsan related issues * update pic hash to release candidate * add gcc m1 build * bump version for release * Add PR description lint (#438) * update pic to release tag --------- Co-authored-by: James Delaplane <[email protected]> Co-authored-by: Michael Dietz <[email protected]> Co-authored-by: Niyati Maheshwari <[email protected]> Co-authored-by: Divya Sampath Kumar <[email protected]> Co-authored-by: Dave Johansen <[email protected]> Co-authored-by: Niyati Maheshwari <[email protected]> Co-authored-by: Jeremy Gunawan <[email protected]> Co-authored-by: Stefan Kieszkowski <[email protected]> Co-authored-by: Tom spot Callaway <[email protected]> Co-authored-by: Jeremy Gunawan <[email protected]> Co-authored-by: delaplan <[email protected]>
@@ -1,3 +1,4 @@ | |||
REM NOTE: May need to replace "Enterprise" with "Community" int the below command |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: int -> in
This reverts commit 93993b0.
Something to consider:
|
message(${CC_NAME}) | ||
if(${CC_NAME} MATCHES ".*gcc-.*") | ||
build_dependency(gtest) | ||
endif() | ||
endif() | ||
|
||
find_package(PkgConfig REQUIRED) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: PkgConfig probably does not need to be checked for on Windows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yet to review the rest. But publishing first half.
project(KinesisVideoProducerC VERSION 1.5.1 LANGUAGES C) | ||
|
||
set(KINESIS_VIDEO_PRODUCER_C_MAJOR_VERSION 1) | ||
set(KINESIS_VIDEO_PRODUCER_C_MINOR_VERSION 5) | ||
set(KINESIS_VIDEO_PRODUCER_C_PATCH_VERSION 1) | ||
set(KINESIS_VIDEO_PRODUCER_C_VERSION ${KINESIS_VIDEO_PRODUCER_C_MAJOR_VERSION}.${KINESIS_VIDEO_PRODUCER_C_MINOR_VERSION}.${KINESIS_VIDEO_PRODUCER_C_PATCH_VERSION}) | ||
|
||
include(GNUInstallDirs) | ||
set(SUPPORTED_CRYPTO_LIBRARIES "{OpenSSL, MbedTLS}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
option(USE_OPENSSL "Use openssl as crypto library" ON) | ||
option(USE_MBEDTLS "Use mbedtls as crypto library" OFF) | ||
option(BUILD_COMMON_LWS "Whether or not to build ProducerC libwebsockets common library" OFF) | ||
option(BUILD_COMMON_CURL "Whether or not to build ProducerC curl common library" ON) | ||
option(BUILD_STATIC "Static build" OFF) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a CI for this and also add a verification step in the CI to confirm the generated libraries are in fact static? Similar to this:
https://github.com/awslabs/amazon-kinesis-video-streams-webrtc-sdk-c/blob/develop/.github/workflows/ci.yml#L801-L805
option(BUILD_OPENSSL_PLATFORM "If buildng OpenSSL what is the target platform" OFF) | ||
option(LOCAL_OPENSSL_BUILD "Whether or not to use local OpenSSL build" OFF) | ||
option(BUILD_CRYPTO "Whether to build OpenSSL or MbedTLS, if not, will use system-installed version" ON) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice!
if (NOT OPEN_SRC_INSTALL_PREFIX) | ||
set(OPEN_SRC_INSTALL_PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/open-source) | ||
set(OPEN_SRC_INSTALL_PREFIX ${CMAKE_SOURCE_DIR}/open-source) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be ${CMAKE_CURRENT_SOURCE_DIR}
? Did we test webrtc with this build to confirm it works and does not break existing behavior if OPEN_SRC_INSTALL_PREFIX
is not set?
option(BUILD_COMMON_CURL "Whether or not to build ProducerC curl common library" ON) | ||
option(BUILD_STATIC "Static build" OFF) | ||
option(BUILD_DEPENDENCIES "Whether to build dependency libraries from source" ON) # This is a master OFF switch, none will be built if off, but if it is ON, some can be specified to be not built | ||
option(BUILD_COMMON_LWS "Whether to build ProducerC libwebsockets common library" OFF) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. For future enhancements, let us see if we can mask these behind a BUILD_ONLY
overarching flag. Similar to how AWS SDK does: https://github.com/aws/aws-sdk-cpp/blob/main/docs/CMake_Parameters.md#build_only
set(BUILD_ARGS -DBUILD_STATIC=${BUILD_STATIC} | ||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} | ||
-DOPENSSL_DIR=${OPEN_SRC_INSTALL_PREFIX} | ||
-DUSE_OPENSSL=${USE_OPENSSL} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we removing this?
What was changed?
Build improvements including the following:
cmake ..
twice for M1 CI testsWhy was it changed?
The SDK build can be very inconsistent when we use
find_package
andpkg_check_modules
for project-built-from-source dependencies. Sometimes they find the system-installed libraries instead of the ones this project builds from source, and this has been the cause for some CI build failures. These commands are no longer used when building the dependencies from source along with the project because setting the known include/header and library directories is sufficient - these are both always in our open-source folder that is generated during the build configurationcmake ..
stage.These kind of build issues were also experienced when building locally on Mac, specifically when there was a rouge version of KVS PIC SDK installed in the usr/local/lib default system library directory and when there was already an openssl library installed via HomeBrew.
How was it changed?
This project's CMakeLists.txt and CI jobs were modified as described in the above sections.
What testing was done for the changes?
otool -L <library>.dylib
was used with the local M2 Mac build to verify that Producer C SDK's dependencies and the Producer C SDK itself when built as a dependency for the above SDKs were not linked to duplicate dependency librariesDraft PR for Producer CPP tests: awslabs/amazon-kinesis-video-streams-producer-sdk-cpp#1154
Draft PR for WebRTC C tests: awslabs/amazon-kinesis-video-streams-webrtc-sdk-c#1952
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.