diff --git a/.github/actions/build-and-test/action.yml b/.github/actions/build-and-test/action.yml index ad8a25c2a..de8f3cd38 100644 --- a/.github/actions/build-and-test/action.yml +++ b/.github/actions/build-and-test/action.yml @@ -57,6 +57,13 @@ runs: shell: bash run: | ${{ inputs.executable }} test --workspace --target ${{ inputs.target }} ${{ inputs.test-flags }} --release ${{ steps.set-feature-flags.outputs.cargo-features }} $CARGO_VERBOSE + - name: "dll" + if: ${{ failure() }} + shell: powershell + run: | + $env:Path += "C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\;" + gflags /i "target/${{ inputs.target }}/release/deps"/bibtex-*.exe +sls + cdb -c "g;q" "target/${{ inputs.target }}/release/deps"/bibtex-*.exe - name: "Package test failure files" id: package-tests if: ${{ failure() }} @@ -64,13 +71,14 @@ runs: run: | artifact_dir="test_failures" mkdir -p "$artifact_dir" + mv "target/${{ inputs.target }}/release/deps"/*.exe "$artifact_dir" || true mv *.observed "$artifact_dir" || true mv *.expected "$artifact_dir" || true if [ -n "$(ls -A $artifact_dir)" ]; then - echo "failure-artifacts=true" >> "$GITHUB_OUTPUTS" + echo "failure-artifacts=true" >> "$GITHUB_OUTPUT" fi - name: "Publish packaged test failures" - if: ${{ steps.package-tests.outputs.failure-artifacts }} + if: ${{ failure() && steps.package-tests.outputs.failure-artifacts == 'true' }} uses: actions/upload-artifact@v4 with: name: test-failures-${{ inputs.target }} diff --git a/.github/actions/pkgconfig-deps/action.yml b/.github/actions/pkgconfig-deps/action.yml index 2a5479154..c3f53323d 100644 --- a/.github/actions/pkgconfig-deps/action.yml +++ b/.github/actions/pkgconfig-deps/action.yml @@ -49,7 +49,7 @@ runs: - name: "Set MSYS64 paths (Windows)" if: ${{ runner.os == 'Windows' }} shell: pwsh - run: Add-Content -Value "PATH=C:\msys64\usr\bin;C:\msys64\mingw64\bin;$Env:PATH" -Path $Env:GITHUB_ENV -Encoding utf8 + run: Add-Content -Value "PATH=C:\msys64\mingw64\bin;C:\msys64\usr\bin;$Env:PATH" -Path $Env:GITHUB_ENV -Encoding utf8 - name: "Install pkg-config dependencies (Windows)" if: ${{ runner.os == 'Windows' }} shell: bash diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 2c62575a3..ffb103b54 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -3,197 +3,197 @@ name: "Build and Test" on: [ workflow_call ] jobs: - clippy: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: true - - name: "Generic Setup" - uses: ./.github/actions/build-setup - - name: "Install pkg-config dependencies" - uses: ./.github/actions/pkgconfig-deps - with: - install-all-deps: 'true' - - name: "Install clippy" - run: | - rustup component add clippy - cargo clippy --version - - name: "cargo clippy" - run: cargo clippy --all --all-targets --all-features -- --deny warnings - coverage: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: true - - name: "Generic Setup" - uses: ./.github/actions/build-setup - - name: "Install pkg-config dependencies" - uses: ./.github/actions/pkgconfig-deps - - name: "Set up code coverage" - run: | - wget https://apt.llvm.org/llvm.sh - chmod +x llvm.sh - sudo ./llvm.sh 20 - - echo "CC=clang-20" >> "$GITHUB_ENV" - echo "CXX=clang++-20" >> "$GITHUB_ENV" - cargo install cargo-llvm-cov - - name: "cargo llvm-cov" - run: cargo llvm-cov --workspace --include-ffi --ignore-filename-regex '/harfbuzz/' --codecov --output-path coverage.json - - name: "Report coverage results" - uses: codecov/codecov-action@v5 - with: - token: ${{ secrets.CODECOV_TOKEN }} - appimage: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: true - - name: "Generic Setup" - uses: ./.github/actions/build-setup - - name: "Install pkg-config dependencies" - uses: ./.github/actions/pkgconfig-deps - - name: "Setup build variables" - shell: bash - run: | - echo "TECTONIC_DEP_BACKEND=pkg-config" >> "$GITHUB_ENV" - echo "TECTONIC_PKGCONFIG_FORCE_SEMI_STATIC=true" >> "$GITHUB_ENV" - - name: "Build AppImage" - shell: bash - run: | - artifact_dir="appimage" - mkdir -p "$artifact_dir" - - if [[ $SOURCE_BRANCH == master ]] ; then - export TECTONIC_APPIMAGE_TAG=continuous - export UPDATE_INFORMATION="gh-releases-zsync|tectonic-typesetting|tectonic|continuous|tectonic-*.AppImage.zsync" - fi - - ./dist/appimage/build.sh - cp dist/appimage/tectonic-*.AppImage* "$artifact_dir" - env: - SOURCE_BRANCH: ${{ github.ref_name }} - - name: "Upload AppImage" - uses: actions/upload-artifact@v4 - with: - name: appimage - path: appimage - book: - runs-on: ubuntu-latest - env: - MDBOOK_VERSION: 0.4.2 - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: true - - name: "Generic Setup" - uses: ./.github/actions/build-setup - - name: "Install mdbook ${{ env.MDBOOK_VERSION }}" - run: | - fn="mdbook-v${{ env.MDBOOK_VERSION }}-x86_64-unknown-linux-gnu.tar.gz" - url="https://github.com/rust-lang/mdBook/releases/download/v${{ env.MDBOOK_VERSION }}/$fn" - wget -q --progress=dot "$url" - tar xzf "$fn" - rm -f "$fn" - - name: "mdbook build" - run: | - artifact_dir="${{ github.workspace }}/book" - mkdir -p "$artifact_dir" - cd docs && ../mdbook build -d "$artifact_dir" - - name: "mdbook test" - run: | - cd docs && ../mdbook test - - name: "Publish book artifacts" - uses: actions/upload-artifact@v4 - with: - path: ${{ github.workspace }}/book - name: book - linux-semistatic: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: true - - name: "Generic Setup" - uses: ./.github/actions/build-setup - - name: "Install pkg-config dependencies" - uses: ./.github/actions/pkgconfig-deps - - name: "Setup build variables" - shell: bash - run: | - echo "TECTONIC_DEP_BACKEND=pkg-config" >> "$GITHUB_ENV" - echo "TECTONIC_PKGCONFIG_FORCE_SEMI_STATIC=true" >> "$GITHUB_ENV" - - name: "Build and Test" - uses: ./.github/actions/build-and-test - with: - target: x86_64-unknown-linux-gnu - publish: true - linux-toolchains: - runs-on: ubuntu-latest - strategy: - matrix: - toolchain: [ "beta", "nightly" ] - fail-fast: false - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: true - - name: "Generic Setup" - uses: ./.github/actions/build-setup - with: - toolchain: ${{ matrix.toolchain }} - - name: "Install pkg-config dependencies" - uses: ./.github/actions/pkgconfig-deps - - name: "Setup build variables" - shell: bash - run: | - echo "TECTONIC_DEP_BACKEND=pkg-config" >> "$GITHUB_ENV" - - name: "Build and Test" - uses: ./.github/actions/build-and-test - with: - target: x86_64-unknown-linux-gnu - linux-feature-tests: - strategy: - matrix: - features: [ "_all_", "_none_", "geturl-curl serialization" ] - fail-fast: false - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: true - - name: "Generic Setup" - uses: ./.github/actions/build-setup - - name: "Install pkg-config dependencies" - uses: ./.github/actions/pkgconfig-deps - with: - install-all-deps: ${{ matrix.features == '_all_' }} - - name: "Setup build variables" - shell: bash - run: | - echo "TECTONIC_DEP_BACKEND=pkg-config" >> "$GITHUB_ENV" - - name: "Build and Test" - uses: ./.github/actions/build-and-test - with: - target: x86_64-unknown-linux-gnu - features: ${{ matrix.features }} +# clippy: +# runs-on: ubuntu-latest +# steps: +# - name: Checkout repository +# uses: actions/checkout@v4 +# with: +# fetch-depth: 0 +# submodules: true +# - name: "Generic Setup" +# uses: ./.github/actions/build-setup +# - name: "Install pkg-config dependencies" +# uses: ./.github/actions/pkgconfig-deps +# with: +# install-all-deps: 'true' +# - name: "Install clippy" +# run: | +# rustup component add clippy +# cargo clippy --version +# - name: "cargo clippy" +# run: cargo clippy --all --all-targets --all-features -- --deny warnings +# coverage: +# runs-on: ubuntu-latest +# steps: +# - name: Checkout repository +# uses: actions/checkout@v4 +# with: +# fetch-depth: 0 +# submodules: true +# - name: "Generic Setup" +# uses: ./.github/actions/build-setup +# - name: "Install pkg-config dependencies" +# uses: ./.github/actions/pkgconfig-deps +# - name: "Set up code coverage" +# run: | +# wget https://apt.llvm.org/llvm.sh +# chmod +x llvm.sh +# sudo ./llvm.sh 20 +# +# echo "CC=clang-20" >> "$GITHUB_ENV" +# echo "CXX=clang++-20" >> "$GITHUB_ENV" +# cargo install cargo-llvm-cov +# - name: "cargo llvm-cov" +# run: cargo llvm-cov --workspace --include-ffi --ignore-filename-regex '/harfbuzz/' --codecov --output-path coverage.json +# - name: "Report coverage results" +# uses: codecov/codecov-action@v5 +# with: +# token: ${{ secrets.CODECOV_TOKEN }} +# appimage: +# runs-on: ubuntu-latest +# steps: +# - name: Checkout repository +# uses: actions/checkout@v4 +# with: +# fetch-depth: 0 +# submodules: true +# - name: "Generic Setup" +# uses: ./.github/actions/build-setup +# - name: "Install pkg-config dependencies" +# uses: ./.github/actions/pkgconfig-deps +# - name: "Setup build variables" +# shell: bash +# run: | +# echo "TECTONIC_DEP_BACKEND=pkg-config" >> "$GITHUB_ENV" +# echo "TECTONIC_PKGCONFIG_FORCE_SEMI_STATIC=true" >> "$GITHUB_ENV" +# - name: "Build AppImage" +# shell: bash +# run: | +# artifact_dir="appimage" +# mkdir -p "$artifact_dir" +# +# if [[ $SOURCE_BRANCH == master ]] ; then +# export TECTONIC_APPIMAGE_TAG=continuous +# export UPDATE_INFORMATION="gh-releases-zsync|tectonic-typesetting|tectonic|continuous|tectonic-*.AppImage.zsync" +# fi +# +# ./dist/appimage/build.sh +# cp dist/appimage/tectonic-*.AppImage* "$artifact_dir" +# env: +# SOURCE_BRANCH: ${{ github.ref_name }} +# - name: "Upload AppImage" +# uses: actions/upload-artifact@v4 +# with: +# name: appimage +# path: appimage +# book: +# runs-on: ubuntu-latest +# env: +# MDBOOK_VERSION: 0.4.2 +# steps: +# - name: Checkout repository +# uses: actions/checkout@v4 +# with: +# fetch-depth: 0 +# submodules: true +# - name: "Generic Setup" +# uses: ./.github/actions/build-setup +# - name: "Install mdbook ${{ env.MDBOOK_VERSION }}" +# run: | +# fn="mdbook-v${{ env.MDBOOK_VERSION }}-x86_64-unknown-linux-gnu.tar.gz" +# url="https://github.com/rust-lang/mdBook/releases/download/v${{ env.MDBOOK_VERSION }}/$fn" +# wget -q --progress=dot "$url" +# tar xzf "$fn" +# rm -f "$fn" +# - name: "mdbook build" +# run: | +# artifact_dir="${{ github.workspace }}/book" +# mkdir -p "$artifact_dir" +# cd docs && ../mdbook build -d "$artifact_dir" +# - name: "mdbook test" +# run: | +# cd docs && ../mdbook test +# - name: "Publish book artifacts" +# uses: actions/upload-artifact@v4 +# with: +# path: ${{ github.workspace }}/book +# name: book +# linux-semistatic: +# runs-on: ubuntu-latest +# steps: +# - name: Checkout repository +# uses: actions/checkout@v4 +# with: +# fetch-depth: 0 +# submodules: true +# - name: "Generic Setup" +# uses: ./.github/actions/build-setup +# - name: "Install pkg-config dependencies" +# uses: ./.github/actions/pkgconfig-deps +# - name: "Setup build variables" +# shell: bash +# run: | +# echo "TECTONIC_DEP_BACKEND=pkg-config" >> "$GITHUB_ENV" +# echo "TECTONIC_PKGCONFIG_FORCE_SEMI_STATIC=true" >> "$GITHUB_ENV" +# - name: "Build and Test" +# uses: ./.github/actions/build-and-test +# with: +# target: x86_64-unknown-linux-gnu +# publish: true +# linux-toolchains: +# runs-on: ubuntu-latest +# strategy: +# matrix: +# toolchain: [ "beta", "nightly" ] +# fail-fast: false +# steps: +# - name: Checkout repository +# uses: actions/checkout@v4 +# with: +# fetch-depth: 0 +# submodules: true +# - name: "Generic Setup" +# uses: ./.github/actions/build-setup +# with: +# toolchain: ${{ matrix.toolchain }} +# - name: "Install pkg-config dependencies" +# uses: ./.github/actions/pkgconfig-deps +# - name: "Setup build variables" +# shell: bash +# run: | +# echo "TECTONIC_DEP_BACKEND=pkg-config" >> "$GITHUB_ENV" +# - name: "Build and Test" +# uses: ./.github/actions/build-and-test +# with: +# target: x86_64-unknown-linux-gnu +# linux-feature-tests: +# strategy: +# matrix: +# features: [ "_all_", "_none_", "geturl-curl serialization" ] +# fail-fast: false +# runs-on: ubuntu-latest +# steps: +# - name: Checkout repository +# uses: actions/checkout@v4 +# with: +# fetch-depth: 0 +# submodules: true +# - name: "Generic Setup" +# uses: ./.github/actions/build-setup +# - name: "Install pkg-config dependencies" +# uses: ./.github/actions/pkgconfig-deps +# with: +# install-all-deps: ${{ matrix.features == '_all_' }} +# - name: "Setup build variables" +# shell: bash +# run: | +# echo "TECTONIC_DEP_BACKEND=pkg-config" >> "$GITHUB_ENV" +# - name: "Build and Test" +# uses: ./.github/actions/build-and-test +# with: +# target: x86_64-unknown-linux-gnu +# features: ${{ matrix.features }} pkg-config: strategy: matrix: @@ -250,94 +250,94 @@ jobs: target: ${{ matrix.target }} features: ${{ matrix.features }} publish: ${{ matrix.publish }} - vcpkg: - strategy: - matrix: - data: - - image: ubuntu-latest - target: x86_64-unknown-linux-gnu - - image: windows-latest - target: x86_64-pc-windows-msvc - - image: macos-latest - target: x86_64-apple-darwin - - image: macos-latest - target: aarch64-apple-darwin - fail-fast: false - runs-on: ${{ matrix.data.image }} - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: true - - name: "Generic Setup" - uses: ./.github/actions/build-setup - with: - toolchain: ${{ matrix.toolchain }} - - name: "Install vcpkg dependencies" - uses: ./.github/actions/vcpkg-deps - with: - target: ${{ matrix.data.target }} - - name: "Setup build variables" - shell: bash - run: | - echo "TECTONIC_DEP_BACKEND=vcpkg" >> "$GITHUB_ENV" - echo "VCPKG_ROOT=$GITHUB_WORKSPACE/target/vcpkg" >> "$GITHUB_ENV" - - name: "Setup build variables (Windows)" - if: ${{ runner.os == 'Windows' }} - shell: bash - run: | - echo "RUSTFLAGS=-Ctarget-feature=+crt-static" >> "$GITHUB_ENV" - echo "VCPKGRS_TRIPLET=x64-windows-static-release" >> "$GITHUB_ENV" - echo "VCPKG_DEFAULT_HOST_TRIPLET=x64-windows-static-release" >> "$GITHUB_ENV" - # Format file locking issue workaround: - echo "RUST_TEST_THREADS=1" >> "$GITHUB_ENV" - - name: "Build and Test" - uses: ./.github/actions/build-and-test - with: - target: ${{ matrix.data.target }} - publish: ${{ matrix.data.image != 'ubuntu-latest' }} - cross: - strategy: - matrix: - target: - - aarch64-unknown-linux-musl - - arm-unknown-linux-musleabihf - - i686-unknown-linux-gnu - - x86_64-unknown-linux-musl - fail-fast: false - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: true - - name: "Generic Setup" - uses: ./.github/actions/build-setup - - name: "Set up QEMU" - shell: bash - run: - docker run --rm --privileged multiarch/qemu-user-static:register --reset --credential yes - - name: "cargo install cross" - shell: bash - run: - cargo install cross - - name: "Setup build variables" - shell: bash - run: | - HOST_UID=$(id -u) - HOST_GID=$(id -g) - echo "CROSS_ROOTLESS_CONTAINER_ENGINE=1" >> "$GITHUB_ENV" - echo "DOCKER_OPTS=--privileged -e HOST_UID=${HOST_UID} -e HOST_GID=${HOST_GID}" >> "$GITHUB_ENV" - # TODO: Add font files to the cross images so we can include fontconfig_bridge in tests - # TODO: Figure out why doctests are broken so we can drop all-targets - - name: "Build and Test" - uses: ./.github/actions/build-and-test - with: - target: ${{ matrix.target }} - publish: 'true' - executable: 'cross' - test-flags: '--all-targets --exclude tectonic_bridge_fontconfig' - package-flags: '--command-name=cross --reroot=.' +# vcpkg: +# strategy: +# matrix: +# data: +# - image: ubuntu-latest +# target: x86_64-unknown-linux-gnu +# - image: windows-latest +# target: x86_64-pc-windows-msvc +# - image: macos-latest +# target: x86_64-apple-darwin +# - image: macos-latest +# target: aarch64-apple-darwin +# fail-fast: false +# runs-on: ${{ matrix.data.image }} +# steps: +# - name: Checkout repository +# uses: actions/checkout@v4 +# with: +# fetch-depth: 0 +# submodules: true +# - name: "Generic Setup" +# uses: ./.github/actions/build-setup +# with: +# toolchain: ${{ matrix.toolchain }} +# - name: "Install vcpkg dependencies" +# uses: ./.github/actions/vcpkg-deps +# with: +# target: ${{ matrix.data.target }} +# - name: "Setup build variables" +# shell: bash +# run: | +# echo "TECTONIC_DEP_BACKEND=vcpkg" >> "$GITHUB_ENV" +# echo "VCPKG_ROOT=$GITHUB_WORKSPACE/target/vcpkg" >> "$GITHUB_ENV" +# - name: "Setup build variables (Windows)" +# if: ${{ runner.os == 'Windows' }} +# shell: bash +# run: | +# echo "RUSTFLAGS=-Ctarget-feature=+crt-static" >> "$GITHUB_ENV" +# echo "VCPKGRS_TRIPLET=x64-windows-static-release" >> "$GITHUB_ENV" +# echo "VCPKG_DEFAULT_HOST_TRIPLET=x64-windows-static-release" >> "$GITHUB_ENV" +# # Format file locking issue workaround: +# echo "RUST_TEST_THREADS=1" >> "$GITHUB_ENV" +# - name: "Build and Test" +# uses: ./.github/actions/build-and-test +# with: +# target: ${{ matrix.data.target }} +# publish: ${{ matrix.data.image != 'ubuntu-latest' }} +# cross: +# strategy: +# matrix: +# target: +# - aarch64-unknown-linux-musl +# - arm-unknown-linux-musleabihf +# - i686-unknown-linux-gnu +# - x86_64-unknown-linux-musl +# fail-fast: false +# runs-on: ubuntu-latest +# steps: +# - name: Checkout repository +# uses: actions/checkout@v4 +# with: +# fetch-depth: 0 +# submodules: true +# - name: "Generic Setup" +# uses: ./.github/actions/build-setup +# - name: "Set up QEMU" +# shell: bash +# run: +# docker run --rm --privileged multiarch/qemu-user-static:register --reset --credential yes +# - name: "cargo install cross" +# shell: bash +# run: +# cargo install cross +# - name: "Setup build variables" +# shell: bash +# run: | +# HOST_UID=$(id -u) +# HOST_GID=$(id -g) +# echo "CROSS_ROOTLESS_CONTAINER_ENGINE=1" >> "$GITHUB_ENV" +# echo "DOCKER_OPTS=--privileged -e HOST_UID=${HOST_UID} -e HOST_GID=${HOST_GID}" >> "$GITHUB_ENV" +# # TODO: Add font files to the cross images so we can include fontconfig_bridge in tests +# # TODO: Figure out why doctests are broken so we can drop all-targets +# - name: "Build and Test" +# uses: ./.github/actions/build-and-test +# with: +# target: ${{ matrix.target }} +# publish: 'true' +# executable: 'cross' +# test-flags: '--all-targets --exclude tectonic_bridge_fontconfig' +# package-flags: '--command-name=cross --reroot=.'