From 90dc7f4153f9f98ca07da00949717291a50cd105 Mon Sep 17 00:00:00 2001 From: swiftylab-ci Date: Fri, 29 Mar 2024 11:21:07 +0000 Subject: [PATCH] chore(CHANGELOG): update for v1.6.0 [skip ci] --- CHANGELOG.md | 24 ++++++++ dist/index.js | 140 ++++++++++++++++++++++++++++++++++------------ package-lock.json | 4 +- package.json | 2 +- 4 files changed, 132 insertions(+), 38 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e1dfb4..157c7a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,27 @@ +## [1.6.0](https://github.com/SwiftyLab/setup-swift/compare/v1.5.2...v1.6.0) (2024-03-29) + + +### 🚀 Features + +* added git ref support to `check-latest` option ([840a162](https://github.com/SwiftyLab/setup-swift/commit/840a162aceb6bbd06e4d75fc2a01368606fbcd79)) +* added supporting new swift toolchains without action release ([#259](https://github.com/SwiftyLab/setup-swift/issues/259)) ([b8b0c2a](https://github.com/SwiftyLab/setup-swift/commit/b8b0c2a092dae00291896efaed137186604e8a4f)) + + +### 🐛 Fixes + +* fixed toolchain caching ([a36cd73](https://github.com/SwiftyLab/setup-swift/commit/a36cd7340bd78afaec08414baf006875c510cfc8)) + + +### 🐎 Performance Improvements + +* added skipping gpg verification if signature missing ([17c7929](https://github.com/SwiftyLab/setup-swift/commit/17c79292c8f4fa745c8473d6e3d1b1ee36ee6d6e)) +* cache will only be saved if not saved once ([a7ba193](https://github.com/SwiftyLab/setup-swift/commit/a7ba1938c28b6866f405452b04d443f3f9bab9b1)) + + +### 🛠 Dependency + +* bump glob from 10.3.10 to 10.3.12 ([#261](https://github.com/SwiftyLab/setup-swift/issues/261)) ([3495928](https://github.com/SwiftyLab/setup-swift/commit/349592802c9eab68a74c07a825d431adb37d185e)) + ## [1.5.2](https://github.com/SwiftyLab/setup-swift/compare/v1.5.1...v1.5.2) (2024-03-23) diff --git a/dist/index.js b/dist/index.js index 4d7f8a8..1f9c5fe 100644 --- a/dist/index.js +++ b/dist/index.js @@ -105,8 +105,8 @@ class ToolchainInstaller { }; } install(arch) { - var _a; return __awaiter(this, void 0, void 0, function* () { + var _a; const key = `${this.data.dir}-${this.data.platform}`; const version = (_a = this.version) === null || _a === void 0 ? void 0 : _a.raw; let tool; @@ -669,8 +669,8 @@ class Installation { }); } static detect() { - var _a; return __awaiter(this, void 0, void 0, function* () { + var _a; const systemDrive = (_a = process.env.SystemDrive) !== null && _a !== void 0 ? _a : 'C:'; const defaultPath = path.join(systemDrive, 'Library'); const devPath = path.join(systemDrive, 'Program Files', 'Swift'); @@ -897,8 +897,8 @@ const version_1 = __nccwpck_require__(4428); const swiftorg_1 = __nccwpck_require__(5010); const platform_1 = __nccwpck_require__(1190); function run() { - var _a; return __awaiter(this, void 0, void 0, function* () { + var _a; try { const requestedVersion = (_a = core.getInput('swift-version')) !== null && _a !== void 0 ? _a : 'latest'; const development = core.getBooleanInput('development'); @@ -1698,8 +1698,8 @@ class Swiftorg { }); } update() { - var _a; return __awaiter(this, void 0, void 0, function* () { + var _a; let ref; if (typeof this.checkLatest === 'boolean' && this.checkLatest) { ref = 'HEAD'; @@ -2210,8 +2210,8 @@ var VSWhere; /// Borrowed from setup-msbuild action: https://github.com/microsoft/setup-msbuild /// From source file: https://github.com/microsoft/setup-msbuild/blob/master/src/main.ts function get() { - var _a; return __awaiter(this, void 0, void 0, function* () { + var _a; // check to see if we are using a specific path for vswhere let vswhereToolExe = ''; // Env variable for self-hosted runner to provide custom path @@ -88481,7 +88481,7 @@ module.exports = require("zlib"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Glob = void 0; const minimatch_1 = __nccwpck_require__(266); -const path_scurry_1 = __nccwpck_require__(9569); +const path_scurry_1 = __nccwpck_require__(1081); const url_1 = __nccwpck_require__(7310); const pattern_js_1 = __nccwpck_require__(6866); const walker_js_1 = __nccwpck_require__(153); @@ -88820,6 +88820,12 @@ class Ignore { if (!parsed || !globParts) { throw new Error('invalid pattern object'); } + // strip off leading ./ portions + // https://github.com/isaacs/node-glob/issues/570 + while (parsed[0] === '.' && globParts[0] === '.') { + parsed.shift(); + globParts.shift(); + } /* c8 ignore stop */ const p = new pattern_js_1.Pattern(parsed, globParts, 0, platform); const m = new minimatch_1.Minimatch(p.globString(), mmopts); @@ -89495,7 +89501,7 @@ exports.GlobStream = exports.GlobWalker = exports.GlobUtil = void 0; * * @module */ -const minipass_1 = __nccwpck_require__(8865); +const minipass_1 = __nccwpck_require__(4968); const ignore_js_1 = __nccwpck_require__(9703); const processor_js_1 = __nccwpck_require__(4628); const makeIgnore = (ignore, opts) => typeof ignore === 'string' @@ -89584,13 +89590,26 @@ class GlobUtil { e = rpc; } const needStat = e.isUnknown() || this.opts.stat; - return this.matchCheckTest(needStat ? await e.lstat() : e, ifDir); + const s = needStat ? await e.lstat() : e; + if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) { + const target = await s.realpath(); + /* c8 ignore start */ + if (target && (target.isUnknown() || this.opts.stat)) { + await target.lstat(); + } + /* c8 ignore stop */ + } + return this.matchCheckTest(s, ifDir); } matchCheckTest(e, ifDir) { return e && (this.maxDepth === Infinity || e.depth() <= this.maxDepth) && (!ifDir || e.canReaddir()) && (!this.opts.nodir || !e.isDirectory()) && + (!this.opts.nodir || + !this.opts.follow || + !e.isSymbolicLink() || + !e.realpathCached()?.isDirectory()) && !this.#ignored(e) ? e : undefined; @@ -89606,7 +89625,14 @@ class GlobUtil { e = rpc; } const needStat = e.isUnknown() || this.opts.stat; - return this.matchCheckTest(needStat ? e.lstatSync() : e, ifDir); + const s = needStat ? e.lstatSync() : e; + if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) { + const target = s.realpathSync(); + if (target && (target?.isUnknown() || this.opts.stat)) { + target.lstatSync(); + } + } + return this.matchCheckTest(s, ifDir); } matchFinish(e, absolute) { if (this.#ignored(e)) @@ -91701,7 +91727,7 @@ exports.unescape = unescape; /***/ }), -/***/ 8865: +/***/ 4968: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -92736,7 +92762,7 @@ exports.Minipass = Minipass; /***/ }), -/***/ 9569: +/***/ 1081: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -92766,7 +92792,7 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.PathScurry = exports.Path = exports.PathScurryDarwin = exports.PathScurryPosix = exports.PathScurryWin32 = exports.PathScurryBase = exports.PathPosix = exports.PathWin32 = exports.PathBase = exports.ChildrenCache = exports.ResolveCache = void 0; -const lru_cache_1 = __nccwpck_require__(7433); +const lru_cache_1 = __nccwpck_require__(6091); const path_1 = __nccwpck_require__(1017); const url_1 = __nccwpck_require__(7310); const actualFS = __importStar(__nccwpck_require__(7147)); @@ -92775,7 +92801,7 @@ const realpathSync = fs_1.realpathSync.native; // TODO: test perf of fs/promises realpath vs realpathCB, // since the promises one uses realpath.native const promises_1 = __nccwpck_require__(3292); -const minipass_1 = __nccwpck_require__(8865); +const minipass_1 = __nccwpck_require__(4968); const defaultFS = { lstatSync: fs_1.lstatSync, readdir: fs_1.readdir, @@ -92817,21 +92843,21 @@ const IFMT = 0b1111; // mask to unset low 4 bits const IFMT_UNKNOWN = ~IFMT; // set after successfully calling readdir() and getting entries. -const READDIR_CALLED = 16; +const READDIR_CALLED = 0b0000_0001_0000; // set after a successful lstat() -const LSTAT_CALLED = 32; +const LSTAT_CALLED = 0b0000_0010_0000; // set if an entry (or one of its parents) is definitely not a dir -const ENOTDIR = 64; +const ENOTDIR = 0b0000_0100_0000; // set if an entry (or one of its parents) does not exist // (can also be set on lstat errors like EACCES or ENAMETOOLONG) -const ENOENT = 128; +const ENOENT = 0b0000_1000_0000; // cannot have child entries -- also verify &IFMT is either IFDIR or IFLNK // set if we fail to readlink -const ENOREADLINK = 256; +const ENOREADLINK = 0b0001_0000_0000; // set if we know realpath() will fail -const ENOREALPATH = 512; +const ENOREALPATH = 0b0010_0000_0000; const ENOCHILD = ENOTDIR | ENOENT | ENOREALPATH; -const TYPEMASK = 1023; +const TYPEMASK = 0b0011_1111_1111; const entToType = (s) => s.isFile() ? IFREG : s.isDirectory() @@ -93445,7 +93471,7 @@ class PathBase { /* c8 ignore stop */ try { const read = await this.#fs.promises.readlink(this.fullpath()); - const linkTarget = this.parent.resolve(read); + const linkTarget = (await this.parent.realpath())?.resolve(read); if (linkTarget) { return (this.#linkTarget = linkTarget); } @@ -93474,7 +93500,7 @@ class PathBase { /* c8 ignore stop */ try { const read = this.#fs.readlinkSync(this.fullpath()); - const linkTarget = this.parent.resolve(read); + const linkTarget = (this.parent.realpathSync())?.resolve(read); if (linkTarget) { return (this.#linkTarget = linkTarget); } @@ -93489,7 +93515,9 @@ class PathBase { this.#type |= READDIR_CALLED; // mark all remaining provisional children as ENOENT for (let p = children.provisional; p < children.length; p++) { - children[p].#markENOENT(); + const c = children[p]; + if (c) + c.#markENOENT(); } } #markENOENT() { @@ -94761,7 +94789,7 @@ exports.PathScurry = process.platform === 'win32' /***/ }), -/***/ 7433: +/***/ 6091: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -95202,6 +95230,9 @@ class LRUCache { if (ttls[index]) { const ttl = ttls[index]; const start = starts[index]; + /* c8 ignore next */ + if (!ttl || !start) + return; status.ttl = ttl; status.start = start; status.now = cachedNow || getNow(); @@ -95233,16 +95264,16 @@ class LRUCache { } const ttl = ttls[index]; const start = starts[index]; - if (ttl === 0 || start === 0) { + if (!ttl || !start) { return Infinity; } const age = (cachedNow || getNow()) - start; return ttl - age; }; this.#isStale = index => { - return (ttls[index] !== 0 && - starts[index] !== 0 && - (cachedNow || getNow()) - starts[index] > ttls[index]); + const s = starts[index]; + const t = ttls[index]; + return !!t && !!s && (cachedNow || getNow()) - s > t; }; } // conditionally set private methods related to TTL @@ -95437,6 +95468,11 @@ class LRUCache { [Symbol.iterator]() { return this.entries(); } + /** + * A String value that is used in the creation of the default string description of an object. + * Called by the built-in method Object.prototype.toString. + */ + [Symbol.toStringTag] = 'LRUCache'; /** * Find a value for which the supplied fn method returns a truthy value, * similar to Array.find(). fn is called as fn(value, key, cache). @@ -95500,6 +95536,37 @@ class LRUCache { } return deleted; } + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Like {@link LRUCache#dump}, but just for a + * single key. Always returns stale values, if their info is found in the + * cache, so be sure to check for expired TTLs if relevant. + */ + info(key) { + const i = this.#keyMap.get(key); + if (i === undefined) + return undefined; + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) + ? v.__staleWhileFetching + : v; + if (value === undefined) + return undefined; + const entry = { value }; + if (this.#ttls && this.#starts) { + const ttl = this.#ttls[i]; + const start = this.#starts[i]; + if (ttl && start) { + const remain = ttl - (perf.now() - start); + entry.ttl = remain; + entry.start = Date.now(); + } + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + return entry; + } /** * Return an array of [key, {@link LRUCache.Entry}] tuples which can be * passed to cache.load() @@ -95766,12 +95833,13 @@ class LRUCache { peek(k, peekOptions = {}) { const { allowStale = this.allowStale } = peekOptions; const index = this.#keyMap.get(k); - if (index !== undefined && - (allowStale || !this.#isStale(index))) { - const v = this.#valList[index]; - // either stale and allowed, or forcing a refresh of non-stale value - return this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (index === undefined || + (!allowStale && this.#isStale(index))) { + return; } + const v = this.#valList[index]; + // either stale and allowed, or forcing a refresh of non-stale value + return this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; } #backgroundFetch(k, index, options, context) { const v = index === undefined ? undefined : this.#valList[index]; @@ -96107,8 +96175,10 @@ class LRUCache { this.#head = this.#next[index]; } else { - this.#next[this.#prev[index]] = this.#next[index]; - this.#prev[this.#next[index]] = this.#prev[index]; + const pi = this.#prev[index]; + this.#next[pi] = this.#next[index]; + const ni = this.#next[index]; + this.#prev[ni] = this.#prev[index]; } this.#size--; this.#free.push(index); diff --git a/package-lock.json b/package-lock.json index fb3ab0b..98956cf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "setup-swift", - "version": "1.5.2", + "version": "1.6.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "setup-swift", - "version": "1.5.2", + "version": "1.6.0", "license": "MIT", "dependencies": { "@actions/cache": "^3.2.4", diff --git a/package.json b/package.json index 67086fe..65b60d1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "setup-swift", - "version": "1.5.2", + "version": "1.6.0", "private": true, "description": "Setup Swift environment.", "main": "lib/main.js",