Skip to content

Commit

Permalink
[ubunty] Add note about LLVM repo (actions#3523)
Browse files Browse the repository at this point in the history
* Add LLVM libc++ info

* combine clang, clang-format into LLVM components

* fix formatting

Co-authored-by: Sergey Dolin <v-sedoli@micorosoft.com>
  • Loading branch information
Sergey Dolin and Sergey Dolin authored Jun 10, 2021
1 parent a9d832d commit 24ae664
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ function Get-ClangVersions {
return "Clang " + $clangVersions
}

function Get-LLVMInfo {
$clangVersions = Get-ClangToolVersions -ToolName "clang"
$clangFormatVersions = Get-ClangToolVersions -ToolName "clang-format"
$aptSourceRepo = Get-AptSourceRepository -PackageName "llvm"
return "LLVM components: Clang $clangFormatVersions, Clang-format $clangFormatVersions (apt source: $aptSourceRepo)"
}

function Get-ClangFormatVersions {
$clangFormatVersions = Get-ClangToolVersions -ToolName "clang-format"
return "Clang-format " + $clangFormatVersions
Expand Down
16 changes: 11 additions & 5 deletions images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,10 @@ $markdown += New-MDList -Style Unordered -Lines @(
$markdown += New-MDHeader "Installed Software" -Level 2
$markdown += New-MDHeader "Language and Runtime" -Level 3

$markdown += New-MDList -Style Unordered -Lines (@(
$runtimesList = @(
(Get-BashVersion),
(Get-CPPVersions),
(Get-FortranVersions),
(Get-ClangVersions),
(Get-ClangFormatVersions),
(Get-ErlangVersion),
(Get-ErlangRebar3Version),
(Get-MonoVersion),
Expand All @@ -52,8 +50,16 @@ $markdown += New-MDList -Style Unordered -Lines (@(
(Get-RubyVersion),
(Get-SwiftVersion),
(Get-JuliaVersion)
) | Sort-Object
)
)

if (Test-IsUbuntu20) {
$runtimesList += (Get-LLVMInfo)
} else {
$runtimesList += (Get-ClangVersions)
$runtimesList += (Get-ClangFormatVersions)
}

$markdown += New-MDList -Style Unordered -Lines ($runtimesList | Sort-Object)

$markdown += New-MDHeader "Package Management" -Level 3

Expand Down
2 changes: 2 additions & 0 deletions images/linux/scripts/installers/clang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ function InstallClang {
if [[ $version =~ 9 ]] && isUbuntu16 || [[ $version =~ 12 ]]; then
./llvm.sh $version
apt-get install -y "clang-format-$version"
llvm_repo=$(grep '^deb.*apt.llvm.org\/' /etc/apt/sources.list)
echo "llvm $llvm_repo" >> $HELPER_SCRIPTS/apt-sources.txt
else
apt-get install -y "clang-$version" "lldb-$version" "lld-$version" "clang-format-$version"
fi
Expand Down

0 comments on commit 24ae664

Please sign in to comment.