Skip to content

Commit

Permalink
bump: LLVM 13 (#491)
Browse files Browse the repository at this point in the history
* fix: remove prints

* misc: changelog

* fix: changelog

* misc: use 13.0.1 on windows

* bump: use catch2 via extern

* fix: delete commented lines in cmake
  • Loading branch information
baszalmstra authored Dec 7, 2022
1 parent 245b9ee commit b475164
Show file tree
Hide file tree
Showing 22 changed files with 313 additions and 238 deletions.
158 changes: 79 additions & 79 deletions .github/actions/install-llvm/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1460,84 +1460,84 @@ exports.prepareKeyValueMessage = prepareKeyValueMessage;
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "execute", function() { return execute; });
const core = __webpack_require__(470);
const exec = __webpack_require__(986);
const tc = __webpack_require__(533);
const path = __webpack_require__(622);

const isWindows = process.platform == "win32"
const isMacOS = process.platform == "darwin"
const isLinux = process.platform == "linux"

async function execute(cmd) {
let myOutput = '';
let myError = '';
await exec.exec(cmd, [], {
listeners: {
stdout: (data) => {
myOutput += data.toString().trim();
},
stderr: (data) => {
myError += data.toString().trim();
}
}
});

if (myError) {
throw new Error(myError);
}
return myOutput;
}

(async () => {
try {
if (isLinux) {
const installScript = path.join(__dirname, "../../../../scripts/install-llvm.sh");
await exec.exec(`sudo ${installScript}`);
} else if (isMacOS) {
await exec.exec("brew install llvm@12")
let llvmPath = await execute("brew --prefix llvm@12");
core.addPath(`${llvmPath}/bin`)
} else if (isWindows) {
const downloadUrl = "https://github.com/mun-lang/llvm-package-windows/releases/download/v12.0.1/llvm-12.0.1-windows-x64-msvc16-mt.7z"
core.info(`downloading LLVM from '${downloadUrl}'`)
const downloadLocation = await tc.downloadTool(downloadUrl);

core.info("Succesfully downloaded LLVM release, extracting...")
const llvmPath = "C:\\llvm";
const _7zPath = path.join(__dirname, '..', 'externals', '7zr.exe');
let attempt = 1;
while (true) {
const args = [
"x", // extract
downloadLocation,
`-o${llvmPath}`
]
const exit = await exec.exec(_7zPath, args);
if (exit === 2 && attempt <= 4) {
attempt += 1;
console.error(`Error extracting LLVM release, retrying attempt #${attempt} after 1s..`)
await new Promise(resolve => setTimeout(resolve, 1000));
}
else if (exit !== 0) {
throw new Error("Could not extract LLVM and Clang binaries.");
}
else {
core.info("Succesfully extracted LLVM release")
break;
}
}

core.addPath(`${llvmPath}/bin`)
core.exportVariable('LIBCLANG_PATH', `${llvmPath}/bin`)
} else {
core.setFailed(`unsupported platform '${process.platform}'`)
}
} catch (error) {
console.error(error.stack);
core.setFailed(error.message);
}
})();
const core = __webpack_require__(470);
const exec = __webpack_require__(986);
const tc = __webpack_require__(533);
const path = __webpack_require__(622);

const isWindows = process.platform == "win32"
const isMacOS = process.platform == "darwin"
const isLinux = process.platform == "linux"

async function execute(cmd) {
let myOutput = '';
let myError = '';
await exec.exec(cmd, [], {
listeners: {
stdout: (data) => {
myOutput += data.toString().trim();
},
stderr: (data) => {
myError += data.toString().trim();
}
}
});

if (myError) {
throw new Error(myError);
}
return myOutput;
}

(async () => {
try {
if (isLinux) {
const installScript = path.join(__dirname, "../../../../scripts/install-llvm.sh");
await exec.exec(`sudo ${installScript}`);
} else if (isMacOS) {
await exec.exec("brew install llvm@13")
let llvmPath = await execute("brew --prefix llvm@13");
core.addPath(`${llvmPath}/bin`)
} else if (isWindows) {
const downloadUrl = "https://github.com/mun-lang/llvm-package-windows/releases/download/v13.0.1/llvm-13.0.1-windows-x64-msvc16-mt.7z"
core.info(`downloading LLVM from '${downloadUrl}'`)
const downloadLocation = await tc.downloadTool(downloadUrl);

core.info("Succesfully downloaded LLVM release, extracting...")
const llvmPath = "C:\\llvm";
const _7zPath = path.join(__dirname, '..', 'externals', '7zr.exe');
let attempt = 1;
while (true) {
const args = [
"x", // extract
downloadLocation,
`-o${llvmPath}`
]
const exit = await exec.exec(_7zPath, args);
if (exit === 2 && attempt <= 4) {
attempt += 1;
console.error(`Error extracting LLVM release, retrying attempt #${attempt} after 1s..`)
await new Promise(resolve => setTimeout(resolve, 1000));
}
else if (exit !== 0) {
throw new Error("Could not extract LLVM and Clang binaries.");
}
else {
core.info("Succesfully extracted LLVM release")
break;
}
}

core.addPath(`${llvmPath}/bin`)
core.exportVariable('LIBCLANG_PATH', `${llvmPath}/bin`)
} else {
core.setFailed(`unsupported platform '${process.platform}'`)
}
} catch (error) {
console.error(error.stack);
core.setFailed(error.message);
}
})();


/***/ }),
Expand Down Expand Up @@ -7419,4 +7419,4 @@ const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCa
/******/ }();
/******/
/******/ }
);
);
156 changes: 78 additions & 78 deletions .github/actions/install-llvm/index.js
Original file line number Diff line number Diff line change
@@ -1,78 +1,78 @@
const core = require('@actions/core');
const exec = require('@actions/exec');
const tc = require('@actions/tool-cache');
const path = require('path');

const isWindows = process.platform == "win32"
const isMacOS = process.platform == "darwin"
const isLinux = process.platform == "linux"

export async function execute(cmd) {
let myOutput = '';
let myError = '';
await exec.exec(cmd, [], {
listeners: {
stdout: (data) => {
myOutput += data.toString().trim();
},
stderr: (data) => {
myError += data.toString().trim();
}
}
});

if (myError) {
throw new Error(myError);
}
return myOutput;
}

(async () => {
try {
if (isLinux) {
const installScript = path.join(__dirname, "../../../../scripts/install-llvm.sh");
await exec.exec(`sudo ${installScript}`);
} else if (isMacOS) {
await exec.exec("brew install llvm@12")
let llvmPath = await execute("brew --prefix llvm@12");
core.addPath(`${llvmPath}/bin`)
} else if (isWindows) {
const downloadUrl = "https://github.com/mun-lang/llvm-package-windows/releases/download/v12.0.1/llvm-12.0.1-windows-x64-msvc16-mt.7z"
core.info(`downloading LLVM from '${downloadUrl}'`)
const downloadLocation = await tc.downloadTool(downloadUrl);

core.info("Succesfully downloaded LLVM release, extracting...")
const llvmPath = "C:\\llvm";
const _7zPath = path.join(__dirname, '..', 'externals', '7zr.exe');
let attempt = 1;
while (true) {
const args = [
"x", // extract
downloadLocation,
`-o${llvmPath}`
]
const exit = await exec.exec(_7zPath, args);
if (exit === 2 && attempt <= 4) {
attempt += 1;
console.error(`Error extracting LLVM release, retrying attempt #${attempt} after 1s..`)
await new Promise(resolve => setTimeout(resolve, 1000));
}
else if (exit !== 0) {
throw new Error("Could not extract LLVM and Clang binaries.");
}
else {
core.info("Succesfully extracted LLVM release")
break;
}
}

core.addPath(`${llvmPath}/bin`)
core.exportVariable('LIBCLANG_PATH', `${llvmPath}/bin`)
} else {
core.setFailed(`unsupported platform '${process.platform}'`)
}
} catch (error) {
console.error(error.stack);
core.setFailed(error.message);
}
})();
const core = require('@actions/core');
const exec = require('@actions/exec');
const tc = require('@actions/tool-cache');
const path = require('path');

const isWindows = process.platform == "win32"
const isMacOS = process.platform == "darwin"
const isLinux = process.platform == "linux"

export async function execute(cmd) {
let myOutput = '';
let myError = '';
await exec.exec(cmd, [], {
listeners: {
stdout: (data) => {
myOutput += data.toString().trim();
},
stderr: (data) => {
myError += data.toString().trim();
}
}
});

if (myError) {
throw new Error(myError);
}
return myOutput;
}

(async () => {
try {
if (isLinux) {
const installScript = path.join(__dirname, "../../../../scripts/install-llvm.sh");
await exec.exec(`sudo ${installScript}`);
} else if (isMacOS) {
await exec.exec("brew install llvm@13")
let llvmPath = await execute("brew --prefix llvm@13");
core.addPath(`${llvmPath}/bin`)
} else if (isWindows) {
const downloadUrl = "https://github.com/mun-lang/llvm-package-windows/releases/download/v13.0.1/llvm-13.0.1-windows-x64-msvc16-mt.7z"
core.info(`downloading LLVM from '${downloadUrl}'`)
const downloadLocation = await tc.downloadTool(downloadUrl);

core.info("Succesfully downloaded LLVM release, extracting...")
const llvmPath = "C:\\llvm";
const _7zPath = path.join(__dirname, '..', 'externals', '7zr.exe');
let attempt = 1;
while (true) {
const args = [
"x", // extract
downloadLocation,
`-o${llvmPath}`
]
const exit = await exec.exec(_7zPath, args);
if (exit === 2 && attempt <= 4) {
attempt += 1;
console.error(`Error extracting LLVM release, retrying attempt #${attempt} after 1s..`)
await new Promise(resolve => setTimeout(resolve, 1000));
}
else if (exit !== 0) {
throw new Error("Could not extract LLVM and Clang binaries.");
}
else {
core.info("Succesfully extracted LLVM release")
break;
}
}

core.addPath(`${llvmPath}/bin`)
core.exportVariable('LIBCLANG_PATH', `${llvmPath}/bin`)
} else {
core.setFailed(`unsupported platform '${process.platform}'`)
}
} catch (error) {
console.error(error.stack);
core.setFailed(error.message);
}
})();
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ concurrency:
jobs:
check:
name: Check
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: ["ubuntu-20.04", "windows-latest", "macOS-latest"]
os: ["ubuntu-latest", "windows-latest", "macOS-latest"]
include:
- RUSTFLAGS: "-Dwarnings"
CARGO_INCREMENTAL: 1
Expand All @@ -69,7 +69,7 @@ jobs:
uses: ./.github/actions/install-llvm

- name: Install packages
if: matrix.os == 'ubuntu-20.04'
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install libasound2-dev libudev-dev
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:

test-mdbook:
name: Test mdbook
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
needs: check
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -157,7 +157,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: ["ubuntu-20.04", "windows-latest", "macOS-latest"]
os: ["ubuntu-latest", "windows-latest", "macOS-latest"]
include:
- RUSTFLAGS: "-Dwarnings"
- os: "windows-latest"
Expand Down Expand Up @@ -219,7 +219,7 @@ jobs:

style:
name: Check Style
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
needs: check
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -251,7 +251,7 @@ jobs:
args: --all-features

tarpaulin:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
needs: check
steps:
- uses: actions/checkout@v3
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,3 @@
path = book/vendor/highlight.js
url = https://github.com/mun-lang/highlight.js.git
branch = add-mun
[submodule "cpp/tests/catch2"]
path = cpp/tests/catch2
url = https://github.com/catchorg/Catch2.git
Loading

0 comments on commit b475164

Please sign in to comment.