Skip to content

Update apple-gdb-1824-macos.yml #271

Update apple-gdb-1824-macos.yml

Update apple-gdb-1824-macos.yml #271

# -*- coding: utf-8; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- vim:fenc=utf-8:et:sw=2:ts=2:sts=2
name: cooljeanius/apple-gdb-1824-macos
on:
push:
branches:
- "**/*"
pull_request:
jobs:
test:
runs-on: macos-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: Install dependencies with Homebrew
env:
HOMEBREW_NO_EMOJI: 1
HOMEBREW_VERBOSE_USING_DOTS: 1
run: |
if test ${{ matrix.compiler }} == clang; then \
COMPILER_FORMULA="clang-build-analyzer"; \
elif test ${{ matrix.compiler }} == gcc; then \
COMPILER_FORMULA="libgccjit"; \
else \
COMPILER_FORMULA=""; \
fi
date && sync
brew install autogen texi2html texinfo deja-gnu expect dmalloc fastjar osslsigncode gperf help2man ant-contrib findutils grep coreutils remake byacc texlive gawk util-macros autoconf-archive automake scons smake "${COMPILER_FORMULA}"
- run: test -e ./.profile_generic && test -r ./.profile_generic && test -s ./.profile_generic && sync && source ./.profile_generic && sync && (env | uniq | sort | uniq) && sync && sleep 1
- run: ./configure --enable-silent-rules CC=${{ matrix.compiler }} OBJC=${{ matrix.compiler }}
- run: make -ki -C libcheckpoint || make -ki -C libcheckpoint -f Makefile_orig || make -ki -C macsbug || make -ki -C macsbug/gdb_plugin_support || (if test -x "$(which ant)"; then ant; else echo "ant missing"; fi)
- run: if test ! -e libcheckpoint/libcheckpoint.dylib; then (sync && echo "ensuring libcheckpoint is built" && sync && make -ki -C libcheckpoint -f Makefile_orig RC_CFLAGS="-std=gnu89 -w -Wno-error" && sync) || (sync && make -ki -C macsbug && sync) || (sync && make -ki -C macsbug/gdb_plugin_support && sync) || (if test -x "$(which ant)"; then ant; else echo "ant missing"; fi); else (sync && stat libcheckpoint/libcheckpoint.dylib && sync); fi
- run: if test -d .. && test -w .. && test ! -e ../gdb; then (sync && echo "symlinking source directory" && sync && pushd .. && sync && ln -sv apple-gdb-1824 gdb && sync && readlink gdb && sync && popd && sync && sleep 1); else (sync && stat .. && sync && ls .. && sync && sleep 1); fi
- run: (if test -n "$(type ant 2>/dev/null)" && test -x "$(which ant)" && test -r build.xml; then if test ! -d build; then mkdir build; elif test ! -d "${HOME}"/work/apple-gdb-1824/build; then mkdir -pv "${HOME}"/work/apple-gdb-1824/build; fi; ant; else (echo "ant missing" && sync); fi) || (if test -x ./gradlew; then (./gradlew build || ./gradlew assemble || ./gradlew); elif test -r ./gradlew; then sh ./gradlew; elif test -e ./gradlew; then stat ./gradlew; else echo "gradlewrapper missing"; fi) || (if test -x "$(which gradle)"; then gradle; else echo "gradle missing"; fi) || (if test -x ~rc/bin/buildit; then sudo ~rc/bin/buildit "$(pwd)" -arch ppc -arch i386 -arch armv5 -target cross -project gdb -release RELEASENAME RC_CROSS_ARCHS=armv6; else echo "buildit missing"; fi) || ls
- run: (if test -x ./gradlew; then (./gradlew build || ./gradlew assemble || ./gradlew); elif test -r ./gradlew; then sh ./gradlew; elif test -e ./gradlew; then stat ./gradlew; else echo "gradlewrapper missing" >&2; fi) || (if test -x "$(which gradle)"; then gradle; else echo "gradle missing"; fi) || (if test -x ~rc/bin/buildit; then sudo ~rc/bin/buildit "$(pwd)" -arch ppc -arch i386 -arch armv5 -target cross -project gdb -release RELEASENAME RC_CROSS_ARCHS=armv6; else echo "buildit missing"; fi) || ls
- run: cd src && ./configure --disable-werror --disable-opts-test --enable-carbon-framework --enable-debug-symbols-framework --enable-64-bit-bfd --enable-silent-rules CC=${{ matrix.compiler }} OBJC=${{ matrix.compiler }}
- run: cd src && make configure-bfd
- run: cd src && sync && make -C bfd headers && sync
- run: cd src && if test ! -e bfd/bfd.h; then (sync && make -C bfd bfd.h); else (sync && stat bfd/bfd.h); fi && sync && find . -name bfd.h -print && sync
- run: cd src && make -C bfd diststuff
- run: cd src && make all-bfd
- run: if test ! -e macsbug/MacsBug_plugin; then make -ki -C macsbug || make -ki -C macsbug/gdb_plugin_support || (if test -x "$(which ant)"; then ant; else echo "ant missing"; fi); else stat macsbug/MacsBug_plugin; fi
- run: if test ! -e macsbug/gdb_plugin_support/gdb_plugin_support.o; then (sync && make -ki -C macsbug/gdb_plugin_support TARGET_ARCHITECTURE="x86_64" && sync) || (if test -x "$(which ant)"; then ant; fi) || (for cfile in macsbug/gdb_plugin_support/*.c; do ${{ matrix.compiler }} -c "${cfile}" || stat "${cfile}"; done); else stat macsbug/gdb_plugin_support/gdb_plugin_support.o; fi
- run: cd src && make all-opcodes
- run: cd src && make configure-binutils
- name: Backup that annoying arparse.h header
run: |
cd src/binutils
sync && make arparse.h
if test ! -e arparse.h; then \
echo "make my_arparse.h"; \
make my_arparse.h; \
else \
sync && echo "arparse.h exists" && sync && stat arparse.h; \
fi
if test ! -f arparse.h; then \
echo "remake arparse.c"; \
remake arparse.c; \
else \
sync && echo "checking arparse.h length" && sync && wc -l arparse.h; \
fi
# shellcheck disable=SC2046
if test ! -e arparse.h; then \
echo "trying the relevant Makefile rule as copied into this CI workflow"; \
/bin/sh ./../ylwrap arparse.y y.tab.c arparse.c y.tab.h "$(echo arparse.c | sed -e s/cc$/hh/ -e s/cpp$/hpp/ -e s/cxx$/hxx/ -e s/c++$/h++/ -e s/c$/h/)" y.output arparse.output -- $(if [ -f ../bison/bison ]; then echo ../bison/bison -y -L./../bison/; else echo bison -o y.tab.c; fi) -d -t -v -k; \
else \
sync && echo "checking arparse.h disk usage" && sync && du arparse.h; \
fi
if test -e arparse.h; then \
if test ! -e ../bfd/arparse.h; then \
sync && cp -v arparse.h ../bfd; \
elif test ! -e ../include/arparse.h; then \
sync && cp -v arparse.h ../include; \
else \
sync && stat arparse.h; \
fi; \
else \
sync && (ls ./*.h || ls || pwd); \
fi
sync && find . -name arparse.h -type f -print && sync && sleep 1
- run: cd src && make all-binutils
- run: cd src && make all-cgen && make all-libiberty && make all-intl
- run: cd src && make all-electric-fence
- run: cd src && make all-etc
- run: cd src && make all-libdecnumber
- run: cd src && make all-mmalloc
- run: cd src && make configure-readline
- run: cd src && for dir in libtool_gnu sim utils tcl expect dejagnu itcl tk libgui; do if test -e ${dir}/configure; then (echo "configuring in ${dir}" && make configure-${dir} && ls ${dir}/config*); elif test -d ${dir}; then ls ${dir}/configure*; else echo "skipping configuring in ${dir}"; fi; done
- run: cd src && for dir in sim utils tcl expect dejagnu itcl tk libgui; do if test -e ${dir}/Makefile; then (echo "building in ${dir}" && make -C ${dir}); elif test -d ${dir}; then ls ${dir}/Makefile*; else echo "skipping ${dir}"; fi; done
- run: cd src && make configure-gdb
- run: cd src && make all-gdb
- name: bootstrap libtool
run: |
cd src/libtool_gnu
if test -z "$(which autoconf)" || test ! -x "$(which autoconf)"; then \
brew install [email protected] || brew install [email protected] || brew install m4 || ls "configure*"; \
else \
echo "autoconf available at $(which autoconf)"; \
fi
if test -z "$(which gm4)" || test ! -x "$(which gm4)"; then \
brew install m4 || brew analytics on || find . -name '*.m4' -print; \
else \
sync && echo "the following gm4 binaries are available"; \
which -a gm4 || gwhich -a gm4 || type gm4; \
echo "...and the first of them has the following information"; \
sync && gm4 --version; \
sync && gm4 --help; \
fi
./bootstrap || stat ./bootstrap || test -x ./bootstrap
if test libltdl/configure -ot libltdl/configure.ac; then \
if test -x libltdl/configure && test -s libltdl/configure; then \
touch libltdl/configure; \
elif test -x libltdl/configure~ && test -s libltdl/configure~; then \
cp -vf libltdl/configure~ libltdl/configure; \
elif test -x "$(which sync)"; then \
which sync && sync; \
else \
echo "configure-related timestamps might be off?"; \
fi; \
fi
if test libltdl/Makefile.in -ot libltdl/Makefile.am; then \
test -s libltdl/Makefile.in && touch libltdl/Makefile.in; \
fi
if test libltdl/Makefile -ot libltdl/Makefile.in; then \
test -s libltdl/Makefile && touch libltdl/Makefile; \
fi
for subdir in libltdl libltdl/loaders libtool_gnu/libltdl/loaders loaders; do \
if test -d "${subdir}" && test -w "${subdir}" && test ! -d "${subdir}"/.deps; then \
mkdir -pv "${subdir}"/.deps; \
elif test -e "${subdir}"/.deps; then \
stat "${subdir}"/.deps; \
elif test -r "${subdir}"; then \
find "${subdir}" -name '*.Plo' -print; \
elif test -x "$(which sync)"; then \
sync && pwd; \
else \
echo "unhandled possibility for ${subdir}"; \
fi; \
if test -r "${subdir}"/Makefile && test -s "${subdir}"/Makefile && test -w "${subdir}"; then \
pushd "${subdir}"; \
echo "attempting to ensure depfiles are fine in ${subdir}..."; \
make am--depfiles || make am--refresh || make distdir-am || stat Makefile; \
popd; \
else \
sync && echo "no usable Makefile found in ${subdir}"; \
fi; \
if test -r "${subdir}"/.deps; then \
(find "${subdir}" -name '*.Tpo' -print) || echo "depfile generation may have failed for ${subdir}"; \
else \
echo "depdir generation may have failed for ${subdir}"; \
fi; \
done
sync && echo "hopefully libtool_gnu timestamps will be fine..."
- name: Full build to get anything that might have been missed
run: |
cd src
touch config.log
if test -x "$(which nproc)" && test "$(nproc)" -ge 2; then \
echo "nproc says we can use $(nproc) build jobs"; \
if test "$(nproc)" -eq 4; then \
echo "special-casing the 4-job build case..."; \
(make -j"$(nproc)" || make -j2 || make || remake -dpPw --verbosity=terse >>config.log || remake --trace=noshell --verbosity=terse >>config.log || remake all-gdb >>config.log || clear || stat Makefile); \
else
(make -j"$(nproc)" || make || remake -dpPw --verbosity=terse >>config.log || remake --trace=noshell --verbosity=terse >>config.log || remake all-gdb >>config.log || clear || stat Makefile); \
fi; \
elif test -x "$(which gnproc)" && test "$(gnproc)" -ge 2; then \
echo "gnproc says we can use $(gnproc) build jobs"; \
(make -j"$(gnproc)" || make || remake -dpPw --verbosity=terse >>config.log || remake --trace=noshell --verbosity=terse >>config.log || remake all-gdb >>config.log || clear || stat Makefile); \
else \
echo "on the slow path..."; \
(make || remake -dpPw --verbosity=terse >>config.log || remake --trace=noshell --verbosity=terse >>config.log || remake all-gdb >>config.log || clear || stat Makefile); \
fi
- run: cd src && make check-libiberty
- run: cd src && sync && make -C tcl/unix tcltest && sync
- run: cd src && for dir in cgen sim expect dejagnu itcl libgui; do if test -r ${dir}/Makefile; then (sync && echo "running testsuite for ${dir}" && sync && make check-${dir} V=0 RUNTESTFLAGS="-v" && sync); elif test -d ${dir}; then ls ${dir}/Makefile*; else echo "skipping testing ${dir}"; fi; done
- name: Possibly do static analysis
run: |
cd src
if test ${{ matrix.compiler }} == clang; then \
time make check-bfd; \
echo "done with bfd; moving onto binutils next..."; \
time make check-binutils; \
echo "done with binutils; moving onto mmalloc next..."; \
time make check-mmalloc; \
echo "done with mmalloc; moving onto electrict-fence next..."; \
cd electric-fence; \
make check-local || make check stamp-framework ls; \
echo "done with electric-fence..." ; \
elif test ${{ matrix.compiler }} == gcc; then \
echo "getting some additional dependencies..."; \
brew install idutils || brew install ctags || brew install universal-ctags || brew install emacs || brew install global || brew install cscope; \
if test -z "$(which etags)" || test ! -x "$(which etags)"; then \
brew install emacs || stat "$(which emacs)" || echo "etags missing"; \
fi; \
if test -z "$(which gtags)" || test ! -x "$(which gtags)"; then \
brew install global || which global || echo "gtags missing"; \
fi; \
if test -z "$(which cscope)" || test ! -x "$(which cscope)"; then \
brew install cscope || stat "$(which cscope)" || echo "cscope missing"; \
fi; \
pushd bfd; \
sync && make check-DEJAGNU; \
popd; \
pushd binutils; \
make am_check-DEJAGNU || make check-DEJAGNU || make check-TESTS; \
make check-recursive || make cscope || make ID || make TAGS || make CTAGS || make GTAGS || make recheck || stat Makefile; \
sh ./sanity.sh || stat ./sanity.sh; \
popd; \
echo "done with binutils; moving on to mmalloc next..."; \
pushd mmalloc; \
sync && make info dvi stamp-framework-headers ls; \
popd; \
echo "done with mmalloc; moving on to electric-fence next..."; \
pushd electric-fence; \
sync && make check stamp-framework ls; \
popd; \
echo "done with electric-fence; moving on to readline next..."; \
pushd readline; \
if test -e static; then mv -v static static.orig; fi; \
make clean || make clean-local || make mostlyclean || make mostlyclean-local; \
make lint || make lint-local || make my_TAGS || make tags-local; \
if test ! -e TAGS; then \
make my_TAGS || make tags-local || make ID || make TAGS || touch TAGS; \
fi; \
popd; \
echo "done with readline..."; \
else \
echo "error, unhandled compiler!" >&2 && exit 1; \
fi
- run: cd src && sync && make check-opcodes && sync && make check-intl && sync
# (check-binutils target is now moved into the static analysis step)
- run: cd src && make check-utils
- run: time (sync && pwd && sync && ls && sync)
if: "${{ success() }}"
- name: Upload a Build Artifact
uses: actions/[email protected]
if: "${{ success() }}"
with:
# Artifact name
name: apple-gdb-1824-macos-${{ matrix.compiler }}-logfiles
# A file, directory or wildcard pattern that describes what to upload
path: |
**/*.log
- run: find . -name config.log -print0 | xargs -0 cat | grep -i error | sort | uniq
if: "${{ failure() }}"
strategy:
fail-fast: false
matrix:
compiler:
- clang
- gcc