Skip to content

Commit 2068222

Browse files
committed
Use openssl and musl versions in the runtime cache keys
1 parent 66d7641 commit 2068222

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

lib/burrito.ex

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,29 @@ defmodule Burrito do
33
alias Burrito.Builder.Log
44

55
@zig_version_expected %Version{major: 0, minor: 14, patch: 1}
6+
@openssl_version %Version{major: 3, minor: 5, patch: 1}
7+
@musl_version %Version{major: 1, minor: 2, patch: 5}
68

79
@spec wrap(Mix.Release.t()) :: Mix.Release.t()
810
def wrap(%Mix.Release{} = release) do
911
pre_check()
1012
Builder.build(release)
1113
end
1214

15+
@spec register_erts_resolver(module()) :: :ok
1316
def register_erts_resolver(module) when is_atom(module) do
1417
Application.put_env(:burrito, :erts_resolver, module)
1518
end
1619

20+
@spec get_versions() :: map()
21+
def get_versions() do
22+
%{
23+
zig: @zig_version_expected,
24+
openssl: @openssl_version,
25+
musl: @musl_version
26+
}
27+
end
28+
1729
defp pre_check() do
1830
if Enum.any?(~w(zig xz), &(System.find_executable(&1) == nil)) do
1931
Log.error(

lib/util/erts_universal_machine_fetcher.ex

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ defmodule Burrito.Util.ERTSUniversalMachineFetcher do
1515
final_url =
1616
case os do
1717
:darwin ->
18-
@mac_url <> @please_do_not_abuse_these_downloads_bandwidth_costs_money
18+
@mac_url <> @please_do_not_abuse_these_downloads_bandwidth_costs_money <> append_versions()
1919

2020
:linux ->
21-
@linux_url <> @please_do_not_abuse_these_downloads_bandwidth_costs_money
21+
@linux_url <> @please_do_not_abuse_these_downloads_bandwidth_costs_money <> append_versions()
2222

2323
:windows ->
2424
@windows_url
@@ -30,4 +30,10 @@ defmodule Burrito.Util.ERTSUniversalMachineFetcher do
3030

3131
URI.parse(final_url)
3232
end
33+
34+
defp append_versions() do
35+
# These are used to cache-bust when openssl or musl versions are changed upstream in the BEAM Machine build server
36+
versions = Burrito.get_versions()
37+
"&openssl=#{to_string(versions.openssl)}&musl=#{to_string(versions.musl)}"
38+
end
3339
end

0 commit comments

Comments
 (0)