diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a272bae62..81d4102e6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,7 +50,7 @@ jobs: name: ${{ matrix.name }} runs-on: ${{ matrix.runs-on }} - container: ${{ (matrix.compiler == 'gcc' && 'ubuntu:22.04') || matrix.container }} + container: ${{ matrix.container }} env: ${{ matrix.env }} permissions: contents: write @@ -86,7 +86,7 @@ jobs: DEBIAN_FRONTEND: 'noninteractive' TZ: 'Etc/UTC' with: - apt-get: ${{ matrix.install }} git build-essential python3 curl openjdk-11-jdk ninja-build pkg-config libncurses-dev + apt-get: ${{ matrix.install }} git build-essential python3 curl openjdk-11-jdk ninja-build pkg-config libncurses-dev libxml2-utils libxml2-dev cc: ${{ steps.setup-cpp.outputs.cc || matrix.cc }} ccflags: ${{ matrix.ccflags }} cxx: ${{ steps.setup-cpp.outputs.cxx || matrix.cxx }} @@ -148,6 +148,7 @@ jobs: - name: Install Libxml2 id: libxml2-install + if: matrix.compiler == 'msvc' shell: bash run: | set -x @@ -254,16 +255,55 @@ jobs: -D duktape_ROOT=${{ steps.duktape-install.outputs.duktape-root }} -D Duktape_ROOT=${{ steps.duktape-install.outputs.duktape-root }} -D fmt_ROOT=${{ steps.fmt-install.outputs.fmt-root }} - -D libxml2_ROOT=${{ steps.libxml2-install.outputs.libxml2-root }} - -D LibXml2_ROOT=${{ steps.libxml2-install.outputs.libxml2-root }} + ${{ (steps.libxml2-install.outputs.libxml2-root && format('-D libxml2_ROOT={0}', steps.libxml2-install.outputs.libxml2-root)) || '' }} + ${{ (steps.libxml2-install.outputs.libxml2-root && format('-D LibXml2_ROOT={0}', steps.libxml2-install.outputs.libxml2-root)) || '' }} export-compile-commands: true run-tests: true install: true - package: ${{ matrix.is-main }} + package: ${{ matrix.is-main && matrix.compiler == 'msvc' }} package-dir: packages package-generators: ${{ (runner.os == 'Windows' && '7Z ZIP WIX') || 'TGZ TXZ' }} package-artifact: false + # See src/wrapper/README.adoc + - name: Wrap GCC Binaries + if: matrix.compiler == 'gcc' && matrix.is-main + run: | + set -x + + # 1) Inspect what the executable ./local/bin/mrdocs is linked against + MRDOCS_PATH=.local/bin/mrdocs + WRAPPER_PATH=src/wrapper/wrapper + ldd "$MRDOCS_PATH" + ldd_output=$(ldd "$MRDOCS_PATH") + libgcc=$(echo "$ldd_output" | grep 'libgcc_s.so.1' | awk -F '=>' '{print $2}' | awk '{print $1}') + libstdcpp=$(echo "$ldd_output" | grep 'libstdc++.so.6' | awk -F '=>' '{print $2}' | awk '{print $1}') + echo "libgcc_s.so.1 path: $libgcc" + echo "libstdc++.so.6 path: $libstdcpp" + + # 2) Generate wrapper .inc files + ./src/wrapper/generate_tables.sh "$MRDOCS_PATH" + + # 3) Copy the required libraries to the package + mkdir -p .local/lib/gcc + cp "$libgcc" .local/lib/gcc + mkdir -p .local/lib/stdcpp + cp "$libstdcpp" .local/lib/stdcpp + + # 4) Rename original executable to mrdocs.base + mv "$MRDOCS_PATH" "$MRDOCS_PATH.base" + + # 5) Copy wrapper executable + cp "$WRAPPER_PATH" "$MRDOCS_PATH" + + # 6) Test wrapped executable + "$MRDOCS_PATH" --version + + # 7) Check if we're missing any symbols in the wrapper + + + + - name: Upload GitHub Release Artifacts if: ${{ matrix.is-main && matrix.compiler != 'clang' }} uses: actions/upload-artifact@v3 @@ -482,6 +522,7 @@ jobs: # Iterate over the previous files and compare them with the corresponding local files find $PREV_DEMOS_DIR -type f | while read previous_file; do # Derive the corresponding local file path + local_file="${LOCAL_DEMOS_DIR}${previous_file#$PREV_DEMOS_DIR}" diff_output="$DIFF_DIR${previous_file#$PREV_DEMOS_DIR}" if [[ -f $local_file ]]; then