-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added LLVM Installation with Rust LLVM Version
Moved Environment Variable Initialisation to Setup
- Loading branch information
1 parent
01211eb
commit a7deec2
Showing
4 changed files
with
46 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,12 @@ inputs: | |
runs: | ||
using: composite | ||
steps: | ||
- name: Get LLVM Version from Rust | ||
shell: bash | ||
run: | | ||
rustc --version --verbose | sed -n 's/LLVM version: \([0-9]\{1,\}\).*/LLVM_MAJOR_VERSION=\1/p' >> $GITHUB_ENV | ||
rustc --version --verbose | sed -n 's/LLVM version: \([0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}\)/LLVM_VERSION=\1/p' >> $GITHUB_ENV | ||
- name: Install Dependencies on Windows | ||
if: inputs.os == 'windows' | ||
env: | ||
|
@@ -21,29 +27,55 @@ runs: | |
MOZTOOLS_PATH: ${{ github.workspace }}\\target\\dependencies\\moztools-4.0 | ||
shell: pwsh | ||
run: | | ||
curl -SL "$env:MOZTOOLS_LINK/moztools-$env:MOZTOOLS_VERSION.zip" --create-dirs -o target/dependencies/moztools.zip | ||
curl -fsSL "$env:MOZTOOLS_LINK/moztools-$env:MOZTOOLS_VERSION.zip" --create-dirs -o target/dependencies/moztools.zip | ||
cd target/dependencies && unzip -qo moztools.zip -d . | ||
echo "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Tools\LLVM\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | ||
echo "MOZTOOLS_PATH=$env:MOZTOOLS_PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||
echo "CC=clang-cl" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||
echo "CXX=clang-cl" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||
echo "AR=llvm-lib" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||
echo "LINKER=lld-link" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||
Write-Output "MOZTOOLS_PATH=$env:MOZTOOLS_PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||
Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression | ||
scoop install "llvm@$env:LLVM_VERSION" --global | ||
$( | ||
Write-Output "$env:PROGRAMDATA\scoop\shims" | ||
Get-Content "$env:GITHUB_PATH" | ||
) | Set-Content -Path "$env:GITHUB_PATH" -Encoding utf8 | ||
Write-Output "CC=clang-cl" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||
Write-Output "CXX=clang-cl" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||
Write-Output "AR=llvm-lib" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||
Write-Output "LINKER=lld-link" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||
Write-Output "CCACHE=sccache" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||
- name: Install Dependencies on MacOS | ||
if: inputs.os == 'macos' | ||
shell: bash | ||
run: | | ||
brew list -1 | grep python | while read formula; do brew unlink $formula; brew link --overwrite $formula; done | ||
brew install lld llvm yasm | ||
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_PATH | ||
brew install llvm@$LLVM_MAJOR_VERSION yasm | ||
{ echo "$(brew --prefix llvm@$LLVM_MAJOR_VERSION)/bin"; cat "$GITHUB_PATH"; } > "$GITHUB_PATH.new" | ||
mv "$GITHUB_PATH.new" "$GITHUB_PATH" | ||
echo "CC=clang" >> $GITHUB_ENV | ||
echo "CXX=clang++" >> $GITHUB_ENV | ||
echo "AR=llvm-ar" >> $GITHUB_ENV | ||
echo "CCACHE=sccache" >> $GITHUB_ENV | ||
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV | ||
- name: Install Dependencies on Linux | ||
if: inputs.os == 'linux' | ||
shell: bash | ||
run: | | ||
sudo apt install -y clang llvm | ||
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_PATH | ||
curl -fsSL https://apt.llvm.org/llvm.sh -o llvm.sh && chmod +x llvm.sh | ||
sudo env DPKG_FORCE=overwrite ./llvm.sh "$LLVM_MAJOR_VERSION" all | ||
{ echo "/usr/lib/llvm-$LLVM_MAJOR_VERSION/bin"; cat "$GITHUB_PATH"; } > "$GITHUB_PATH.new" | ||
mv "$GITHUB_PATH.new" "$GITHUB_PATH" | ||
echo "CC=clang" >> $GITHUB_ENV | ||
echo "CXX=clang++" >> $GITHUB_ENV | ||
echo "AR=llvm-ar" >> $GITHUB_ENV | ||
echo "CCACHE=sccache" >> $GITHUB_ENV | ||
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV | ||
- name: Install Just | ||
uses: taiki-e/install-action@just | ||
|
@@ -52,7 +84,7 @@ runs: | |
uses: taiki-e/install-action@nextest | ||
|
||
- name: Setup sccache | ||
uses: mozilla-actions/[email protected].5 | ||
uses: mozilla-actions/[email protected].6 | ||
|
||
- name: Cache Cargo Cache and Git Database | ||
uses: actions/cache@v4 | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters