@@ -19,24 +19,32 @@ class DetermineRebottleRunnersCmd < AbstractCommand
19
19
hide_from_man_page!
20
20
end
21
21
22
- sig { override . void }
23
- def run
24
- formula = Formula [ T . must ( args . named . first ) ]
25
- timeout = args . named . second . to_i
26
-
27
- linux_runner = if timeout > 360
22
+ sig { params ( arch : Symbol , timeout : Integer ) . returns ( T ::Hash [ Symbol , T . any ( String , T ::Hash [ Symbol , String ] ) ] ) }
23
+ def linux_runner_spec ( arch , timeout )
24
+ linux_runner = if arch == :arm64
25
+ "ubuntu-22.04-arm"
26
+ elsif timeout > 360
28
27
"linux-self-hosted-1"
29
28
else
30
29
"ubuntu-latest"
31
30
end
32
- linux_runner_spec = {
31
+
32
+ {
33
33
runner : linux_runner ,
34
34
container : {
35
35
image : "ghcr.io/homebrew/ubuntu22.04:master" ,
36
36
options : "--user=linuxbrew -e GITHUB_ACTIONS_HOMEBREW_SELF_HOSTED" ,
37
37
} ,
38
38
workdir : "/github/home" ,
39
39
}
40
+ end
41
+
42
+ KNOWN_LINUX_ARCHES = [ :arm64 , :x86_64 ] . freeze
43
+
44
+ sig { override . void }
45
+ def run
46
+ formula = Formula [ T . must ( args . named . first ) ]
47
+ timeout = args . named . second . to_i
40
48
41
49
tags = formula . bottle_specification . collector . tags
42
50
runners = if tags . count == 1 && tags . first . system == :all
@@ -51,7 +59,7 @@ def run
51
59
macos_runners << { runner : "#{ macos_version } -arm64#{ ephemeral_suffix } " }
52
60
macos_runners
53
61
end
54
- end << linux_runner_spec
62
+ end << linux_runner_spec ( :x86_64 , timeout )
55
63
else
56
64
tags . map do |tag |
57
65
macos_version = tag . to_macos_version
@@ -66,8 +74,8 @@ def run
66
74
{ runner : }
67
75
end
68
76
rescue MacOSVersion ::Error
69
- if tag . system == :linux && tag . arch == :x86_64
70
- linux_runner_spec
77
+ if tag . system == :linux && KNOWN_LINUX_ARCHES . include? ( tag . arch )
78
+ linux_runner_spec ( tag . arch , timeout )
71
79
elsif tag . system == :all
72
80
# An all bottle with OS-specific bottles also present - ignore it.
73
81
nil
0 commit comments