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
This commit is contained in:
Wojtek Mach 2022-05-06 23:53:10 +02:00
parent 9f24bda2c8
commit f5afac9497
2 changed files with 3 additions and 16 deletions

View file

@ -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

View file

@ -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()