Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misc: adds logging to windows llvm install #301

Merged
merged 1 commit into from
Jan 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 30 additions & 32 deletions .github/actions/install-llvm/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1188,15 +1188,17 @@ async function execute(cmd) {
let llvmPath = await execute("brew --prefix llvm@8");
core.addPath(`${llvmPath}/bin`)
} else if(isWindows) {
let llvmCachedPath = tc.find("llvm", "8.0.1", "windows-x64");
if(!llvmCachedPath) {
let _7zPath = path.join(__dirname, '..', 'externals', '7zr.exe');
llvmCachedPath = await tc.downloadTool("https://github.com/mun-lang/llvm-package-windows/releases/download/v8.0.1/llvm-8.0.1-windows-x64-msvc16.7z")
.then(downloadPath => tc.extract7z(downloadPath, null, _7zPath))
.then(extractPath => tc.cacheDir(extractPath, "llvm", "8.0.1", "windows-x64"));
}
core.addPath(`${llvmCachedPath}/bin`)
core.exportVariable('LIBCLANG_PATH', `${llvmCachedPath}/bin`)
const downloadUrl = "https://github.com/mun-lang/llvm-package-windows/releases/download/v8.0.1/llvm-8.0.1-windows-x64-msvc16.7z"
core.info(`downloading LLVM from '${downloadUrl}'`)
const downloadLocation = await tc.downloadTool(downloadUrl);

core.info("succesfully downloaded llvm release, extracting...")
const _7zPath = path.join(__dirname, '..', 'externals', '7zr.exe');
const llvmPath = await tc.extract7z(downloadLocation, null, _7zPath)

core.info("succesfully extracted llvm release")
core.addPath(`${llvmPath}/bin`)
core.exportVariable('LIBCLANG_PATH', `${llvmPath}/bin`)
} else {
core.setFailed(`unsupported platform '${process.platform}'`)
}
Expand Down Expand Up @@ -4084,7 +4086,6 @@ function _unique(values) {
"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
const url = __webpack_require__(835);
const http = __webpack_require__(605);
const https = __webpack_require__(211);
const pm = __webpack_require__(950);
Expand Down Expand Up @@ -4133,7 +4134,7 @@ var MediaTypes;
* @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
*/
function getProxyUrl(serverUrl) {
let proxyUrl = pm.getProxyUrl(url.parse(serverUrl));
let proxyUrl = pm.getProxyUrl(new URL(serverUrl));
return proxyUrl ? proxyUrl.href : '';
}
exports.getProxyUrl = getProxyUrl;
Expand All @@ -4152,6 +4153,15 @@ const HttpResponseRetryCodes = [
const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
const ExponentialBackoffCeiling = 10;
const ExponentialBackoffTimeSlice = 5;
class HttpClientError extends Error {
constructor(message, statusCode) {
super(message);
this.name = 'HttpClientError';
this.statusCode = statusCode;
Object.setPrototypeOf(this, HttpClientError.prototype);
}
}
exports.HttpClientError = HttpClientError;
class HttpClientResponse {
constructor(message) {
this.message = message;
Expand All @@ -4170,7 +4180,7 @@ class HttpClientResponse {
}
exports.HttpClientResponse = HttpClientResponse;
function isHttps(requestUrl) {
let parsedUrl = url.parse(requestUrl);
let parsedUrl = new URL(requestUrl);
return parsedUrl.protocol === 'https:';
}
exports.isHttps = isHttps;
Expand Down Expand Up @@ -4275,7 +4285,7 @@ class HttpClient {
if (this._disposed) {
throw new Error('Client has already been disposed.');
}
let parsedUrl = url.parse(requestUrl);
let parsedUrl = new URL(requestUrl);
let info = this._prepareRequest(verb, parsedUrl, headers);
// Only perform retries on reads since writes may not be idempotent.
let maxTries = this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1
Expand Down Expand Up @@ -4314,7 +4324,7 @@ class HttpClient {
// if there's no location to redirect to, we won't
break;
}
let parsedRedirectUrl = url.parse(redirectUrl);
let parsedRedirectUrl = new URL(redirectUrl);
if (parsedUrl.protocol == 'https:' &&
parsedUrl.protocol != parsedRedirectUrl.protocol &&
!this._allowRedirectDowngrade) {
Expand Down Expand Up @@ -4430,7 +4440,7 @@ class HttpClient {
* @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
*/
getAgent(serverUrl) {
let parsedUrl = url.parse(serverUrl);
let parsedUrl = new URL(serverUrl);
return this._getAgent(parsedUrl);
}
_prepareRequest(method, requestUrl, headers) {
Expand Down Expand Up @@ -4503,7 +4513,7 @@ class HttpClient {
maxSockets: maxSockets,
keepAlive: this._keepAlive,
proxy: {
proxyAuth: proxyUrl.auth,
proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`,
host: proxyUrl.hostname,
port: proxyUrl.port
}
Expand Down Expand Up @@ -4598,12 +4608,8 @@ class HttpClient {
else {
msg = 'Failed request: (' + statusCode + ')';
}
let err = new Error(msg);
// attach statusCode and body obj (if available) to the error object
err['statusCode'] = statusCode;
if (response.result) {
err['result'] = response.result;
}
let err = new HttpClientError(msg, statusCode);
err.result = response.result;
reject(err);
}
else {
Expand Down Expand Up @@ -4935,22 +4941,14 @@ function v4(options, buf, offset) {
module.exports = v4;


/***/ }),

/***/ 835:
/***/ (function(module) {

module.exports = require("url");

/***/ }),

/***/ 950:
/***/ (function(__unusedmodule, exports, __webpack_require__) {
/***/ (function(__unusedmodule, exports) {

"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
const url = __webpack_require__(835);
function getProxyUrl(reqUrl) {
let usingSsl = reqUrl.protocol === 'https:';
let proxyUrl;
Expand All @@ -4965,7 +4963,7 @@ function getProxyUrl(reqUrl) {
proxyVar = process.env['http_proxy'] || process.env['HTTP_PROXY'];
}
if (proxyVar) {
proxyUrl = url.parse(proxyVar);
proxyUrl = new URL(proxyVar);
}
return proxyUrl;
}
Expand Down
20 changes: 11 additions & 9 deletions .github/actions/install-llvm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,17 @@ export async function execute(cmd) {
let llvmPath = await execute("brew --prefix llvm@8");
core.addPath(`${llvmPath}/bin`)
} else if(isWindows) {
let llvmCachedPath = tc.find("llvm", "8.0.1", "windows-x64");
if(!llvmCachedPath) {
let _7zPath = path.join(__dirname, '..', 'externals', '7zr.exe');
llvmCachedPath = await tc.downloadTool("https://github.com/mun-lang/llvm-package-windows/releases/download/v8.0.1/llvm-8.0.1-windows-x64-msvc16.7z")
.then(downloadPath => tc.extract7z(downloadPath, null, _7zPath))
.then(extractPath => tc.cacheDir(extractPath, "llvm", "8.0.1", "windows-x64"));
}
core.addPath(`${llvmCachedPath}/bin`)
core.exportVariable('LIBCLANG_PATH', `${llvmCachedPath}/bin`)
const downloadUrl = "https://github.com/mun-lang/llvm-package-windows/releases/download/v8.0.1/llvm-8.0.1-windows-x64-msvc16.7z"
core.info(`downloading LLVM from '${downloadUrl}'`)
const downloadLocation = await tc.downloadTool(downloadUrl);

core.info("succesfully downloaded llvm release, extracting...")
const _7zPath = path.join(__dirname, '..', 'externals', '7zr.exe');
const llvmPath = await tc.extract7z(downloadLocation, null, _7zPath)

core.info("succesfully extracted llvm release")
core.addPath(`${llvmPath}/bin`)
core.exportVariable('LIBCLANG_PATH', `${llvmPath}/bin`)
} else {
core.setFailed(`unsupported platform '${process.platform}'`)
}
Expand Down
14 changes: 7 additions & 7 deletions .github/actions/install-llvm/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/actions/install-llvm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"dependencies": {
"@actions/core": "^1.2.6",
"@actions/exec": "^1.0.4",
"@actions/tool-cache": "^1.6.0",
"@actions/tool-cache": "^1.6.1",
"@zeit/ncc": "^0.22.3"
}
}
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,16 @@ jobs:
with:
submodules: true

- name: Install LLVM
uses: ./.github/actions/install-llvm

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
override: true
components: rustfmt

- name: Install LLVM
uses: ./.github/actions/install-llvm

- name: Cargo build
if: ${{ matrix.config.os == 'ubuntu-latest' }}
uses: actions-rs/cargo@v1
Expand Down