Skip to content

Commit

Permalink
Merge pull request #1084 from tleedjarv/gha-fixes
Browse files Browse the repository at this point in the history
Another round of small fixes/improvements for CI and build scripts
  • Loading branch information
gdt authored Nov 23, 2024
2 parents f57eac9 + 96ec097 commit d08a5c3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 38 deletions.
50 changes: 17 additions & 33 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,31 +46,23 @@ jobs:
fail-fast: false
matrix:
job:
- { os: macos-14 , ocaml-version: 5.2.0 }
- { os: macos-14 , ocaml-version: 4.14.2 , publish: true , fnsuffix: -macos-arm64 }
- { os: macos-13 , ocaml-version: 4.14.2 , publish: true , fnsuffix: -macos-x86_64 }
- { os: ubuntu-22.04 , ocaml-version: 5.2.0 }
- { os: ubuntu-22.04 , ocaml-version: 4.14.2 }
- { os: ubuntu-20.04 , ocaml-version: 4.14.2 }
- { os: windows-2022 , ocaml-version: "4.14.2,system-mingw" , publish: true , fnsuffix: -windows-x86_64 }
- { os: windows-2019 , ocaml-version: "4.14.2,system-mingw,arch-x86_32" , publish: true , fnsuffix: -windows-i386 }
- { os: windows-2022 , ocaml-version: "4.14.2,system-msvc" }
- { os: windows-2019 , ocaml-version: "4.14.2,system-msvc,arch-x86_32" }
- { os: macos-14 , ocaml-version: 5.2.x }
- { os: macos-14 , ocaml-version: 4.14.x , publish: true , fnsuffix: -macos-arm64 }
- { os: macos-13 , ocaml-version: 4.14.x , publish: true , fnsuffix: -macos-x86_64 }
- { os: ubuntu-22.04 , ocaml-version: 5.2.x }
- { os: ubuntu-22.04 , ocaml-version: 4.14.x }
- { os: ubuntu-20.04 , ocaml-version: 4.14.x }
- { os: windows-2022 , ocaml-version: "ocaml.4.14.2,system-mingw" , publish: true , fnsuffix: -windows-x86_64 }
- { os: windows-2019 , ocaml-version: "ocaml.4.14.2,system-mingw,arch-x86_32" , publish: true , fnsuffix: -windows-i386 }
- { os: windows-2022 , ocaml-version: "ocaml.4.14.2,system-msvc" }
- { os: windows-2019 , ocaml-version: "ocaml.4.14.2,system-msvc,arch-x86_32" }

runs-on: ${{ matrix.job.os }}

steps:
- if: contains(matrix.job.os, 'ubuntu')
run: sudo apt-get update

- if: runner.os == 'Windows'
name: "Windows: Stash away the default MSYS installation"
continue-on-error: true
shell: cmd
# This conflicts with Cygwin installed by setup-ocaml
# Adjusting PATH alone does not seem to work
run: rename C:\msys64 dmsys64

- name: Checkout code
uses: actions/checkout@v4

Expand All @@ -79,14 +71,6 @@ jobs:
shell: bash
run: |
outputs() { for var in "$@" ; do echo steps.vars.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT ; done; }
# normalize to pre-compiled ocaml compiler variants for windows/Cygwin (decreases OCaml install time by 50%)
case '${{ matrix.job.ocaml-version }}' in
*+*) OCAML_COMPILER='ocaml-variants.${{ matrix.job.ocaml-version }}' ;;
*) OCAML_COMPILER='ocaml-base-compiler.${{ matrix.job.ocaml-version }}' ;;
esac
OCAML_VARIANT='${{ matrix.job.ocaml-version }}'
OCAML_VARIANT="${OCAML_VARIANT/+options/}"
outputs OCAML_VARIANT OCAML_COMPILER
# architecture/platform vars
EXE_suffix='' ; case '${{ matrix.job.os }}' in windows-*) EXE_suffix=".exe" ;; esac
MinGW_ARCH='x86_64' ; case '${{ matrix.job.ocaml-version }}' in *x86_32*) MinGW_ARCH='i686' ;; *mingw*) MinGW_ARCH='x86_64' ;; esac
Expand Down Expand Up @@ -133,7 +117,7 @@ jobs:
- name: Use OCaml ${{ matrix.job.ocaml-version }}
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: "${{ steps.vars.outputs.OCAML_COMPILER }}"
ocaml-compiler: "${{ matrix.job.ocaml-version }}"
opam-pin: false
# setup-ocaml can prepare the build environment from unison.opam
# We're not relying on that capability here, to make sure the builds
Expand Down Expand Up @@ -170,7 +154,7 @@ jobs:
## That remains intentionally so that someone could turn it on if
## desired.
- name: Run self-tests over RPC
if: runner.os == 'Windows' && !contains(matrix.job.ocaml-version, '4.14')
if: runner.os == 'Windows' && !contains(matrix.job.ocaml-version, '4.14') && !contains(matrix.job.ocaml-version, '5.')
shell: bash
run: |
# Separate backup dir must be set for server instance so that the central
Expand All @@ -182,7 +166,7 @@ jobs:
- name: Run self-tests over local socket
# Recent Windows versions do support Unix domain sockets
# but at least OCaml 4.14 is required to use that support
if: runner.os != 'Windows' || contains(matrix.job.ocaml-version, '4.14')
if: runner.os != 'Windows' || contains(matrix.job.ocaml-version, '4.14') || contains(matrix.job.ocaml-version, '5.')
shell: bash
run: |
mkdir localsocket
Expand Down Expand Up @@ -385,16 +369,16 @@ jobs:
# This list is intended to balance good enough coverage and
# limited resource usage.
job:
- { os: ubuntu-22.04 , ocaml-version: 5.2.x , ref: v2.53.5 }
- { os: ubuntu-22.04 , ocaml-version: 4.14.x , ref: v2.53.5 }
- { os: ubuntu-22.04 , ocaml-version: 5.2.x , ref: v2.53.7 }
- { os: ubuntu-22.04 , ocaml-version: 4.14.x , ref: v2.53.7 }
- { os: ubuntu-22.04 , ocaml-version: 4.14.x , ref: v2.52.1 , oldmake: true }
- { os: ubuntu-22.04 , ocaml-version: 4.14.x , ref: v2.51.5 , oldmake: true }
- { os: ubuntu-22.04 , ocaml-version: 4.08.x , ref: v2.51.5 , oldmake: true }
- { os: ubuntu-22.04 , ocaml-version: 4.08.x , ref: v2.51.2 , oldmake: true }
- { os: windows-2019 , ocaml-version: ocaml-variants.4.14.0+mingw64c , ref: v2.53.5 }
- { os: windows-2019 , ocaml-version: ocaml-variants.4.14.0+mingw64c , ref: v2.53.7 }
- { os: windows-2019 , ocaml-version: ocaml-variants.4.14.0+mingw64c , ref: v2.52.1 , oldmake: true }
- { os: windows-2019 , ocaml-version: ocaml-variants.4.08.1+mingw32c , ref: v2.51.5 , oldmake: true }
- { os: macos-13 , ocaml-version: 4.14.x , ref: v2.53.5 }
- { os: macos-13 , ocaml-version: 4.14.x , ref: v2.53.7 }
- { os: macos-13 , ocaml-version: 4.14.x , ref: v2.52.1 , oldmake: true }
- { os: macos-13 , ocaml-version: 4.08.x , ref: v2.51.2 , oldmake: true }

Expand Down
10 changes: 5 additions & 5 deletions src/Makefile.OCaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ ifeq ($(OSARCH),Win32)
endif
ifeq ($(shell $(OCAMLC) -config-var ccomp_type),msvc)
OUTPUT_SEL=-Fo
CLIBS+=-cclib shell32.lib -cclib user32.lib -cclib "-link win32rc/unison.res"
CLIBS+=-cclib user32.lib -cclib "-link win32rc/unison.res"
buildexecutable: win32rc/unison.res
else
OUTPUT_SEL=-o
Expand Down Expand Up @@ -287,8 +287,8 @@ INCLFLAGS_MAC+=-I +threads
ifndef OCAMLFIND
CAMLFLAGS_GUI+=-I +lablgtk3 -I +cairo2
else
CAMLFLAGS_GUI+=$(shell $(OCAMLFIND) query -i-format lablgtk3 )
CAMLFLAGS_GUI+=$(shell $(OCAMLFIND) query -i-format cairo2 )
CAMLFLAGS_GUI+=$(shell $(OCAMLFIND) query -format "-I '%d'" lablgtk3 )
CAMLFLAGS_GUI+=$(shell $(OCAMLFIND) query -format "-I '%d'" cairo2 )
endif
OCAMLOBJS_GUI+=pixmaps.cmo uigtk3.cmo linkgtk3.cmo
OCAMLLIBS_GUI+=lablgtk3.cma cairo.cma
Expand Down Expand Up @@ -494,10 +494,10 @@ clean::
-$(RM) win32rc/unison.res win32rc/unison.res.lib
-$(RM) fsmonitor/*.cm[iox] fsmonitor/*.o fsmonitor/*.obj fsmonitor/*~
ifdef FSMDIR
-$(RM) $(FSMDIR)/*.cm[iox] $(FSMDIR)/*.o $(FSMDIR)/*~
-$(RM) $(FSMDIR)/*.cm[iox] $(FSMDIR)/*.o $(FSMDIR)/*.obj $(FSMDIR)/*~
endif
-$(RM) .depend.dot.tmp DEPENDENCIES.ps
-$(RM) ubase/*.cm[ioxa] ubase/*.cmxa ubase/*.a ubase/*.o ubase/*~ ubase/*.bak
-$(RM) ubase/*.cm[ioxa] ubase/*.cmxa ubase/*.a ubase/*.o ubase/*.obj ubase/*~ ubase/*.bak
-$(RM) lwt/*.cm[ioxa] lwt/*.cmxa lwt/*.a lwt/*.o lwt/*.obj lwt/*~ lwt/*.bak
-$(RM) lwt/generic/*.cm[ioxa] lwt/generic/*.cmxa lwt/generic/*.a lwt/generic/*.o lwt/generic/*.obj lwt/generic/*~ lwt/generic/*.bak
-$(RM) lwt/win/*.cm[ioxa] lwt/win/*.cmxa lwt/win/*.a lwt/win/*.o lwt/win/*.obj lwt/win/*~ lwt/win/*.bak
Expand Down

0 comments on commit d08a5c3

Please sign in to comment.