Template
1
0
mirror of https://github.com/aminya/setup-cpp synced 2024-11-30 21:22:30 +08:00
setup-cpp/dist/modern/setup-cpp.js

39 lines
239 KiB
JavaScript
Raw Normal View History

2023-07-16 06:41:58 +08:00
#!/usr/bin/env node
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);});});}rH(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=rG.sync(e.command,{path:n[rV({env:n})],pathExt:t?n3.delimiter:void 0});}catch(e){}finally{s&&process.chdir(i);}return r&&(r=n3.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 iO&&1===e&&!t.file?d(t.original,"spawn"):null;}function h(e,t,r){let n=rF(e,t,r),i=ri.spawn(n.command,n.args,n.options);return rY.hookChildProcess(i,n),i;}function m(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 v(e={}){let{env:t=process.env,platform:r=process.platform}=e;return"win32"!==r?"PATH":Object.keys(t).reverse().find(e=>"PATH"===e.toUpperCase())||"Path";}function g({env:e=c(ru).env,...t}={}){let r=v({env:e={...e}});return t.path=e[r],e[r]=function(e={}){let t;let{cwd:r=c(ru).cwd(),path:n=c(ru).env[v()],execPath:i=c(ru).execPath}=e,o=i instanceof URL?c(rp).fileURLToPath(i):i,s=r instanceof URL?c(rp).fileURLToPath(r):r,a=c(rl).resolve(s),l=[];for(;t!==a;)l.push(c(rl).join(a,"node_modules/.bin")),t=a,a=c(rl).resolve(a,"..");return l.push(c(rl).resolve(s,o,"..")),[...l,n].join(c(rl).delimiter);}(t),e;}function E(e){return null!==e&&"object"==typeof e&&"function"==typeof e.pipe;}function y(e){return E(e)&&!1!==e.writable&&"function"==typeof e._write&&"object"==typeof e._writableState;}async function w(e,t){if(!e)throw Error("Expected a stream");let{maxBuffer:r}=t={maxBuffer:1/0,...t},n=r4(t);return await new Promise((t,i)=>{let o=e=>{e&&n.getBufferedLength()<=r1.MAX_LENGTH&&(e.bufferedData=n.getBufferedValue()),i(e);};(async()=>{try{await om(e,n),t();}catch(e){o(e);}})(),n.on("data",()=>{n.getBufferedLength()>r&&o(new ov());});}),n.getBufferedValue();}function x(e,t,r){let n;let i=oV(e,t,r),o=oN(e,t),s=oP(e,t);oB(s,i.options),ou(i.options);try{n=c(rc).spawn(i.file,i.args,i.options);}catch(t){let e=new(c(rc).ChildProcess)();return oC(e,Promise.reject(iX({error:t,stdout:"",stderr:"",all:"",command:o,escapedCommand:s,parsed:i,timedOut:!1,isCanceled:!1,killed:!1}))),e;}let a=oA(n),l=oc(n,i.options,a),u=op(n,i.options,l),p={isCanceled:!1};n.kill=or.bind(null,n.kill.bind(n)),n.cancel=oa.bind(null,n,p);let d=rJ(async()=>{let[{error:e,exitCode:t,signal:r,timedOut:a},l,c,d]=await oS(n,i.options,u),f=oq(i.options,l),h=oq(i.options,c),m=oq(i.options,d);if(e||0!==t||null!==r){let l=iX({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};});return ox(n,i.options),n.all=ob(n,i.options),oh(n),oC(n,d),n;}function b(e,t,r){let n;let i=oV(e,t,r),o=oN(e,t),s=oP(e,t);oB(s,i.options);let a=oy(i.options);try{n=c(rc).spawnSync(i.file,i.args,{...i.options,input:a});}catch(e){throw iX({error:e,stdout:"",stderr:"",all:"",command:o,escapedCommand:s,parsed:i,timedOut:!1,isCanceled:!1,killed:!1});}let l=oq(i.options,n.stdout,n.error),u=oq(i.options,n.stderr,n.error);if(n.error||0!==n.status||null!==n.signal){let e=iX({stdout:l,stderr:u,error:n.error,signal:n.signal,exitCode:n.status,command:o,escapedCommand:s,parsed:i,timedOut:n.er
if [ -z "\${${e}}" ]; then export ${e}="${n}"; fi
2024-04-03 15:36:48 +08:00
`),(0,nv.info)(`if not defined ${e} then ${e}="${n}" was added to "${sF}`)):(await(0,rN.appendFile)(sF,`
export ${e}="${n}"
2024-04-03 15:36:48 +08:00
`),(0,nv.info)(`${e}="${n}" was added to "${sF}`));return;}process.env[e]=n;}async function B(e){switch(process.platform){case"win32":await j(`$USER_PATH=([Environment]::GetEnvironmentVariable("PATH", "User")); [Environment]::SetEnvironmentVariable("PATH", "${e};$USER_PATH", "User")`),(0,nv.info)(`"${e}" was added to the PATH.`);return;case"linux":case"darwin":await H(),await(0,rN.appendFile)(sF,`
export PATH="${e}:$PATH"
2024-04-03 15:36:48 +08:00
`),(0,nv.info)(`"${e}" was added to "${sF}"`);return;default:return;}}async function H(){if(sM)return;let e=`
2023-07-16 06:41:58 +08:00
# source .cpprc if SOURCE_CPPRC is not set to 0
2024-04-03 15:36:48 +08:00
if [[ "$SOURCE_CPPRC" != 0 && -f "${sF}" ]]; then source "${sF}"; fi
`;try{await Promise.all([V(),z(e),q(e)]);}catch(t){(0,rS.warning)(`Failed to add ${e} to .profile or .bashrc. You should add it manually: ${t}`);}sM=!0;}async function V(){let e="# Automatically Generated by setup-cpp\nexport SOURCE_CPPRC=0";(await(0,nE.pathExists)(sF))&&!(await(0,rN.readFile)(sF,"utf8")).includes(e)&&(await(0,rN.appendFile)(sF,`
2024-04-03 15:36:48 +08:00
${e}
2024-04-03 16:20:06 +08:00
`),(0,nv.info)(`Added ${e} to ${sF}`));}async function q(e){let t=A("~/.bashrc");(await(0,nE.pathExists)(t))&&!(await(0,rN.readFile)(t,"utf-8")).includes(e)&&(await(0,rN.appendFile)(t,e),(0,nv.info)(`${e} was added to ${t}`));}async function z(e){let t=A("~/.profile");(await(0,nE.pathExists)(t))&&!(await(0,rN.readFile)(t,"utf-8")).includes(e)&&(await(0,rN.appendFile)(t,e),(0,nv.info)(`${e} was added to ${t}`));}async function X(){if(await(0,nE.pathExists)(sF)){let e=[...new Set((await(0,rN.readFile)(sF,"utf-8")).split("\n").reverse())].reverse();await(0,rN.writeFile)(sF,e.join("\n")),await C(sF);}}async function K(e,t=!1){let r;let n=J()?"nala":"apt-get";for(let{name:t,version:r}of e)(0,rS.info)(`Installing ${t} ${r??""} via ${n}`);process.env.DEBIAN_FRONTEND="noninteractive",(!sG||t)&&(Q(n),sG=!0),sB||(await Z(n),sB=!0);let i=[...new Set(e.flatMap(e=>e.repositories??[]))];if(0!==i.length){for(let e of i)I("add-apt-repository",["-y",e]);Q(n);}let o=await Promise.all(e.map(e=>Y(e.name,e.version)));try{I(n,["install","--fix-broken","-y",...o]);}catch(e){if("stderr"in e){let t=e.stderr;sH.some(e=>t.includes(e))&&((0,rS.warning)(`Failed to install packages ${o}. Retrying...`),I(n,["install","--fix-broken","-y",...o]));}else throw e;}return{binDir:"/usr/bin/"};}async function W(e,t){if(void 0!==t&&""!==t){let{stdout:r}=await x("apt-cache",["search","--names-only",`^${(0,ng.default)(e)}-${(0,ng.default)(t)}$`]);if(""!==r.trim())return 0;try{let{stdout:r}=await x("apt-cache",["show",`${e}=${t}`]);if(""===r.trim())return 1;}catch{}}try{let{stdout:t}=await x("apt-cache",["show",e]);if(""!==t.trim())return 2;}catch{}return 3;}async function Y(e,t){switch(await W(e,t)){case 0:return`${e}-${t}`;case 1:return`${e}=${t}`;case 2:return e;default:throw Error(`Could not find package ${e} ${t??""}`);}}function J(){return null!==c(r$).sync("nala",{nothrow:!0});}function Q(e){I(e,"nala"!==e?["update","-y"]:["update"]);}async function Z(e){I(e,["install","--fix-broken","-y","software-properties-common","apt-utils","ca-certificates","gnupg"]);let t=[et(["3B4FE6ACC0B21F32","40976EAF437D05B5"],"setup-cpp-ubuntu-archive.gpg"),et(["1E9377A2BA9EF27F"],"launchpad-toolchain.gpg")];"nala"===e&&t.push(F("LANG","C.UTF-8",{shouldAddOnlyIfNotDefined:!0}),F("LC_ALL","C.UTF-8",{shouldAddOnlyIfNotDefined:!0})),await Promise.all(t);}function ee(){I("gpg",["-k"]);}async function et(e,t,r="keyserver.ubuntu.com"){try{let n="/etc/apt/trusted.gpg.d/"+t;return(await(0,nE.pathExists)(n))||(ee(),await Promise.all(e.map(async e=>{await S("gpg",["--no-default-keyring","--keyring","gnupg-ring:"+n,"--keyserver",r,"--recv-keys",e]),await S("chmod",["644",n]);}))),n;}catch(e){(0,rS.warning)(`Failed to add apt key via server ${r}: ${e}`);return;}}async function er(e,t){let r="/etc/apt/trusted.gpg.d/"+e;return(await(0,nE.pathExists)(r))||(ee(),await K([{name:"curl"},{name:"ca-certificates"}],void 0),await x("curl",["-s",t,"-o","/tmp/"+e]),I("gpg",["--no-default-keyring","--keyring","gnupg-ring:"+r,"--import","/tmp/"+e]),I("chmod",["644",r])),r;}async function en(e,t,r=40){rI.GITHUB_ACTIONS?await S("update-alternatives",["--install","/usr/bin/"+e,e,t,r.toString()]):(await H(),await(0,rN.appendFile)(sF,`
if [ $UID -eq 0 ]; then update-alternatives --install /usr/bin/${e} ${e} ${t} ${r}; fi
2024-04-03 16:20:06 +08:00
`));}async function ei(e){try{let{stdout:t}=await x("dpkg",["-l",e]);if("string"!=typeof t)return!1;return t.split("\n").some(e=>e.startsWith("ii"));}catch{return!1;}}async function eo(e,r,n){if(!["darwin","linux"].includes(process.platform))return;if("string"==typeof t)return{binDir:t};let i=c(r$).sync("brew",{nothrow:!0});if(null!==i)return{binDir:t=(0,nb.dirname)(i)};let o=c(n3).join((0,n4.tmpdir)(),"setup-cpp","brew");await(0,nR.mkdirP)(o),b("curl",["-LJO","https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh"],{cwd:o});let s=(0,n3.join)(o,"install.sh");return"linux"===process.platform&&(await(0,rN.readFile)(s,"utf-8")).replace("#!/bin/bash",""),b("/bin/bash",[s],{stdio:"inherit",env:{NONINTERACTIVE:"1"}}),t=es(),await M(t),{binDir:t};}function es(){return"linux"===process.platform?"/home/linuxbrew/.linuxbrew/bin/":"/usr/local/bin/";}async function ea(e,t,r=[]){(0,nv.info)(`Installing ${e} ${t??""} via brew`),sV&&null!==c(r$).sync("brew",{nothrow:!0})||(await eo("","",process.arch),sV=!0);let n=es();return b((0,nb.join)(n,"brew"),["install",void 0!==t&&""!==t?`${e}@${t}`:e,...r],{stdio:"inherit"}),{binDir:n};}async function el(e,t,n){if("win32"!==process.platform)return;if("string"==typeof r)return{binDir:r};let i=c(r$).sync("choco",{nothrow:!0});if(null!==i)return{binDir:r=(0,nb.dirname)(i)};let o="powershell.exe",s=c(r$).sync(`${process.env.SystemRoot}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,{nothrow:!0});null!==s&&(o=s),b(o,["-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 a=`${process.env.ALLUSERSPROFILE}\\chocolatey\\bin`;await M(a);let l=c(r$).sync("choco",{nothrow:!0});if(r=null!==l?(0,nb.dirname)(l):`${process.env.ChocolateyInstall??"C:/ProgramData/chocolatey"}/bin`,await(0,nE.pathExists)(r))return{binDir:r};}async function ec(e,t,r=[]){(0,rS.info)(`Installing ${e} ${t??""} via chocolatey`),sq&&null!==c(r$).sync("choco",{nothrow:!0})||(await el("","",process.arch),sq=!0);let n=process.env.PATH,i={...process.env};if(delete i.TMP,delete i.TEMP,delete i.Path,i.PATH=n,void 0!==t&&""!==t)b("choco",["install","-y",e,"--version="+t,...r],{env:i,extendEnv:!1,stdio:"inherit"});else try{b("choco",["install","-y",e,...r],{env:i,extendEnv:!1,stdio:"inherit"});}catch(t){if(t.message.includes("exit code 3010"))(0,rS.info)(`${e} might require a reboot for the completion of the installation.`);else throw t;}let o=`${process.env.ChocolateyInstall??"C:/ProgramData/chocolatey"}/bin`;return await M(o),{binDir:o};}async function eu(e){for(let{name:t,version:r}of e)(0,rS.info)(`Installing ${t} ${r??""} via dnf`);return I("dnf",["-y","install",...(await Promise.all(e.map(e=>ep(e.name,e.version))))]),{binDir:"/usr/bin/"};}async function ep(e,t){if(void 0!==t&&""!==t){let{stdout:r}=await x("dnf",["search","-q",`${e}-${t}`]);if(""!==r.trim())return`${e}-${t}`;{let{stdout:r}=await x("dnf",["search","-q",`${e}${t}`]);if(""!==r.trim())return`${e}${t}`;(0,rS.warning)(`Failed to install ${e} ${t} via dnf, trying without version`);}}return e;}async function ed(e,t,r){switch(process.platform){case"win32":return ec("bazelisk",e);case"darwin":return ea("bazelisk",e);case"linux":if(D())throw Error("installing bazel on Arch linux is not supported yet");if(L())return await eu([{name:"dnf-plugins-core"}]),I("dnf",["copr","enable","vbatts/bazel"]),eu([{name:"bazel4"}]);if(k()){let t=await er("bazel-archive-keyring.gpg","https://bazel.build/bazel-release.pub.gpg");return I("bash",["-c",`echo "deb [arch=amd64 signed-by=${t}] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list`]),K([{name:"bazel",version:e}],!0);}throw Error("Unsupported linux distribution");default:throw Error("Unsupported platform");}}async function ef(e,t,r){(0,rS.info)(`Installing ${e} ${t??""} via pacman`);let n="pacman";if("yay"===r&&null===c(r$).sync("yay",{nothrow:!0}))throw Error(`yay is needed f
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 o=i.architecture??process.arch,s=process.env.SETUP_CPP_DIR??A("~"),a=[],l=[],u=rC.create({autoloadLocales:!0});rC.addLocale(c(rA)),rO.addLocale(c(rT));let p=await ab();if(!function(e,t){let r=t.filter(t=>void 0!==e[t]),n=r.filter(t=>!e3(e[t])),i=n.length>=1?e[n[0]]:"true";return!n.some(t=>e[t]!==i)&&(r.forEach(t=>{e[t]=i;}),!0);}(i,["llvm","clangtidy","clangformat"]))return(0,rS.error)("The same version must be used for llvm, clangformat and clangtidy"),1;D()&&"string"==typeof i.cppcheck&&"string"==typeof i.gcovr&&((0,rS.info)("installing python-pygments to avoid conflicts with cppcheck and gcovr on Arch linux"),await ef("python-pygments"));let d=!1,f=!1;for(let e of aJ){if(rI.isCI&&0!==l.length){f=!0;break;}let n=i[e];void 0!==n&&(t=Date.now(),d=await tN(e,n,p,o,s,a,l,6e4*parseFloat(i.timeout??"20")),r=Date.now(),(0,rS.info)("took "+(u.format(t,r)||"0 seconds")));}if(!f){let e=i.compiler;if(void 0!==e){let t=Date.now();await t6(e,p,s,o,a,d,l);let r=Date.now();(0,rS.info)("took "+(u.format(t,r)||"0 seconds"));}}if(await X(),0===a.length&&0===l.length)return(0,rS.warning)("setup-cpp was called without any arguments. Nothing to do."),0;if(a.forEach(e=>(0,rS.success)(e)),l.forEach(e=>(0,rS.error)(e)),(0,rS.info)("setup-cpp finished"),!rI.GITHUB_ACTIONS)switch(process.platform){case"win32":(0,rS.warning)("Run `RefreshEnv.cmd` or restart your shell to update the environment.");break;case"linux":case"darwin":(0,rS.warning)("Run `source ~/.cpprc` or restart your shell to update the environment.");}return await n,0===l.length?0:1;}var t5,t7,t9,re,rt,rr,rn,ri,ro,rs,ra,rl,rc,ru,rp,rd,rf,rh,rm,rv,rg,rE,ry,rw,rx,rb,rR,rI,rS,rO,rT,rC,rA,r$,r_,rN,rP,rL,rD,rk,rU,rj,rF,rM,rG,rB,rH,rV,rq,rz,rX,rK,rW,rY,rJ,rQ,rZ,r0,r1,r2,r4,r3,r6,r8,r5,r7,r9,ne,nt,nr,nn,ni,no,ns,na,nl,nc,nu,np,nd,nf,nh,nm,nv,ng,nE,ny,nw,nx,nb,nR,nI,nS,nO,nT,nC,nA,n$,n_,nN,nP,nL,nD,nk,nU,nj,nF,nM,nG,nB,nH,nV,nq,nz,nX,nK,nW,nY,nJ,nQ,nZ,n0,n1,n2,n4=require("os"),n3=require("path"),n6=require("fs"),n8=require("crypto"),n5=require("http"),n7=require("https");require("net"),t9=require("tls"),re=require("events"),rt=require("assert"),rr=require("util"),rn=require("fs"),ri=require("child_process"),ro=require("string_decoder"),rs=require("timers"),ra=require("buffer"),rl=require("path"),rc=require("child_process"),ru=require("process"),rp=require("url"),rd=require("os"),rf=require("buffer"),rh=require("stream"),rm=require("util"),rv=require("process"),rg=require("url"),rE=require("console"),rw={},rx={},null==(rb=(ry=globalThis).parcelRequire810d)&&((rb=function(e){if(e in rw)return rw[e].exports;if(e in rx){var t=rx[e];delete rx[e];var r={id:e,exports:{}};return rw[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){rx[e]=t;},ry.parcelRequire810d=rb),(rR=rb.register)("52cQ1",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=rb("jgqtC");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]).every(function(e){return n(e);});if(e.exports[t.constant]=r,r)switch(e.exports.name=t.name,typeof t.pr){case"string":e.exports.isPR=!!i[t.pr];break;case"object":"env"in t.pr?e.exports.isPR=t.pr.env in i&&i[t.pr.env]!==t.pr.ne:"any"in t.pr?e.exports.isPR=t.pr.any.some(function(e){return!!i[e];}):e.exports.
2024-04-03 15:36:48 +08:00
Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);},e.exports.setOutput=function(e,t){if(process.env.GITHUB_OUTPUT)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=v,e.exports.endGroup=g,e.exports.group=function(e,t){return o(this,void 0,void 0,function*(){let r;v(e);try{r=yield t();}finally{g();}return r;});},e.exports.saveState=function(e,t){if(process.env.GITHUB_STATE)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=rb("dTpO2"),Object.defineProperty(e.exports,"summary",{enumerable:!0,get:function(){return p.summary;}}),p=rb("dTpO2"),Object.defineProperty(e.exports,"markdownSummary",{enumerable:!0,get:function(){return p.markdownSummary;}}),d=rb("azKnO"),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;}});}),rR("dIPEE",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(n4);o=rb("i0ItD"),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")));}}}),rR("i0ItD",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}:{};};}),rR("aSbHp",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,{enumerable:!0,get:function(){return t[r];}});}:function(e,
Error Code : ${e.statusCode}
2024-04-03 16:20:06 +08:00
Error Message: ${e.message}`);})).result)||void 0===t?void 0:t.value;if(!n)throw Error("Response json body do not have ID Token field");return n;});}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;}),rR("a7JAS",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(n5),d=i(n7),f=i(rb("8gh3V")),h=i(rb("7i1qo"));(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],v=[s.BadGateway,s.ServiceUnavailable,s.GatewayTimeout],g=["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){return"https:"===new URL(e).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.requestOptions=r,r&&(null!=r.ignoreSslError&&(thi
2024-04-03 15:36:48 +08:00
${t}`,i_=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),iN=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),iP=(e,t,r)=>{let n=""===r?"":`with ${r.trim()}() `,i=i$.bind(null,n,t.toString());Object.defineProperty(i,"name",iN),Object.defineProperty(e,"toString",{...i_,value:i});},iL=new WeakMap(),iD=(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(iL.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))iT(e,t,n,r);iA(e,t),iP(e,t,n);}(o,e),iL.set(o,n),o;};iD.callCount=e=>{if(!iL.has(e))throw Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return iL.get(e);},rJ=iD;const ik=()=>Array.from({length:iF-ij+1},iU),iU=(e,t)=>({name:"SIGRT"+(t+1),number:ij+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),ij=34,iF=64,iM=[{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}`:v,y=[E,t,e].filter(Boolean).join("\n");return g?(n.originalMessage=n.message,n.message=y):n=Error(y),n.shortMessage=E,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;},iK=["stdin","stdout","stderr"],iW=e=>iK.some(t=>void 0!==e[t]),iY=e=>{if(!e)return;let{stdio:t}=e;if(void 0===t)return iK.map(t=>e[t]);if(iW(e))throw Error("It's not possible to provide `stdio` in combination with one of "+iK.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}\``);return Array.from({length:Math.max(t.length,iK.length)},(e,r)=>t[r]);};rQ={};const iJ=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(iJ(rZ=ry.process)){var iQ,iZ=rt,i0=rb("e1Rfe"),i1=/^win/i.test(rZ.platform),i2=re;"function"!=typeof i2&&(i2=i2.EventEmitter),rZ.__signal_exit_emitter__?iQ=rZ.__signal_exit_emitter__:((iQ=rZ.__signal_exit_emitter__=new i2()).count=0,iQ.emitted={}),iQ.infinite||(iQ.setMaxListeners(1/0),iQ.infinite=!0);var i4=function(){i8&&iJ(ry.process)&&(i8=!1,i0.forEach(function(e){try{rZ.removeListener(e,i6[e]);}catch(e){}}),rZ.emit=oe,rZ.reallyExit=i7,iQ.count-=1);};(rQ=function(e,t){if(!iJ(ry.process))return function(){};iZ.equal(typeof e,"function","a callback must be provided for exit handler"),!1===i8&&i5();var r="exit";return t&&t.alwaysLast&&(r="afterexit"),iQ.on(r,e),function(){iQ.removeListener(r,e),0===iQ.listeners("exit").length&&0===iQ.listeners("afterexit").length&&i4();};}).unload=i4;var i3=function(e,t,r){iQ.emitted[e]||(iQ.emitted[e]=!0,iQ.emit(e,t,r));},i6={};i0.forEach(function(e){i6[e]=function(){iJ(ry.process)&&rZ.listeners(e).length===iQ.count&&(i4(),i3("exit",null,e),i3("afterexit",null,e),i1&&"SIGHUP"===e&&(e="SIGINT"),rZ.kill(rZ.pid,e));};}),rQ.signals=function(){return i0;};var i8=!1,i5=function(){!i8&&iJ(ry.process)&&(i8=!0,iQ.count+=1,i0=i0.filter(function(e){try{return rZ.on(e,i6[e]),!0;}catch(e){return!1;}}),rZ.emit=ot,rZ.reallyExit=i9);};rQ.load=i5;var i7=rZ.reallyExit,i9=function(e){iJ(ry.process)&&(rZ.exitCode=e||0,i3("exit",rZ.exitCode,null),i3("afterexit",rZ.exitCode,null),i7.call(rZ,rZ.exitCode));},oe=rZ.emit,ot=function(e,t){if(!("exit"===e&&iJ(ry.process)))return oe.apply(this,arguments);void 0!==t&&(rZ.exitCode=t);var r=oe.apply(this,arguments);return i3("exit",rZ.exitCode,null),i3("afterexit",rZ.exitCode,null),r;};}else rQ=function(){return function(){};};const or=(e,t="SIGTERM",r={})=>{let n=e(t);return on(e,t,r,n),n;},on=(e,t,r,n)=>{if(!oi(t,r,n))return;let i=setTimeout(()=>{e("SIGKILL");},os(r));i.unref&&i.unref();},oi=(e,{forceKillAfterTimeout:t},r)=>oo(e)&&!1!==t&&r,oo=e=>e===c(rd).constants.signals.SIGTERM||"string"==typeof e&&"SIGTERM"===e.toUpperCase(),os=({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;},oa=(e,t)=>{e.kill()&&(t.isCanceled=!0);},ol=(e,t,r)=>{e.kill(t),r(Object.assign(Error("Timed out"),{timedOut:!0,signal:t}));},oc=(e,{timeout:t,killSignal:r="SIGTERM"},n)=>{let i;return 0===t||void 0===t?n:Promise.race([new Promise((n,o)=>{i=setTimeout(()=>{ol(e,r,o);},t);}),n.finally(()=>{clearTimeout(i);})]);},ou=({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})`);},op=async(e,{cleanup:t,detached:r},n)=>{if(!t||r)return n;let i=c(rQ)(()=>{e.kill();});return n.finally(()=>{i();});},od=e=>e instanceof rc.ChildProcess&&"function"==typeof e.then,of=(e,t,r)=>{if("string"==typeof r)return e[t].pipe((0,rn.createWriteStream)(r)),e;if(y
`);},oH=({env:e,extendEnv:t,preferLocal:r,localDir:n,execPath:i})=>{let o=t?{...c(ru).env,...e}:e;return r?g({env:o,cwd:n,execPath:i}):o;},oV=(e,t,r={})=>{let n=c(rj)._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:oF,...r}).env=oH(r),r.stdio=iY(r),"win32"===c(ru).platform&&"cmd"===c(rl).basename(e,".exe")&&t.unshift("/q"),{file:e,args:t,options:r,parsed:n};},oq=(e,t,r)=>"string"==typeof t||(0,ra.Buffer).isBuffer(t)?e.stripFinalNewline?m(t):t:void 0===r?void 0:"",oz=({input:e,inputFile:t,stdio:r})=>void 0===e&&void 0===t&&void 0===r?{stdin:"inherit"}:{},oX=(e={})=>({preferLocal:!0,...oz(e),...e});!function e(t){function r(n,...i){if(!Array.isArray(n))return e({...t,...n});let[o,...s]=oj(n,i);return x(o,s,oX(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]=oj(e,r);return b(n,i,oX(t));},r;}();const oK={stdio:"inherit",shell:!0},oW=/^~(?=$|\/|\\)/;rS=rb("ER74K"),r5={},r7=rb("bSUdl"),r9=rv.env.npm_package_json,nt=!!((ne=rv.env.npm_config_user_agent)&&ne.startsWith("npm")),nr=!!(r9&&r9.endsWith("package.json")),nn=nt||nr,ni=!!(ne&&ne.startsWith("yarn")),no=nn||ni,ns=n4.homedir(),na=process.env.XDG_CONFIG_HOME||n3.join(ns,".config","simple-update-notifier"),nl=function(e){return n3.join(na,"".concat(e.replace("@","").replace("/","__"),".json"));},nc=function(){n6.existsSync(na)||n6.mkdirSync(na,{recursive:!0});},nu=function(e){var t=nl(e);try{if(!n6.existsSync(t))return;return JSON.parse(n6.readFileSync(t,"utf8")).lastUpdateCheck;}catch(e){return;}},np=function(e){var t=nl(e);n6.writeFileSync(t,JSON.stringify({lastUpdateCheck:new Date().getTime()}));},nd=function(e,t){return $(void 0,void 0,void 0,function(){var r;return _(this,function(n){return r="https://registry.npmjs.org/-/package/".concat(e,"/dist-tags"),[2,new Promise(function(e,n){n7.get(r,function(r){var i="";r.on("data",function(e){return i+=e;}),r.on("end",function(){try{var r=JSON.parse(i)[t];r||n(Error("Error getting version")),e(r);}catch(e){n(Error("Could not parse version response"));}});}).on("error",function(e){return n(e);});})];});});},nf=function(e){var t=e.pkg,r=e.updateCheckInterval,n=void 0===r?864e5:r,i=e.distTag,o=void 0===i?"latest":i,s=e.alwaysRun,a=e.debug;return $(void 0,void 0,void 0,function(){var e,r;return _(this,function(i){switch(i.label){case 0:if(nc(),e=nu(t.name),!(s||!e||e<new Date().getTime()-n))return[3,2];return[4,nd(t.name,o)];case 1:if(r=i.sent(),np(t.name),r7.gt(r,t.version))return[2,r];return a&&console.error("Latest version (".concat(r,") not newer than current version (").concat(t.version,")")),[3,3];case 2:a&&console.error("Too recent to check for a new update. simpleUpdateNotifier() interval set to ".concat(n,"ms but only ").concat(new Date().getTime()-e,"ms since last check.")),i.label=3;case 3:return[2,!1];}});});},nh=function(e){for(var t=e.split("\n"),r=Math.max.apply(Math,t.map(function(e){return e.length;})),n=["┌".concat("─".repeat(r+2),"┐")],i=0;i<t.length;i++){var o=t[i];n.push("│ ".concat(o.padEnd(r)," │"));}return n.push("└".concat("─".repeat(r+2),"┘")),n.join("\n");},r5=function(e){return $(void 0,void 0,void 0,function(){var t,r;return _(this,function(n){switch(n.label){case 0:if(!e.alwaysRun&&(!process.stdout.isTTY||no&&!e.shouldNotifyInNpmScript))return e.debug&&console.error("Opting out of running simpleUpdateNotifier()"),[2];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,nf(e)];case 2:return(t=n.sent())&&console.error(nh("New version of ".concat(e.pkg.name," available!\nCurrent Version: ").concat(e.pkg.version,"\nLatest Version: ").concat(t))),[3,4];case 3:return r=n.sent(),e.debug&&r instanceof Error&&console.error("Unexpected error in simpleUpdateNotifier():",r),[3,4];case 4:return[2];}});});},nm={},nm=JSON.parse('{"name":"setup-cpp","version":"0.37.0"}'),nv=rb("4t50X"),rS=rb("ER74K"),rI
2024-04-03 15:36:48 +08:00
${n.message}`:h,g=[v,t,e].filter(Boolean).join("\n");return m?(n.originalMessage=n.message,n.message=g):n=Error(g),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;},o1=["stdin","stdout","stderr"],o2=e=>o1.some(t=>void 0!==e[t]),o4=e=>{if(!e)return;let{stdio:t}=e;if(void 0===t)return o1.map(t=>e[t]);if(o2(e))throw Error("It's not possible to provide `stdio` in combination with one of "+o1.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}\``);return Array.from({length:Math.max(t.length,o1.length)},(e,r)=>t[r]);},o3=(e,t="SIGTERM",r={})=>{let n=e(t);return o6(e,t,r,n),n;},o6=(e,t,r,n)=>{if(!o8(t,r,n))return;let i=setTimeout(()=>{e("SIGKILL");},o7(r));i.unref&&i.unref();},o8=(e,{forceKillAfterTimeout:t},r)=>o5(e)&&!1!==t&&r,o5=e=>e===c(rd).constants.signals.SIGTERM||"string"==typeof e&&"SIGTERM"===e.toUpperCase(),o7=({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;},o9=(e,t)=>{e.kill()&&(t.isCanceled=!0);},se=(e,t,r)=>{e.kill(t),r(Object.assign(Error("Timed out"),{timedOut:!0,signal:t}));},st=(e,{timeout:t,killSignal:r="SIGTERM"},n)=>{let i;return 0===t||void 0===t?n:Promise.race([new Promise((n,o)=>{i=setTimeout(()=>{se(e,r,o);},t);}),n.finally(()=>{clearTimeout(i);})]);},sr=({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})`);},sn=async(e,{cleanup:t,detached:r},n)=>{if(!t||r)return n;let i=c(rQ)(()=>{e.kill();});return n.finally(()=>{i();});},si=e=>e instanceof rc.ChildProcess&&"function"==typeof e.then,so=(e,t,r)=>{if("string"==typeof r)return e[t].pipe((0,rn.createWriteStream)(r)),e;if(y(r))return e[t].pipe(r),e;if(!si(r))throw TypeError("The second argument must be a string, a stream or an Execa child process.");if(!y(r.stdin))throw TypeError("The target child process's stdin must be available.");return e[t].pipe(r.stdin),r;},ss=e=>{null!==e.stdout&&(e.pipeStdout=so.bind(void 0,e,"stdout")),null!==e.stderr&&(e.pipeStderr=so.bind(void 0,e,"stderr")),void 0!==e.all&&(e.pipeAll=so.bind(void 0,e,"all"));},sa=e=>{if(void 0!==e)throw TypeError("The `input` and `inputFile` options cannot be both set.");},sl=({input:e,inputFile:t})=>"string"!=typeof t?e:(sa(e),(0,rn.readFileSync)(t)),sc=e=>{let t=sl(e);if(E(t))throw TypeError("The `input` option cannot be a stream in sync mode");return t;},su=({input:e,inputFile:t})=>"string"!=typeof t?e:(sa(e),(0,rn.createReadStream)(t)),sp=(e,t)=>{let r=su(t);void 0!==r&&(E(r)?r.pipe(e.stdin):e.stdin.end(r));},sd=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;let r=c(r6)();return e.stdout&&r.add(e.stdout),e.stderr&&r.add(e.stderr),r;},sf=async(e,t)=>{if(e&&void 0!==t){e.destroy();try{return await t;}catch(e){return e.bufferedData;}}},sh=(e,{encoding:t,buffer:r,maxBuffer:n})=>{if(e&&r)return t?c(r0)(e,{encoding:t,maxBuffer:n}):c(r0).buffer(e,{maxBuffer:n});},sm=async({stdout:e,stderr:t,all:r},{encoding:n,buffer:i,maxBuffer:o},s)=>{let a=sh(e,{encoding:n,buffer:i,maxBuffer:o}),l=sh(t,{encoding:n,buffer:i,maxBuffer:o}),c=sh(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},sf(e,a),sf(t,l),sf(r,c)]);}},sv=(async()=>{})().constructor.prototype,sg=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(sv,e)]),sE=(e,t)=>{for(let[r,n]of sg){let i="function"==typeof t?(...e)=>Reflect.apply(n.value,t(),e):n.value.bind(t);Reflect.defineProperty(e,r,{...n,value:i});}},sy=e=>new Promise((t,r)=>{e.on("exit",(e,r)=>{t({exitCode:e,signal:r});}),e.on("error",e=>{r(e);}),e.stdin&&e.stdin.on("error",e=>{r(e)
`);},sN=({env:e,extendEnv:t,preferLocal:r,localDir:n,execPath:i})=>{let o=t?{...c(ru).env,...e}:e;return r?g({env:o,cwd:n,execPath:i}):o;},sP=(e,t,r={})=>{let n=c(rj)._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:sC,...r}).env=sN(r),r.stdio=o4(r),"win32"===c(ru).platform&&"cmd"===c(rl).basename(e,".exe")&&t.unshift("/q"),{file:e,args:t,options:r,parsed:n};},sL=(e,t,r)=>"string"==typeof t||(0,ra.Buffer).isBuffer(t)?e.stripFinalNewline?m(t):t:void 0===r?void 0:"",sD=({input:e,inputFile:t,stdio:r})=>void 0===e&&void 0===t&&void 0===r?{stdin:"inherit"}:{},sk=(e={})=>({preferLocal:!0,...sD(e),...e});!function e(t){function r(n,...i){if(!Array.isArray(n))return e({...t,...n});let[o,...s]=sT(n,i);return U(o,s,sk(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]=sT(e,r);return function(e,t,r){let n;let i=sP(e,t,r),o=sb(e,t),s=sR(e,t);s_(s,i.options);let a=sc(i.options);try{n=c(rc).spawnSync(i.file,i.args,{...i.options,input:a});}catch(e){throw o0({error:e,stdout:"",stderr:"",all:"",command:o,escapedCommand:s,parsed:i,timedOut:!1,isCanceled:!1,killed:!1});}let l=sL(i.options,n.stdout,n.error),u=sL(i.options,n.stderr,n.error);if(n.error||0!==n.status||null!==n.signal){let e=o0({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,sk(t));},r;}(),rN=rb("4oHc1"),nE=rb("kY0n1");const sU={shouldEscapeSpace:!1,shouldAddOnlyIfNotDefined:!1},sj=[/\/usr\/bin\/?/,/\/usr\/local\/bin\/?/],sF=A("~/.cpprc");let sM=!1,sG=!1,sB=!1;const sH=["E: Could not get lock","dpkg: error processing archive","dpkg: error: dpkg status database is locked by another process"];(t5=nx||(nx={}))[t5.NameDashVersion=0]="NameDashVersion",t5[t5.NameEqualsVersion=1]="NameEqualsVersion",t5[t5.Name=2]="Name",t5[t5.None=3]="None",nv=rb("4t50X"),nb=rb("bzNgi"),nR=rb("hZdK0"),rN=rb("4oHc1"),nb=rb("bzNgi");let sV=!1;rS=rb("ER74K"),nE=rb("kY0n1"),nb=rb("bzNgi");let sq=!1;rS=rb("ER74K"),rS=rb("ER74K");let sz=!1,sX=!1;const sK=/Version\s*:\s*(.*)/g;nI={},nS=n3.resolve(__dirname,"../../node_modules/@actions/tool-cache/lib"),nO=nI&&nI.__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];}),nT=nI&&nI.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t});}:function(e,t){e.default=t;}),nC=nI&&nI.__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)&&nO(t,e,r);return nT(t,e),t;},nA=nI&&nI.__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());});},n$=nI&&nI.__importDefault||function(e){return e&&e.__esModule?e:{default:e};},Object.defineProperty(nI,"__esModule",{value:!0}),nI.evaluateVersions=nI.isExplicitVersion=nI.findFromManifest=nI.getManifestFromRepo=nI.findAllVersions=nI.find=nI.cacheFile=nI.cacheDir=nI.extractZip=nI.extractXar=nI.extractTar=nI.extract7z=nI.downloadTool=nI.HTTPError=void 0;const sW=nC(rb("4t50X")),sY=nC(rb("hZdK0")),sJ=nC(n6),sQ=nC(rb("42L4Y")),sZ=nC(n4),s0=nC(n3),s1=nC(rb("a7JAS")),s2=nC(rb("lroIv")),s4=nC(rh),s3=nC(rr),s6=n$(rb("eAF86"));n_=rb("1f6JF"),nP=(nN={},nN.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumera
2023-07-16 06:41:58 +08:00
//# sourceMappingURL=setup-cpp.js.map