setup-cpp/dist/legacy/cache-dependencies.087b1350.js

6 lines
1.3 MiB
JavaScript
Raw Normal View History

function e(e,t,i,r){Object.defineProperty(e,t,{get:i,set:r,enumerable:!0,configurable:!0});}function t(e){return e&&e.__esModule?e.default:e;}var i=require("path"),r=require("fs"),a=require("util"),n=require("assert"),o=require("os"),s=require("crypto"),u=require("url"),c=require("buffer"),l=require("stream"),p=require("events"),d=require("timers"),m=require("string_decoder"),x=require("http"),h=require("https"),f=require("zlib"),D=require("child_process"),g="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},y=g.parcelRequire810d;y.register("cdq6h",function(t,i){var r,a,n;async function o(e,t){if(r.isFeatureAvailable()||(function(){let e=new URL(process.env.GITHUB_SERVER_URL||"https://github.com");return"GITHUB.COM"!==e.hostname.toUpperCase();}()?a.warning("Caching is only supported on GHES version >= 3.5. If you are on a version >= 3.5, please check with your GHES admin if the Actions cache service is enabled or not."):a.warning("The runner was not able to contact the cache service. Caching will be skipped"),0)){let i=a.getInput("cache-dependency-path")||void 0,r=(0,n.getCacheDistributor)(e,t,i);await r.restoreCache();}}e(t.exports,"cacheDependencies",()=>o),r=y("47qGt"),a=y("2heqc"),n=y("f74Vt");}),y.register("47qGt",function(e,t){var r,a,n,o,s;function u(e){if(!e||0===e.length)throw new x("Path Validation Error: At least one directory or file path is required");}function c(e){if(e.length>512)throw new x(`Key Validation Error: ${e} cannot be larger than 512 characters.`);if(!/^[^,]*$/.test(e))throw new x(`Key Validation Error: ${e} cannot contain commas.`);}r=e.exports&&e.exports.__createBinding||(Object.create?function(e,t,i,r){void 0===r&&(r=i);var a=Object.getOwnPropertyDescriptor(t,i);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[i];}}),Object.defineProperty(e,r,a);}:function(e,t,i,r){void 0===r&&(r=i),e[r]=t[i];}),a=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t});}:function(e,t){e.default=t;}),n=e.exports&&e.exports.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&r(t,e,i);return a(t,e),t;},o=e.exports&&e.exports.__awaiter||function(e,t,i,r){return new(i||(i=Promise))(function(a,n){function o(e){try{u(r.next(e));}catch(e){n(e);}}function s(e){try{u(r.throw(e));}catch(e){n(e);}}function u(e){var t;e.done?a(e.value):((t=e.value)instanceof i?t:new i(function(e){e(t);})).then(o,s);}u((r=r.apply(e,t||[])).next());});},Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.saveCache=e.exports.restoreCache=e.exports.isFeatureAvailable=e.exports.ReserveCacheError=e.exports.ValidationError=void 0;let l=n(y("2heqc")),p=n(i),d=n(y("geSAa")),m=n(y("TDEVD"));s=y("15b9J");class x extends Error{constructor(e){super(e),this.name="ValidationError",Object.setPrototypeOf(this,x.prototype);}}e.exports.ValidationError=x;class h extends Error{constructor(e){super(e),this.name="ReserveCacheError",Object.setPrototypeOf(this,h.prototype);}}e.exports.ReserveCacheError=h,e.exports.isFeatureAvailable=function(){return!!process.env.ACTIONS_CACHE_URL;},e.exports.restoreCache=function(e,t,i,r,a=!1){return o(this,void 0,void 0,function*(){u(e),i=i||[];let n=[t,...i];if(l.debug("Resolved Keys:"),l.debug(JSON.stringify(n)),n.length>10)throw new x("Key Validation Error: Keys are limited to a maximum of 10.");for(let e of n)c(e);let o=yield d.getCompressionMethod(),h="";try{let t=yield m.getCacheEntry(n,e,{compressionMethod:o,enableCrossOsArchive:a});if(!(null==t?void 0:t.archiveLocation))return;if(null==r?void 0:r.lookupOnly)return l.info("Lookup only - skipping download"),t.cacheKey;h=p.join(yield d.createTempDirectory(),d.getCacheFileName(o)),l.debug("Archive Path: "+h),yield m.downloadCache(t.archiveLocation,h,r),l.isDebug()&&(yield(0,s.listTar)(h,o));let i=d.getArchiveFileSizeInBytes(h);return l.info(`Cache Siz
Other caches with similar key:`),(null==t?void 0:t.artifactCaches)||[]))g.debug(`Cache Key: ${null==r?void 0:r.cacheKey}, Cache Version: ${null==r?void 0:r.cacheVersion}, Cache Scope: ${null==r?void 0:r.scope}, Cache Created: ${null==r?void 0:r.creationTime}`);}});}(e[0],r,a)),null;if(!(0,m.isSuccessStatusCode)(s.statusCode))throw Error("Cache service responded with "+s.statusCode);let u=s.result,c=null==u?void 0:u.archiveLocation;if(!c)throw Error("Cache not found.");return g.setSecret(c),g.debug("Cache Result:"),g.debug(JSON.stringify(u)),u;});},e.exports.downloadCache=function(e,t,i){return o(this,void 0,void 0,function*(){let r=new u.URL(e),a=(0,d.getDownloadOptions)(i);r.hostname.endsWith(".blob.core.windows.net")?a.useAzureSdk?yield(0,p.downloadCacheStorageSDK)(e,t,a):a.concurrentBlobDownloads?yield(0,p.downloadCacheHttpClientConcurrent)(e,t,a):yield(0,p.downloadCacheHttpClient)(e,t):yield(0,p.downloadCacheHttpClient)(e,t);});},e.exports.reserveCache=function(e,t,i){return o(this,void 0,void 0,function*(){let r=h(),a=f(t,null==i?void 0:i.compressionMethod,null==i?void 0:i.enableCrossOsArchive),n={key:e,version:a,cacheSize:null==i?void 0:i.cacheSize},s=yield(0,m.retryTypedResponse)("reserveCache",()=>o(this,void 0,void 0,function*(){return r.postJson(x("caches"),n);}));return s;});},e.exports.saveCache=function(e,t,i){return o(this,void 0,void 0,function*(){let r=h();g.debug("Upload cache"),yield function(e,t,i,r){return o(this,void 0,void 0,function*(){let a=v.getArchiveFileSizeInBytes(i),n=x("caches/"+t.toString()),s=C.openSync(i,"r"),u=(0,d.getUploadOptions)(r),c=v.assertDefined("uploadConcurrency",u.uploadConcurrency),l=v.assertDefined("uploadChunkSize",u.uploadChunkSize),p=[...Array(c).keys()];g.debug("Awaiting all uploads");let h=0;try{yield Promise.all(p.map(()=>o(this,void 0,void 0,function*(){for(;h<a;){let t=Math.min(a-h,l),r=h,u=h+t-1;h+=l,yield function(e,t,i,r,a){return o(this,void 0,void 0,function*(){g.debug(`Uploading chunk of size ${a-r+1} bytes at offset ${r} with content range: ${D(r,a)}`);let n={"Content-Type":"application/octet-stream","Content-Range":D(r,a)},s=yield(0,m.retryHttpClientResponse)(`uploadChunk (start: ${r}, end: ${a})`,()=>o(this,void 0,void 0,function*(){return e.sendStream("PATCH",t,i(),n);}));if(!(0,m.isSuccessStatusCode)(s.message.statusCode))throw Error(`Cache service responded with ${s.message.statusCode} during upload chunk.`);});}(e,n,()=>C.createReadStream(i,{fd:s,start:r,end:u,autoClose:!1}).on("error",e=>{throw Error("Cache upload failed because file read failed with "+e.message);}),r,u);}})));}finally{C.closeSync(s);}});}(r,e,t,i),g.debug("Commiting cache");let a=v.getArchiveFileSizeInBytes(t);g.info(`Cache Size: ~${Math.round(a/1048576)} MB (${a} B)`);let n=yield function(e,t,i){return o(this,void 0,void 0,function*(){let r={size:i};return yield(0,m.retryTypedResponse)("commitCache",()=>o(this,void 0,void 0,function*(){return e.postJson(x("caches/"+t.toString()),r);}));});}(r,e,a);if(!(0,m.isSuccessStatusCode)(n.statusCode))throw Error(`Cache service responded with ${n.statusCode} during commit cache.`);g.info("Cache saved successfully");});};}),y.register("9DgeK",function(e,t){var i,n,o,s,u,p,d,m,x;function h(e,t){return s(this,void 0,void 0,function*(){let i=g.createWriteStream(t),r=new u.HttpClient("actions/cache"),a=yield(0,m.retryHttpClientResponse)("downloadCache",()=>s(this,void 0,void 0,function*(){return r.get(e);}));a.message.socket.setTimeout(d.SocketTimeout,()=>{a.message.destroy(),f.debug(`Aborting download, socket timed out after ${d.SocketTimeout} ms`);}),yield function(e,t){return s(this,void 0,void 0,function*(){let i=C.promisify(b.pipeline);yield i(e.message,t);});}(a,i);let n=a.message.headers["content-length"];if(n){let e=parseInt(n),i=v.getArchiveFileSizeInBytes(t);if(i!==e)throw Error(`Incomplete download. Expected file size: ${e}, actual file size: ${i}`);}else f.debug("Unable to validate download, no Content-Length header");});}i=e.exports&&e.exports.__createBinding||(Object.create?function(e,t,i,r){void 0===r&&(r=i);var a=Object.getOwnPropert
`;}),i;}getCanonicalizedResourceString(e){let t=(0,a.getURLPath)(e.url)||"/",i="";i+=`/${this.factory.accountName}${t}`;let r=(0,a.getURLQueries)(e.url),n={};if(r){let e=[];for(let t in r)if(Object.prototype.hasOwnProperty.call(r,t)){let i=t.toLowerCase();n[i]=r[t],e.push(i);}for(let t of(e.sort(),e))i+=`
${t}:${decodeURIComponent(n[t])}`;}return i;}}}),y.register("7STSD",function(t,i){e(t.exports,"SDK_VERSION",()=>r),e(t.exports,"SERVICE_VERSION",()=>a),e(t.exports,"BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES",()=>n),e(t.exports,"BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES",()=>o),e(t.exports,"BLOCK_BLOB_MAX_BLOCKS",()=>s),e(t.exports,"DEFAULT_BLOCK_BUFFER_SIZE_BYTES",()=>u),e(t.exports,"DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES",()=>c),e(t.exports,"DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS",()=>l),e(t.exports,"REQUEST_TIMEOUT",()=>p),e(t.exports,"StorageOAuthScopes",()=>d),e(t.exports,"URLConstants",()=>m),e(t.exports,"HeaderConstants",()=>x),e(t.exports,"ETagNone",()=>h),e(t.exports,"ETagAny",()=>f),e(t.exports,"EncryptionAlgorithmAES25",()=>D),e(t.exports,"DevelopmentConnectionString",()=>g),e(t.exports,"StorageBlobLoggingAllowedHeaderNames",()=>y),e(t.exports,"StorageBlobLoggingAllowedQueryParameters",()=>b),e(t.exports,"BlobUsesCustomerSpecifiedEncryptionMsg",()=>C),e(t.exports,"BlobDoesNotUseCustomerSpecifiedEncryption",()=>v),e(t.exports,"PathStylePorts",()=>E);let r="12.15.0",a="2023-01-03",n=268435456,o=4194304e3,s=5e4,u=8388608,c=4194304,l=5,p=1e5,d="https://storage.azure.com/.default",m={Parameters:{FORCE_BROWSER_NO_CACHE:"_",SIGNATURE:"sig",SNAPSHOT:"snapshot",VERSIONID:"versionid",TIMEOUT:"timeout"}},x={AUTHORIZATION:"Authorization",AUTHORIZATION_SCHEME:"Bearer",CONTENT_ENCODING:"Content-Encoding",CONTENT_ID:"Content-ID",CONTENT_LANGUAGE:"Content-Language",CONTENT_LENGTH:"Content-Length",CONTENT_MD5:"Content-Md5",CONTENT_TRANSFER_ENCODING:"Content-Transfer-Encoding",CONTENT_TYPE:"Content-Type",COOKIE:"Cookie",DATE:"date",IF_MATCH:"if-match",IF_MODIFIED_SINCE:"if-modified-since",IF_NONE_MATCH:"if-none-match",IF_UNMODIFIED_SINCE:"if-unmodified-since",PREFIX_FOR_STORAGE:"x-ms-",RANGE:"Range",USER_AGENT:"User-Agent",X_MS_CLIENT_REQUEST_ID:"x-ms-client-request-id",X_MS_COPY_SOURCE:"x-ms-copy-source",X_MS_DATE:"x-ms-date",X_MS_ERROR_CODE:"x-ms-error-code",X_MS_VERSION:"x-ms-version"},h="",f="*",D="AES256",g="DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;",y=["Access-Control-Allow-Origin","Cache-Control","Content-Length","Content-Type","Date","Request-Id","traceparent","Transfer-Encoding","User-Agent","x-ms-client-request-id","x-ms-date","x-ms-error-code","x-ms-request-id","x-ms-return-client-request-id","x-ms-version","Accept-Ranges","Content-Disposition","Content-Encoding","Content-Language","Content-MD5","Content-Range","ETag","Last-Modified","Server","Vary","x-ms-content-crc64","x-ms-copy-action","x-ms-copy-completion-time","x-ms-copy-id","x-ms-copy-progress","x-ms-copy-status","x-ms-has-immutability-policy","x-ms-has-legal-hold","x-ms-lease-state","x-ms-lease-status","x-ms-range","x-ms-request-server-encrypted","x-ms-server-encrypted","x-ms-snapshot","x-ms-source-range","If-Match","If-Modified-Since","If-None-Match","If-Unmodified-Since","x-ms-access-tier","x-ms-access-tier-change-time","x-ms-access-tier-inferred","x-ms-account-kind","x-ms-archive-status","x-ms-blob-append-offset","x-ms-blob-cache-control","x-ms-blob-committed-block-count","x-ms-blob-condition-appendpos","x-ms-blob-condition-maxsize","x-ms-blob-content-disposition","x-ms-blob-content-encoding","x-ms-blob-content-language","x-ms-blob-content-length","x-ms-blob-content-md5","x-ms-blob-content-type","x-ms-blob-public-access","x-ms-blob-sequence-number","x-ms-blob-type","x-ms-copy-destination-snapshot","x-ms-creation-time","x-ms-default-encryption-scope","x-ms-delete-snapshots","x-ms-delete-type-permanent","x-ms-deny-encryption-scope-override","x-ms-encryption-algorithm","x-ms-if-sequence-number-eq","x-ms-if-sequence-number-le","x-ms-if-sequence-number-lt","x-ms-incremental-copy","x-ms-lease-action","x-ms-lease-break-period","x-ms-lease-duration","x-ms-lease-id","x-ms-lease-time","x-ms-page-write","x-ms-proposed-lease-id","x-ms-range-get-content-md5","x-ms-rehydrate-priority","x-ms-sequence-number-action","x-ms-sku-nam
${n.sanitize(this)}`;}}o.REQUEST_SEND_ERROR="REQUEST_SEND_ERROR",o.PARSE_ERROR="PARSE_ERROR";}),y.register("196jF",function(t,i){e(t.exports,"Sanitizer",()=>u);var r=y("bcmcP"),a=y("9lKSi");let n="REDACTED",o=["x-ms-client-request-id","x-ms-return-client-request-id","x-ms-useragent","x-ms-correlation-request-id","x-ms-request-id","client-request-id","ms-cv","return-client-request-id","traceparent","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Origin","Accept","Accept-Encoding","Cache-Control","Connection","Content-Length","Content-Type","Date","ETag","Expires","If-Match","If-Modified-Since","If-None-Match","If-Unmodified-Since","Last-Modified","Pragma","Request-Id","Retry-After","Server","Transfer-Encoding","User-Agent","WWW-Authenticate"],s=["api-version"];class u{constructor({allowedHeaderNames:e=[],allowedQueryParameters:t=[]}={}){e=Array.isArray(e)?o.concat(e):o,t=Array.isArray(t)?s.concat(t):s,this.allowedHeaderNames=new Set(e.map(e=>e.toLowerCase())),this.allowedQueryParameters=new Set(t.map(e=>e.toLowerCase()));}sanitize(e){let t=new Set();return JSON.stringify(e,(e,i)=>{if(i instanceof Error)return Object.assign(Object.assign({},i),{name:i.name,message:i.message});if("_headersMap"===e)return this.sanitizeHeaders(i);if("url"===e)return this.sanitizeUrl(i);if("query"===e)return this.sanitizeQuery(i);if("body"!==e){if("response"===e)return;else if("operationSpec"===e)return;else if(Array.isArray(i)||(0,a.isObject)(i)){if(t.has(i))return"[Circular]";t.add(i);}return i;}},2);}sanitizeHeaders(e){return this.sanitizeObject(e,this.allowedHeaderNames,(e,t)=>e[t].value);}sanitizeQuery(e){return this.sanitizeObject(e,this.allowedQueryParameters,(e,t)=>e[t]);}sanitizeObject(e,t,i){if("object"!=typeof e||null===e)return e;let r={};for(let a of Object.keys(e))t.has(a.toLowerCase())?r[a]=i(e,a):r[a]=n;return r;}sanitizeUrl(e){if("string"!=typeof e||null===e)return e;let t=(0,r.URLBuilder).parse(e),i=t.getQuery();if(!i)return e;let a=(0,r.URLQuery).parse(i);for(let e of a.keys())this.allowedQueryParameters.has(e.toLowerCase())||a.set(e,n);return t.setQuery(a.toString()),t.toString();}}}),y.register("ks2oG",function(t,i){e(t.exports,"custom",()=>r);let r=a.inspect.custom;}),y.register("3kF9U",function(t,i){var r,a;function n(e,t={}){var i;c.rootName=t.rootName,c.charkey=null!==(i=t.xmlCharKey)&&void 0!==i?i:a.XML_CHARKEY;let n=new r.Builder(c);return n.buildObject(e);}function o(e,t={}){var i;u.explicitRoot=!!t.includeRoot,u.charkey=null!==(i=t.xmlCharKey)&&void 0!==i?i:a.XML_CHARKEY;let n=new r.Parser(u);return new Promise((t,i)=>{e?n.parseString(e,(e,r)=>{e?i(e):t(r);}):i(Error("Document is empty"));});}e(t.exports,"stringifyXML",()=>n),e(t.exports,"parseXML",()=>o),r=y("fkZEj"),a=y("kv60D");let s={explicitCharkey:!1,trim:!1,normalize:!1,normalizeTags:!1,attrkey:a.XML_ATTRKEY,explicitArray:!0,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!0,validator:void 0,xmlns:!1,explicitChildren:!1,preserveChildrenOrder:!1,childkey:"$$",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:void 0,attrValueProcessors:void 0,tagNameProcessors:void 0,valueProcessors:void 0,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:!0},doctype:void 0,renderOpts:{pretty:!0,indent:" ",newline:"\n"},headless:!1,chunkSize:1e4,emptyTag:"",cdata:!1},u=Object.assign({},s);u.explicitArray=!1;let c=Object.assign({},s);c.explicitArray=!1,c.renderOpts={pretty:!1};}),y.register("fkZEj",function(e,t){(function(){var t,i,r,a,n=function(e,t){function i(){this.constructor=e;}for(var r in t)o.call(t,r)&&(e[r]=t[r]);return i.prototype=t.prototype,e.prototype=new i(),e.__super__=t.prototype,e;},o={}.hasOwnProperty;i=y("530nM"),t=y("iKJ0N"),r=y("iBX9L"),a=y("jSvm5"),e.exports.defaults=i.defaults,e.exports.processors=a,e.exports.ValidationError=function(e){function t(e){this.message=e;}return n(t,e),t;}(Error),e.exports.Builder=t.Build
//# sourceMappingURL=cache-dependencies.087b1350.js.map