Skip to content

Commit 5079c18

Browse files
authored
Reverse the order of LLVM compilers proposed in the wizard (#633)
This is done to match the fact that the default LLVM compiler is the latest one, rather than the oldest one as it is for GCC.
1 parent 2eec6a4 commit 5079c18

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/wizard/obtain_source.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,8 +384,8 @@ end
384384
function get_preferred_version(state::WizardState, compiler::AbstractString,
385385
available_versions=Vector{Integer})
386386
terminal = TTYTerminal("xterm", state.ins, state.outs, state.outs)
387-
version_selected = request(terminal, "Select the preferred $(compiler) version",
388-
RadioMenu(string.(available_versions)))
387+
message = "Select the preferred $(compiler) version (default: $(first(available_versions)))"
388+
version_selected = request(terminal, message, RadioMenu(string.(available_versions)))
389389
if compiler == "GCC"
390390
state.preferred_gcc_version = available_versions[version_selected]
391391
elseif compiler == "LLVM"
@@ -404,8 +404,10 @@ function step2(state::WizardState)
404404
get_name_and_version(state)
405405
if yn_prompt(state, "Do you want to customize the set of compilers?", :n) == :y
406406
get_compilers(state)
407+
# Default GCC version is the oldest one
407408
get_preferred_version(state, "GCC", getversion.(available_gcc_builds))
408-
get_preferred_version(state, "LLVM", getversion.(available_llvm_builds))
409+
# Default LLVM version is the latest one
410+
get_preferred_version(state, "LLVM", getversion.(reverse(available_llvm_builds)))
409411
else
410412
state.compilers = [:c]
411413
# Default GCC version is the oldest one

test/wizard.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,9 @@ end
119119
@test state.source_hashes == [libfoo_tarball_hash]
120120
@test Set(state.compilers) == Set([:c, :rust, :go])
121121
@test state.preferred_gcc_version == getversion(available_gcc_builds[1])
122-
@test state.preferred_llvm_version == getversion(BinaryBuilder.available_llvm_builds[end])
122+
# The default LLVM shard is the latest one, and above we pressed three times
123+
# arrow down in the reverse order list.
124+
@test state.preferred_llvm_version == getversion(BinaryBuilder.available_llvm_builds[end-3])
123125

124126
# Test two tar.gz download
125127
state = step2_state()

0 commit comments

Comments
 (0)