Skip to content
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

Attempt mac build on cloud. #186

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
558b292
Attempt mac build on cloud.
kumaakh Jan 4, 2023
23dc842
use gnu-tar
kumaakh Jan 4, 2023
3c981d2
fixes
kumaakh Jan 4, 2023
05b2d0b
try without GST
kumaakh Jan 4, 2023
a01d071
Leap of faith, try with the latest vcpkg
kumaakh Jan 5, 2023
6ceb8f0
use latest vcpkg
kumaakh Jan 5, 2023
41025c3
add json-glib
kumaakh Jan 5, 2023
54aa9b8
libsoup version
kumaakh Jan 5, 2023
6a6cfae
dont use libsoup in mac_osx_build
kumaakh Jan 9, 2023
81d56ac
no libsoup on mac osx build
kumaakh Jan 9, 2023
23c4015
no soup
kumaakh Jan 9, 2023
2c15f72
save the update
kumaakh Jan 11, 2023
80c7f54
lets try building everything with latest codebase
kumaakh Feb 2, 2023
671ffd1
try without libpcre and check for python version
kumaakh Feb 2, 2023
ea02c39
try without lzma and fix some warnings
kumaakh Feb 3, 2023
eebf09b
use older ffmpeg
kumaakh Feb 3, 2023
2ff3101
try to use older ffmpeg
kumaakh Feb 3, 2023
855990f
Added YUYV Metadata (#174)
yashrajsapra Feb 3, 2023
20f4322
use pre build vcpkg tool for arm, there is no official version
kumaakh Feb 3, 2023
90c5f68
libtool issue fix
kumaakh Feb 3, 2023
727d877
use the correct version of gstreamer
kumaakh Feb 3, 2023
fd16dcc
fix gstreamer build
kumaakh Feb 4, 2023
a76e929
gstreamer fix yet again
kumaakh Feb 4, 2023
fdec9c5
Update targetver.h
kumaakh Feb 4, 2023
0a38bc1
Update stdafx.h
kumaakh Feb 4, 2023
87cbf85
reinstate the cida related lines in vcpkg.json
kumaakh Feb 4, 2023
4081359
Attempt mac build on cloud.
kumaakh Jan 4, 2023
9e71304
jlt
kumaakh Feb 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/CI-Linux-ARM64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
is-selfhosted: true
cuda: 'ON'
prep-cmd: 'echo skipping builder prep as I can not sudo'
bootstrap-cmd: 'cp ./thirdparty/vcpkg-tool/arm64/vcpkg ./vcpkg/ && chmod a+x ./vcpkg/vcpkg && export VCPKG_FORCE_SYSTEM_BINARIES=1 && ./vcpkg/vcpkg --version'
is-build-gst: false
cache-path: './none'
cmake-conf-cmd: 'export VCPKG_FORCE_SYSTEM_BINARIES=1 && cmake -B . -DENABLE_ARM64=ON ../base'
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/CI-Mac-NoCUDA.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI-Mac-NoCUDA

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

env:
NOTE_TO_SELF: "environments can not be passed from here to reused workflows!"

jobs:
mac-nocuda-build-prep:
uses: ./.github/workflows/build-test-mac.yml
with:
runner: 'macos-latest'
flav: Mac
is-selfhosted: false
is-build-gst: false
is-prep-phase: true
cuda: 'OFF'
nProc: 3
mac-nocuda-build-test:
needs: mac-nocuda-build-prep
uses: ./.github/workflows/build-test-mac.yml
with:
runner: 'macos-latest'
flav: Mac
is-selfhosted: false
is-build-gst: false # part of vcpkg on mac
is-prep-phase: false
cuda: 'OFF'
nProc: 3
mac-nocuda-publish:
needs: mac-nocuda-build-test
permissions:
checks: write
pull-requests: write
uses: ./.github/workflows/publish-test.yml
with:
flav: Mac
secrets:
GIST_TOKEN: ${{ secrets.GIST_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/build-test-lin-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ on:
prep-check-cmd:
type: string
description: 'command to check if the builder is ready'
default: 'cmake --version ; ninja --version ; gcc --version ; git --version; pwsh --version ||true '
default: 'cmake --version ; ninja --version ; gcc --version ; git --version; python --version; pwsh --version ||true '
#pwsh is required on self hosted runners: see here: https://learn.microsoft.com/en-us/powershell/scripting/install/install-other-linux?view=powershell-7.2#installation-using-a-binary-archive-file
required: false
bootstrap-cmd:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-test-lin-wsl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ on:
prep-check-cmd:
type: string
description: 'command to check if the builder is ready'
default: 'cmake --version ; ninja --version ; gcc --version ; git --version; pwsh --version ||true '
default: 'cmake --version ; ninja --version ; gcc --version ; git --version; python --version; pwsh --version ||true '
#pwsh is required on self hosted runners: see here: https://learn.microsoft.com/en-us/powershell/scripting/install/install-other-linux?view=powershell-7.2#installation-using-a-binary-archive-file
required: false
bootstrap-cmd:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-test-lin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ on:
prep-check-cmd:
type: string
description: 'command to check if the builder is ready'
default: 'cmake --version ; ninja --version ; gcc --version ; git --version; pwsh --version ||true '
default: 'cmake --version ; ninja --version ; gcc --version ; git --version; python --version; pwsh --version ||true '
#pwsh is required on self hosted runners: see here: https://learn.microsoft.com/en-us/powershell/scripting/install/install-other-linux?view=powershell-7.2#installation-using-a-binary-archive-file
required: false
bootstrap-cmd:
Expand Down
210 changes: 210 additions & 0 deletions .github/workflows/build-test-mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
on:
workflow_call:
inputs:
runner:
type: string
description: 'runner where this job will run'
required: true
flav:
type: string
description: 'flavour of the build: Windows/linux_x64/linux_arm64/Mac'
required: true
buildConf:
type: string
description: 'build configuration e.g. Release/Debug etc.'
default: 'RelWithDebInfo'
required: false
is-selfhosted:
type: boolean
description: 'self hosted runners do not need to use cache'
required: true
skip-test:
type: boolean
description: 'should test steps be skipped'
default: false
required: false
cuda:
type: string
description: 'ON/OFF based on this runner support cuda'
required: true
prep-cmd:
type: string
description: 'commands required to be run on a builder to prep it for build'
default: 'brew install ca-certificates curl zip unzip gnu-tar autoconf automake flex git libass gnutls json-glib libtool libsoup@2 libva libvdpau libvorbis libxcb ncurses ninja pkg-config texinfo wget yasm zlib nasm gperf bison python3 dos2unix && pip3 install meson'
required: false
prep-check-cmd:
type: string
description: 'command to check if the builder is ready'
default: 'cmake --version ; ninja --version ; gcc --version ; git --version; python --version; pwsh --version ||true '
#pwsh is required on self hosted runners: see here: https://learn.microsoft.com/en-us/powershell/scripting/install/install-other-linux?view=powershell-7.2#installation-using-a-binary-archive-file
required: false
bootstrap-cmd:
type: string
description: 'commands required to boot strap builder after code checkout'
default: './vcpkg/bootstrap-vcpkg.sh'
required: false
is-prep-phase:
type: boolean
description: 'this workflow is called for a prep phase: it will split vcpkg install into 2 portions to cache and save'
default: false
required: false
is-build-gst:
type: boolean
description: 'should we build GStreamer? we dont build on windows and ARM_Linux.'
default: true
required: false
cache-path:
type: string
description: 'the folder which needs to be cached e.g. .cache/vcpkg'
default: ${{ '~/.cache/vcpkg/archives' }}
required: false
cmake-conf-cmd:
type: string
description: 'command needed for installing and configuring cmake'
default: 'PATH=/usr/local/cuda/bin:$PATH ; cmake -B . -DENABLE_WINDOWS=OFF -DENABLE_LINUX=OFF -DENABLE_OSX=ON ../base'
required: false
nProc:
type: number
description: 'number of threads to be used by cmake/make'
default: 6
required: false
nTestTimeoutMins:
type: number
description: 'number of mins of timeout for tests run'
default: 20
required: false
jobs:
build:
env:
TEST_EXE: build/aprapipesut
LD_LIB_PATH: '${{github.workspace}}/thirdparty/gst-build/gst-build-1.16/outInstall/lib/x86_64-linux-gnu:${{github.workspace}}/thirdparty/Video_Codec_SDK_10.0.26/Lib/linux/stubs/x86_64:/usr/local/cuda-10.2/compat/:/usr/local/cuda/lib64:${LD_LIBRARY_PATH-}'
CMAKE_TC_FILE: '../vcpkg/scripts/buildsystems/vcpkg.cmake' # Note: naming this variable as CMAKE_TOOLCHAIN_FILE can cause havoc!!!
runs-on: ${{ inputs.runner }}
steps:
- name: Prepare builder
run: |
${{ inputs.prep-cmd }}
apt purge cmake || true
pip3 install cmake --upgrade || echo 'did not update cmake'
${{ inputs.prep-check-cmd }}

- name: Check builder for CUDA
if: ${{ contains(inputs.cuda,'ON')}}
run: |
(PATH=/usr/local/cuda/bin:$PATH && nvcc --version) || echo 'please install cuda and add /usr/local/cuda/bin into path'
test -f /usr/local/cuda/include/cudnn.h || echo 'install cudnn as described in the readme.md'

- name: Cleanup workspace on self hosted runners
if: inputs.is-selfhosted
run: 'Remove-Item -Recurse -Force *'
shell: pwsh
continue-on-error: true

- name: Checkout code
uses: actions/checkout@v3
with:
submodules: 'recursive'
lfs: true
fetch-depth: 0
- name: Checkout submodule
run: |
git submodule status > submodule_ver.txt
cat submodule_ver.txt
git rev-list --all --count

- name: Run VCPKG bootstrap
run: ${{ inputs.bootstrap-cmd }}

- name: Remove CUDA from vcpkg if we are in nocuda
if: ${{ contains(inputs.cuda,'OFF')}}
working-directory: ${{github.workspace}}/base
run: .\fix-vcpkg-json.ps1 -removeCUDA
shell: pwsh

- name: Remove OpenCV from vcpkg during prep phase
if: inputs.is-prep-phase
working-directory: ${{github.workspace}}/base
run: .\fix-vcpkg-json.ps1 -removeOpenCV
shell: pwsh

- name: cache init on container build
if: ${{ job.container != null }} # we are running on a cloud hosted container... move the cache "initially"
run: |
cp -R /root/.cache /github/home/ || true
ls ${{ inputs.cache-path }} || true
ls thirdparty/gst-build/gst-build-1.16/outInstall || true
continue-on-error: true

- name: Cache dependencies for fast cloud build
id: cache-all
uses: actions/cache@v3
with:
path: |
${{ inputs.cache-path }}
./thirdparty/gst-build/gst-build-1.16/outInstall/
./thirdparty/libmp4/build
key: ${{ inputs.flav }}-4-${{ hashFiles( 'base/vcpkg.json', 'vcpkg/baseline.json', 'submodule_ver.txt') }}
restore-keys: ${{ inputs.flav }}-

- name: Build Gstreamer On Linux_x64 when it is not cached
if: ${{ inputs.is-build-gst && steps.cache-all.outputs.cache-hit != 'true'}}
working-directory: ${{github.workspace}}/thirdparty
run: sh ./build_gstreamer.sh

- name: Build libmp4 when it is not cached
if: ${{ steps.cache-all.outputs.cache-hit != 'true' }}
working-directory: ${{github.workspace}}/thirdparty/libmp4
run: ./build.cmd

- name: Make build folder
run: mkdir -p build
continue-on-error: true

- name: Configure CMake Common
working-directory: ${{github.workspace}}/build
run: '${{ inputs.cmake-conf-cmd }} -DCMAKE_TOOLCHAIN_FILE=${{env.CMAKE_TC_FILE}} -DCMAKE_BUILD_TYPE=${{inputs.buildConf}} -DENABLE_CUDA=${{inputs.cuda}}'
continue-on-error: ${{inputs.is-prep-phase}} # in prep phase we expect an error here due to missing OpenCV

- name: Build
if: ${{!inputs.is-prep-phase}}
working-directory: ${{github.workspace}}/build
run: cmake --build . --config ${{inputs.buildConf}} -j ${{ inputs.nProc }}

- name: List Test cases
if: ${{!inputs.is-prep-phase}}
env:
LD_LIBRARY_PATH: ${{env.LD_LIB_PATH}}
run: |
ldd ${{env.TEST_EXE}} | grep 'not found' || true
${{env.TEST_EXE}} --list_content > tests.txt
timeout-minutes: 1

- name: Run Tests
if: ${{!inputs.is-prep-phase && !inputs.skip-test}}
env:
LD_LIBRARY_PATH: ${{env.LD_LIB_PATH}}
run: |
${{env.TEST_EXE}} --log_format=JUNIT --log_sink=CI_test_result_${{inputs.flav}}.xml -p -l all || echo 'test execution returned error'
timeout-minutes: ${{ inputs.nTestTimeoutMins}}

- name: Upload Test Results
if: ${{ always() }}
continue-on-error: true
uses: actions/upload-artifact@v3
with:
name: TestResults_${{ inputs.flav }}
path: |
CI_test_result_${{inputs.flav}}.xml


- name: Upload build logs
if: ${{ failure() }} # only upload logs when we have a failure above
uses: actions/upload-artifact@v3
with:
name: BuildLogs_${{ inputs.flav }}
path: |
${{ github.workspace }}/vcpkg/buildtrees/**/*.log
${{ github.workspace }}/vcpkg/buildtrees/**/*.txt



2 changes: 1 addition & 1 deletion .github/workflows/build-test-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ on:
prep-check-cmd:
type: string
description: 'command to check if the builder is ready'
default: 'cmake --version ; ninja --version ; git --version; pwsh --version'
default: 'cmake --version ; ninja --version ; git --version; python --version; pwsh --version'
#pwsh is required on self hosted runners: see here: https://learn.microsoft.com/en-us/powershell/scripting/install/install-other-linux?view=powershell-7.2#installation-using-a-binary-archive-file
required: false
bootstrap-cmd:
Expand Down
28 changes: 20 additions & 8 deletions base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ OPTION(ENABLE_LINUX "Use this switch to enable LINUX" ON)
OPTION(ENABLE_CUDA "Use this switch to enable CUDA" ON)
OPTION(ENABLE_ARM64 "Use this switch to enable ARM64" OFF)
OPTION(ENABLE_WINDOWS "Use this switch to enable WINDOWS" OFF)
OPTION(ENABLE_OSX "Use this switch to enable Mac OSX" OFF)
OPTION(ENABLE_GST "Use this switch to integrate Gstreamer" ON)

IF(ENABLE_ARM64) #no GST build for ARM64 yet
Expand Down Expand Up @@ -69,14 +70,17 @@ IF(ENABLE_GST)
pkg_check_modules(gstreamer-app-1.0 REQUIRED IMPORTED_TARGET GLOBAL gstreamer-app-1.0)
pkg_check_modules(gstreamer-net-1.0 REQUIRED IMPORTED_TARGET GLOBAL gstreamer-net-1.0)
pkg_check_modules(gstreamer-webrtc-1.0 REQUIRED IMPORTED_TARGET GLOBAL gstreamer-webrtc-1.0)
pkg_check_modules(libpcre REQUIRED IMPORTED_TARGET GLOBAL libpcre)
# pkg_check_modules(libpcre REQUIRED IMPORTED_TARGET GLOBAL libpcre)
pkg_check_modules(gthread-2.0 REQUIRED IMPORTED_TARGET GLOBAL gthread-2.0)
pkg_check_modules(gmodule-2.0 REQUIRED IMPORTED_TARGET GLOBAL gmodule-2.0)
pkg_check_modules(gstreamer-base-1.0 REQUIRED IMPORTED_TARGET GLOBAL gstreamer-base-1.0)
IF(NOT ENABLE_WINDOWS)
pkg_check_modules(json-glib-1.0 REQUIRED IMPORTED_TARGET GLOBAL json-glib-1.0)
ENDIF(NOT ENABLE_WINDOWS)
IF(ENABLE_LINUX)
pkg_check_modules(libsoup-2.4 REQUIRED IMPORTED_TARGET GLOBAL libsoup-2.4)
ENDIF(NOT ENABLE_WINDOWS)
ENDIF(ENABLE_LINUX)


ENDIF(ENABLE_GST)

Expand All @@ -86,7 +90,7 @@ find_package(Boost COMPONENTS system thread filesystem serialization log chrono
find_package(OpenCV CONFIG REQUIRED)
find_package(BZip2 REQUIRED)
find_package(ZLIB REQUIRED)
find_package(liblzma REQUIRED)
#find_package(liblzma REQUIRED)
find_package(FFMPEG REQUIRED)
find_package(ZXing CONFIG REQUIRED)
find_package(bigint CONFIG REQUIRED)
Expand Down Expand Up @@ -498,7 +502,7 @@ IF(ENABLE_GST)
${gstreamer-1.0_INCLUDE_DIRS}
${gstreamer-rtsp-server-1.0_INCLUDE_DIRS}
${gstreamer-webrtc-1.0_INCLUDE_DIRS}
${libpcre_INCLUDE_DIRS}
# ${libpcre_INCLUDE_DIRS}
${glib-2.0_INCLUDE_DIRS}
${gstreamer-rtsp-1.0_INCLUDE_DIRS}
${gstreamer-rtp-1.0_INCLUDE_DIRS}
Expand All @@ -512,9 +516,13 @@ IF(ENABLE_GST)
target_include_directories( aprapipes PRIVATE
${gstreamer-webrtc-1.0_INCLUDE_DIRS}
${json-glib-1.0_INCLUDE_DIRS}
${libsoup-2.4_INCLUDE_DIRS}
)
ENDIF(NOT ENABLE_WINDOWS)
IF(ENABLE_LINUX)
target_include_directories( aprapipes PRIVATE
${libsoup-2.4_INCLUDE_DIRS}
)
ENDIF(ENABLE_LINUX)
ENDIF(ENABLE_GST)


Expand Down Expand Up @@ -623,7 +631,7 @@ IF(ENABLE_GST)
PkgConfig::gstreamer-base-1.0
PkgConfig::gstreamer-1.0
PkgConfig::gstreamer-rtsp-server-1.0
PkgConfig::libpcre
# PkgConfig::libpcre
PkgConfig::glib-2.0
PkgConfig::gstreamer-rtsp-1.0
PkgConfig::gstreamer-rtp-1.0
Expand All @@ -637,12 +645,16 @@ IF(ENABLE_GST)
list(APPEND GST_LIBS
PkgConfig::gstreamer-webrtc-1.0
PkgConfig::json-glib-1.0
PkgConfig::libsoup-2.4
)
list(APPEND UT_FILES
test/gstwebrtcsink_tests.cpp
)
ENDIF(NOT ENABLE_WINDOWS)
IF(ENABLE_LINUX)
list(APPEND GST_LIBS
PkgConfig::libsoup-2.4
)
ENDIF(ENABLE_LINUX)
ENDIF(ENABLE_GST)


Expand Down Expand Up @@ -673,7 +685,7 @@ target_link_libraries(aprapipesut
ZXing::ZXing
BZip2::BZip2
ZLIB::ZLIB
liblzma::liblzma
#liblzma::liblzma
bigint::bigint
sfml-audio
)
Expand Down
Loading