libjxl

FORK: libjxl patches used on blog
git clone https://git.neptards.moe/blog/libjxl.git
Log | Files | Refs | Submodules | README | LICENSE

debugging_workflows.md (2418B)


      1 ### Reasoning 
      2 
      3 Given the differences in compilers / environment it is not always clear why some
      4 build / test fails in workflows. In this document we gather practices that
      5 would help debugging workflows.
      6 
      7 ### Debugging workflows on GitHub
      8 
      9 To connect to real workflow on GitHub one can use "tmate" plugin. To do that,
     10 add the following snippet in workflow .yml:
     11 
     12 ```
     13  - name: Setup tmate session
     14    # Or other condition that pin-points a single strategy matrix item
     15    if: failure()
     16    uses: mxschmitt/action-tmate@a283f9441d2d96eb62436dc46d7014f5d357ac22 # v3.17
     17 ```
     18 
     19 When the plugin is executed it dumps to log a command to "ssh" to that instance.
     20 
     21 NB: since session is wrapped in tmux, scrolling might be very inconvenient.
     22 
     23 ### Debugging build_test_cross.yml locally
     24 
     25 "cross" workflows are executed in container, so those are easy to reproduce
     26 locally. Here is a snippet that reflects how setup / compilation are (currently)
     27 done in the workflow:
     28 
     29 ```
     30 docker run -it -v`pwd`:/libjxl debian:bookworm bash
     31 
     32 cd /libjxl
     33 
     34 export ARCH=i386 # arm64 armhf
     35 export MAIN_LIST="amd64,${ARCH}"
     36 export BUILD_DIR=build
     37 export CC=clang-14
     38 export CXX=clang++-14
     39 export BUILD_TARGET=i686-linux-gnu # aarch64-linux-gnu arm-linux-gnueabihf
     40 
     41 rm -f /var/lib/man-db/auto-update
     42 apt-get update -y
     43 apt-get install -y ca-certificates debian-ports-archive-keyring python3
     44 
     45 dpkg --add-architecture ${ARCH}
     46 python3 ./tools/scripts/transform_sources_list.py "${MAIN_LIST}"
     47 apt update
     48 
     49 apt-get install -y \
     50   clang-14 cmake doxygen g++-aarch64-linux-gnu graphviz libbrotli-dev:${ARCH} \
     51   libc6-dev-${ARCH}-cross libgdk-pixbuf2.0-dev:${ARCH} libgif-dev:${ARCH} \
     52   libgtk2.0-dev:${ARCH} libilmbase-dev:${ARCH} libjpeg-dev:${ARCH} \
     53   libopenexr-dev:${ARCH} libpng-dev:${ARCH} libstdc++-12-dev-${ARCH}-cross \
     54   libstdc++-12-dev:${ARCH} libwebp-dev:${ARCH} ninja-build pkg-config \
     55   qemu-user-static unzip xdg-utils xvfb
     56 
     57 #apt-get install -y binutils-${BUILD_TARGET} gcc-${BUILD_TARGET}
     58 #apt-get install -y \
     59 #  libgoogle-perftools-dev:${ARCH} libgoogle-perftools4:${ARCH} \
     60 #  libtcmalloc-minimal4:${ARCH} libunwind-dev:${ARCH}
     61 #export CMAKE_FLAGS="-march=armv8-a+sve"
     62 
     63 SKIP_TEST=1 ./ci.sh release \
     64   -DJPEGXL_FORCE_SYSTEM_BROTLI=ON \
     65   -DJPEGXL_ENABLE_JNI=OFF
     66 #  -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-aarch64-static
     67 #  -DJPEGXL_ENABLE_OPENEXR=off
     68 #  -DJPEGXL_ENABLE_SIZELESS_VECTORS=on
     69 #  -DCMAKE_CXX_FLAGS=-DJXL_HIGH_PRECISION=0
     70 ```