ML-DSA: import and enable x86_64 assembly backend from mldsa-native #9196
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Windows Alternative Compilers | |
| on: | |
| push: | |
| branches: [ '*' ] | |
| pull_request: | |
| branches: [ '*' ] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref_name }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| mingw: | |
| if: github.repository_owner == 'aws' | |
| runs-on: windows-latest | |
| steps: | |
| - name: Install NASM | |
| uses: ilammy/setup-nasm@v1.5.1 | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| path: "path has spaces/aws-lc" | |
| - name: Setup MinGW | |
| uses: egor-tensin/setup-mingw@v3 | |
| id: setup_mingw | |
| with: | |
| static: 0 | |
| - name: Setup CMake | |
| uses: threeal/cmake-action@v2.1.0 | |
| with: | |
| generator: Ninja | |
| source-dir: 'path has spaces/aws-lc' | |
| build-dir: 'path has spaces/build' | |
| c-compiler: ${{ steps.setup_mingw.outputs.gcc }} | |
| cxx-compiler: ${{ steps.setup_mingw.outputs.gxx }} | |
| options: | | |
| CMAKE_SYSTEM_NAME=Windows | |
| CMAKE_SYSTEM_PROCESSOR=x86_64 | |
| CMAKE_BUILD_TOOL=C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin/ninja.exe | |
| CMAKE_FIND_ROOT_PATH=C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64 | |
| CMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER | |
| CMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY | |
| CMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY | |
| CMAKE_BUILD_TYPE=Release | |
| - name: Build Project | |
| run: cmake --build "path has spaces/build" --target all | |
| - name: Run tests | |
| run: cmake --build "path has spaces/build" --target run_tests | |
| clang: | |
| if: github.repository_owner == 'aws' | |
| runs-on: windows-latest | |
| steps: | |
| - name: Install NASM | |
| uses: ilammy/setup-nasm@v1.5.1 | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Install LLVM and Clang | |
| uses: KyleMayes/install-llvm-action@v2 | |
| id: clang | |
| with: | |
| version: 19 | |
| env: true | |
| - name: Setup CMake | |
| uses: threeal/cmake-action@v2.1.0 | |
| with: | |
| generator: Ninja | |
| c-compiler: "C:/Program Files/LLVM/bin/clang.exe" | |
| cxx-compiler: "C:/Program Files/LLVM/bin/clang++.exe" | |
| options: | | |
| CMAKE_SYSTEM_NAME=Windows | |
| CMAKE_SYSTEM_PROCESSOR=x86_64 | |
| CMAKE_BUILD_TYPE=Release | |
| - name: Build Project | |
| run: cmake --build ./build --target all | |
| - name: Run tests | |
| run: cmake --build ./build --target run_tests | |
| clang-cl-msbuild: | |
| if: github.repository_owner == 'aws' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: | |
| - x64 | |
| - x64_arm64 | |
| runs-on: windows-latest | |
| env: | |
| CMAKE_GENERATOR: "Visual Studio 17 2022" | |
| CMAKE_GENERATOR_TOOLSET: "ClangCL,host=x64" | |
| steps: | |
| - if: ${{ matrix.target == 'x64' }} | |
| name: Install NASM | |
| uses: ilammy/setup-nasm@v1.5.1 | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - uses: TheMrMilchmann/setup-msvc-dev@v4 | |
| with: | |
| arch: ${{ matrix.target }} | |
| - if: ${{ matrix.target == 'x64' }} | |
| name: Setup CMake | |
| uses: threeal/cmake-action@v2.1.0 | |
| with: | |
| options: | | |
| CMAKE_BUILD_TYPE=Release | |
| - if: ${{ matrix.target == 'x64_arm64' }} | |
| name: Setup CMake | |
| uses: threeal/cmake-action@v2.1.0 | |
| with: | |
| options: | | |
| CMAKE_GENERATOR_PLATFORM=ARM64 | |
| CMAKE_SYSTEM_NAME=Windows | |
| CMAKE_SYSTEM_PROCESSOR=ARM64 | |
| CMAKE_BUILD_TYPE=Release | |
| - name: Build Project | |
| run: cmake --build ./build --target all_tests | |
| - if: ${{ matrix.target == 'x64' }} | |
| name: Run tests | |
| run: cmake --build ./build --target run_tests | |
| clang-cl-ninja: | |
| if: github.repository_owner == 'aws' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: | |
| - x64 | |
| - x64_arm64 | |
| runs-on: windows-latest | |
| steps: | |
| - if: ${{ matrix.target == 'x64' }} | |
| name: Install NASM | |
| uses: ilammy/setup-nasm@v1.5.1 | |
| - name: Remove wrong clang-cl.exe | |
| run: rm "C:/Program Files/LLVM/bin/clang-cl.exe" | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - uses: TheMrMilchmann/setup-msvc-dev@v4 | |
| with: | |
| arch: ${{ matrix.target }} | |
| - if: ${{ matrix.target == 'x64' }} | |
| name: Setup CMake | |
| uses: threeal/cmake-action@v2.1.0 | |
| with: | |
| generator: Ninja | |
| c-compiler: clang-cl | |
| cxx-compiler: clang-cl | |
| options: | | |
| CMAKE_BUILD_TYPE=Release | |
| - if: ${{ matrix.target == 'x64_arm64' }} | |
| name: Setup CMake | |
| uses: threeal/cmake-action@v2.1.0 | |
| with: | |
| generator: Ninja | |
| c-compiler: clang-cl | |
| cxx-compiler: clang-cl | |
| options: | | |
| CMAKE_SYSTEM_NAME=Windows | |
| CMAKE_SYSTEM_PROCESSOR=ARM64 | |
| CMAKE_C_COMPILER_TARGET=arm64-pc-windows-msvc | |
| CMAKE_ASM_COMPILER_TARGET=arm64-pc-windows-msvc | |
| CMAKE_CXX_COMPILER_TARGET=arm64-pc-windows-msvc | |
| CMAKE_BUILD_TYPE=Release | |
| - name: Build Project | |
| run: cmake --build ./build --target all | |
| - if: ${{ matrix.target == 'x64' }} | |
| name: Run tests | |
| run: cmake --build ./build --target run_tests | |
| - if: ${{ matrix.target == 'x64' }} | |
| name: Setup Go (for FIPS) | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: '>=1.20' | |
| - if: ${{ matrix.target == 'x64' }} | |
| name: Build and test with FIPS | |
| run: | | |
| cmake -GNinja -B ./build-fips -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_BUILD_TYPE=Release -DFIPS=1 -DBUILD_SHARED_LIBS=1 | |
| cmake --build ./build-fips | |
| $buildFips = (Resolve-Path ./build-fips).Path | |
| $env:PATH = "$buildFips;$buildFips\crypto;$buildFips\ssl;$env:PATH" | |
| cmake --build ./build-fips --target run_tests | |
| cross-mingw: | |
| if: github.repository_owner == 'aws' | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Install Tools | |
| run: | | |
| set -ex | |
| sudo apt-get update -o Acquire::Languages=none -o Acquire::Translation=none | |
| sudo apt-get install --assume-yes --no-install-recommends software-properties-common | |
| sudo add-apt-repository --yes ppa:longsleep/golang-backports | |
| sudo dpkg --add-architecture i386 | |
| sudo mkdir -pm755 /etc/apt/keyrings | |
| sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key | |
| sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources | |
| sudo apt-get update -o Acquire::Languages=none -o Acquire::Translation=none | |
| sudo apt-get install --assume-yes --no-install-recommends build-essential cmake golang-go nasm clang wget mingw-w64 | |
| sudo apt-get install --assume-yes --install-recommends winehq-stable wine-binfmt | |
| sudo update-binfmts --display | |
| sudo update-binfmts --disable | |
| sudo update-binfmts --enable wine | |
| sudo update-binfmts --display | |
| sudo rm -rf /tmp/* | |
| - uses: actions/checkout@v6 | |
| - name: x86_64-w64-mingw32 Build/Test | |
| run: | |
| ./tests/ci/run_cross_mingw_tests.sh x86_64 w64-mingw32 "-DCMAKE_BUILD_TYPE=Release" | |
| cross-clang-cl-ninja: | |
| # Cross-compile from Linux to x86_64-pc-windows-msvc with Ninja + clang-cl, | |
| # mirroring the default aws-lc-rs setup. This catches command-line quoting | |
| # regressions the Windows-native clang-cl-ninja job misses because cmd.exe | |
| # and /bin/sh tokenize arguments differently (see aws/aws-lc-rs#981). | |
| if: github.repository_owner == 'aws' | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup toolchain | |
| run: | | |
| set -ex | |
| sudo apt-get update -o Acquire::Languages=none -o Acquire::Translation=none | |
| sudo apt-get install --assume-yes --no-install-recommends \ | |
| cmake ninja-build nasm \ | |
| wget lsb-release software-properties-common gnupg | |
| # Clang 19 (xwin's MSVC STL headers require Clang >= 19; 24.04 ships 18). | |
| wget -qO- https://apt.llvm.org/llvm.sh | sudo bash -s -- 19 | |
| sudo ln -sf /usr/bin/clang-19 /usr/local/bin/clang-cl | |
| sudo ln -sf /usr/bin/lld-19 /usr/local/bin/lld-link | |
| sudo ln -sf /usr/bin/llvm-ar-19 /usr/local/bin/llvm-lib | |
| sudo ln -sf /usr/bin/llvm-rc-19 /usr/local/bin/llvm-rc | |
| sudo ln -sf /usr/bin/llvm-mt-19 /usr/local/bin/llvm-mt | |
| # xwin provides the MSVC SDK headers/libs for cross-compiling. | |
| XWIN_VERSION=0.6.5 | |
| wget -qO- https://github.com/Jake-Shadle/xwin/releases/download/${XWIN_VERSION}/xwin-${XWIN_VERSION}-x86_64-unknown-linux-musl.tar.gz | tar xz | |
| sudo mv xwin-${XWIN_VERSION}-x86_64-unknown-linux-musl/xwin /usr/local/bin/ | |
| xwin --accept-license --arch x86_64 splat --output /tmp/xwin | |
| - name: Build | |
| run: | | |
| set -ex | |
| cmake -B build -G Ninja \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DCMAKE_TOOLCHAIN_FILE=util/x86_64-windows-clang-cl-toolchain.cmake | |
| cmake --build build --target all | |
| msys2: | |
| name: msys2 ${{ matrix.sys }} - ${{ matrix.generator }} | |
| if: github.repository_owner == 'aws' | |
| runs-on: windows-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| sys: | |
| - mingw64 | |
| - ucrt64 | |
| - clang64 | |
| generator: | |
| - 'Ninja' | |
| - 'MinGW Makefiles' | |
| - 'MSYS Makefiles' | |
| steps: | |
| - name: Install MSYS2 | |
| uses: msys2/setup-msys2@v2 | |
| id: setup_msys2 | |
| with: | |
| msystem: ${{ matrix.sys }} | |
| update: true | |
| pacboy: >- | |
| cmake | |
| toolchain | |
| llvm | |
| rust | |
| rust-bindgen | |
| ninja | |
| cc | |
| go | |
| nasm | |
| - name: Update Environment | |
| shell: bash | |
| run: | | |
| SYSROOT=$(cygpath -a -m '${{ steps.setup_msys2.outputs.msys2-location }}\${{ matrix.sys }}') | |
| echo "GOPATH=${SYSROOT}" >> $GITHUB_ENV | |
| echo "GOROOT=${SYSROOT}/lib/go" >> $GITHUB_ENV | |
| echo "CMAKE_GENERATOR=${{ matrix.generator }}" >> $GITHUB_ENV | |
| cygpath -m ${SYSROOT}/bin >> $GITHUB_PATH | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup CMake | |
| uses: threeal/cmake-action@v2.1.0 | |
| with: | |
| build-dir: ./build | |
| options: | | |
| CMAKE_SYSTEM_NAME=Windows | |
| CMAKE_SYSTEM_PROCESSOR=x86_64 | |
| CMAKE_FIND_ROOT_PATH='${{ steps.setup_msys2.outputs.msys2-location }}\${{ matrix.sys }}\' | |
| CMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER | |
| CMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY | |
| CMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY | |
| CMAKE_BUILD_TYPE=Release | |
| - name: Run tests | |
| shell: 'msys2 {0}' | |
| run: cmake --build ./build --target run_tests |