Skip to content

Commit 012a962

Browse files
github: linux debug build
1 parent a217561 commit 012a962

File tree

5 files changed

+108
-32
lines changed

5 files changed

+108
-32
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Build Debug for Linux
2+
3+
on: [ push, pull_request ]
4+
5+
jobs:
6+
build_linux:
7+
name: CI for Linux
8+
runs-on: ubuntu-latest
9+
container: ubuntu:20.04
10+
steps:
11+
- name: Install dependencies for Linux
12+
env:
13+
DEBIAN_FRONTEND: noninteractive
14+
run: |
15+
apt-get -qq update
16+
apt-get install -y -qq autopoint automake autoconf intltool libc6-dev yasm libglib2.0-bin perl wget zip bzip2 make libtool pkg-config fakeroot clang openssh-client rsync libglib2.0-dev-bin git
17+
- name: Checkout for Linux
18+
uses: actions/checkout@v4
19+
with:
20+
submodules: true
21+
- name: Fetch static-deps
22+
run: travis/download-linux-static-deps.sh
23+
- name: Run Tests
24+
run: scripts/test.sh
25+
- name: Build for Linux
26+
run: TRAVIS_OS_NAME=linux travis/build.sh --debug
27+
- name: Upload for Linux
28+
env:
29+
gh_ed25519_key: ${{ secrets.GH_ENCRYPTED_ED25519_KEY }}
30+
gh_ed25519_iv: ${{ secrets.GH_ENCRYPTED_ED25519_IV }}
31+
run: TRAVIS_OS_NAME=linux travis/upload.sh --debug
32+
- name: Upload artifact
33+
uses: actions/upload-artifact@v4
34+
with:
35+
name: linux-debug
36+
# todo: rename and upload only one artifact (the build)
37+
path: portable_out/build/*.tar.bz2
38+

scripts/portable_package_static.sh

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
./scripts/portable_postbuild.sh
44

5+
DEBUG=false
6+
7+
for arg in "$@"; do
8+
if [[ "$arg" == "--debug" ]]; then
9+
DEBUG=true
10+
break
11+
fi
12+
done
13+
514
# package for distribution
615
VERSION=`cat PORTABLE_VERSION | perl -ne 'chomp and print'`
716
BUILD=`cat PORTABLE_BUILD | perl -ne 'chomp and print'`
@@ -20,8 +29,11 @@ PLUGDIR=$SRCDIR/plugins
2029
LIBDIR=$SRCDIR/lib
2130
DOCDIR=$SRCDIR/doc
2231
PIXMAPDIR=$SRCDIR/pixmaps
23-
OUTNAME=deadbeef-static_${VERSION}-${BUILD}_${ARCH}.tar.bz2
24-
DEBUG_OUTNAME=deadbeef-debug-symbols_${VERSION}-${BUILD}_${ARCH}.tar.bz2
32+
if ! $DEBUG; then
33+
OUTNAME=deadbeef-static_${VERSION}-${BUILD}_${ARCH}.tar.bz2
34+
else
35+
OUTNAME=deadbeef-static-debug_${VERSION}-${BUILD}_${ARCH}.tar.bz2
36+
fi
2537

2638
mkdir -p portable_out/build
2739
rm portable_out/build/$OUTNAME
@@ -94,8 +106,4 @@ tar jcvf ../../portable_out/build/$OUTNAME\
94106
$SRCDIR/locale\
95107
|| exit 1
96108

97-
tar jcvf ../../portable_out/build/$DEBUG_OUTNAME\
98-
./deadbeef.debug\
99-
|| exit 1
100-
101109
cd ../..

scripts/static_build.sh

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
#!/bin/bash
2+
3+
DEBUG=false
4+
5+
for arg in "$@"; do
6+
if [[ "$arg" == "--debug" ]]; then
7+
DEBUG=true
8+
break
9+
fi
10+
done
11+
212
VERSION=`cat PORTABLE_VERSION | perl -ne 'chomp and print'`
313
ORIGIN=$PWD
414
STATIC_DEPS=static-deps
515
AP=$ORIGIN/external/apbuild
616
#ARCH=`uname -m | perl -ne 'chomp and print'`
717
if [[ "$ARCH" == "i686" ]]; then
818
export CFLAGS="-m32 -I$ORIGIN/$STATIC_DEPS/lib-x86-32/include"
9-
export CXXFLAGS=$CFLAGS
1019
export LDFLAGS="-m32 -L$ORIGIN/$STATIC_DEPS/lib-x86-32/lib -L$ORIGIN/$STATIC_DEPS/lib-x86-32/lib/i386-linux-gnu"
1120
export CONFIGURE_FLAGS="--build=i686-unknown-linux-gnu"
1221
export LIBRARY_PATH="$ORIGIN/$STATIC_DEPS/lib-x86-32/lib"
@@ -65,10 +74,18 @@ export OBJC=$AP/apgcc
6574

6675
./autogen.sh || exit 1
6776

68-
CFLAGS="$CFLAGS -g"
77+
CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=0"
78+
79+
if $DEBUG; then
80+
CFLAGS="$CFLAGS -O0 -g"
81+
else
82+
CFLAGS="$CFLAGS -O3"
83+
fi
84+
85+
CXXFLAGS=$CFLAGS
6986
LDFLAGS="$LDFLAGS -Wl,--build-id"
7087

71-
./configure CFLAGS="$CFLAGS -O3 -D_FORTIFY_SOURCE=0" CXXFLAGS="$CXXFLAGS -O3 -D_FORTIFY_SOURCE=0" LDFLAGS="$LDFLAGS" $CONFIGURE_FLAGS --enable-staticlink --prefix=/opt/deadbeef || {
88+
./configure CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" $CONFIGURE_FLAGS --enable-staticlink --prefix=/opt/deadbeef || {
7289
# store failed config.log in portable dir, which is mapped to
7390
# docker-artifacts when using docker.
7491
cp config.log ./portable/
@@ -82,16 +99,6 @@ make clean
8299
make V=1 -j8 DESTDIR=`pwd`/static/$ARCH/deadbeef-$VERSION || exit 1
83100
export DESTDIR=`pwd`/static/$ARCH/deadbeef-$VERSION
84101

85-
echo "Extracting debug symbols..."
86-
# Note: need to do it before make install!
87-
mkdir -p "portable/$ARCH"
88-
cd src
89-
objcopy --only-keep-debug ./deadbeef deadbeef.debug || exit 1
90-
strip --strip-debug --strip-unneeded ./deadbeef || exit 1
91-
objcopy --add-gnu-debuglink=deadbeef.debug ./deadbeef || exit 1
92-
cd ..
93-
mv src/deadbeef.debug "portable/$ARCH/" || exit 1
94-
95102
make DESTDIR=$DESTDIR install || exit 1
96103
mkdir -p $LIBRARY_PATH
97104
cp -r $LIBRARY_PATH/libBlocksRuntime.so* $DESTDIR/opt/deadbeef/lib/

travis/build.sh

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,32 @@
11
#!/bin/bash
22
set -e
3+
4+
DEBUG=false
5+
6+
for arg in "$@"; do
7+
if [[ "$arg" == "--debug" ]]; then
8+
DEBUG=true
9+
break
10+
fi
11+
done
12+
313
case "$TRAVIS_OS_NAME" in
414
linux)
515
ls -l .
616
# echo "building for i686"
717
# ARCH=i686 ./scripts/static_build.sh
818
# ARCH=i686 ./scripts/portable_package_static.sh
919
echo "Building for x86_64"
10-
if [[ "$1" == "--clang" ]] ; then
11-
CLANG_FLAG="--clang"
20+
ARCH=x86_64 ./scripts/static_build.sh $@
21+
ARCH=x86_64 ./scripts/portable_package_static.sh $@
22+
if ! $DEBUG; then
23+
echo "Making deb package"
24+
ARCH=x86_64 ./tools/packages/debian.sh
25+
echo "Making arch package"
26+
ARCH=x86_64 ./tools/packages/arch.sh
27+
echo "Running make dist"
28+
make dist
1229
fi
13-
ARCH=x86_64 ./scripts/static_build.sh $CLANG_FLAG
14-
ARCH=x86_64 ./scripts/portable_package_static.sh
15-
echo "Making deb package"
16-
ARCH=x86_64 ./tools/packages/debian.sh
17-
echo "Making arch package"
18-
ARCH=x86_64 ./tools/packages/arch.sh
19-
echo "Running make dist"
20-
make dist
2130
;;
2231
osx)
2332
echo "Install xcbeautify ..."

travis/upload.sh

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,27 @@ if [ ! -z $GITHUB_REF ]; then
2525
echo "Branch/Tag: $TRAVIS_BRANCH"
2626
fi
2727

28+
DEBUG=false
29+
30+
for arg in "$@"; do
31+
if [[ "$arg" == "--debug" ]]; then
32+
DEBUG=true
33+
break
34+
fi
35+
done
36+
37+
2838
case "$TRAVIS_OS_NAME" in
2939
linux)
3040
echo Uploading linux artifacts...
31-
rsync -e "$SSHOPTS" deadbeef-*.tar.bz2 waker,deadbeef@frs.sourceforge.net:/home/frs/project/d/de/deadbeef/travis/linux/$TRAVIS_BRANCH/ || exit 1
41+
if ! $DEBUG; then
42+
# Do not upload packages / source for debug build
43+
rsync -e "$SSHOPTS" deadbeef-*.tar.bz2 waker,deadbeef@frs.sourceforge.net:/home/frs/project/d/de/deadbeef/travis/linux/$TRAVIS_BRANCH/ || exit 1
44+
rsync -e "$SSHOPTS" package_out/x86_64/debian/*.deb waker,deadbeef@frs.sourceforge.net:/home/frs/project/d/de/deadbeef/travis/linux/$TRAVIS_BRANCH/ || exit 1
45+
rsync -e "$SSHOPTS" package_out/x86_64/arch/*.pkg.tar.xz waker,deadbeef@frs.sourceforge.net:/home/frs/project/d/de/deadbeef/travis/linux/$TRAVIS_BRANCH/ || exit 1
46+
fi
47+
# This will match the build tarballs and debug symbols
3248
rsync -e "$SSHOPTS" portable_out/build/*.tar.bz2 waker,deadbeef@frs.sourceforge.net:/home/frs/project/d/de/deadbeef/travis/linux/$TRAVIS_BRANCH/ || exit 1
33-
rsync -e "$SSHOPTS" package_out/x86_64/debian/*.deb waker,deadbeef@frs.sourceforge.net:/home/frs/project/d/de/deadbeef/travis/linux/$TRAVIS_BRANCH/ || exit 1
34-
rsync -e "$SSHOPTS" package_out/x86_64/arch/*.pkg.tar.xz waker,deadbeef@frs.sourceforge.net:/home/frs/project/d/de/deadbeef/travis/linux/$TRAVIS_BRANCH/ || exit 1
3549
;;
3650
osx)
3751
echo Uploading mac artifacts...

0 commit comments

Comments
 (0)