diff --git a/.github/workflows/linux-mit-interop.yml b/.github/workflows/linux-interop.yml similarity index 80% rename from .github/workflows/linux-mit-interop.yml rename to .github/workflows/linux-interop.yml index 769d80a40..9707ef349 100644 --- a/.github/workflows/linux-mit-interop.yml +++ b/.github/workflows/linux-interop.yml @@ -3,7 +3,7 @@ name: Linux Build on: push: branches: - - 'interop-mit*' + - 'interop*' jobs: unix: @@ -20,6 +20,11 @@ jobs: steps: - name: Clone repository uses: actions/checkout@v4 + - name: Clone older Heimdal for interop testing + uses: actions/checkout@v4 + with: + ref: older-branch-for-interop-testing + path: older-heimdal - name: Checkout MIT uses: actions/checkout@v4 with: @@ -41,6 +46,17 @@ jobs: # Temporary workaround for: # https://github.com/actions/virtual-environments/issues/3185 sudo hostname localhost + - name: Build older Heimdal + env: + CC: ${{ matrix.compiler }} + run: | + cd older-heimdal + /bin/sh ./autogen.sh + mkdir build + cd build + ../configure --prefix=$HOME/oh5l --srcdir=`dirname "$PWD"` --enable-maintainer-mode --enable-developer --with-ldap $CONFIGURE_OPTS CFLAGS="${{ matrix.cflags }} -Wno-error=shadow -Wno-error=bad-function-cast -Wno-error=unused-function -Wno-error=unused-result -Wno-error=deprecated-declarations" + make -j4 + make install - name: Build MIT env: CC: ${{ matrix.compiler }} @@ -59,7 +75,7 @@ jobs: /bin/sh ./autogen.sh mkdir build cd build - ../configure --srcdir=`dirname "$PWD"` --enable-maintainer-mode --enable-developer --with-ldap $CONFIGURE_OPTS --prefix=$HOME/inst CFLAGS="${{ matrix.cflags }} -Wno-error=shadow -Wno-error=bad-function-cast -Wno-error=unused-function -Wno-error=unused-result -Wno-error=deprecated-declarations" --with-mitkrb5=$HOME/mitkrb5 + ../configure --srcdir=`dirname "$PWD"` --enable-maintainer-mode --enable-developer --with-ldap $CONFIGURE_OPTS --prefix=$HOME/inst CFLAGS="${{ matrix.cflags }} -Wno-error=shadow -Wno-error=bad-function-cast -Wno-error=unused-function -Wno-error=unused-result -Wno-error=deprecated-declarations" --with-mitkrb5=$HOME/mitkrb5 --with-older-heimdal=$HOME/oh5l make -j4 - name: Test env: @@ -69,7 +85,12 @@ jobs: cd build sudo sysctl kernel.core_pattern=core.%p || true ulimit -c unlimited + cd lib make check + cd ../tests/bin + make check + cd ../kdc + make SCRIPT_TESTS='check-fast check-mit-kdc check-old-heimdal-client check-old-heimdal-kdc' check - name: Make Install env: CC: ${{ matrix.compiler }} @@ -92,27 +113,13 @@ jobs: if: ${{ failure() }} run: | find build -name \*.trs | xargs grep -lw FAIL | sed -e 's/trs$/log/' | xargs cat - - name: Make Dist - run: | - cd build - make dist - make distclean - if [ "$(git ls-files -o|grep -v ^build/ | wc -l)" -ne 0 ]; then - echo "Files not removed by make distclean:" - git ls-files -o|grep -v ^build/ - fi - name: Upload Install Tarball uses: actions/upload-artifact@v4 with: - name: Install Tarball (mit-interop) + name: Install Tarball (interop) path: '~/heimdal-install-linux-${{ matrix.compiler }}.tgz' - - name: Upload Dist Tarball - uses: actions/upload-artifact@v4 - with: - name: Dist Tarball (mit-interop) - path: 'build/heimdal-*.tar.gz' - name: Upload Logs Tarball uses: actions/upload-artifact@v4 with: - name: Test Logs (mit-interop) + name: Test Logs (interop) path: '~/logs-linux-${{ matrix.compiler }}.tgz' diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 6e8761197..36ea4ac2c 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -50,16 +50,18 @@ on: jobs: unix: + # Run if no [only X] tag, or if [only linux] is present (check both push commits and PR titles) + if: >- + (!contains(github.event.head_commit.message, '[only ') && + !contains(github.event.pull_request.title, '[only ')) || + contains(github.event.head_commit.message, '[only linux]') || + contains(github.event.pull_request.title, '[only linux]') runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - name: [linux-clang, linux-gcc] + name: [linux-gcc] include: - - name: linux-clang - os: ubuntu-22.04 - compiler: clang - cflags: '' - name: linux-gcc os: ubuntu-22.04 compiler: gcc diff --git a/.github/workflows/osx.yml b/.github/workflows/osx.yml index fcf3832fe..b5daf5d11 100644 --- a/.github/workflows/osx.yml +++ b/.github/workflows/osx.yml @@ -51,6 +51,12 @@ on: jobs: osx: + # Run if no [only X] tag, or if [only osx] is present (check both push commits and PR titles) + if: >- + (!contains(github.event.head_commit.message, '[only ') && + !contains(github.event.pull_request.title, '[only ')) || + contains(github.event.head_commit.message, '[only osx]') || + contains(github.event.pull_request.title, '[only osx]') runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -66,8 +72,10 @@ jobs: echo "bison, flex, ncurses, texinfo, and unzip are in the base OS." echo "berkeley-db, perl, python3, curl, and jq are installed in the" echo "base image already." - brew install autoconf automake libtool cpanm texinfo texi2html + brew install autoconf automake bison libtool cpanm texinfo texi2html bash openssl@3 sudo cpanm install JSON + # Use Homebrew bash for tests (much faster than /bin/bash on macOS) + echo "$(brew --prefix)/bin" >> $GITHUB_PATH - name: Clone repository uses: actions/checkout@v4 - name: Build @@ -79,7 +87,7 @@ jobs: /bin/sh ./autogen.sh mkdir build cd build - ../configure --srcdir=`dirname "$PWD"` --disable-heimdal-documentation --disable-afs-support --enable-maintainer-mode --enable-developer $CONFIGURE_OPTS --prefix=$HOME/inst CFLAGS="-O0 -g -ggdb3 -Wno-error=shadow -Wno-error=bad-function-cast -Wno-error=unused-function -Wno-error=unused-result -Wno-error=deprecated-declarations" + ../configure --srcdir=`dirname "$PWD"` --disable-heimdal-documentation --enable-maintainer-mode --enable-developer $CONFIGURE_OPTS --prefix=$HOME/inst --with-openssl=/opt/homebrew/opt/openssl@3/ CFLAGS="-O0 -g -ggdb3 -Wno-error=shadow -Wno-error=bad-function-cast -Wno-error=unused-function -Wno-error=unused-result -Wno-error=deprecated-declarations" ulimit -c unlimited PATH=/usr/local/opt/texinfo/bin:$PATH export PATH @@ -89,12 +97,15 @@ jobs: # with: # limit-access-to-actor: true - name: Test + shell: bash env: CC: ${{ matrix.compiler }} MAKEVARS: ${{ matrix.makevars }} CONFIGURE_OPTS: ${{ matrix.configureopts }} run: | set -vx + # Verify we're using Homebrew bash (faster than system bash) + echo "Using bash: $(which bash) version $BASH_VERSION" sudo lsof -nP -i:49188 || true cd build make check diff --git a/.github/workflows/valgrind.yml b/.github/workflows/valgrind.yml index be933e055..714694117 100644 --- a/.github/workflows/valgrind.yml +++ b/.github/workflows/valgrind.yml @@ -43,7 +43,7 @@ jobs: /bin/sh ./autogen.sh mkdir build cd build - ../configure --srcdir=`dirname "$PWD"` --enable-maintainer-mode --enable-developer --with-ldap $CONFIGURE_OPTS --prefix=$HOME/inst CFLAGS="-g -ggdb3 -O0 -Wno-error=shadow -Wno-error=bad-function-cast -Wno-error=unused-function -Wno-error=unused-result -Wno-error=deprecated-declarations" + ../configure --srcdir=`dirname "$PWD"` --enable-maintainer-mode --enable-developer --with-ldap $CONFIGURE_OPTS --prefix=$HOME/inst CFLAGS="-gdwarf-4 -g -ggdb3 -O0 -Wno-error=shadow -Wno-error=bad-function-cast -Wno-error=unused-function -Wno-error=unused-result -Wno-error=deprecated-declarations" make -j4 - name: Test env: diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 77035045a..98bb78449 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -49,7 +49,18 @@ on: jobs: windows: + # Run if no [only X] tag, or if [only windows] is present (check both push commits and PR titles) + if: >- + (!contains(github.event.head_commit.message, '[only ') && + !contains(github.event.pull_request.title, '[only ')) || + contains(github.event.head_commit.message, '[only windows]') || + contains(github.event.pull_request.title, '[only windows]') runs-on: windows-latest + strategy: + fail-fast: false + matrix: + # clang-cl disabled due to LLVM 19 bug with MMX intrinsics in VS 2022 headers + compiler: [msvc] env: APPVER: '10.0' CODESIGN_PKT: 0000000000000000 @@ -59,36 +70,65 @@ jobs: steps: - name: Clone repository uses: actions/checkout@v4 + - name: Find MSVC and run vcvarsall.bat uses: ilammy/msvc-dev-cmd@v1 with: arch: amd64 - - name: Build and Test + + - name: Setup OpenSSL + shell: pwsh + run: | + # OpenSSL 3.x is pre-installed on windows-latest at C:\Program Files\OpenSSL + $opensslDir = "C:\Program Files\OpenSSL" + if (Test-Path $opensslDir) { + Write-Host "OpenSSL found at $opensslDir" + Get-ChildItem $opensslDir + # Show version + & "$opensslDir\bin\openssl.exe" version + } else { + Write-Host "OpenSSL not found, installing via chocolatey..." + choco install openssl -y + $opensslDir = "C:\Program Files\OpenSSL" + } + # Set environment variables for the build + echo "OPENSSL_DIR=$opensslDir" >> $env:GITHUB_ENV + echo "INCLUDE_openssl_crypto=$opensslDir\include" >> $env:GITHUB_ENV + echo "LIB_openssl_crypto=$opensslDir\lib\VC\x64\MD\libcrypto.lib" >> $env:GITHUB_ENV + + - name: Install MSYS2 packages shell: cmd run: | - set PATH=%PATH%;C:\msys64\usr\bin;C:\Program Files (x86)\HTML Help Workshop;C:\program files (x86)\windows installer xml v3.5\bin;C:\cygwin\bin + C:\msys64\usr\bin\pacman.exe --noconfirm -S zstd autoconf automake flex bison perl perl-JSON texinfo + + - name: Build + shell: cmd + run: | + set "PATH=%PATH%;C:\msys64\usr\bin" + set "PATH=%PATH%;C:\Program Files (x86)\HTML Help Workshop" + set "PATH=%PATH%;C:\Program Files\OpenSSL\bin" set CODESIGN_PKT=0000000000000000 - set dbg__type=Debug mkdir %INSTALL_DIR% - pacman --noconfirm -S zstd - pacman --noconfirm -S autoconf - pacman --noconfirm -S automake - pacman --noconfirm -S flex - pacman --noconfirm -S bison - pacman --noconfirm -S perl - pacman --noconfirm -S perl-JSON - pacman --noconfirm -S texinfo - set PATH=%PATH%;%wix%bin - title Heimdal Build %CPU% %dbg__type% - set "PATH=%PATH%;C:\Perl64\bin;C:\tools\cygwin\bin;C:\Program Files (x86)\HTML Help Workshop" - set "PATH=%PATH%;C:/msys64/usr/bin" - set "PATH=%PATH%;C:\program files (x86)\windows installer xml v3.5\bin;C:\cygwin\bin" - set "PATH=%PATH%;C:\Python310-x64" echo PATH=%PATH% - nmake /f NTMakefile APPVEYOR=1 MAKEINFO=makeinfo NO_INSTALLERS=1 + echo INCLUDE_openssl_crypto=%INCLUDE_openssl_crypto% + echo LIB_openssl_crypto=%LIB_openssl_crypto% + echo Compiler: ${{ matrix.compiler }} + if "${{ matrix.compiler }}"=="clang-cl" ( + clang-cl --version + nmake /f NTMakefile CC=clang-cl APPVEYOR=1 MAKEINFO=makeinfo NO_INSTALLERS=1 INCLUDE_openssl_crypto="%INCLUDE_openssl_crypto%" LIB_openssl_crypto="%LIB_openssl_crypto%" CFLAGS="-msse2" + ) else ( + nmake /f NTMakefile APPVEYOR=1 MAKEINFO=makeinfo NO_INSTALLERS=1 INCLUDE_openssl_crypto="%INCLUDE_openssl_crypto%" LIB_openssl_crypto="%LIB_openssl_crypto%" + ) + + - name: Test + shell: cmd + run: | + set "PATH=%PATH%;C:\msys64\usr\bin" + set "PATH=%PATH%;C:\Program Files\OpenSSL\bin" nmake /f NTMakefile APPVEYOR=1 MAKEINFO=makeinfo NO_INSTALLERS=1 test + - name: Upload Artifacts uses: actions/upload-artifact@v4 with: - name: Objects + name: Objects-${{ matrix.compiler }} path: 'D:/a/heimdal/heimdal/out/'