mirror of
https://github.com/actions/runner-images.git
synced 2025-12-14 22:05:17 +00:00
[Ubuntu] Fix Erlang version in software report
SoftwareReport collects wrong version for Erlang, it reports Eshell version rather than Erlang itself. reference: https://stackoverflow.com/questions/9560815/how-to-get-erlangs-release-version-number-from-a-shell 2nd answer `erl` doesn't have `-v` flag, only `-version` `erlc` `-v` flag is for verbose output `rebar3` reports it's version with flag `-v` Change `erl -v` to `erl -version` as it gets stuck in certain scenarios like using Docker as packer builder. reference: http://erlang.org/doc/man/erl.html
This commit is contained in:
@@ -34,8 +34,9 @@ function Get-ClangVersions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function Get-ErlangVersion {
|
function Get-ErlangVersion {
|
||||||
$version = (erl -eval 'erlang:display(erlang:system_info(version)), halt().' -noshell).Trim('"')
|
$erlangVersion = (erl -eval '{ok, Version} = file:read_file(filename:join([code:root_dir(), "releases", erlang:system_info(otp_release), ''OTP_VERSION''])), io:fwrite(Version), halt().' -noshell)
|
||||||
return "Erlang $version"
|
$shellVersion = (erl -eval 'erlang:display(erlang:system_info(version)), halt().' -noshell).Trim('"')
|
||||||
|
return "Erlang $erlangVersion (Eshell $shellVersion)"
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-MonoVersion {
|
function Get-MonoVersion {
|
||||||
|
|||||||
@@ -110,15 +110,15 @@ Describe "Cmake" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Describe "erlang" {
|
Describe "erlang" {
|
||||||
$testCases = @("erl", "erlc", "rebar3") | ForEach-Object { @{ErlangCommand = $_} }
|
$testCases = @("erl -version", "erlc -v", "rebar3 -v") | ForEach-Object { @{ErlangCommand = $_} }
|
||||||
|
|
||||||
It "erlang <ErlangCommand>" -TestCases $testCases {
|
It "erlang <ErlangCommand>" -TestCases $testCases {
|
||||||
param (
|
param (
|
||||||
[string] $ErlangCommand
|
[string] $ErlangCommand
|
||||||
)
|
)
|
||||||
|
|
||||||
"$ErlangCommand -v" | Should -ReturnZeroExitCode
|
"$ErlangCommand" | Should -ReturnZeroExitCode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Describe "gcc" {
|
Describe "gcc" {
|
||||||
|
|||||||
Reference in New Issue
Block a user