Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update GHA CI and build scripts #1082

Merged
merged 6 commits into from
Nov 13, 2024
Merged

Update GHA CI and build scripts #1082

merged 6 commits into from
Nov 13, 2024

Conversation

tleedjarv
Copy link
Contributor

More description and motivation in each commit message. Easiest reviewed commit by commit.

Instead of requiring the user to specify NATIVE=false, automatically do
a bytecode-only build if the native compiler is not found.
Improve detection of tool prefixes by consulting the OCaml compiler's
configuration, in order to increase compatibility with various mingw
setups/system configurations. This is a more generic solution; the
previous setup appears to have relied more on a specific (cross
compilation) environment being correctly set up.
Automatically detecting supported compiler options by simply executing
the compiler with no input is no longer possible since OCaml 5.2.0.
Using '-version' instead of supplying an input seems to work well so far
and can be used as a workaround.
This is mainly required for building in Windows and for enabling OCaml 5
builds in Windows. Building in Windows has always been a bit tricky. For
many years, a separate opam repository with patched compilers (and
packages), together with (optional) pre-compiled compiler binaries was
used to make these builds possible. That separate repository, however,
was created and maintained by a single person who decided to retire it
as of August 2021.

After a while, a migration path was proposed, which started with a
compatibility mechanism in the upstream opam repository and concluded
with a recent release of opam 2.2.0, a version which supports Windows
natively. setup-ocaml v3 makes use of opam 2.2+ and is thus required to
complete the migration of Windows build environments.

Use of opam 2.2 and the upstream opam repository requires a few changes
in the CI build process:

 - The depext mechanism is no longer available in Windows. Not sure if
   this is permanent or not, but since Unison builds were not relying on
   it heavily anyway (just for GTK), work around this by explicitly
   installing GTK before the GUI builds.

 - Many (likely most) opam packages are not compatible with Windows,
   often in just missing little things in the build process. Luckily,
   Unison does not rely on packages other than lablgtk and its
   dependencies, which just require a workaround for pkg-config (see
   further comments in the build script).

 - ocaml-env is no longer required nor available. Any invocations can
   simply be removed from the build script.
lablgtk and/or cairo do not build with MSVC, so no GUI builds with MSVC.
macOS 12 GHA runners are deprecated and will be shut down soon. Increase
the macOS target version as with older target versions the builds are
starting to fail with newer runner images and OCaml compiler versions.
@gdt gdt merged commit f57eac9 into bcpierce00:master Nov 13, 2024
30 checks passed
@tleedjarv tleedjarv deleted the gha-upd branch November 14, 2024 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants