setup-cpp/dist/legacy/setup-cpp.js

40 lines
251 KiB
JavaScript
Raw Normal View History

2023-07-16 06:41:58 +08:00
#!/usr/bin/env node
2023-09-08 04:47:30 +08:00
let e,t,r,n,i,o,s,a;function l(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0});}function c(e){return e&&e.__esModule?e.default:e;}function u(e,t,r){if("function"==typeof t&&(r=t,t={}),!r){if("function"!=typeof Promise)throw TypeError("callback not provided");return new Promise(function(r,n){u(e,t||{},function(e,t){e?n(e):r(t);});});}r$(e,t||{},function(e,n){e&&("EACCES"===e.code||t&&t.ignoreErrors)&&(e=null,n=!1),r(e,n);});}function p(e,t){let r;let n=e.options.env||process.env,i=process.cwd(),o=null!=e.options.cwd,s=o&&void 0!==process.chdir&&!process.chdir.disabled;if(s)try{process.chdir(e.options.cwd);}catch(e){}try{r=rT.sync(e.command,{path:n[rL({env:n})],pathExt:t?iO.delimiter:void 0});}catch(e){}finally{s&&process.chdir(i);}return r&&(r=iO.resolve(o?e.options.cwd:"",r)),r;}function d(e,t){return Object.assign(Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args});}function f(e,t){return ij&&1===e&&!t.file?d(t.original,"spawn"):null;}function h(e,t,r){let n=rP(e,t,r),i=rt.spawn(n.command,n.args,n.options);return rj.hookChildProcess(i,n),i;}async function m(e,t){if(!e)throw Error("Expected a stream");t={maxBuffer:1/0,...t};let{maxBuffer:r}=t,n=r7(t);return await new Promise((t,i)=>{let o=e=>{e&&n.getBufferedLength()<=r5.MAX_LENGTH&&(e.bufferedData=n.getBufferedValue()),i(e);};(async()=>{try{await oh(e,n),t();}catch(e){o(e);}})(),n.on("data",()=>{n.getBufferedLength()>r&&o(new om());});}),n.getBufferedValue();}function g(){var e;return((null===(e=process.getuid)||void 0===e?void 0:e.call(process))===0||!!process.env.CI)&&null!==c(rT).sync("sudo",{nothrow:!0});}function v(e,t=[],r={stdio:"inherit",shell:!0}){return g()?c(rA).commandSync("sudo "+[e,...t].map(e=>`'${e}'`).join(" "),r):c(rA).sync(e,t,r);}function E(e,t=[],r={stdio:"inherit",shell:!0}){return g()?c(rA).command("sudo "+[e,...t].map(e=>`'${e}'`).join(" "),r):c(rA)(e,t,r);}function y(e){return g()&&"string"==typeof process.env.SUDO_USER?"darwin"===process.platform?(0,iO.join)("/Users/",process.env.SUDO_USER,e):(0,iO.join)("/home/",process.env.SUDO_USER,e):c(rR)("~/"+e);}function w(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e));}catch(e){o(e);}}function a(e){try{l(n.throw(e));}catch(e){o(e);}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t);})).then(s,a);}l((n=n.apply(e,t||[])).next());});}function x(e,t){function r(r){return function(l){return function(r){if(n)throw TypeError("Generator is already executing.");for(;s&&(s=0,r[0]&&(a=0)),a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===r[0]||2===r[0])){a=0;continue;}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break;}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break;}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break;}o[2]&&a.ops.pop(),a.trys.pop();continue;}r=t.call(e,a);}catch(e){r=[6,e],i=0;}finally{n=o=0;}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0};}([r,l]);};}var n,i,o,s,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1];},trys:[],ops:[]};return s={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this;}),s;}async function b(){try{await c(nh)({pkg:c(nA)});}catch(e){(0,rx.warning)("Failed to check for updates: "+(e instanceof Error?e.message+e.stack:e));}}function S(e){return null==e?[]:Array.isArray(e)?e:[e];}function I(e){let t="string"==typeof e?"\n":"\n".charCodeAt(),r="string"==typeof e?"\r":"\r".charCodeAt();return e[e.length-1]===t&&(e=e.slice(0,-1)),e[e.length-1]===r&&(e=e.slice(0,-1)),e;}function O(e={}){let{env:t=process.env,platform:r=process.platform}=e;return"win32"!==r?"PATH":Object.keys(t).reverse().find(e=>"PATH"===e.to
2023-07-16 06:41:58 +08:00
if [ -z "\${${e}}" ]; then export ${e}="${n}"; fi
`),(0,n_.info)(`if not defined ${e} then ${e}="${n}" was added to "${sk}`)):((0,iR.appendFileSync)(sk,`
2023-07-16 06:41:58 +08:00
export ${e}="${n}"
`),(0,n_.info)(`${e}="${n}" was added to "${sk}`));return;}process.env[e]=n;}async function D(e){switch(process.platform){case"win32":await A(`$USER_PATH=([Environment]::GetEnvironmentVariable("PATH", "User")); [Environment]::SetEnvironmentVariable("PATH", "${e};$USER_PATH", "User")`),(0,n_.info)(`"${e}" was added to the PATH.`);return;case"linux":case"darwin":await k(),(0,iR.appendFileSync)(sk,`
2023-07-16 06:41:58 +08:00
export PATH="${e}:$PATH"
`),(0,n_.info)(`"${e}" was added to "${sk}"`);return;default:return;}}async function k(){if(sU)return;let e="# Automatically Generated by setup-cpp\nexport SOURCE_CPPRC=0";if(await(0,nD.pathExists)(sk)){let t=(0,iR.readFileSync)(sk,"utf8");if(t.includes(e))return;}(0,iR.appendFileSync)(sk,`
2023-07-16 06:41:58 +08:00
${e}
`),(0,n_.info)(`Added ${e} to ${sk}`);let t=`
2023-07-16 06:41:58 +08:00
# source .cpprc if SOURCE_CPPRC is not set to 0
if [[ "$SOURCE_CPPRC" != 0 && -f "${sk}" ]]; then source "${sk}"; fi
`;try{let e=y(".profile");(0,iR.appendFileSync)(e,t),(0,n_.info)(`${t} was added to ${e}`);let r=y(".bashrc");(0,iR.appendFileSync)(r,t),(0,n_.info)(`${t} was added to ${r}`);}catch(e){(0,rx.warning)(`Failed to add ${t} to .profile or .bashrc. You should add it manually: ${e}`);}sU=!0;}async function U(){if(await(0,nD.pathExists)(sk)){let e=(0,iR.readFileSync)(sk,"utf-8").split("\n"),t=[...new Set(e.reverse())].reverse();(0,iR.writeFileSync)(sk,t.join("\n"));try{_(sk);}catch{}}}function j(e,t,r){let n;let i=aE(e,t,r),o=aa(e,t),s=al(e,t);ag(s,i.options),sQ(i.options);try{n=c(rc).spawn(i.file,i.args,i.options);}catch(r){let e=new(c(rc).ChildProcess)(),t=Promise.reject(sF({error:r,stdout:"",stderr:"",all:"",command:o,escapedCommand:s,parsed:i,timedOut:!1,isCanceled:!1,killed:!1}));return an(e,t),e;}let a=ai(n),l=sY(n,i.options,a),u=sJ(n,i.options,l),p={isCanceled:!1};n.kill=sH.bind(null,n.kill.bind(n)),n.cancel=sW.bind(null,n,p);let d=async()=>{let[{error:e,exitCode:t,signal:r,timedOut:a},l,c,d]=await ae(n,i.options,u),f=ay(i.options,l),h=ay(i.options,c),m=ay(i.options,d);if(e||0!==t||null!==r){let l=sF({error:e,exitCode:t,signal:r,stdout:f,stderr:h,all:m,command:o,escapedCommand:s,parsed:i,timedOut:a,isCanceled:p.isCanceled||!!i.options.signal&&i.options.signal.aborted,killed:n.killed});if(!i.options.reject)return l;throw l;}return{command:o,escapedCommand:s,exitCode:0,stdout:f,stderr:h,all:m,failed:!1,timedOut:!1,isCanceled:!1,killed:!1};},f=nP(d);return s8(n,i.options),n.all=s5(n,i.options),s1(n),an(n,f),n;}function F(e,t,r){let n;let i=aE(e,t,r),o=aa(e,t),s=al(e,t);ag(s,i.options);let a=s4(i.options);try{n=c(rc).spawnSync(i.file,i.args,{...i.options,input:a});}catch(e){throw sF({error:e,stdout:"",stderr:"",all:"",command:o,escapedCommand:s,parsed:i,timedOut:!1,isCanceled:!1,killed:!1});}let l=ay(i.options,n.stdout,n.error),u=ay(i.options,n.stderr,n.error);if(n.error||0!==n.status||null!==n.signal){let e=sF({stdout:l,stderr:u,error:n.error,signal:n.signal,exitCode:n.status,command:o,escapedCommand:s,parsed:i,timedOut:n.error&&"ETIMEDOUT"===n.error.code,isCanceled:!1,killed:null!==n.signal});if(!i.options.reject)return e;throw e;}return{command:o,escapedCommand:s,exitCode:0,stdout:l,stderr:u,failed:!1,timedOut:!1,isCanceled:!1,killed:!1};}async function M(e,t=!1){var r;let n;let i=H()?"nala":"apt-get";for(let{name:t,version:r}of e)(0,rx.info)(`Installing ${t} ${null!=r?r:""} via ${i}`);process.env.DEBIAN_FRONTEND="noninteractive",(!aA||t)&&(q(i),aA=!0),a_||(await V(i),a_=!0);let o=[...new Set(e.flatMap(e=>null!==(r=e.repositories)&&void 0!==r?r:[]))];if(0!==o.length){for(let e of o)v("add-apt-repository",["-y",e]);q(i);}let s=await Promise.all(e.map(e=>B(e.name,e.version)));try{v(i,["install","--fix-broken","-y",...s]);}catch(e){if("stderr"in e){let t=e.stderr;aP.some(e=>t.includes(e))&&((0,rx.warning)(`Failed to install packages ${s}. Retrying...`),v(i,["install","--fix-broken","-y",...s]));}else throw e;}return{binDir:"/usr/bin/"};}async function G(e,t){if(void 0!==t&&""!==t){let{stdout:r}=await j("apt-cache",["search","--names-only",`^${(0,nk.default)(e)}-${(0,nk.default)(t)}$`]);if(""!==r.trim())return nB.NameDashVersion;try{let{stdout:r}=await j("apt-cache",["show",`${e}=${t}`]);if(""===r.trim())return nB.NameEqualsVersion;}catch{}}try{let{stdout:t}=await j("apt-cache",["show",e]);if(""!==t.trim())return nB.Name;}catch{}return nB.None;}async function B(e,t){let r=await G(e,t);switch(r){case nB.NameDashVersion:return`${e}-${t}`;case nB.NameEqualsVersion:return`${e}=${t}`;case nB.Name:return e;case nB.None:default:throw Error(`Could not find package ${e} ${null!=t?t:""}`);}}function H(){return null!==c(nU).sync("nala",{nothrow:!0});}function q(e){v(e,"nala"!==e?["update","-y"]:["update"]);}async function V(e){v(e,["install","--fix-broken","-y","software-properties-common","apt-utils","ca-certificates","gnupg"]);let t=[z(["3B4FE6ACC0B21F32","40976EAF437D05B5"],"setup-cpp-ubuntu-archive.gpg"),z(["1E9377A2BA9EF27F"],"launchpad-toolchain.gpg")];"nala"===e&&t.push(P("LANG","C.UTF-8",{shouldAddOnlyIfNotDefined:!0}),P("LC_AL
2023-07-16 06:41:58 +08:00
if [ $UID -eq 0 ]; then update-alternatives --install /usr/bin/${e} ${e} ${t} 40; fi
`));}async function Y(e){try{let{stdout:t}=await j("dpkg",["-l",e]),r=t.split("\n");return r.some(e=>e.startsWith("ii"));}catch{return!1;}}async function Q(e,r,n){if(!["darwin","linux"].includes(process.platform))return;if("string"==typeof t)return{binDir:t};let i=c(nU).sync("brew",{nothrow:!0});if(null!==i)return{binDir:t=(0,nH.dirname)(i)};let o=c(iO).join((0,iI.tmpdir)(),"setup-cpp","brew");await(0,nq.mkdirP)(o),F("curl",["-LJO","https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh"],{cwd:o});let s=(0,iO.join)(o,"install.sh");if("linux"===process.platform){let e=(0,iR.readFileSync)(s,"utf-8");e.replace("#!/bin/bash","");}return F("/bin/bash",[s],{stdio:"inherit",env:{NONINTERACTIVE:"1"}}),t=J(),await N(t),{binDir:t};}function J(){return"linux"===process.platform?"/home/linuxbrew/.linuxbrew/bin/":"/usr/local/bin/";}async function Z(e,t,r=[]){(0,n_.info)(`Installing ${e} ${null!=t?t:""} via brew`),aN&&null!==c(nU).sync("brew",{nothrow:!0})||(await Q("","",process.arch),aN=!0);let n=J();return F((0,nH.join)(n,"brew"),["install",void 0!==t&&""!==t?`${e}@${t}`:e,...r],{stdio:"inherit"}),{binDir:n};}async function ee(e,t,n){var i;if("win32"!==process.platform)return;if("string"==typeof r)return{binDir:r};let o=c(nU).sync("choco",{nothrow:!0});if(null!==o)return{binDir:r=(0,nH.dirname)(o)};let s="powershell.exe",a=c(nU).sync(`${process.env.SystemRoot}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,{nothrow:!0});null!==a&&(s=a),F(s,["-NoProfile","-InputFormat","None","-ExecutionPolicy","Bypass","-Command","[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))"],{stdio:"inherit"});let l=`${process.env.ALLUSERSPROFILE}\\chocolatey\\bin`;await N(l);let u=c(nU).sync("choco",{nothrow:!0});if(r=null!==u?(0,nH.dirname)(u):`${null!==(i=process.env.ChocolateyInstall)&&void 0!==i?i:"C:/ProgramData/chocolatey"}/bin`,await(0,nD.pathExists)(r))return{binDir:r};}async function et(e,t,r=[]){var n;(0,rx.info)(`Installing ${e} ${null!=t?t:""} via chocolatey`),aL&&null!==c(nU).sync("choco",{nothrow:!0})||(await ee("","",process.arch),aL=!0);let i=process.env.PATH,o={...process.env};if(delete o.TMP,delete o.TEMP,delete o.Path,o.PATH=i,void 0!==t&&""!==t)F("choco",["install","-y",e,"--version="+t,...r],{env:o,extendEnv:!1,stdio:"inherit"});else try{F("choco",["install","-y",e,...r],{env:o,extendEnv:!1,stdio:"inherit"});}catch(t){if(t.message.includes("exit code 3010"))(0,rx.info)(`${e} might require a reboot for the completion of the installation.`);else throw t;}let s=`${null!==(n=process.env.ChocolateyInstall)&&void 0!==n?n:"C:/ProgramData/chocolatey"}/bin`;return await N(s),{binDir:s};}function er(){return"linux"===process.platform&&(void 0===o&&(o=null!==c(nU).sync("pacman",{nothrow:!0})),o);}function en(){return"linux"===process.platform&&(void 0===s&&(s=null!==c(nU).sync("dnf",{nothrow:!0})),s);}async function ei(e){for(let{name:t,version:r}of e)(0,rx.info)(`Installing ${t} ${null!=r?r:""} via dnf`);let t=await Promise.all(e.map(e=>eo(e.name,e.version)));return v("dnf",["-y","install",...t]),{binDir:"/usr/bin/"};}async function eo(e,t){if(void 0!==t&&""!==t){let{stdout:r}=await j("dnf",["search","-q",`${e}-${t}`]);if(""!==r.trim())return`${e}-${t}`;{let{stdout:r}=await j("dnf",["search","-q",`${e}${t}`]);if(""!==r.trim())return`${e}${t}`;(0,rx.warning)(`Failed to install ${e} ${t} via dnf, trying without version`);}}return e;}function es(){return"linux"===process.platform&&(void 0===a&&(a=null!==c(nU).sync("apt-get",{nothrow:!0})),a);}async function ea(e,t,r){switch(process.platform){case"win32":return et("bazelisk",e);case"darwin":return Z("bazelisk",e);case"linux":if(er())throw Error("installing bazel on Arch linux is not supported yet");if(en())return await ei([{name:"dnf-plugins-core"}]),v("dnf",["copr","enable","vbatts/bazel"]),ei([{name:"bazel4"}]);if(es()){let t=await W("bazel-archive-keyring.gpg","https://bazel.build/bazel-release.pub.gpg");return v("bash",["-c",`echo "deb [arch=amd64 signed-by=${t}] https
2023-07-16 06:41:58 +08:00
setup-cpp [options]
setup-cpp --compiler llvm --cmake true --ninja true --ccache true --vcpkg true
Install all the tools required for building and testing C++/C projects.
--architecture the cpu architecture to install the tools for. By default it uses the current CPU architecture.
--timeout the timeout for the installation of each tool in minutes. By default it is 10 minutes.
2023-07-16 06:41:58 +08:00
--compiler the <compiler> to install.
You can specify the version instead of specifying just the name e.g: --compiler 'llvm-13.0.0'
--$tool_name pass "true" or pass the <version> you would like to install for this tool. e.g. --conan true or --conan "1.42.1"
All the available tools:
`),console.table({"compiler and analyzer":{tools:"--llvm, --gcc, --msvc, --vcvarsall, --cppcheck, --clangtidy, --clangformat"},"build system":{tools:"--cmake, --ninja, --meson, --make, --task, --bazel"},"package manager":{tools:"--vcpkg, --conan, --choco, --brew, --nala"},cache:{tools:"--cppcache, --sccache"},documentation:{tools:"--doxygen, --graphviz"},coverage:{tools:"--gcovr, --opencppcoverage, --kcov"},other:{tools:"--python, --powershell, --sevenzip"}},["tools"]));let l=null!==(t=a.architecture)&&void 0!==t?t:process.arch,u=null!==(r=process.env.SETUP_CPP_DIR)&&void 0!==r?r:y(""),p=[],d=[],f=rI.create({autoloadLocales:!0});rI.addLocale(c(rO)),rb.addLocale(c(rS));let h=await a8();if(!function(e,t){let r=t.filter(t=>void 0!==e[t]),n=r.filter(t=>!eZ(e[t])),i=n.length>=1?e[n[0]]:"true";return!n.some(t=>e[t]!==i)&&(r.forEach(t=>{e[t]=i;}),!0);}(a,["llvm","clangtidy","clangformat"]))return(0,rx.error)("The same version must be used for llvm, clangformat and clangtidy"),1;er()&&"string"==typeof a.cppcheck&&"string"==typeof a.gcovr&&((0,rx.info)("installing python-pygments to avoid conflicts with cppcheck and gcovr on Arch linux"),await el("python-pygments"));let m=!1,g=!1;for(let e of lA){if(rw.isCI&&0!==d.length){g=!0;break;}let t=a[e];void 0!==t&&(i=Date.now(),m=await tC(e,t,h,l,u,p,d,6e4*parseFloat(null!==(n=a.timeout)&&void 0!==n?n:"20")),o=Date.now(),(0,rx.info)("took "+(f.format(i,o)||"0 seconds")));}if(!g){let e=a.compiler;if(void 0!==e){let t=Date.now();await t2(e,h,u,l,p,m,d);let r=Date.now();(0,rx.info)("took "+(f.format(t,r)||"0 seconds"));}}if(await U(),0===p.length&&0===d.length)return(0,rx.warning)("setup-cpp was called without any arguments. Nothing to do."),0;if(p.forEach(e=>(0,rx.success)(e)),d.forEach(e=>(0,rx.error)(e)),(0,rx.info)("setup-cpp finished"),!rw.GITHUB_ACTIONS)switch(process.platform){case"win32":(0,rx.warning)("Run `RefreshEnv.cmd` or restart your shell to update the environment.");break;case"linux":case"darwin":(0,rx.warning)("Run `source ~/.cpprc` or restart your shell to update the environment.");}return await s,0===d.length?0:1;}var t4,t6,t8,t5,t9,t7,re,rt,rr,rn,ri,ro,rs,ra,rl,rc,ru,rp,rd,rf,rh,rm,rg,rv,rE,ry,rw,rx,rb,rS,rI,rO,rR,rT,rC,r$,rA,r_,rP,rN,rL,rD,rk,rU,rj,rF,rM,rG,rB,rH,rq,rV,rX,rz,rW,rK,rY,rQ,rJ,rZ,r0,r1,r2,r3,r4,r6,r8,r5,r9,r7,ne,nt,nr,nn,ni,no,ns,na,nl,nc,nu,np,nd,nf,nh,nm,ng,nv,nE,ny,nw,nx,nb,nS,nI,nO,nR,nT,nC,n$,nA,n_,nP,nN,nL,nD,nk,nU,nj,nF,nM,nG,nB,nH,nq,nV,nX,nz,nW,nK,nY,nQ,nJ,nZ,n0,n1,n2,n3,n4,n6,n8,n5,n9,n7,ie,it,ir,ii,io,is,ia,il,ic,iu,ip,id,ih,im,ig,iv,iE,iy,iw,ix,ib,iS,iI=require("os"),iO=require("path"),iR=require("fs"),iT=require("crypto"),iC=require("http"),i$=require("https");require("net"),t8=require("tls"),t5=require("events"),t9=require("assert"),t7=require("util"),re=require("fs"),rt=require("child_process"),rr=require("string_decoder"),rn=require("timers"),ri=require("buffer"),ro=require("stream"),rs=require("process"),ra=require("buffer"),rl=require("path"),rc=require("child_process"),ru=require("process"),rp=require("url"),rd=require("os"),rf=require("util"),rh=require("url"),rm=require("console"),rg="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},rv={},rE={},null==(ry=rg.parcelRequire810d)&&((ry=function(e){if(e in rv)return rv[e].exports;if(e in rE){var t=rE[e];delete rE[e];var r={id:e,exports:{}};return rv[e]=r,t.call(r.exports,r,r.exports),r.exports;}var n=Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n;}).register=function(e,t){rE[e]=t;},rg.parcelRequire810d=ry),ry.register("cLprm",function(e,t){var r;function n(e){return"string"==typeof e?!!i[e]:"env"in e?i[e.env]&&i[e.env].includes(e.includes):"any"in e?e.any.some(function(e){return!!i[e];}):Object.keys(e).every(function(t){return i[t]===e[t];});}r=ry("iQYeD");let i=process.env;Object.defineProperty(e.exports,"_vendors",{value:r.map(function(e){return e.constant;})}),e.exports.name=null,e.exports.isPR=null,r.forEach(function(t){let r=Array.isArray(t.env)?t.env:[t.env],o=r.every(fu
Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);},e.exports.setOutput=function(e,t){let r=process.env.GITHUB_OUTPUT||"";if(r)return a.issueFileCommand("OUTPUT",a.prepareKeyValueMessage(e,t));process.stdout.write(E.EOL),s.issueCommand("set-output",{name:e},l.toCommandValue(t));},e.exports.setCommandEcho=function(e){s.issue("echo",e?"on":"off");},e.exports.setFailed=function(e){process.exitCode=u.Failure,m(e);},e.exports.isDebug=function(){return"1"===process.env.RUNNER_DEBUG;},e.exports.debug=function(e){s.issueCommand("debug",{},e);},e.exports.error=m,e.exports.warning=function(e,t={}){s.issueCommand("warning",l.toCommandProperties(t),e instanceof Error?e.toString():e);},e.exports.notice=function(e,t={}){s.issueCommand("notice",l.toCommandProperties(t),e instanceof Error?e.toString():e);},e.exports.info=function(e){process.stdout.write(e+E.EOL);},e.exports.startGroup=g,e.exports.endGroup=v,e.exports.group=function(e,t){return o(this,void 0,void 0,function*(){let r;g(e);try{r=yield t();}finally{v();}return r;});},e.exports.saveState=function(e,t){let r=process.env.GITHUB_STATE||"";if(r)return a.issueFileCommand("STATE",a.prepareKeyValueMessage(e,t));s.issueCommand("save-state",{name:e},l.toCommandValue(t));},e.exports.getState=function(e){return process.env["STATE_"+e]||"";},e.exports.getIDToken=function(e){return o(this,void 0,void 0,function*(){return yield c.OidcClient.getIDToken(e);});},p=ry("a9gnA"),Object.defineProperty(e.exports,"summary",{enumerable:!0,get:function(){return p.summary;}}),p=ry("a9gnA"),Object.defineProperty(e.exports,"markdownSummary",{enumerable:!0,get:function(){return p.markdownSummary;}}),d=ry("3zXsD"),Object.defineProperty(e.exports,"toPosixPath",{enumerable:!0,get:function(){return d.toPosixPath;}}),Object.defineProperty(e.exports,"toWin32Path",{enumerable:!0,get:function(){return d.toWin32Path;}}),Object.defineProperty(e.exports,"toPlatformPath",{enumerable:!0,get:function(){return d.toPlatformPath;}});}),ry.register("lxvYw",function(e,t){var r,n,i,o;function s(e,t,r){let n=new l(e,t,r);process.stdout.write(n.toString()+a.EOL);}r=e.exports&&e.exports.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r];}});}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r];}),n=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t});}:function(e,t){e.default=t;}),i=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.hasOwnProperty.call(e,i)&&r(t,e,i);return n(t,e),t;},Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.issue=e.exports.issueCommand=void 0;let a=i(iI);o=ry("3GPt4"),e.exports.issueCommand=s,e.exports.issue=function(e,t=""){s(e,{},t);};class l{constructor(e,t,r){e||(e="missing.command"),this.command=e,this.properties=t,this.message=r;}toString(){var e;let t="::"+this.command;if(this.properties&&Object.keys(this.properties).length>0){t+=" ";let e=!0;for(let r in this.properties)if(this.properties.hasOwnProperty(r)){let n=this.properties[r];n&&(e?e=!1:t+=",",t+=`${r}=${o.toCommandValue(n).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}`);}}return t+("::"+(e=this.message,o.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")));}}}),ry.register("3GPt4",function(e,t){Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.toCommandProperties=e.exports.toCommandValue=void 0,e.exports.toCommandValue=function(e){return null==e?"":"string"==typeof e||e instanceof String?e:JSON.stringify(e);},e.exports.toCommandProperties=function(e){return Object.keys(e).length?{title:e.title,file:e.file,line:e.startLine,endLine:e.endLine,col:e.startColumn,endColumn:e.endColumn}:{};};}),ry.register("izMKk",function(e,t){var r,n,i,o,s;r=e.exports&&e.exports.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumera
Error Code : ${e.statusCode}
Error Message: ${e.result.message}`);}),i=null===(t=n.result)||void 0===t?void 0:t.value;if(!i)throw Error("Response json body do not have ID Token field");return i;});}static getIDToken(e){return r(this,void 0,void 0,function*(){try{let t=s.getIDTokenUrl();if(e){let r=encodeURIComponent(e);t=`${t}&audience=${r}`;}o.debug("ID token url is "+t);let r=yield s.getCall(t);return o.setSecret(r),r;}catch(e){throw Error("Error message: "+e.message);}});}}e.exports.OidcClient=s;}),ry.register("aPbbM",function(e,t){var r,n,i,o,s,a,l,c,u;r=e.exports&&e.exports.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r];}});}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r];}),n=e.exports&&e.exports.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t});}:function(e,t){e.default=t;}),i=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.hasOwnProperty.call(e,i)&&r(t,e,i);return n(t,e),t;},o=e.exports&&e.exports.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e));}catch(e){o(e);}}function a(e){try{l(n.throw(e));}catch(e){o(e);}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t);})).then(s,a);}l((n=n.apply(e,t||[])).next());});},Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.HttpClient=e.exports.isHttps=e.exports.HttpClientResponse=e.exports.HttpClientError=e.exports.getProxyUrl=e.exports.MediaTypes=e.exports.Headers=e.exports.HttpCodes=void 0;let p=i(iC),d=i(i$),f=i(ry("dG8Uc")),h=i(ry("j6C2A"));(c=s=e.exports.HttpCodes||(e.exports.HttpCodes={}))[c.OK=200]="OK",c[c.MultipleChoices=300]="MultipleChoices",c[c.MovedPermanently=301]="MovedPermanently",c[c.ResourceMoved=302]="ResourceMoved",c[c.SeeOther=303]="SeeOther",c[c.NotModified=304]="NotModified",c[c.UseProxy=305]="UseProxy",c[c.SwitchProxy=306]="SwitchProxy",c[c.TemporaryRedirect=307]="TemporaryRedirect",c[c.PermanentRedirect=308]="PermanentRedirect",c[c.BadRequest=400]="BadRequest",c[c.Unauthorized=401]="Unauthorized",c[c.PaymentRequired=402]="PaymentRequired",c[c.Forbidden=403]="Forbidden",c[c.NotFound=404]="NotFound",c[c.MethodNotAllowed=405]="MethodNotAllowed",c[c.NotAcceptable=406]="NotAcceptable",c[c.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",c[c.RequestTimeout=408]="RequestTimeout",c[c.Conflict=409]="Conflict",c[c.Gone=410]="Gone",c[c.TooManyRequests=429]="TooManyRequests",c[c.InternalServerError=500]="InternalServerError",c[c.NotImplemented=501]="NotImplemented",c[c.BadGateway=502]="BadGateway",c[c.ServiceUnavailable=503]="ServiceUnavailable",c[c.GatewayTimeout=504]="GatewayTimeout",(u=a=e.exports.Headers||(e.exports.Headers={})).Accept="accept",u.ContentType="content-type",(l=e.exports.MediaTypes||(e.exports.MediaTypes={})).ApplicationJson="application/json",e.exports.getProxyUrl=function(e){let t=f.getProxyUrl(new URL(e));return t?t.href:"";};let m=[s.MovedPermanently,s.ResourceMoved,s.SeeOther,s.TemporaryRedirect,s.PermanentRedirect],g=[s.BadGateway,s.ServiceUnavailable,s.GatewayTimeout],v=["OPTIONS","GET","DELETE","HEAD"];class E extends Error{constructor(e,t){super(e),this.name="HttpClientError",this.statusCode=t,Object.setPrototypeOf(this,E.prototype);}}e.exports.HttpClientError=E;class y{constructor(e){this.message=e;}readBody(){return o(this,void 0,void 0,function*(){return new Promise(e=>o(this,void 0,void 0,function*(){let t=Buffer.alloc(0);this.message.on("data",e=>{t=Buffer.concat([t,e]);}),this.message.on("end",()=>{e(t.toString());});}));});}}e.exports.HttpClientResponse=y,e.exports.isHttps=function(e){let t=new URL(e);return"https:"===t.protocol;},e.exports.HttpClient=class{constructor(e,t,r){this._ignoreSslError=!1,this._allowRedirects=!0,this._allowRedirectDowngrade=!1,this._maxRedirects=50,this._allowRetries=!1,this._maxRetries=1,this._keepAlive=!1,this._disposed=!1,this.userAgent=e,this.handlers=t||[],this.requestOptio
2023-09-08 05:15:08 +08:00
${n.message}`:m,E=[v,t,e].filter(Boolean).join("\n");return g?(n.originalMessage=n.message,n.message=E):n=Error(E),n.shortMessage=v,n.command=s,n.escapedCommand=a,n.exitCode=o,n.signal=i,n.signalDescription=d,n.stdout=e,n.stderr=t,void 0!==r&&(n.all=r),"bufferedData"in n&&delete n.bufferedData,n.failed=!0,n.timedOut=!!l,n.isCanceled=c,n.killed=u&&!l,n;},rK={};const iZ=["stdin","stdout","stderr"],i0=e=>iZ.some(t=>void 0!==e[t]),i1=e=>{if(!e)return;let{stdio:t}=e;if(void 0===t)return iZ.map(t=>e[t]);if(i0(e))throw Error("It's not possible to provide `stdio` in combination with one of "+iZ.map(e=>`\`${e}\``).join(", "));if("string"==typeof t)return t;if(!Array.isArray(t))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let r=Math.max(t.length,iZ.length);return Array.from({length:r},(e,r)=>t[r]);};(rK=i1).node=e=>{let t=i1(e);return"ipc"===t?"ipc":void 0===t||"string"==typeof t?[t,t,t,"ipc"]:t.includes("ipc")?t:[...t,"ipc"];},rY={},rQ={},rJ=rg.process;const i2=function(e){return e&&"object"==typeof e&&"function"==typeof e.removeListener&&"function"==typeof e.emit&&"function"==typeof e.reallyExit&&"function"==typeof e.listeners&&"function"==typeof e.kill&&"number"==typeof e.pid&&"function"==typeof e.on;};if(i2(rJ)){var i3,i4=t9,i6=ry("2dWxz"),i8=/^win/i.test(rJ.platform),i5=t5;"function"!=typeof i5&&(i5=i5.EventEmitter),rJ.__signal_exit_emitter__?i3=rJ.__signal_exit_emitter__:((i3=rJ.__signal_exit_emitter__=new i5()).count=0,i3.emitted={}),i3.infinite||(i3.setMaxListeners(1/0),i3.infinite=!0);var i9=function(){ot&&i2(rg.process)&&(ot=!1,i6.forEach(function(e){try{rJ.removeListener(e,oe[e]);}catch(e){}}),rJ.emit=oo,rJ.reallyExit=on,i3.count-=1);};(rQ=function(e,t){if(!i2(rg.process))return function(){};i4.equal(typeof e,"function","a callback must be provided for exit handler"),!1===ot&&or();var r="exit";return t&&t.alwaysLast&&(r="afterexit"),i3.on(r,e),function(){i3.removeListener(r,e),0===i3.listeners("exit").length&&0===i3.listeners("afterexit").length&&i9();};}).unload=i9;var i7=function(e,t,r){i3.emitted[e]||(i3.emitted[e]=!0,i3.emit(e,t,r));},oe={};i6.forEach(function(e){oe[e]=function(){i2(rg.process)&&rJ.listeners(e).length===i3.count&&(i9(),i7("exit",null,e),i7("afterexit",null,e),i8&&"SIGHUP"===e&&(e="SIGINT"),rJ.kill(rJ.pid,e));};}),rQ.signals=function(){return i6;};var ot=!1,or=function(){!ot&&i2(rg.process)&&(ot=!0,i3.count+=1,i6=i6.filter(function(e){try{return rJ.on(e,oe[e]),!0;}catch(e){return!1;}}),rJ.emit=os,rJ.reallyExit=oi);};rQ.load=or;var on=rJ.reallyExit,oi=function(e){i2(rg.process)&&(rJ.exitCode=e||0,i7("exit",rJ.exitCode,null),i7("afterexit",rJ.exitCode,null),on.call(rJ,rJ.exitCode));},oo=rJ.emit,os=function(e,t){if(!("exit"===e&&i2(rg.process)))return oo.apply(this,arguments);void 0!==t&&(rJ.exitCode=t);var r=oo.apply(this,arguments);return i7("exit",rJ.exitCode,null),i7("afterexit",rJ.exitCode,null),r;};}else rQ=function(){return function(){};};const oa=(e,t,r,n)=>{if(!ol(t,r,n))return;let i=ou(r),o=setTimeout(()=>{e("SIGKILL");},i);o.unref&&o.unref();},ol=(e,{forceKillAfterTimeout:t},r)=>oc(e)&&!1!==t&&r,oc=e=>e===iI.constants.signals.SIGTERM||"string"==typeof e&&"SIGTERM"===e.toUpperCase(),ou=({forceKillAfterTimeout:e=!0})=>{if(!0===e)return 5e3;if(!Number.isFinite(e)||e<0)throw TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e;},op=(e,t,r)=>{e.kill(t),r(Object.assign(Error("Timed out"),{timedOut:!0,signal:t}));},od=async(e,{cleanup:t,detached:r},n)=>{if(!t||r)return n;let i=rQ(()=>{e.kill();});return n.finally(()=>{i();});};rZ=(rY={spawnedKill(e,t="SIGTERM",r={}){let n=e(t);return oa(e,t,r,n),n;},spawnedCancel(e,t){let r=e.kill();r&&(t.isCanceled=!0);},setupTimeout(e,{timeout:t,killSignal:r="SIGTERM"},n){let i;if(0===t||void 0===t)return n;let o=new Promise((n,o)=>{i=setTimeout(()=>{op(e,r,o);},t);}),s=n.finally(()=>{clearTimeout(i);});return Promise.race([o,s]);},validateTimeout({timeout:e}){if(void 0!==e&&(!Number.isFinite(e)||e<0))throw TypeError(`Expected the \`timeout\
${t}`,o_=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),oP=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),oN=(e,t,r)=>{let n=""===r?"":`with ${r.trim()}() `,i=oA.bind(null,n,t.toString());Object.defineProperty(i,"name",oP),Object.defineProperty(e,"toString",{...o_,value:i});},oL=new WeakMap(),oD=(e,t={})=>{let r;if("function"!=typeof e)throw TypeError("Expected a function");let n=0,i=e.displayName||e.name||"<anonymous>",o=function(...s){if(oL.set(o,++n),1===n)r=e.apply(this,s),e=null;else if(!0===t.throw)throw Error(`Function \`${i}\` can only be called once`);return r;};return!function(e,t,{ignoreNonConfigurable:r=!1}={}){let{name:n}=e;for(let n of Reflect.ownKeys(t))oT(e,t,n,r);o$(e,t),oN(e,t,n);}(o,e),oL.set(o,n),o;};oD.callCount=e=>{if(!oL.has(e))throw Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return oL.get(e);},nP=oD;const ok=()=>Array.from({length:oF-oj+1},oU),oU=(e,t)=>({name:"SIGRT"+(t+1),number:oj+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),oj=34,oF=64,oM=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"t
${n.message}`:m,E=[v,t,e].filter(Boolean).join("\n");return g?(n.originalMessage=n.message,n.message=E):n=Error(E),n.shortMessage=v,n.command=s,n.escapedCommand=a,n.exitCode=o,n.signal=i,n.signalDescription=d,n.stdout=e,n.stderr=t,void 0!==r&&(n.all=r),"bufferedData"in n&&delete n.bufferedData,n.failed=!0,n.timedOut=!!l,n.isCanceled=c,n.killed=u&&!l,n;},oK=["stdin","stdout","stderr"],oY=e=>oK.some(t=>void 0!==e[t]),oQ=e=>{if(!e)return;let{stdio:t}=e;if(void 0===t)return oK.map(t=>e[t]);if(oY(e))throw Error("It's not possible to provide `stdio` in combination with one of "+oK.map(e=>`\`${e}\``).join(", "));if("string"==typeof t)return t;if(!Array.isArray(t))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let r=Math.max(t.length,oK.length);return Array.from({length:r},(e,r)=>t[r]);},oJ=(e,t="SIGTERM",r={})=>{let n=e(t);return oZ(e,t,r,n),n;},oZ=(e,t,r,n)=>{if(!o0(t,r,n))return;let i=o2(r),o=setTimeout(()=>{e("SIGKILL");},i);o.unref&&o.unref();},o0=(e,{forceKillAfterTimeout:t},r)=>o1(e)&&!1!==t&&r,o1=e=>e===c(rd).constants.signals.SIGTERM||"string"==typeof e&&"SIGTERM"===e.toUpperCase(),o2=({forceKillAfterTimeout:e=!0})=>{if(!0===e)return 5e3;if(!Number.isFinite(e)||e<0)throw TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e;},o3=(e,t)=>{let r=e.kill();r&&(t.isCanceled=!0);},o4=(e,t,r)=>{e.kill(t),r(Object.assign(Error("Timed out"),{timedOut:!0,signal:t}));},o6=(e,{timeout:t,killSignal:r="SIGTERM"},n)=>{let i;if(0===t||void 0===t)return n;let o=new Promise((n,o)=>{i=setTimeout(()=>{o4(e,r,o);},t);}),s=n.finally(()=>{clearTimeout(i);});return Promise.race([o,s]);},o8=({timeout:e})=>{if(void 0!==e&&(!Number.isFinite(e)||e<0))throw TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);},o5=async(e,{cleanup:t,detached:r},n)=>{if(!t||r)return n;let i=c(rQ)(()=>{e.kill();});return n.finally(()=>{i();});},o9=e=>e instanceof rc.ChildProcess&&"function"==typeof e.then,o7=(e,t,r)=>{if("string"==typeof r)return e[t].pipe((0,re.createWriteStream)(r)),e;if(C(r))return e[t].pipe(r),e;if(!o9(r))throw TypeError("The second argument must be a string, a stream or an Execa child process.");if(!C(r.stdin))throw TypeError("The target child process's stdin must be available.");return e[t].pipe(r.stdin),r;},se=e=>{null!==e.stdout&&(e.pipeStdout=o7.bind(void 0,e,"stdout")),null!==e.stderr&&(e.pipeStderr=o7.bind(void 0,e,"stderr")),void 0!==e.all&&(e.pipeAll=o7.bind(void 0,e,"all"));},st=e=>{if(void 0!==e)throw TypeError("The `input` and `inputFile` options cannot be both set.");},sr=({input:e,inputFile:t})=>"string"!=typeof t?e:(st(e),(0,re.readFileSync)(t)),sn=e=>{let t=sr(e);if(T(t))throw TypeError("The `input` option cannot be a stream in sync mode");return t;},si=({input:e,inputFile:t})=>"string"!=typeof t?e:(st(e),(0,re.createReadStream)(t)),so=(e,t)=>{let r=si(t);void 0!==r&&(T(r)?r.pipe(e.stdin):e.stdin.end(r));},ss=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;let r=c(nt)();return e.stdout&&r.add(e.stdout),e.stderr&&r.add(e.stderr),r;},sa=async(e,t)=>{if(e&&void 0!==t){e.destroy();try{return await t;}catch(e){return e.bufferedData;}}},sl=(e,{encoding:t,buffer:r,maxBuffer:n})=>{if(e&&r)return t?c(r8)(e,{encoding:t,maxBuffer:n}):c(r8).buffer(e,{maxBuffer:n});},sc=async({stdout:e,stderr:t,all:r},{encoding:n,buffer:i,maxBuffer:o},s)=>{let a=sl(e,{encoding:n,buffer:i,maxBuffer:o}),l=sl(t,{encoding:n,buffer:i,maxBuffer:o}),c=sl(r,{encoding:n,buffer:i,maxBuffer:2*o});try{return await Promise.all([s,a,l,c]);}catch(n){return Promise.all([{error:n,signal:n.signal,timedOut:n.timedOut},sa(e,a),sa(t,l),sa(r,c)]);}},su=(async()=>{})().constructor.prototype,sp=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(su,e)]),sd=(e,t)=>{for(let[r,n]of sp){let i="function"==typeof t?(...e)=>Reflect.apply(n.value,t(),e):n.value.bind(t);Reflect.defineProperty(e,r,{...n,value:i});}},sf=e=>new Promise((t,r)=>{e.on("exit",(e,r)=>{t({exitCode:e,signal:r});}),e.on("error",e=>{r(
`);},sR=({env:e,extendEnv:t,preferLocal:r,localDir:n,execPath:i})=>{let o=t?{...c(ru).env,...e}:e;return r?R({env:o,cwd:n,execPath:i}):o;},sT=(e,t,r={})=>{let n=c(r_)._parse(e,t,r);return e=n.command,t=n.args,(r={maxBuffer:1e8,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:(r=n.options).cwd||c(ru).cwd(),execPath:c(ru).execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:sb,...r}).env=sR(r),r.stdio=oQ(r),"win32"===c(ru).platform&&"cmd"===c(rl).basename(e,".exe")&&t.unshift("/q"),{file:e,args:t,options:r,parsed:n};},sC=(e,t,r)=>"string"==typeof t||(0,ra.Buffer).isBuffer(t)?e.stripFinalNewline?I(t):t:void 0===r?void 0:"",s$=({input:e,inputFile:t,stdio:r})=>void 0===e&&void 0===t&&void 0===r?{stdin:"inherit"}:{},sA=(e={})=>({preferLocal:!0,...s$(e),...e});!function e(t){function r(n,...i){if(!Array.isArray(n))return e({...t,...n});let[o,...s]=sx(n,i);return $(o,s,sA(t));}return r.sync=(e,...r)=>{if(!Array.isArray(e))throw TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");let[n,...i]=sx(e,r);return function(e,t,r){let n;let i=sT(e,t,r),o=sg(e,t),s=sv(e,t);sO(s,i.options);let a=sn(i.options);try{n=c(rc).spawnSync(i.file,i.args,{...i.options,input:a});}catch(e){throw oW({error:e,stdout:"",stderr:"",all:"",command:o,escapedCommand:s,parsed:i,timedOut:!1,isCanceled:!1,killed:!1});}let l=sC(i.options,n.stdout,n.error),u=sC(i.options,n.stderr,n.error);if(n.error||0!==n.status||null!==n.signal){let e=oW({stdout:l,stderr:u,error:n.error,signal:n.signal,exitCode:n.status,command:o,escapedCommand:s,parsed:i,timedOut:n.error&&"ETIMEDOUT"===n.error.code,isCanceled:!1,killed:null!==n.signal});if(!i.options.reject)return e;throw e;}return{command:o,escapedCommand:s,exitCode:0,stdout:l,stderr:u,failed:!1,timedOut:!1,isCanceled:!1,killed:!1};}(n,i,sA(t));},r;}(),nN={};const s_="win32"!==iI.platform(),sP=iI.release(),sN=(e="",t="")=>/1\d+\.\d+/.test(e)&&+t>=17134.1184;nN=function(e){return s_?e.replace(/(\s+)/g,"\\$1"):sN(.../(\d+\.\d+)\.(\d+)/.exec(sP).splice(1))?e:e.replace(/(\s+)/g,"%20");},function(){var e,t;e=ry("eaZtc"),t=function(e){return e.split("").reverse().join("");},nL=function(r,n,i){var o;return(null==n&&(n="'"),null==i&&(i="\\"),"string"!=typeof r)?r:(o=RegExp("(["+e(n)+"])(?!"+e(i)+")","g"),t(t(r).replace(o,"$1"+i)));};}.call(nL={}),nD=ry("3WkGD");const sL={shouldEscapeSpace:!1,shouldAddOnlyIfNotDefined:!1},sD=[/\/usr\/bin\/?/,/\/usr\/local\/bin\/?/],sk=y(".cpprc");let sU=!1;nD=ry("3WkGD");const sj=({timedOut:e,timeout:t,errorCode:r,signal:n,signalDescription:i,exitCode:o,isCanceled:s})=>e?`timed out after ${t} milliseconds`:s?"was canceled":void 0!==r?"failed with "+r:void 0!==n?`was killed with ${n} (${i})`:void 0!==o?"failed with exit code "+o:"failed",sF=({stdout:e,stderr:t,all:r,error:n,signal:i,exitCode:o,command:s,escapedCommand:a,timedOut:l,isCanceled:u,killed:p,parsed:{options:{timeout:d,cwd:f=c(ru).cwd()}}})=>{o=null===o?void 0:o,i=null===i?void 0:i;let h=void 0===i?void 0:oq[i].description,m=n&&n.code,g=sj({timedOut:l,timeout:d,errorCode:m,signal:i,signalDescription:h,exitCode:o,isCanceled:u}),v=`Command ${g}: ${s}`,E="[object Error]"===Object.prototype.toString.call(n),y=E?`${v}
${n.message}`:v,w=[y,t,e].filter(Boolean).join("\n");return E?(n.originalMessage=n.message,n.message=w):n=Error(w),n.shortMessage=y,n.command=s,n.escapedCommand=a,n.exitCode=o,n.signal=i,n.signalDescription=h,n.stdout=e,n.stderr=t,n.cwd=f,void 0!==r&&(n.all=r),"bufferedData"in n&&delete n.bufferedData,n.failed=!0,n.timedOut=!!l,n.isCanceled=u,n.killed=p&&!l,n;},sM=["stdin","stdout","stderr"],sG=e=>sM.some(t=>void 0!==e[t]),sB=e=>{if(!e)return;let{stdio:t}=e;if(void 0===t)return sM.map(t=>e[t]);if(sG(e))throw Error("It's not possible to provide `stdio` in combination with one of "+sM.map(e=>`\`${e}\``).join(", "));if("string"==typeof t)return t;if(!Array.isArray(t))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let r=Math.max(t.length,sM.length);return Array.from({length:r},(e,r)=>t[r]);},sH=(e,t="SIGTERM",r={})=>{let n=e(t);return sq(e,t,r,n),n;},sq=(e,t,r,n)=>{if(!sV(t,r,n))return;let i=sz(r),o=setTimeout(()=>{e("SIGKILL");},i);o.unref&&o.unref();},sV=(e,{forceKillAfterTimeout:t},r)=>sX(e)&&!1!==t&&r,sX=e=>e===c(rd).constants.signals.SIGTERM||"string"==typeof e&&"SIGTERM"===e.toUpperCase(),sz=({forceKillAfterTimeout:e=!0})=>{if(!0===e)return 5e3;if(!Number.isFinite(e)||e<0)throw TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e;},sW=(e,t)=>{let r=e.kill();r&&(t.isCanceled=!0);},sK=(e,t,r)=>{e.kill(t),r(Object.assign(Error("Timed out"),{timedOut:!0,signal:t}));},sY=(e,{timeout:t,killSignal:r="SIGTERM"},n)=>{let i;if(0===t||void 0===t)return n;let o=new Promise((n,o)=>{i=setTimeout(()=>{sK(e,r,o);},t);}),s=n.finally(()=>{clearTimeout(i);});return Promise.race([o,s]);},sQ=({timeout:e})=>{if(void 0!==e&&(!Number.isFinite(e)||e<0))throw TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);},sJ=async(e,{cleanup:t,detached:r},n)=>{if(!t||r)return n;let i=c(rQ)(()=>{e.kill();});return n.finally(()=>{i();});},sZ=e=>e instanceof rc.ChildProcess&&"function"==typeof e.then,s0=(e,t,r)=>{if("string"==typeof r)return e[t].pipe((0,re.createWriteStream)(r)),e;if(C(r))return e[t].pipe(r),e;if(!sZ(r))throw TypeError("The second argument must be a string, a stream or an Execa child process.");if(!C(r.stdin))throw TypeError("The target child process's stdin must be available.");return e[t].pipe(r.stdin),r;},s1=e=>{null!==e.stdout&&(e.pipeStdout=s0.bind(void 0,e,"stdout")),null!==e.stderr&&(e.pipeStderr=s0.bind(void 0,e,"stderr")),void 0!==e.all&&(e.pipeAll=s0.bind(void 0,e,"all"));},s2=e=>{if(void 0!==e)throw TypeError("The `input` and `inputFile` options cannot be both set.");},s3=({input:e,inputFile:t})=>"string"!=typeof t?e:(s2(e),(0,re.readFileSync)(t)),s4=e=>{let t=s3(e);if(T(t))throw TypeError("The `input` option cannot be a stream in sync mode");return t;},s6=({input:e,inputFile:t})=>"string"!=typeof t?e:(s2(e),(0,re.createReadStream)(t)),s8=(e,t)=>{let r=s6(t);void 0!==r&&(T(r)?r.pipe(e.stdin):e.stdin.end(r));},s5=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;let r=c(nt)();return e.stdout&&r.add(e.stdout),e.stderr&&r.add(e.stderr),r;},s9=async(e,t)=>{if(e&&void 0!==t){e.destroy();try{return await t;}catch(e){return e.bufferedData;}}},s7=(e,{encoding:t,buffer:r,maxBuffer:n})=>{if(e&&r)return t?c(r8)(e,{encoding:t,maxBuffer:n}):c(r8).buffer(e,{maxBuffer:n});},ae=async({stdout:e,stderr:t,all:r},{encoding:n,buffer:i,maxBuffer:o},s)=>{let a=s7(e,{encoding:n,buffer:i,maxBuffer:o}),l=s7(t,{encoding:n,buffer:i,maxBuffer:o}),c=s7(r,{encoding:n,buffer:i,maxBuffer:2*o});try{return await Promise.all([s,a,l,c]);}catch(n){return Promise.all([{error:n,signal:n.signal,timedOut:n.timedOut},s9(e,a),s9(t,l),s9(r,c)]);}},at=(async()=>{})().constructor.prototype,ar=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(at,e)]),an=(e,t)=>{for(let[r,n]of ar){let i="function"==typeof t?(...e)=>Reflect.apply(n.value,t(),e):n.value.bind(t);Reflect.defineProperty(e,r,{...n,value:i});}},ai=e=>new Promise((t,r)=>{e.on("exit",(e,r)=>{t({exitCode:e,signal:r});}),e.on("error
`);},av=({env:e,extendEnv:t,preferLocal:r,localDir:n,execPath:i})=>{let o=t?{...c(ru).env,...e}:e;return r?R({env:o,cwd:n,execPath:i}):o;},aE=(e,t,r={})=>{let n=c(r_)._parse(e,t,r);return e=n.command,t=n.args,(r={maxBuffer:1e8,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:(r=n.options).cwd||c(ru).cwd(),execPath:c(ru).execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:af,...r}).env=av(r),r.stdio=sB(r),"win32"===c(ru).platform&&"cmd"===c(rl).basename(e,".exe")&&t.unshift("/q"),{file:e,args:t,options:r,parsed:n};},ay=(e,t,r)=>"string"==typeof t||(0,ra.Buffer).isBuffer(t)?e.stripFinalNewline?I(t):t:void 0===r?void 0:"",aw=({input:e,inputFile:t,stdio:r})=>void 0===e&&void 0===t&&void 0===r?{stdin:"inherit"}:{},ax=(e={})=>({preferLocal:!0,...aw(e),...e});!function e(t){function r(n,...i){if(!Array.isArray(n))return e({...t,...n});let[o,...s]=ad(n,i);return j(o,s,ax(t));}return r.sync=(e,...r)=>{if(!Array.isArray(e))throw TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");let[n,...i]=ad(e,r);return F(n,i,ax(t));},r;}(),nk=ry("9O4vc"),rx=ry("hHq4F"),nU={},nj=iO.join,nF=iO.delimiter,nM=iO.sep,nG=iO.posix;const ab="win32"===process.platform,aS=new RegExp(`[${nG.sep}${nM===nG.sep?"":nM}]`.replace(/(\\)/g,"\\$1")),aI=RegExp("^\\."+aS.source),aO=e=>Object.assign(Error("not found: "+e),{code:"ENOENT"}),aR=(e,{path:t=process.env.PATH,pathExt:r=process.env.PATHEXT,delimiter:n=nF})=>{let i=e.match(aS)?[""]:[...(ab?[process.cwd()]:[]),...(t||"").split(n)];if(ab){let t=r||[".EXE",".CMD",".BAT",".COM"].join(n),o=t.split(n).reduce((e,t)=>(e.push(t),e.push(t.toLowerCase()),e),[]);return e.includes(".")&&""!==o[0]&&o.unshift(""),{pathEnv:i,pathExt:o,pathExtExe:t};}return{pathEnv:i,pathExt:[""]};},aT=(e,t)=>{let r=/^".*"$/.test(e)?e.slice(1,-1):e,n=!r&&aI.test(t)?t.slice(0,2):"";return n+nj(r,t);},aC=async(e,t={})=>{let{pathEnv:r,pathExt:n,pathExtExe:i}=aR(e,t),o=[];for(let s of r){let r=aT(s,e);for(let e of n){let n=r+e,s=await rC(n,{pathExt:i,ignoreErrors:!0});if(s){if(!t.all)return n;o.push(n);}}}if(t.all&&o.length)return o;if(t.nothrow)return null;throw aO(e);};nU=aC,aC.sync=(e,t={})=>{let{pathEnv:r,pathExt:n,pathExtExe:i}=aR(e,t),o=[];for(let s of r){let r=aT(s,e);for(let e of n){let n=r+e,s=rC.sync(n,{pathExt:i,ignoreErrors:!0});if(s){if(!t.all)return n;o.push(n);}}}if(t.all&&o.length)return o;if(t.nothrow)return null;throw aO(e);};const{appendFile:a$}=iR.promises;let aA=!1,a_=!1;const aP=["E: Could not get lock","dpkg: error processing archive","dpkg: error: dpkg status database is locked by another process"];(t4=nB||(nB={}))[t4.NameDashVersion=0]="NameDashVersion",t4[t4.NameEqualsVersion=1]="NameEqualsVersion",t4[t4.Name=2]="Name",t4[t4.None=3]="None",n_=ry("2heqc"),nH=ry("A8hFE"),nH=ry("A8hFE"),nq=ry("kSdX3");let aN=!1;nD=ry("3WkGD"),nH=ry("A8hFE"),rx=ry("hHq4F");let aL=!1;rx=ry("hHq4F"),rx=ry("hHq4F");let aD=!1,ak=!1;const aU=/Version\s*:\s*(.*)/g;nV={},nX=iO.resolve(__dirname,"../../node_modules/.pnpm/@actions+tool-cache@2.0.1/node_modules/@actions/tool-cache/lib"),nz=nV&&nV.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r];}});}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r];}),nW=nV&&nV.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t});}:function(e,t){e.default=t;}),nK=nV&&nV.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&nz(t,e,r);return nW(t,e),t;},nY=nV&&nV.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e));}catch(e){o(e);}}function a(e){try{l(n.throw(e));}catch(e){o(e);}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t);})).then(s,a);}l((n=n.apply(e,t||[])).next());});},nQ=nV&&nV.__importDefault||function(e){return e&&e.__esModule?e:{default:e};},Object.defineProperty(nV,"__esModule",{value:!0}),nV.evaluateVersions=nV.isExplicitVer
2023-07-16 06:41:58 +08:00
//# sourceMappingURL=setup-cpp.js.map