From 45bc7a2bf67c816ef07be8103ee6cad7b70777c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eric=20Meadows-J=C3=B6nsson?= Date: Wed, 15 May 2024 17:20:47 +0200 Subject: [PATCH] Constrain ubuntu-24.04 builds --- lib/bob/job/otp_checker.ex | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/lib/bob/job/otp_checker.ex b/lib/bob/job/otp_checker.ex index f04e053..d128cdc 100644 --- a/lib/bob/job/otp_checker.ex +++ b/lib/bob/job/otp_checker.ex @@ -21,8 +21,8 @@ defmodule Bob.Job.OTPChecker do defp build_ref?("ubuntu-20.04", "maint-" <> version), do: build_ubuntu_20?(version) defp build_ref?("ubuntu-22.04", "OTP-" <> version), do: build_ubuntu_22?(version) defp build_ref?("ubuntu-22.04", "maint-" <> version), do: build_ubuntu_22?(version) - defp build_ref?("ubuntu-24.04", "OTP-" <> version), do: build_ubuntu_22?(version) - defp build_ref?("ubuntu-24.04", "maint-" <> version), do: build_ubuntu_22?(version) + defp build_ref?("ubuntu-24.04", "OTP-" <> version), do: build_ubuntu_24?(version) + defp build_ref?("ubuntu-24.04", "maint-" <> version), do: build_ubuntu_24?(version) defp build_ref?(_linux, "OTP-" <> _), do: true defp build_ref?(_linux, "maint" <> _), do: true defp build_ref?(_linux, "master" <> _), do: true @@ -39,6 +39,19 @@ defmodule Bob.Job.OTPChecker do erlang_version >= [24, 2] end + defp build_ubuntu_24?(erlang_version) do + dev_version? = length(String.split(erlang_version, "-")) > 1 + + # WX compatibility + case parse_otp_ref(erlang_version) do + [25, 0] -> + not dev_version? + + version -> + version >= [24, 3, 4] + end + end + defp parse_otp_ref(ref) do ref |> String.split("-")