egor-tensin / setup-clang Goto Github PK
View Code? Open in Web Editor NEWGitHub action to set up Clang & LLVM
License: MIT License
GitHub action to set up Clang & LLVM
License: MIT License
Is it possible to use cache action like the following code?
- name: Restore artifacts.
uses: actions/cache@v2
with:
path: |
${{ **LLVM PATH HERE** }}
key: |
${{ env.LLVM_VER}}
After installing one of the oldest Clang versions available (pre-5.0 on bionic, pre-9 on focal), any subsequent apt-get update
will fail:
E: The repository 'http://apt.llvm.org/bionic llvm-toolchain-bionic-3.9 Release' does not have a Release file.
Error: Process completed with exit code 100.
It appears that these versions are not present on apt.llvm.org, even though they are in universe
.
(setup-clang
itself ignores this failure and carries on, though I'm not sure if this was intended on your part.)
It would be nice if the repo URL was checked first and omitted if missing. Or, failing that, a mention in the README advising running any apt-get update
before setup-clang
would help prevent some head-scratching. Thanks!
Hello there @egor-tensin ,
Thank you for providing such useful github actions.
Unfortunately the workflow seems to be broken. Please see e.g. this workflow.
Relevant part of the logs:
Get:35 https://packages.microsoft.com/ubuntu/22.04/prod jammy/main armhf Packages [6875 B]
Ign:27 https://apt.llvm.org/jammy llvm-toolchain-jammy-8 InRelease
Err:36 https://apt.llvm.org/jammy llvm-toolchain-jammy-8 Release
404 Not Found [IP: 146.75.30.49 443]
Reading package lists...
E: The repository 'http://apt.llvm.org/jammy llvm-toolchain-jammy-8 Release' does not have a Release file.
Repository: 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-8 main'
Description:
Archive for codename: llvm-toolchain-jammy-8 components: main
More info: http://apt.llvm.org/jammy/
Adding repository.
Adding deb entry to /etc/apt/sources.list.d/archive_uri-http_apt_llvm_org_jammy_-jammy.list
It seems that also the unit tests on this "setup-clang" repository are broken, see this link. Perhaps it is the same issue?
llvm released version 17. Can the new version be added?
https://github.com/llvm/llvm-project/releases/tag/llvmorg-17.0.6
Since just now, trying to invoke this action from Github Actions' Windows runner fails:
Run egor-tensin/setup-clang@v1
with:
version: latest
platform: x64
cygwin: 0
cc: 1
hardlinks: 0
env:
BUILD_TYPE: Release
PIP_BREAK_SYSTEM_PACKAGES: 1
pythonLocation: C:\hostedtoolcache\windows\Python\3.8.10\x64
PKG_CONFIG_PATH: C:\hostedtoolcache\windows\Python\3.8.10\x64/lib/pkgconfig
Python_ROOT_DIR: C:\hostedtoolcache\windows\Python\3.8.10\x64
Python2_ROOT_DIR: C:\hostedtoolcache\windows\Python\3.8.10\x64
Python3_ROOT_DIR: C:\hostedtoolcache\windows\Python\3.8.10\x64
Run New-Variable os -Value 'Windows' -Option Constant
New-Variable os -Value 'Windows' -Option Constant
New-Variable linux_host -Value ($os -eq 'Linux') -Option Constant
New-Variable cygwin_host -Value ('0' -eq '1') -Option Constant
New-Variable windows_host -Value ($os -eq 'Windows' -and !$cygwin_host) -Option Constant
New-Variable version -Value ('latest') -Option Constant
New-Variable latest -Value ($version -eq 'latest') -Option Constant
New-Variable x64 -Value ('x64' -eq 'x64') -Option Constant
function Locate-Choco {
$path = Get-Command 'choco' -ErrorAction SilentlyContinue
'@
}
# IDK why, but without libiconv-devel, even a "Hello, world!"
# C++ app cannot be compiled as of December 2020. Also, libstdc++
# is required; it's simpler to install gcc-g++ for all the
# dependencies.
Install-Package clang gcc-g++ libiconv-devel llvm
} elseif ($windows_host) {
Install-Package llvm
$bin_dir = Join-Path $env:ProgramFiles LLVM bin
echo $bin_dir >> $env:GITHUB_PATH
} else {
throw "Sorry, installing Clang is unsupported on $os"
}
echo "clang=$clang" >> $env:GITHUB_OUTPUT
echo "clangxx=$clangxx" >> $env:GITHUB_OUTPUT
shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
env:
BUILD_TYPE: Release
PIP_BREAK_SYSTEM_PACKAGES: 1
pythonLocation: C:\hostedtoolcache\windows\Python\3.8.10\x64
PKG_CONFIG_PATH: C:\hostedtoolcache\windows\Python\3.8.10\x64/lib/pkgconfig
Python_ROOT_DIR: C:\hostedtoolcache\windows\Python\3.8.10\x64
Python2_ROOT_DIR: C:\hostedtoolcache\windows\Python\3.8.10\x64
Python3_ROOT_DIR: C:\hostedtoolcache\windows\Python\3.8.10\x64
Chocolatey v2.2.2
Upgrading the following packages:
llvm
By upgrading, you accept licenses for the packages.
Invalid credentials specified.
Please provide credentials for: https://community.chocolatey.org/api/v2/
User name: Password: Chocolatey had an error on fv-az1105-743 (with user runneradmin):
System.InvalidOperationException: Cannot read keys when either application does not have a console or when console input has been redirected from a file. Try Console.Read.
at System.Console.ReadKey(Boolean intercept)
at chocolatey.infrastructure.commandline.ReadKeyTimeout.ConsoleReadKey()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Unhandled Exception: System.InvalidOperationException: Cannot read keys when either application does not have a console or when console input has been redirected from a file. Try Console.Read.
at System.Console.ReadKey(Boolean intercept)
at chocolatey.infrastructure.commandline.ReadKeyTimeout.ConsoleReadKey()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Error: Process completed with exit code 1.
It seems to be some kind of authentication issue with Chocolatey. I don't know if it is an intermittent error or something that needs to be addressed.
llvm released version 16 last week I think. Can the new version be added?
hello, I using clang to compile my code, compile with libc++:
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++")
endif()
it works in my localhost, but does not work in github action(it loses a lot of system headers, https://github.com/netcan/config-loader/runs/4703563002?check_suite_focus=true). When I remove the CMake code above, It works in github action but compiles failed in my localhost(I have checked it must compile with clang system headers, using libc++).
so how to keep the same CMake in localhost and github action?
https://github.com/netcan/config-loader/blob/c%2B%2B20/CMakeLists.txt#L12
Would be great if you also setup clang-tidy and clang-format and then configure their paths. This is what I have to do now: https://github.com/yegor256/fibonacci/blob/5a428c2cdc448fff939356c45707f1da8a712803/.github/workflows/pr.yml#L24-L32
Is it possible to install the OpenMP clang component using this action?
I need it for one of my projects,
Running this actions results in this:
The
set-output
command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Problematic commands are here:
Lines 208 to 209 in 4b8d6e7
Dear Egor,
I am unable to setup Clang 4.0 with the following snippet:
name: Setup Clang
uses: egor-tensin/setup-clang@v1
with:
version: 4.0
platform: x64
I get the errror:
E: The repository 'http://apt.llvm.org/bionic llvm-toolchain-bionic-4 Release' does not have a Release file.
The version is missing from https://apt.llvm.org/bionic/dists/.
Best regards,
Robert
P.S. Full workflow is at https://github.com/rvaser/test/blob/master/.github/workflows/test.yml.
If I use clang++ with the command line switch "-m32", it produces a viable executable file, but the executable file does not have any text output (nothing send to stdout actually reaches stdout).
Attempting to use this in my CI workflow, and can't get v13 to load on Jammy.
Here is the build logs I see:
https://github.com/gamebox/chakra-lang/actions/runs/4148242687/jobs/7176032330
I don't know if this issue is temporary, but I would truly appreciate any pointers.
I'm using another action to setup a cross compilation workflow
I'm getting this error:
Error: pwsh: command not found
See the full log: https://github.com/yegor256/fibonacci/runs/4907989586?check_suite_focus=true
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.