Commit 254a8102 authored by Nirbheek Chauhan's avatar Nirbheek Chauhan 🐜 Committed by Jordan Petridіs
Browse files

ci: Check the plugins found by gst-inspect

It is very easy to accidentally break the loading of a plugin. Add a
check against a pre-defined list so we notice when that happens.

We're a little lenient when the job is triggered by the gstreamer repo,
and only error out if a plugin is missing from the list. Jobs triggered
by the cerbero repo are strict and fail if the lists don't match.

This allows people to add new plugins to the gstreamer repo without
having a circular dependency on this list. We will add it to the list
the next time we make a cerbero MR.

Lines starting with `#` are treated as comments in the plugins list.
parent b5a77eb6
Pipeline #588460 waiting for manual action with stages
......@@ -233,6 +233,8 @@ cerbero deps cross-windows x86:
variables:
CONFIG: "cross-win32.cbc"
ARCH: "mingw_x86"
CERBERO_RUN_WRAPPER: "wine"
CERBERO_RUN_SUFFIX: ".exe"
build cerbero cross win32:
extends: '.cerbero mr'
......@@ -247,6 +249,8 @@ cerbero deps cross-windows x86_64:
variables:
CONFIG: "cross-win64.cbc"
ARCH: "mingw_x86_64"
CERBERO_RUN_WRAPPER: "wine"
CERBERO_RUN_SUFFIX: ".exe"
build cerbero cross win64:
extends: '.cerbero mr'
......
......@@ -69,14 +69,62 @@ fix_build_tools() {
fi
}
run_cerbero_shell() {
$CERBERO $CERBERO_ARGS run $CERBERO_RUN_WRAPPER "$@"
}
run_gst_inspect() {
run_cerbero_shell gst-inspect-1.0$CERBERO_RUN_SUFFIX "$@"
}
is_deps_build() {
[[ $CI_GSTREAMER_TRIGGERED != true ]]
}
# If this is a cerbero deps job, then we ensure that the diff is empty. Else,
# we ensure that the the diff only has additions and no removals. This prevents
# a circular dependency between these plugins lists and merge requests in the
# gstreamer repo that add new plugins. Removal of plugins must first remove the
# plugin from these lists, and that's ok.
check_gst_inspect_output() {
local common_plugins="ci/data/common plugins.txt"
local target_plugins="ci/data/$(cut -f3- -d\ <<<$CI_JOB_NAME) plugins.txt"
local all_plugins="all_plugins.txt"
local plugins_diff="plugins_diff.txt"
cat "$common_plugins" "$target_plugins" | grep -v '^#' | sort | uniq > "$all_plugins"
# Get the list of plugins by skipping the first three and the last two
# lines of output, then splitting on `:` and getting the first field, then
# sorting and deduplicating the list.
run_gst_inspect | tail -n+4 | head -n-2 | cut -f1 -d\: | sort | uniq > gst_inspect.txt
diff -u "$all_plugins" gst_inspect.txt > "$plugins_diff" || true
if [[ $(wc -l "$plugins_diff" | cut -f1 -d\ ) == 0 ]]; then
echo "All expected plugins loaded correctly"
return 0
fi
if ! is_deps_build && ! grep -q '^-[^+-]\+' "$plugins_diff"; then
echo "All expected plugins loaded correctly, and some extra ones were found:"
cat "$plugins_diff"
return 0
fi
echo "Expected plugins list did not match the plugins found by gst-inspect:"
cat "$plugins_diff"
return 1
}
# Produces runtime and devel tarball packages for linux/android or .pkg for macos
cerbero_package_and_check() {
$CERBERO $CERBERO_ARGS package --offline ${CERBERO_PACKAGE_ARGS} -o "$(pwd_native)" gstreamer-1.0
# Run gst-inspect-1.0 for some basic checks. Can't do this for cross-(android|ios)-universal, of course.
if [[ $CONFIG != *universal* ]]; then
$CERBERO $CERBERO_ARGS run $CERBERO_RUN_WRAPPER gst-inspect-1.0$CERBERO_RUN_SUFFIX --version
$CERBERO $CERBERO_ARGS run $CERBERO_RUN_WRAPPER gst-inspect-1.0$CERBERO_RUN_SUFFIX
run_gst_inspect --version
run_gst_inspect
#set +x # The next command runs a lot of shell commands, quiet the spam
check_gst_inspect_output
#set -x
fi
show_ccache_sum
......
accurip
adder
adpcmdec
adpcmenc
aes
aiff
alaw
alpha
alphacolor
amrnb
amrwbdec
apetag
app
asf
asfmux
assrender
audiobuffersplit
audioconvert
audiofx
audiofxbad
audiolatency
audiomixer
audiomixmatrix
audioparsers
audiorate
audioresample
audiotestsrc
audiovisualizers
auparse
autoconvert
autodetect
avi
bayer
bz2
cairo
camerabin
closedcaption
codecalpha
coloreffects
compositor
coreelements
coretracers
cutter
dash
debug
debugutilsbad
decklink
deinterlace
dtls
dtmf
dtsdec
dv
dvbsubenc
dvbsuboverlay
dvdlpcmdec
dvdspu
dvdsub
effectv
encoding
equalizer
faceoverlay
fieldanalysis
flac
flv
flxdec
freeverb
gaudieffects
gdkpixbuf
gdp
geometrictransform
ges
gio
goom
goom2k1
hls
icydemux
id3demux
id3tag
imagefreeze
inter
interlace
interleave
ipcpipeline
isomp4
ivfparse
ivtc
jp2kdecimator
jpeg
jpegformat
kate
lame
legacyrawparse
level
libav
matroska
midi
monoscope
mpegpsdemux
mpegpsmux
mpegtsdemux
mpegtsmux
mpg123
mulaw
multifile
multipart
mxf
navigationtest
netsim
nice
nle
ogg
opengl
openh264
openjpeg
opus
opusparse
overlaycomposition
pango
pbtypes
pcapparse
playback
png
pnm
proxy
rawparse
realmedia
removesilence
replaygain
rfbsrc
rist
rsvg
rtmp
rtmp2
rtp
rtpmanager
rtpmanagerbad
rtponvif
rtsp
rtspclientsink
sbc
sctp
sdpelem
segmentclip
shapewipe
siren
smooth
smoothstreaming
smpte
soup
spandsp
spectrum
speed
speex
srt
srtp
staticelements
subenc
subparse
switchbin
tcp
theora
timecode
transcode
ttmlsubs
typefindfunctions
udp
validatetracer
videobox
videoconvert
videocrop
videofilter
videofiltersbad
videoframe_audiolevel
videomixer
videoparsersbad
videorate
videoscale
videosignal
videotestsrc
vmnc
voaacenc
volume
vorbis
vpx
wavenc
wavpack
wavparse
webrtc
x264
xingmux
y4mdec
y4menc
zbar
a52dec
d3d
d3d11
directsound
directsoundsrc
dvdread
resindvd
soundtouch
taglib
wasapi
webrtcdsp
winks
winscreencap
a52dec
d3d
d3d11
directsound
directsoundsrc
dvdread
resindvd
soundtouch
taglib
wasapi
webrtcdsp
winks
winscreencap
a52dec
alsa
cdparanoia
dvb
dvdread
kms
pulseaudio
resindvd
shm
soundtouch
taglib
video4linux2
webrtcdsp
ximagesink
ximagesrc
xvimagesink
a52dec
applemedia
dvdread
osxaudio
osxvideo
resindvd
shm
soundtouch
taglib
vulkan
webrtcdsp
d3d
d3d11
directshow
wasapi
# These plugins can't be loaded because the Windows Features that provide DLLs
# needed by them are disabled on the ServerCore image:
# https://docs.microsoft.com/en-us/windows-server/administration/server-core/server-core-container-removed-roles
# Likely these two:
# ServerCore-Drivers-General
# ServerMediaFoundation
# There is a workaround, but it's too difficult to enable on the CI:
# https://github.com/microsoft/Windows-Containers/issues/159#issuecomment-1045390706
#winscreencap
#directsound
#directsoundsrc
#mediafoundation
#opengl
#wasapi2
#winks
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment