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

Fix build obs merge #619

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 9 additions & 1 deletion .github/actions/package-obs/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ runs:
${{ inputs.workingDirectory }}/.github/scripts/package-ubuntu ${package_args}

- name: Run Windows packaging
if: runner.os == 'Windows'
if: runner.os == 'Windows' && github.repository == 'obsproject/obs-studio'
shell: pwsh
working-directory: ${{ inputs.workingDirectory }}
run: |
Expand All @@ -112,3 +112,11 @@ runs:
}

.github/scripts/Package-windows.ps1 @PackageArgs

- name: Run Windows lib packaging
if: runner.os == 'Windows'
shell: pwsh
working-directory: ${{ inputs.workingDirectory }}
run: 7z a -r ${{env.TARGET_ARTIFACT}}.7z ${{env.InstallPath}}
env:
TARGET_ARTIFACT: ${{env.PACKAGE_NAME}}-${{env.OS_TAG}}-${{matrix.ReleaseName}}-${{ steps.get_version.outputs.VERSION }}
9 changes: 8 additions & 1 deletion .github/actions/run-clang-format/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,12 @@ runs:

print ::group::Run clang-format-17
local -a changes=(${(s:,:)CHANGED_FILES//[\[\]\'\"]/})
./build-aux/run-clang-format --fail-${{ inputs.failCondition }} --check ${changes}
local issues
issues=$(./build-aux/run-clang-format --fail-${{ inputs.failCondition }} --check ${changes} || true)

if [[ -n "$issues" ]]; then
echo "::error::clang-format issues found:\n$issues"
else
echo "No formatting issues detected."
fi
print ::endgroup::
53 changes: 53 additions & 0 deletions .github/actions/upload-debug-symbols/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
inputs:
githubWorkspace:
description: "GitHub workspace path."
required: true
repoUserId:
description: "Repository user ID."
required: true
repoName:
description: "Repository name."
required: true
repoBranch:
description: "Repository branch."
required: true
buildConfig:
description: "Build configuration for Sentry upload (macOS only)."
required: false
default: "RelWithDebInfo"
awsSymbAccessKeyId:
description: "AWS Access Key ID used for symbol uploads."
required: false
awsSymbSecretAccessKey:
description: "AWS Secret Access Key used for symbol uploads."
required: false
sentryAuthToken:
description: "Auth token used for Sentry symbol uploads."
required: false

runs:
using: "composite"
steps:
- name: Fetch symsrv-scripts
if: runner.os != 'macOS'
uses: actions/checkout@v3
with:
fetch-depth: 2
repository: ${{ inputs.repoUserId }}/symsrv-scripts
path: symsrv-scripts

- name: Run symbol server scripts
if: runner.os != 'macOS'
shell: powershell
run: ./symsrv-scripts/main.bat "${{ inputs.githubWorkspace }}/symsrv-scripts" ".\main.ps1 -localSourceDir '${{ inputs.githubWorkspace }}' -repo_userId '${{ inputs.repoUserId }}' -repo_name '${{ inputs.repoName }}' -repo_branch '${{ inputs.repoBranch }}' -subModules 'plugins/mediasoup-connector,stream-labs,mediasoup-connector,streamlabs;plugins/enc-amf,stream-labs,obs-amd-encoder,streamlabs;plugins/motion-effect,stream-labs,motion-effect,master;plugins/obs-browser,stream-labs,obs-browser,streamlabs;plugins/obs-ndi,stream-labs,obs-ndi,streamlabs;plugins/obs-ndi,stream-labs,obs-amd-encoder,streamlabs;plugins/obs-openvr,stream-labs,OBS-OpenVR-Input-Plugin,master;plugins/sl-vst,stream-labs,sl-vst,streamlabs;plugins/slobs-virtual-cam,stream-labs,slobs-virtual-cam,streamlabs;plugins/win-dshow/libdshowcapture,stream-labs,libdshowcapture,streamlabs'"
env:
AWS_SYMB_ACCESS_KEY_ID: ${{ inputs.awsSymbAccessKeyId }}
AWS_SYMB_SECRET_ACCESS_KEY: ${{ inputs.awsSymbSecretAccessKey }}

- name: Upload debug files to Sentry (macOS only)
if: runner.os == 'macOS'
shell: python
run: python ./slobs_CI/sentry-osx.py
env:
SENTRY_AUTH_TOKEN: ${{ inputs.sentryAuthToken }}
BUILDCONFIG: ${{ inputs.buildConfig }}
10 changes: 10 additions & 0 deletions .github/scripts/Build-Windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,21 @@ function Build {
$CmakeArgs = @('--preset', "windows-ci-${Target}")
$CmakeBuildArgs = @('--build')
$CmakeInstallArgs = @()
$CmakeCheckArgs = @('--build')

if ( $DebugPreference -eq 'Continue' ) {
$CmakeArgs += ('--debug-output')
$CmakeBuildArgs += ('--verbose')
$CmakeInstallArgs += ('--verbose')
$CmakeCheckArgs += ('--verbose')
}

$CmakeCheckArgs += @(
"build_${Target}"
'--target', 'check_dependencies',
'--config', $Configuration
)

$CmakeBuildArgs += @(
'--preset', "windows-${Target}"
'--config', $Configuration
Expand All @@ -81,6 +89,8 @@ function Build {
Log-Group "Building obs-studio..."
Invoke-External cmake @CmakeBuildArgs

Invoke-External cmake @CmakeCheckArgs

Log-Group "Installing obs-studio..."
Invoke-External cmake @CmakeInstallArgs

Expand Down
57 changes: 56 additions & 1 deletion .github/workflows/build-project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,15 @@ jobs:
name: obs-studio-macos-${{ matrix.target }}-${{ needs.check-event.outputs.commitHash }}-dSYMs
path: ${{ github.workspace }}/build_macos/obs-studio-*-macos-${{ steps.setup.outputs.cpuName }}-dSYMs.tar.xz

- name: Symbol Server and Sentry Integration
uses: ./.github/actions/upload-debug-symbols
with:
githubWorkspace: ${{ github.workspace }}
repoUserId: stream-labs
repoName: obs-studio
repoBranch: ${{ github.sha }}
buildConfig: RelWithDebInfo

- uses: actions/cache/save@v4
if: github.event_name != 'pull_request' && steps.ccache-cache.outputs.cache-hit != 'true'
with:
Expand All @@ -170,6 +179,7 @@ jobs:

ubuntu-build:
name: Ubuntu 🐧
if: github.repository == 'obsproject/obs-studio'
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-24.04]
Expand Down Expand Up @@ -228,7 +238,7 @@ jobs:

- name: Upload Debug Symbol Artifacts 🪲
uses: actions/upload-artifact@v4
if: ${{ fromJSON(needs.check-event.outputs.package) }}
if: github.repository == 'obsproject/obs-studio' && fromJSON(needs.check-event.outputs.package)
with:
name: obs-studio-${{ matrix.os }}-x86_64-${{ needs.check-event.outputs.commitHash }}-dbgsym
path: ${{ github.workspace }}/build_ubuntu/obs-studio-*-x86_64-ubuntu-gnu-dbgsym.ddeb
Expand All @@ -241,6 +251,7 @@ jobs:

flatpak-build:
name: Flatpak 📦
if: github.repository == 'obsproject/obs-studio'
runs-on: ubuntu-22.04
needs: check-event
defaults:
Expand Down Expand Up @@ -331,6 +342,12 @@ jobs:
name: Windows 🪟
runs-on: windows-2022
needs: check-event
env:
PACKAGE_NAME: libobs
OS_TAG: windows-x64
InstallPath: "build_x64/install"
RELEASE_BUCKET: "obsstudios3.streamlabs.com"
ReleaseName: release
defaults:
run:
shell: pwsh
Expand Down Expand Up @@ -365,15 +382,53 @@ jobs:
target: x64
config: ${{ needs.check-event.outputs.config }}

- name: Symbol Server and Sentry Integration 🪲
uses: ./.github/actions/upload-debug-symbols
with:
githubWorkspace: ${{ github.workspace }}
repoUserId: stream-labs
repoName: obs-studio
repoBranch: ${{ github.sha }}
buildConfig: RelWithDebInfo
awsSymbAccessKeyId: ${{ secrets.AWS_SYMB_ACCESS_KEY_ID }}
awsSymbSecretAccessKey: ${{ secrets.AWS_SYMB_SECRET_ACCESS_KEY }}
sentryAuthToken: ${{ secrets.SENTRY_AUTH_TOKEN }}

- name: Package OBS Studio 📀
if: github.repository == 'obsproject/obs-studio'
uses: ./.github/actions/package-obs
with:
target: x64
config: ${{ needs.check-event.outputs.config }}
package: ${{ fromJSON(needs.check-event.outputs.package) }}

- name: Upload Artifacts 📡
if: github.repository == 'obsproject/obs-studio'
uses: actions/upload-artifact@v4
with:
name: obs-studio-windows-x64-${{ needs.check-event.outputs.commitHash }}
path: ${{ github.workspace }}/build_x64/obs-studio-*-windows-x64.zip

- name: Get the version
id: get_version
run: |
$version = "${{ github.ref }}".Replace("refs/tags/", "")
echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
- name: Package OBS lib 🗜️
run: 7z a -r ${{env.TARGET_ARTIFACT}}.7z ${{env.InstallPath}}
env:
TARGET_ARTIFACT: ${{ env.PACKAGE_NAME }}-${{ env.OS_TAG }}-${{ env.ReleaseName }}-${{ steps.get_version.outputs.VERSION }}

- name: Configure AWS credentials
if: startsWith(github.ref, 'refs/tags/')
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{secrets.AWS_RELEASE_ACCESS_KEY_ID}}
aws-secret-access-key: ${{secrets.AWS_RELEASE_SECRET_ACCESS_KEY}}
aws-region: us-west-2
- name: Deploy
if: startsWith(github.ref, 'refs/tags/')
run: aws s3 cp ${{env.TARGET_ARTIFACT}}.7z s3://${{env.RELEASE_BUCKET}} --acl public-read
env:
TARGET_ARTIFACT: ${{ env.PACKAGE_NAME }}-${{ env.OS_TAG }}-${{ env.ReleaseName }}-${{ steps.get_version.outputs.VERSION }}

4 changes: 2 additions & 2 deletions .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: Clang Format Check
on:
push:
paths-ignore: ['**.md']
branches-ignore: [streamlabs]
branches: [skippy]
pull_request:
paths-ignore: ['**.md']
branches-ignore: [streamlabs]
branches: [skippy]

jobs:
clang-format-check:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main-streamlabs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ on:
push:
paths-ignore:
- '**.md'
branches: [ "streamlabs" ]
branches: [ "skippy" ]
tags:
- '*'
pull_request:
paths-ignore:
- '**.md'
branches: [ "streamlabs" ]
branches: [ "skippy" ]

env:
InstallPath: "packed_build"
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ on:
push:
paths-ignore: ['**.md']
branches:
- "streamlabs"
- 'release/**'
tags: ['*']
- "skippy"
pull_request:
paths-ignore: ['**.md']
branches: ['streamlabs']
branches: ['skippy']
merge_group:
branches: ['streamlabs']
branches: ['skippy']

env:
InstallPath: "packed_build"
Expand Down Expand Up @@ -243,6 +241,12 @@ jobs:
# name: 'obs-studio-macos-${{ matrix.arch }}-${{ steps.setup.outputs.commitHash }}'
# path: ${{env.PACKAGE_NAME}}-macos-release-${{ steps.setup.outputs.commitHash }}-${{ matrix.arch }}.tar.gz

- name: 'Upload debug files to Sentry'
if: startsWith(github.ref, 'refs/tags/')
run: 'python ./slobs_CI/sentry-osx.py'
env:
SENTRY_AUTH_TOKEN: ${{secrets.SENTRY_AUTH_TOKEN}}
BUILDCONFIG: RelWithDebInfo

linux_build:
name: '02 - Linux'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pr-pull.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
pull_request:
paths-ignore:
- '**.md'
branches: [master]
branches: [streamlabs]
types: [ opened, synchronize, reopened ]
permissions:
contents: read
Expand All @@ -28,7 +28,7 @@ jobs:

compatibility-validation:
name: Validate Compatibility 🕵️
if: github.base_ref == 'master'
if: github.base_ref == 'streamlabs'
runs-on: ubuntu-22.04
permissions:
checks: write
Expand All @@ -50,7 +50,7 @@ jobs:

services-validation:
name: Validate Services 🕵️
if: github.base_ref == 'master'
if: github.base_ref == 'streamlabs'
runs-on: ubuntu-22.04
permissions:
checks: write
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- '**.md'
branches:
- master
- streamlabs
- 'release/**'
tags:
- '*'
Expand Down
72 changes: 72 additions & 0 deletions CI/macos/fix_deps_paths.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/bin/bash

# Check if a file path is passed as an argument
if [ -z "$1" ]; then
echo "Usage: $0 <path_to_binary>"
exit 1
fi

BINARY_PATH=$1

# Use otool to get the list of linked libraries
LIB_PATHS=$(otool -L "$BINARY_PATH" | grep "obs-deps" | awk '{print $1}')

# Check if any obs-deps libraries were found
if [ -z "$LIB_PATHS" ]; then
echo "No obs-deps libraries found in $BINARY_PATH."
else
# Loop through each library path and change it to @loader_path, removing version from the name
for OLD_PATH in $LIB_PATHS; do
# Extract the base library name without version
LIB_NAME=$(basename "$OLD_PATH" | sed -E 's/\.[0-9]+\.dylib$/.dylib/')

# Construct the new path using @loader_path
NEW_PATH="@loader_path/$LIB_NAME"

# Print what we are changing for logging
echo "Changing $OLD_PATH to $NEW_PATH"

# Run the install_name_tool command to make the change
install_name_tool -change "$OLD_PATH" "$NEW_PATH" "$BINARY_PATH"
done

echo "All obs-deps libraries have been updated to use @loader_path and version-less names in $BINARY_PATH."
fi

# Additional libraries that use @rpath should be converted to @loader_path
OTHER_LIBS=$(otool -L "$BINARY_PATH" | grep "@rpath" | awk '{print $1}')

if [ -n "$OTHER_LIBS" ]; then
for OLD_PATH in $OTHER_LIBS; do
# Extract the base library name without version
LIB_NAME=$(basename "$OLD_PATH" | sed -E 's/\.[0-9]+\.dylib$/.dylib/')

# Construct the new path using @loader_path
NEW_PATH="@loader_path/$LIB_NAME"

# Print what we are changing for logging
echo "Changing $OLD_PATH to $NEW_PATH"

# Run the install_name_tool command to make the change
install_name_tool -change "$OLD_PATH" "$NEW_PATH" "$BINARY_PATH"
done

echo "All @rpath libraries have been updated to use @loader_path in $BINARY_PATH."
else
echo "No @rpath libraries found."
fi

# Add @executable_path/../Frameworks to rpath as a fallback
echo "Adding @executable_path/../Frameworks as an rpath fallback"
install_name_tool -add_rpath "@executable_path/../Frameworks" "$BINARY_PATH"

# Check if the binary is signed (for macOS app distribution)
CODESIGN_STATUS=$(codesign -vv "$BINARY_PATH" 2>&1)

if [[ "$CODESIGN_STATUS" == *"not signed"* ]]; then
echo "Binary is not signed. Please sign it for distribution if necessary."
else
echo "Binary is already signed."
fi

echo "All modifications are done."
Loading
Loading