From f5afac94970d9c3bd3ad93f6c633e305e9bce30a Mon Sep 17 00:00:00 2001 From: Wojtek Mach Date: Fri, 6 May 2022 23:53:10 +0200 Subject: [PATCH] Remove otp version check when building desktop app Since we're building our own OTP for Mac, the idea was not to accidentally building agains something we happen to be testing at the moment, like the latest RC. This check turned out to be a little bit too annoying in practice though. We plan to automate builds on CI in the near future so we wouldn't need it the anyway. Closes #1177 --- mix.exs | 3 +-- rel/app/standalone.exs | 16 ++-------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/mix.exs b/mix.exs index 331c6562b..73435dbde 100644 --- a/mix.exs +++ b/mix.exs @@ -6,7 +6,6 @@ defmodule Livebook.MixProject do @description "Interactive and collaborative code notebooks - made with Phoenix LiveView" @app_elixir_version "1.13.4" - @app_otp_version "24.3" def project do [ @@ -169,7 +168,7 @@ defmodule Livebook.MixProject do Code.require_file("rel/app/standalone.exs") release - |> Standalone.copy_otp(@app_otp_version) + |> Standalone.copy_otp() |> Standalone.copy_elixir(@app_elixir_version) end diff --git a/rel/app/standalone.exs b/rel/app/standalone.exs index 8c1bb26d2..c7b327943 100644 --- a/rel/app/standalone.exs +++ b/rel/app/standalone.exs @@ -5,12 +5,8 @@ defmodule Standalone do @doc """ Copies OTP into the release. """ - @spec copy_otp(Mix.Release.t(), otp_version :: String.t()) :: Mix.Release.t() - def copy_otp(release, otp_version) do - if Mix.env() != :dev do - ensure_otp_version(otp_version) - end - + @spec copy_otp(Mix.Release.t()) :: Mix.Release.t() + def copy_otp(release) do {erts_source, otp_bin_dir, otp_lib_dir} = otp_dirs() # 1. copy erts/bin @@ -120,14 +116,6 @@ defmodule Standalone do File.cp_r!(source, destination, fn _, _ -> false end) end - defp ensure_otp_version(expected_otp_version) do - actual_otp_version = otp_version() - - if actual_otp_version != expected_otp_version do - raise "expected OTP #{expected_otp_version}, got: #{actual_otp_version}" - end - end - # From https://github.com/fishcakez/dialyze/blob/6698ae582c77940ee10b4babe4adeff22f1b7779/lib/mix/tasks/dialyze.ex#L168 defp otp_version do major = :erlang.system_info(:otp_release) |> List.to_string()