mirror of https://github.com/aminya/setup-cpp
6 lines
1.3 MiB
JavaScript
6 lines
1.3 MiB
JavaScript
|
function e(e,t,i,a){Object.defineProperty(e,t,{get:i,set:a,enumerable:!0,configurable:!0});}function t(e){return e&&e.__esModule?e.default:e;}var i=require("path"),a=require("fs"),r=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("67dfi",function(t,i){var a,r,n;async function o(e,t){if(a.isFeatureAvailable()||(function(){let e=new URL(process.env.GITHUB_SERVER_URL||"https://github.com");return"GITHUB.COM"!==e.hostname.toUpperCase();}()?r.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."):r.warning("The runner was not able to contact the cache service. Caching will be skipped"),0)){let i=r.getInput("cache-dependency-path")||void 0,a=(0,n.getCacheDistributor)(e,t,i);await a.restoreCache();}}e(t.exports,"cacheDependencies",()=>o),a=y("ehenw"),r=y("lcRzN"),n=y("kN51U");}),y.register("ehenw",function(e,t){var a,r,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.`);}a=e.exports&&e.exports.__createBinding||(Object.create?function(e,t,i,a){void 0===a&&(a=i);var r=Object.getOwnPropertyDescriptor(t,i);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[i];}}),Object.defineProperty(e,a,r);}:function(e,t,i,a){void 0===a&&(a=i),e[a]=t[i];}),r=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)&&a(t,e,i);return r(t,e),t;},o=e.exports&&e.exports.__awaiter||function(e,t,i,a){return new(i||(i=Promise))(function(r,n){function o(e){try{u(a.next(e));}catch(e){n(e);}}function s(e){try{u(a.throw(e));}catch(e){n(e);}}function u(e){var t;e.done?r(e.value):((t=e.value)instanceof i?t:new i(function(e){e(t);})).then(o,s);}u((a=a.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("lcRzN")),p=n(i),d=n(y("awTSO")),m=n(y("a6VyY"));s=y("NxvoN");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,a,r=!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:r});if(!(null==t?void 0:t.archiveLocation))return;if(null==a?void 0:a.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,a),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==a?void 0:a.cacheKey}, Cache Version: ${null==a?void 0:a.cacheVersion}, Cache Scope: ${null==a?void 0:a.scope}, Cache Created: ${null==a?void 0:a.creationTime}`);}});}(e[0],a,r)),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 a=new u.URL(e),r=(0,d.getDownloadOptions)(i);r.useAzureSdk&&a.hostname.endsWith(".blob.core.windows.net")?yield(0,p.downloadCacheStorageSDK)(e,t,r):yield(0,p.downloadCacheHttpClient)(e,t);});},e.exports.reserveCache=function(e,t,i){return o(this,void 0,void 0,function*(){let a=h(),r=f(t,null==i?void 0:i.compressionMethod,null==i?void 0:i.enableCrossOsArchive),n={key:e,version:r,cacheSize:null==i?void 0:i.cacheSize},s=yield(0,m.retryTypedResponse)("reserveCache",()=>o(this,void 0,void 0,function*(){return a.postJson(x("caches"),n);}));return s;});},e.exports.saveCache=function(e,t,i){return o(this,void 0,void 0,function*(){let a=h();g.debug("Upload cache"),yield function(e,t,i,a){return o(this,void 0,void 0,function*(){let r=v.getArchiveFileSizeInBytes(i),n=x("caches/"+t.toString()),s=C.openSync(i,"r"),u=(0,d.getUploadOptions)(a),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<r;){let t=Math.min(r-h,l),a=h,u=h+t-1;h+=l,yield function(e,t,i,a,r){return o(this,void 0,void 0,function*(){g.debug(`Uploading chunk of size ${r-a+1} bytes at offset ${a} with content range: ${D(a,r)}`);let n={"Content-Type":"application/octet-stream","Content-Range":D(a,r)},s=yield(0,m.retryHttpClientResponse)(`uploadChunk (start: ${a}, end: ${r})`,()=>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:a,end:u,autoClose:!1}).on("error",e=>{throw Error("Cache upload failed because file read failed with "+e.message);}),a,u);}})));}finally{C.closeSync(s);}});}(a,e,t,i),g.debug("Commiting cache");let r=v.getArchiveFileSizeInBytes(t);g.info(`Cache Size: ~${Math.round(r/1048576)} MB (${r} B)`);let n=yield function(e,t,i){return o(this,void 0,void 0,function*(){let a={size:i};return yield(0,m.retryTypedResponse)("commitCache",()=>o(this,void 0,void 0,function*(){return e.postJson(x("caches/"+t.toString()),a);}));});}(a,e,r);if(!(0,m.isSuccessStatusCode)(n.statusCode))throw Error(`Cache service responded with ${n.statusCode} during commit cache.`);g.info("Cache saved successfully");});};}),y.register("dJfwp",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),a=new u.HttpClient("actions/cache"),r=yield(0,m.retryHttpClientResponse)("downloadCache",()=>s(this,void 0,void 0,function*(){return a.get(e);}));r.message.socket.setTimeout(d.SocketTimeout,()=>{r.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);});}(r,i);let n=r.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,a){void 0===a&&(a=i);var r=Object.getOwnPropertyDescriptor(t,i);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return
|
||
|
`;}),i;}getCanonicalizedResourceString(e){let t=(0,r.getURLPath)(e.url)||"/",i="";i+=`/${this.factory.accountName}${t}`;let a=(0,r.getURLQueries)(e.url),n={};if(a){let e=[];for(let t in a)if(Object.prototype.hasOwnProperty.call(a,t)){let i=t.toLowerCase();n[i]=a[t],e.push(i);}for(let t of(e.sort(),e))i+=`
|
||
|
${t}:${decodeURIComponent(n[t])}`;}return i;}}}),y.register("5MFjo",function(t,i){e(t.exports,"SDK_VERSION",()=>a),e(t.exports,"SERVICE_VERSION",()=>r),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 a="12.15.0",r="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("fH185",function(t,i){e(t.exports,"Sanitizer",()=>u);var a=y("65kMX"),r=y("8i3wZ");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,r.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 a={};for(let r of Object.keys(e))t.has(r.toLowerCase())?a[r]=i(e,r):a[r]=n;return a;}sanitizeUrl(e){if("string"!=typeof e||null===e)return e;let t=(0,a.URLBuilder).parse(e),i=t.getQuery();if(!i)return e;let r=(0,a.URLQuery).parse(i);for(let e of r.keys())this.allowedQueryParameters.has(e.toLowerCase())||r.set(e,n);return t.setQuery(r.toString()),t.toString();}}}),y.register("bn8hv",function(t,i){e(t.exports,"custom",()=>a);let a=r.inspect.custom;}),y.register("Ahf9T",function(t,i){var a,r;function n(e,t={}){var i;c.rootName=t.rootName,c.charkey=null!==(i=t.xmlCharKey)&&void 0!==i?i:r.XML_CHARKEY;let n=new a.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:r.XML_CHARKEY;let n=new a.Parser(u);return new Promise((t,i)=>{e?n.parseString(e,(e,a)=>{e?i(e):t(a);}):i(Error("Document is empty"));});}e(t.exports,"stringifyXML",()=>n),e(t.exports,"parseXML",()=>o),a=y("9OKsB"),r=y("WRKX0");let s={explicitCharkey:!1,trim:!1,normalize:!1,normalizeTags:!1,attrkey:r.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("9OKsB",function(e,t){(function(){var t,i,a,r,n=function(e,t){function i(){this.constructor=e;}for(var a in t)o.call(t,a)&&(e[a]=t[a]);return i.prototype=t.prototype,e.prototype=new i(),e.__super__=t.prototype,e;},o={}.hasOwnProperty;i=y("AfX4q"),t=y("hBFg5"),a=y("7JuJD"),r=y("jyooR"),e.exports.defaults=i.defaults,e.exports.processors=r,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.e0061047.js.map
|