Merge pull request #12889 from gasche/thread-safe-DLS #1
This file contains 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: Build with MSVC | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
on: | |
push: | |
branches: | |
- '4.**' | |
- '5.**' | |
- 'trunk' | |
pull_request: | |
jobs: | |
build: | |
permissions: {} | |
runs-on: windows-latest | |
timeout-minutes: 60 | |
name: ${{ matrix.x86_64 && 'MSVC 64 bits' || 'MSVC 32 bits' }} | |
strategy: | |
matrix: | |
x86_64: [true, false] | |
steps: | |
- name: Save pristine PATH | |
run: | | |
echo "PRISTINE_PATH=${env:Path}" >> "${env:GITHUB_ENV}" | |
- name: Set up MSVC | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
# This is cl version 19.38, Visual Studio version 17.8 | |
toolset: 14.38 | |
arch: ${{ matrix.x86_64 && 'x64' || 'x86' }} | |
- name: Fetch OCaml | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Restore Cygwin cache | |
uses: actions/cache/restore@v3 | |
env: | |
PATH: ${{ env.PRISTINE_PATH }} | |
with: | |
path: | | |
C:\cygwin-packages | |
key: cygwin-packages | |
- name: Install Cygwin | |
uses: cygwin/cygwin-install-action@v3 | |
with: | |
packages: make,bash,mingw64-x86_64-gcc-core | |
install-dir: 'D:\cygwin' | |
- name: Save Cygwin cache | |
uses: actions/cache/save@v3 | |
env: | |
PATH: ${{ env.PRISTINE_PATH }} | |
with: | |
path: | | |
C:\cygwin-packages | |
key: cygwin-packages | |
- name: Build OCaml | |
shell: bash -e {0} | |
env: | |
HOST: ${{ matrix.x86_64 && 'x86_64-pc-windows' || 'i686-pc-windows' }} | |
run: >- | |
eval $(tools/msvs-promote-path) ; | |
./configure --host=$HOST ; | |
make ; | |
runtime/ocamlrun ocamlc -config ; | |
- name: Assemble backend with MinGW GASM and compare | |
shell: bash -e {0} | |
run: >- | |
x86_64-w64-mingw32-gcc -c -I./runtime -I ./flexdll -D__USE_MINGW_ANSI_STDIO=0 -DUNICODE -D_UNICODE -DWINDOWS_UNICODE=1 -DCAMLDLLIMPORT= -DIN_CAML_RUNTIME -DNATIVE_CODE -DTARGET_amd64 -DMODEL_default -DSYS_mingw64 -o runtime/amd64.o runtime/amd64.S ; | |
dumpbin /disasm:nobytes runtime/amd64nt.obj > runtime/amd64nt.dump ; | |
awk -f tools/ci/actions/canonicalize-dumpbin.awk runtime/amd64nt.dump runtime/amd64nt.dump > runtime/amd64nt.canonical ; | |
dumpbin /disasm:nobytes runtime/amd64.o > runtime/amd64.dump ; | |
awk -f tools/ci/actions/canonicalize-dumpbin.awk runtime/amd64.dump runtime/amd64.dump > runtime/amd64.canonical ; | |
git diff --no-index -- runtime/amd64*.canonical ; | |
wc -l runtime/amd64*.dump runtime/amd64*.canonical ; | |
# ^ The final wc is there to make sure that the canonical files are | |
# reasonable cleaned-up versions of the raw dumpbins and not simply | |
# empty | |
if: matrix.x86_64 | |
- name: Run the test suite | |
shell: bash -e {0} | |
run: >- | |
eval $(tools/msvs-promote-path) ; | |
make tests ; |