Skip to content
Merged
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
44 changes: 44 additions & 0 deletions .github/script/check_no_copyleft_libs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/usr/bin/env bash
# Fail if a Linux package ships, links or depends on a library FLM dropped for
# licensing reasons: FFmpeg and the GPL codecs distro FFmpeg pulls in (x264,
# x265, xvid, libdvdnav/libdvdread), FFTW and GNU readline.
#
# Usage: check_no_copyleft_libs.sh <package.tar.gz | package.deb>...
set -euo pipefail

# Shared-library file names (bundled files and ELF NEEDED entries).
lib_re='^lib(av(codec|format|util|filter|device)|sw(scale|resample)|postproc|x264|x265|xvidcore|dvdnav|dvdread|fftw3[a-z_]*|readline)[.]so'
# Debian binary package names (.deb Depends).
pkg_re='^(libav(codec|format|util|filter|device)|libsw(scale|resample)|libpostproc|libx26[45]|libxvidcore|libdvd(nav|read)|libfftw3|libreadline)'

status=0
for pkg in "$@"; do
tmp=$(mktemp -d)
case "$pkg" in
*.deb)
if dpkg-deb -f "$pkg" Depends | tr ',|' '\n\n' | sed 's/^ *//' | grep -E "$pkg_re"; then
echo "::error::$pkg depends on a package listed above"
status=1
fi
dpkg-deb -x "$pkg" "$tmp" ;;
*.tar.gz)
tar xzf "$pkg" -C "$tmp" ;;
*)
echo "::error::unknown package type: $pkg"
exit 2 ;;
esac

if find "$tmp" \( -type f -o -type l \) -printf '%f\n' | grep -E "$lib_re"; then
echo "::error::$pkg bundles a library listed above"
status=1
fi
while IFS= read -r -d '' f; do
if readelf -d "$f" 2>/dev/null | sed -n 's/.*(NEEDED).*\[\(.*\)\]/\1/p' | grep -E "$lib_re"; then
echo "::error::${f#"$tmp"/} in $pkg links a library listed above"
status=1
fi
done < <(find "$tmp" -type f -print0)
rm -rf "$tmp"
[ "$status" -eq 0 ] && echo "$pkg: no FFmpeg, GPL codec, FFTW or readline libraries"
done
exit "$status"
19 changes: 7 additions & 12 deletions .github/workflows/asr-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@ name: ASR Test
# platform) and the same 5 points per set.
#
# The trigger paths are the Whisper engine, its NPU kernels and prebuilt NPU
# libraries, the FFmpeg, audio front end and FFT code, the audio front ends of
# libraries, the audio decoders, front end and FFT code, the audio front ends of
# the chat models that transcribe, and the server files that host
# /v1/audio/transcriptions. Those server files also hold every other endpoint,
# so any change to them runs this test too. The pull_request and push path
# lists must stay identical. Shared files such as src/CMakeLists.txt (the Linux
# FFmpeg version) and lm_config.hpp are left out, since every change touches
# them.
# lists must stay identical. Shared files such as src/CMakeLists.txt and
# lm_config.hpp are left out, since every change touches them.
#
# The weekly run catches what no commit changes: Whisper weights republished
# on Hugging Face, and NPU driver or firmware updates on the runners.
Expand All @@ -45,11 +44,9 @@ on:
- 'src/include/audio/**'
- 'src/common/AutoModel/*_audio.cpp'
- 'src/detail/gemma4e_npu/gemma4e_audio*'
- 'src/include/fftw3.h'
- 'src/include/pocketfft/**'
- 'src/lib/libfftw3*'
- 'src/lib/av*'
- 'src/lib/sw*'
- 'src/include/dr_libs/**'
- 'src/cmake/FlmAudioCodecs.cmake'
- 'src/server/rest_handler.cpp'
- 'src/server/server.cpp'
- 'src/server/multipart.cpp'
Expand All @@ -74,11 +71,9 @@ on:
- 'src/include/audio/**'
- 'src/common/AutoModel/*_audio.cpp'
- 'src/detail/gemma4e_npu/gemma4e_audio*'
- 'src/include/fftw3.h'
- 'src/include/pocketfft/**'
- 'src/lib/libfftw3*'
- 'src/lib/av*'
- 'src/lib/sw*'
- 'src/include/dr_libs/**'
- 'src/cmake/FlmAudioCodecs.cmake'
- 'src/server/rest_handler.cpp'
- 'src/server/server.cpp'
- 'src/server/multipart.cpp'
Expand Down
65 changes: 7 additions & 58 deletions .github/workflows/debian-portable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ jobs:
echo "Created tarball with symlinks preserved"
# The default backend is XRT, so confirm libxrt is bundled.
tar tzf $GITHUB_WORKSPACE/fastflowlm_${VERSION}_linux.tar.gz | grep libxrt
$GITHUB_WORKSPACE/.github/script/check_no_copyleft_libs.sh \
$GITHUB_WORKSPACE/fastflowlm_${VERSION}_linux.tar.gz

- name: Upload portable build artifact
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -140,6 +142,8 @@ jobs:
LICENSE_RUNTIME.txt \
LICENSE_BINARY.txt \
THIRD_PARTY_NOTICES.txt
"$GITHUB_WORKSPACE/.github/script/check_no_copyleft_libs.sh" \
"$GITHUB_WORKSPACE/models-from-source_fastflowlm_${VERSION}_linux.tar.gz"

- name: Upload models-from-source build artifact
uses: actions/upload-artifact@v4
Expand All @@ -149,28 +153,6 @@ jobs:
retention-days: 7
if-no-files-found: error

- name: Collect FFmpeg logs
if: always()
shell: bash
run: |
set -euxo pipefail
OUT="${RUNNER_TEMP}/ffmpeg-logs"
mkdir -p "${OUT}"
find "${GITHUB_WORKSPACE}" -type f \
\( -name "configure.log" -o -name "build.log" -o -name "config.log" \) \
-path "*/ffmpeg-build/*" \
-print \
-exec cp --parents {} "${OUT}" \; || true

- name: Upload FFmpeg logs artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: ffmpeg-logs-${{ github.job }}-run${{ github.run_number }}-attempt${{ github.run_attempt }}
path: ${{ runner.temp }}/ffmpeg-logs
if-no-files-found: warn
retention-days: 14

build-HRX-portable:
runs-on: ubuntu-latest
strategy:
Expand Down Expand Up @@ -254,18 +236,8 @@ jobs:
echo "Created tarball with symlinks preserved"
# This build selects the HRX backend, so confirm libhrx is bundled.
tar tzf $GITHUB_WORKSPACE/HRX_fastflowlm_${VERSION}_linux.tar.gz | grep libhrx
# FFmpeg is linked statically from an LGPL source build, so neither flm
# nor the tarball may carry a shared FFmpeg (distro builds are GPL) or
# the GPL codecs it would drag in.
if readelf -d flm-real | grep -E 'NEEDED.*lib(av|sw|postproc)'; then
echo "::error::flm-real links a shared FFmpeg library"
exit 1
fi
if tar tzf $GITHUB_WORKSPACE/HRX_fastflowlm_${VERSION}_linux.tar.gz \
| grep -E 'lib/lib(av(codec|format|util|filter|device)|sw(scale|resample)|postproc|x264|x265|xvidcore)[.]so'; then
echo "::error::tarball bundles a shared FFmpeg or GPL codec library"
exit 1
fi
$GITHUB_WORKSPACE/.github/script/check_no_copyleft_libs.sh \
$GITHUB_WORKSPACE/HRX_fastflowlm_${VERSION}_linux.tar.gz

- name: Upload portable build artifact
uses: actions/upload-artifact@v4
Expand All @@ -275,28 +247,6 @@ jobs:
retention-days: 7
if-no-files-found: error

- name: Collect FFmpeg logs
if: always()
shell: bash
run: |
set -euxo pipefail
OUT="${RUNNER_TEMP}/ffmpeg-logs"
mkdir -p "${OUT}"
find "${GITHUB_WORKSPACE}" -type f \
\( -name "configure.log" -o -name "build.log" -o -name "config.log" \) \
-path "*/ffmpeg-build/*" \
-print \
-exec cp --parents {} "${OUT}" \; || true

- name: Upload FFmpeg logs artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: ffmpeg-logs-${{ github.job }}-run${{ github.run_number }}-attempt${{ github.run_attempt }}
path: ${{ runner.temp }}/ffmpeg-logs
if-no-files-found: warn
retention-days: 14

test-summary:
runs-on: ubuntu-latest
needs: build-portable
Expand All @@ -307,11 +257,10 @@ jobs:
echo "# Portable Build Test Results" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "✅ FLM built successfully with portable distribution" >> $GITHUB_STEP_SUMMARY
echo "✅ FFmpeg statically linked (no external FFmpeg dependencies)" >> $GITHUB_STEP_SUMMARY
echo "✅ No FFmpeg, GPL codec, FFTW or readline libraries shipped or linked" >> $GITHUB_STEP_SUMMARY
echo "✅ XRT and XDNA plugin bundled with distribution" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "## Build Configuration" >> $GITHUB_STEP_SUMMARY
echo "- **FFmpeg**: Statically linked (built from source)" >> $GITHUB_STEP_SUMMARY
echo "- **XRT**: Dynamically linked, bundled in lib/" >> $GITHUB_STEP_SUMMARY
echo "- **XDNA plugin**: Bundled in lib/" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ubuntu-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ jobs:
dpkg-buildpackage -b -us -uc
mv ../fastflowlm_${DEB_VERSION}_amd64.deb ./fastflowlm_${DEB_VERSION}_${{ matrix.distro }}${{ matrix.version }}_amd64.deb
ls -lah ./fastflowlm_${DEB_VERSION}_${{ matrix.distro }}${{ matrix.version }}_amd64.deb
.github/script/check_no_copyleft_libs.sh \
./fastflowlm_${DEB_VERSION}_${{ matrix.distro }}${{ matrix.version }}_amd64.deb

- name: Upload Debian package artifact
uses: actions/upload-artifact@v4
Expand Down
5 changes: 0 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,11 @@ RUN apt update && apt install -y \
dpkg-dev \
fakeroot \
git \
libavcodec-dev \
libavformat-dev \
libavutil-dev \
libboost-dev \
libboost-program-options-dev \
libcurl4-openssl-dev \
libdrm-dev \
libedit-dev \
libswresample-dev \
libswscale-dev \
libxrt-dev \
nasm \
ninja-build \
Expand Down
Loading
Loading