setup-cpp/dist/modern/setup-cpp.js

39 lines
317 KiB
JavaScript
Raw Normal View History

2023-07-16 06:41:58 +08:00
#!/usr/bin/env node
2024-02-17 15:11:59 +08:00
let e,t,r,n,i,o,a,s,l,u;function c(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0});}function p(e){return e&&e.__esModule?e.default:e;}function d(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){d(e,t||{},function(e,t){e?n(e):r(t);});});}r7(e,t||{},function(e,n){e&&("EACCES"===e.code||t&&t.ignoreErrors)&&(e=null,n=!1),r(e,n);});}function f(e,t){let r;let n=e.options.env||process.env,i=process.cwd(),o=null!=e.options.cwd,a=o&&void 0!==process.chdir&&!process.chdir.disabled;if(a)try{process.chdir(e.options.cwd);}catch(e){}try{r=r8.sync(e.command,{path:n[ne({env:n})],pathExt:t?iE.delimiter:void 0});}catch(e){}finally{a&&process.chdir(i);}return r&&(r=iE.resolve(o?e.options.cwd:"",r)),r;}function h(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 m(e,t){return ou&&1===e&&!t.file?h(t.original,"spawn"):null;}function g(e,t,r){let n=r5(e,t,r),i=rS.spawn(n.command,n.args,n.options);return na.hookChildProcess(i,n),i;}function v(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 E(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 y({env:e=p(rO).env,...t}={}){let r=E({env:e={...e}});return t.path=e[r],e[r]=function(e={}){let t;let{cwd:r=p(rO).cwd(),path:n=p(rO).env[E()],execPath:i=p(rO).execPath}=e,o=i instanceof URL?p(rA).fileURLToPath(i):i,a=r instanceof URL?p(rA).fileURLToPath(r):r,s=p(rR).resolve(a),l=[];for(;t!==s;)l.push(p(rR).join(s,"node_modules/.bin")),t=s,s=p(rR).resolve(s,"..");return l.push(p(rR).resolve(a,o,"..")),[...l,n].join(p(rR).delimiter);}(t),e;}function w(e){return null!==e&&"object"==typeof e&&"function"==typeof e.pipe;}function b(e){return w(e)&&!1!==e.writable&&"function"==typeof e._write&&"object"==typeof e._writableState;}async function x(e,t){if(!e)throw Error("Expected a stream");let{maxBuffer:r}=t={maxBuffer:1/0,...t},n=nf(t);return await new Promise((t,i)=>{let o=e=>{e&&n.getBufferedLength()<=np.MAX_LENGTH&&(e.bufferedData=n.getBufferedValue()),i(e);};(async()=>{try{await o9(e,n),t();}catch(e){o(e);}})(),n.on("data",()=>{n.getBufferedLength()>r&&o(new o7());});}),n.getBufferedValue();}function S(e,t,r){let n;let i=aR(e,t,r),o=am(e,t),a=ag(e,t);aN(a,i.options),o2(i.options);try{n=p(rI).spawn(i.file,i.args,i.options);}catch(t){let e=new(p(rI).ChildProcess)();return ap(e,Promise.reject(oA({error:t,stdout:"",stderr:"",all:"",command:o,escapedCommand:a,parsed:i,timedOut:!1,isCanceled:!1,killed:!1}))),e;}let s=ad(n),l=o3(n,i.options,s),u=o4(n,i.options,l),c={isCanceled:!1};n.kill=oK.bind(null,n.kill.bind(n)),n.cancel=o0.bind(null,n,c);let d=ns(async()=>{let[{error:e,exitCode:t,signal:r,timedOut:s},l,p,d]=await al(n,i.options,u),f=aI(i.options,l),h=aI(i.options,p),m=aI(i.options,d);if(e||0!==t||null!==r){let l=oA({error:e,exitCode:t,signal:r,stdout:f,stderr:h,all:m,command:o,escapedCommand:a,parsed:i,timedOut:s,isCanceled:c.isCanceled||!!i.options.signal&&i.options.signal.aborted,killed:n.killed});if(!i.options.reject)return l;throw l;}return{command:o,escapedCommand:a,exitCode:0,stdout:f,stderr:h,all:m,failed:!1,timedOut:!1,isCanceled:!1,killed:!1};});return ai(n,i.options),n.all=ao(n,i.options),o8(n),ap(n,d),n;}function D(e,t,r){let n;let i=aR(e,t,r),o=am(e,t),a=ag(e,t);aN(a,i.options);let s=ar(i.options);try{n=p(rI).spawnSync(i.file,i.args,{...i.options,input:s});}catch(e){throw oA({error:e,stdout:"",stderr:"",all:"",command:o,escapedCommand:a,parsed:i,timedOut:!1,isCanceled:!1,killed:!1});}let l=aI(i.options,n.stdout,n.error),u=aI(i.options,n.stderr,n.error);if(n.error||0!==n.status||null!==n.signal){let e=oA({stdout:l,stderr:u,error:n.error,signal:n.signal,exitCode:n.status,command:o,escapedCommand:a,parsed:i,timedOut:
2023-07-16 06:41:58 +08:00
if [ -z "\${${e}}" ]; then export ${e}="${n}"; fi
2024-02-17 15:11:59 +08:00
`),(0,nk.info)(`if not defined ${e} then ${e}="${n}" was added to "${sx}`)):((0,iy.appendFileSync)(sx,`
2023-07-16 06:41:58 +08:00
export ${e}="${n}"
2024-02-17 15:11:59 +08:00
`),(0,nk.info)(`${e}="${n}" was added to "${sx}`));return;}process.env[e]=n;}async function q(e){switch(process.platform){case"win32":await U(`$USER_PATH=([Environment]::GetEnvironmentVariable("PATH", "User")); [Environment]::SetEnvironmentVariable("PATH", "${e};$USER_PATH", "User")`),(0,nk.info)(`"${e}" was added to the PATH.`);return;case"linux":case"darwin":await B(),(0,iy.appendFileSync)(sx,`
2023-07-16 06:41:58 +08:00
export PATH="${e}:$PATH"
2024-02-17 15:11:59 +08:00
`),(0,nk.info)(`"${e}" was added to "${sx}"`);return;default:return;}}async function B(){if(sS)return;let e="# Automatically Generated by setup-cpp\nexport SOURCE_CPPRC=0";if((await(0,nF.pathExists)(sx))&&(0,iy.readFileSync)(sx,"utf8").includes(e))return;(0,iy.appendFileSync)(sx,`
2023-07-16 06:41:58 +08:00
${e}
2024-02-17 15:11:59 +08:00
`),(0,nk.info)(`Added ${e} to ${sx}`);let t=`
2023-07-16 06:41:58 +08:00
# source .cpprc if SOURCE_CPPRC is not set to 0
2024-02-17 15:11:59 +08:00
if [[ "$SOURCE_CPPRC" != 0 && -f "${sx}" ]]; then source "${sx}"; fi
`;try{let e=C("~/.profile");(0,iy.appendFileSync)(e,t),(0,nk.info)(`${t} was added to ${e}`);let r=C("~/.bashrc");(0,iy.appendFileSync)(r,t),(0,nk.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}`);}sS=!0;}async function G(){if(await(0,nF.pathExists)(sx)){let e=[...new Set((0,iy.readFileSync)(sx,"utf-8").split("\n").reverse())].reverse();(0,iy.writeFileSync)(sx,e.join("\n")),await A(sx);}}async function H(e,t=!1){let r;let n=z()?"nala":"apt-get";for(let{name:t,version:r}of e)(0,rX.info)(`Installing ${t} ${r??""} via ${n}`);process.env.DEBIAN_FRONTEND="noninteractive",(!sN||t)&&(Y(n),sN=!0),sT||(await K(n),sT=!0);let i=[...new Set(e.flatMap(e=>e.repositories??[]))];if(0!==i.length){for(let e of i)T("add-apt-repository",["-y",e]);Y(n);}let o=await Promise.all(e.map(e=>X(e.name,e.version)));try{T(n,["install","--fix-broken","-y",...o]);}catch(e){if("stderr"in e){let t=e.stderr;sR.some(e=>t.includes(e))&&((0,rX.warning)(`Failed to install packages ${o}. Retrying...`),T(n,["install","--fix-broken","-y",...o]));}else throw e;}return{binDir:"/usr/bin/"};}async function V(e,t){if(void 0!==t&&""!==t){let{stdout:r}=await S("apt-cache",["search","--names-only",`^${(0,nj.default)(e)}-${(0,nj.default)(t)}$`]);if(""!==r.trim())return 0;try{let{stdout:r}=await S("apt-cache",["show",`${e}=${t}`]);if(""===r.trim())return 1;}catch{}}try{let{stdout:t}=await S("apt-cache",["show",e]);if(""!==t.trim())return 2;}catch{}return 3;}async function X(e,t){switch(await V(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 z(){return null!==p(rJ).sync("nala",{nothrow:!0});}function Y(e){T(e,"nala"!==e?["update","-y"]:["update"]);}async function K(e){T(e,["install","--fix-broken","-y","software-properties-common","apt-utils","ca-certificates","gnupg"]);let t=[J(["3B4FE6ACC0B21F32","40976EAF437D05B5"],"setup-cpp-ubuntu-archive.gpg"),J(["1E9377A2BA9EF27F"],"launchpad-toolchain.gpg")];"nala"===e&&t.push(M("LANG","C.UTF-8",{shouldAddOnlyIfNotDefined:!0}),M("LC_ALL","C.UTF-8",{shouldAddOnlyIfNotDefined:!0})),await Promise.all(t);}function W(){T("gpg",["-k"]);}async function J(e,t,r="keyserver.ubuntu.com"){try{let n="/etc/apt/trusted.gpg.d/"+t;return(await(0,nF.pathExists)(n))||(W(),await Promise.all(e.map(async e=>{await R("gpg",["--no-default-keyring","--keyring","gnupg-ring:"+n,"--keyserver",r,"--recv-keys",e]),await R("chmod",["644",n]);}))),n;}catch(e){(0,rX.warning)(`Failed to add apt key via server ${r}: ${e}`);return;}}async function Q(e,t){let r="/etc/apt/trusted.gpg.d/"+e;return(await(0,nF.pathExists)(r))||(W(),await H([{name:"curl"},{name:"ca-certificates"}],void 0),await S("curl",["-s",t,"-o","/tmp/"+e]),T("gpg",["--no-default-keyring","--keyring","gnupg-ring:"+r,"--import","/tmp/"+e]),T("chmod",["644",r])),r;}async function Z(e,t,r=40){return rV.GITHUB_ACTIONS?R("update-alternatives",["--install","/usr/bin/"+e,e,t,r.toString()]):(await B(),sD(sx,`
if [ $UID -eq 0 ]; then update-alternatives --install /usr/bin/${e} ${e} ${t} ${r}; fi
2024-02-17 15:11:59 +08:00
`));}async function ee(e){try{let{stdout:t}=await S("dpkg",["-l",e]);return t.split("\n").some(e=>e.startsWith("ii"));}catch{return!1;}}async function et(e,r,n){if(!["darwin","linux"].includes(process.platform))return;if("string"==typeof t)return{binDir:t};let i=p(rJ).sync("brew",{nothrow:!0});if(null!==i)return{binDir:t=(0,nB.dirname)(i)};let o=p(iE).join((0,iv.tmpdir)(),"setup-cpp","brew");await(0,nG.mkdirP)(o),D("curl",["-LJO","https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh"],{cwd:o});let a=(0,iE.join)(o,"install.sh");return"linux"===process.platform&&(0,iy.readFileSync)(a,"utf-8").replace("#!/bin/bash",""),D("/bin/bash",[a],{stdio:"inherit",env:{NONINTERACTIVE:"1"}}),t=er(),await F(t),{binDir:t};}function er(){return"linux"===process.platform?"/home/linuxbrew/.linuxbrew/bin/":"/usr/local/bin/";}async function en(e,t,r=[]){(0,nk.info)(`Installing ${e} ${t??""} via brew`),sI&&null!==p(rJ).sync("brew",{nothrow:!0})||(await et("","",process.arch),sI=!0);let n=er();return D((0,nB.join)(n,"brew"),["install",void 0!==t&&""!==t?`${e}@${t}`:e,...r],{stdio:"inherit"}),{binDir:n};}async function ei(e,t,n){if("win32"!==process.platform)return;if("string"==typeof r)return{binDir:r};let i=p(rJ).sync("choco",{nothrow:!0});if(null!==i)return{binDir:r=(0,nB.dirname)(i)};let o="powershell.exe",a=p(rJ).sync(`${process.env.SystemRoot}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,{nothrow:!0});null!==a&&(o=a),D(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 s=`${process.env.ALLUSERSPROFILE}\\chocolatey\\bin`;await F(s);let l=p(rJ).sync("choco",{nothrow:!0});if(r=null!==l?(0,nB.dirname)(l):`${process.env.ChocolateyInstall??"C:/ProgramData/chocolatey"}/bin`,await(0,nF.pathExists)(r))return{binDir:r};}async function eo(e,t,r=[]){(0,rX.info)(`Installing ${e} ${t??""} via chocolatey`),sO&&null!==p(rJ).sync("choco",{nothrow:!0})||(await ei("","",process.arch),sO=!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)D("choco",["install","-y",e,"--version="+t,...r],{env:i,extendEnv:!1,stdio:"inherit"});else try{D("choco",["install","-y",e,...r],{env:i,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 o=`${process.env.ChocolateyInstall??"C:/ProgramData/chocolatey"}/bin`;return await F(o),{binDir:o};}function ea(){return"linux"===process.platform&&(void 0===s&&(s=null!==p(rJ).sync("pacman",{nothrow:!0})),s);}function es(){return"linux"===process.platform&&(void 0===l&&(l=null!==p(rJ).sync("dnf",{nothrow:!0})),l);}async function el(e){for(let{name:t,version:r}of e)(0,rX.info)(`Installing ${t} ${r??""} via dnf`);return T("dnf",["-y","install",...(await Promise.all(e.map(e=>eu(e.name,e.version))))]),{binDir:"/usr/bin/"};}async function eu(e,t){if(void 0!==t&&""!==t){let{stdout:r}=await S("dnf",["search","-q",`${e}-${t}`]);if(""!==r.trim())return`${e}-${t}`;{let{stdout:r}=await S("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 ec(){return"linux"===process.platform&&(void 0===u&&(u=null!==p(rJ).sync("apt-get",{nothrow:!0})),u);}async function ep(e,t,r){switch(process.platform){case"win32":return eo("bazelisk",e);case"darwin":return en("bazelisk",e);case"linux":if(ea())throw Error("installing bazel on Arch linux is not supported yet");if(es())return await el([{name:"dnf-plugins-core"}]),T("dnf",["copr","enable","vbatts/bazel"]),el([{name:"bazel4"}]);if(ec()){let t=await Q("bazel-archive-keyring.gpg","https://bazel.build/bazel-release.pub.gpg");return T("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`]),H
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:
2024-02-17 15:11:59 +08:00
`),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,a=process.env.SETUP_CPP_DIR??C("~"),s=[],l=[],u=rK.create({autoloadLocales:!0});rK.addLocale(p(rW)),rz.addLocale(p(rY));let c=await s1();if(!function(e,t){let r=t.filter(t=>void 0!==e[t]),n=r.filter(t=>!e2(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,rX.error)("The same version must be used for llvm, clangformat and clangtidy"),1;ea()&&"string"==typeof i.cppcheck&&"string"==typeof i.gcovr&&((0,rX.info)("installing python-pygments to avoid conflicts with cppcheck and gcovr on Arch linux"),await ed("python-pygments"));let d=!1,f=!1;for(let e of ut){if(rV.isCI&&0!==l.length){f=!0;break;}let n=i[e];void 0!==n&&(t=Date.now(),d=await tW(e,n,c,o,a,s,l,6e4*parseFloat(i.timeout??"20")),r=Date.now(),(0,rX.info)("took "+(u.format(t,r)||"0 seconds")));}if(!f){let e=i.compiler;if(void 0!==e){let t=Date.now();await rf(e,c,a,o,s,d,l);let r=Date.now();(0,rX.info)("took "+(u.format(t,r)||"0 seconds"));}}if(await G(),0===s.length&&0===l.length)return(0,rX.warning)("setup-cpp was called without any arguments. Nothing to do."),0;if(s.forEach(e=>(0,rX.success)(e)),l.forEach(e=>(0,rX.error)(e)),(0,rX.info)("setup-cpp finished"),!rV.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 n,0===l.length?0:1;}var rm,rg,rv,rE,ry,rw,rb,rx,rS,rD,rN,rT,rR,rI,rO,rA,rC,r_,rL,r$,rP,rk,rU,rM,rF,rj,rq,rB,rG,rH,rV,rX,rz,rY,rK,rW,rJ,rQ,rZ,r0,r1,r3,r2,r4,r5,r6,r8,r9,r7,ne,nt,nr,nn,ni,no,na,ns,nl,nu,nc,np,nd,nf,nh,nm,ng,nv,nE,ny,nw,nb,nx,nS,nD,nN,nT,nR,nI,nO,nA,nC,n_,nL,n$,nP,nk,nU,nM,nF,nj,nq,nB,nG,nH,nV,nX,nz,nY,nK,nW,nJ,nQ,nZ,n0,n1,n3,n2,n4,n5,n6,n8,n9,n7,ie,it,ir,ii,io,ia,is,il,iu,ic,ip,id,ih,im,ig,iv=require("os"),iE=require("path"),iy=require("fs"),iw=require("crypto"),ib=require("http"),ix=require("https");require("net"),rE=require("tls"),ry=require("events"),rw=require("assert"),rb=require("util"),rx=require("fs"),rS=require("child_process"),rD=require("string_decoder"),rN=require("timers"),rT=require("buffer"),rR=require("path"),rI=require("child_process"),rO=require("process"),rA=require("url"),rC=require("os"),r_=require("buffer"),rL=require("stream"),r$=require("util"),rP=require("process"),rk=require("url"),rU=require("stream"),rM=require("stream/promises"),rF=require("console"),rq={},rB={},null==(rG=(rj=globalThis).parcelRequire810d)&&((rG=function(e){if(e in rq)return rq[e].exports;if(e in rB){var t=rB[e];delete rB[e];var r={id:e,exports:{}};return rq[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){rB[e]=t;},rj.parcelRequire810d=rG),(rH=rG.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=rG("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.e
Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);},e.exports.setOutput=function(e,t){if(process.env.GITHUB_OUTPUT)return s.issueFileCommand("OUTPUT",s.prepareKeyValueMessage(e,t));process.stdout.write(E.EOL),a.issueCommand("set-output",{name:e},l.toCommandValue(t));},e.exports.setCommandEcho=function(e){a.issue("echo",e?"on":"off");},e.exports.setFailed=function(e){process.exitCode=c.Failure,m(e);},e.exports.isDebug=function(){return"1"===process.env.RUNNER_DEBUG;},e.exports.debug=function(e){a.issueCommand("debug",{},e);},e.exports.error=m,e.exports.warning=function(e,t={}){a.issueCommand("warning",l.toCommandProperties(t),e instanceof Error?e.toString():e);},e.exports.notice=function(e,t={}){a.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){if(process.env.GITHUB_STATE)return s.issueFileCommand("STATE",s.prepareKeyValueMessage(e,t));a.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 u.OidcClient.getIDToken(e);});},p=rG("dTpO2"),Object.defineProperty(e.exports,"summary",{enumerable:!0,get:function(){return p.summary;}}),p=rG("dTpO2"),Object.defineProperty(e.exports,"markdownSummary",{enumerable:!0,get:function(){return p.markdownSummary;}}),d=rG("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;}});}),rH("dIPEE",function(e,t){var r,n,i,o;function a(e,t,r){let n=new l(e,t,r);process.stdout.write(n.toString()+s.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 s=i(iv);o=rG("i0ItD"),e.exports.issueCommand=a,e.exports.issue=function(e,t=""){a(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")));}}}),rH("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}:{};};}),rH("aSbHp",function(e,t){var r,n,i,o,a;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-02-17 15:11:59 +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=a.getIDTokenUrl();if(e){let r=encodeURIComponent(e);t=`${t}&audience=${r}`;}o.debug("ID token url is "+t);let r=yield a.getCall(t);return o.setSecret(r),r;}catch(e){throw Error("Error message: "+e.message);}});}}e.exports.OidcClient=a;}),rH("a7JAS",function(e,t){var r,n,i,o,a,s,l,u,c;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 a(e){try{l(n.next(e));}catch(e){o(e);}}function s(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(a,s);}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(ib),d=i(ix),f=i(rG("8gh3V")),h=i(rG("7i1qo"));(u=a=e.exports.HttpCodes||(e.exports.HttpCodes={}))[u.OK=200]="OK",u[u.MultipleChoices=300]="MultipleChoices",u[u.MovedPermanently=301]="MovedPermanently",u[u.ResourceMoved=302]="ResourceMoved",u[u.SeeOther=303]="SeeOther",u[u.NotModified=304]="NotModified",u[u.UseProxy=305]="UseProxy",u[u.SwitchProxy=306]="SwitchProxy",u[u.TemporaryRedirect=307]="TemporaryRedirect",u[u.PermanentRedirect=308]="PermanentRedirect",u[u.BadRequest=400]="BadRequest",u[u.Unauthorized=401]="Unauthorized",u[u.PaymentRequired=402]="PaymentRequired",u[u.Forbidden=403]="Forbidden",u[u.NotFound=404]="NotFound",u[u.MethodNotAllowed=405]="MethodNotAllowed",u[u.NotAcceptable=406]="NotAcceptable",u[u.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",u[u.RequestTimeout=408]="RequestTimeout",u[u.Conflict=409]="Conflict",u[u.Gone=410]="Gone",u[u.TooManyRequests=429]="TooManyRequests",u[u.InternalServerError=500]="InternalServerError",u[u.NotImplemented=501]="NotImplemented",u[u.BadGateway=502]="BadGateway",u[u.ServiceUnavailable=503]="ServiceUnavailable",u[u.GatewayTimeout=504]="GatewayTimeout",(c=s=e.exports.Headers||(e.exports.Headers={})).Accept="accept",c.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=[a.MovedPermanently,a.ResourceMoved,a.SeeOther,a.TemporaryRedirect,a.PermanentRedirect],g=[a.BadGateway,a.ServiceUnavailable,a.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){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
${t}`,oh=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),om=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),og=(e,t,r)=>{let n=""===r?"":`with ${r.trim()}() `,i=of.bind(null,n,t.toString());Object.defineProperty(i,"name",om),Object.defineProperty(e,"toString",{...oh,value:i});},ov=new WeakMap(),oE=(e,t={})=>{let r;if("function"!=typeof e)throw TypeError("Expected a function");let n=0,i=e.displayName||e.name||"<anonymous>",o=function(...a){if(ov.set(o,++n),1===n)r=e.apply(this,a),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))oc(e,t,n,r);od(e,t),og(e,t,n);}(o,e),ov.set(o,n),o;};oE.callCount=e=>{if(!ov.has(e))throw Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return ov.get(e);},ns=oE;const oy=()=>Array.from({length:ox-ob+1},ow),ow=(e,t)=>({name:"SIGRT"+(t+1),number:ob+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),ob=34,ox=64,oS=[{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}`:g,y=[E,t,e].filter(Boolean).join("\n");return v?(n.originalMessage=n.message,n.message=y):n=Error(y),n.shortMessage=E,n.command=a,n.escapedCommand=s,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=c&&!l,n;},oC=["stdin","stdout","stderr"],o_=e=>oC.some(t=>void 0!==e[t]),oL=e=>{if(!e)return;let{stdio:t}=e;if(void 0===t)return oC.map(t=>e[t]);if(o_(e))throw Error("It's not possible to provide `stdio` in combination with one of "+oC.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,oC.length)},(e,r)=>t[r]);};nl={};const o$=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(o$(nu=rj.process)){var oP,ok=rw,oU=rG("e1Rfe"),oM=/^win/i.test(nu.platform),oF=ry;"function"!=typeof oF&&(oF=oF.EventEmitter),nu.__signal_exit_emitter__?oP=nu.__signal_exit_emitter__:((oP=nu.__signal_exit_emitter__=new oF()).count=0,oP.emitted={}),oP.infinite||(oP.setMaxListeners(1/0),oP.infinite=!0);var oj=function(){oG&&o$(rj.process)&&(oG=!1,oU.forEach(function(e){try{nu.removeListener(e,oB[e]);}catch(e){}}),nu.emit=oz,nu.reallyExit=oV,oP.count-=1);};(nl=function(e,t){if(!o$(rj.process))return function(){};ok.equal(typeof e,"function","a callback must be provided for exit handler"),!1===oG&&oH();var r="exit";return t&&t.alwaysLast&&(r="afterexit"),oP.on(r,e),function(){oP.removeListener(r,e),0===oP.listeners("exit").length&&0===oP.listeners("afterexit").length&&oj();};}).unload=oj;var oq=function(e,t,r){oP.emitted[e]||(oP.emitted[e]=!0,oP.emit(e,t,r));},oB={};oU.forEach(function(e){oB[e]=function(){o$(rj.process)&&nu.listeners(e).length===oP.count&&(oj(),oq("exit",null,e),oq("afterexit",null,e),oM&&"SIGHUP"===e&&(e="SIGINT"),nu.kill(nu.pid,e));};}),nl.signals=function(){return oU;};var oG=!1,oH=function(){!oG&&o$(rj.process)&&(oG=!0,oP.count+=1,oU=oU.filter(function(e){try{return nu.on(e,oB[e]),!0;}catch(e){return!1;}}),nu.emit=oY,nu.reallyExit=oX);};nl.load=oH;var oV=nu.reallyExit,oX=function(e){o$(rj.process)&&(nu.exitCode=e||0,oq("exit",nu.exitCode,null),oq("afterexit",nu.exitCode,null),oV.call(nu,nu.exitCode));},oz=nu.emit,oY=function(e,t){if(!("exit"===e&&o$(rj.process)))return oz.apply(this,arguments);void 0!==t&&(nu.exitCode=t);var r=oz.apply(this,arguments);return oq("exit",nu.exitCode,null),oq("afterexit",nu.exitCode,null),r;};}else nl=function(){return function(){};};const oK=(e,t="SIGTERM",r={})=>{let n=e(t);return oW(e,t,r,n),n;},oW=(e,t,r,n)=>{if(!oJ(t,r,n))return;let i=setTimeout(()=>{e("SIGKILL");},oZ(r));i.unref&&i.unref();},oJ=(e,{forceKillAfterTimeout:t},r)=>oQ(e)&&!1!==t&&r,oQ=e=>e===p(rC).constants.signals.SIGTERM||"string"==typeof e&&"SIGTERM"===e.toUpperCase(),oZ=({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;},o0=(e,t)=>{e.kill()&&(t.isCanceled=!0);},o1=(e,t,r)=>{e.kill(t),r(Object.assign(Error("Timed out"),{timedOut:!0,signal:t}));},o3=(e,{timeout:t,killSignal:r="SIGTERM"},n)=>{let i;return 0===t||void 0===t?n:Promise.race([new Promise((n,o)=>{i=setTimeout(()=>{o1(e,r,o);},t);}),n.finally(()=>{clearTimeout(i);})]);},o2=({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})`);},o4=async(e,{cleanup:t,detached:r},n)=>{if(!t||r)return n;let i=p(nl)(()=>{e.kill();});return n.finally(()=>{i();});},o5=e=>e instanceof rI.ChildProcess&&"function"==typeof e.then,o6=(e,t,r)=>{if("string"==typeof r)return e[t].pipe((0,rx.createWriteStream)(r)),e;if(b
`);},aT=({env:e,extendEnv:t,preferLocal:r,localDir:n,execPath:i})=>{let o=t?{...p(rO).env,...e}:e;return r?y({env:o,cwd:n,execPath:i}):o;},aR=(e,t,r={})=>{let n=p(r4)._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||p(rO).cwd(),execPath:p(rO).execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:ax,...r}).env=aT(r),r.stdio=oL(r),"win32"===p(rO).platform&&"cmd"===p(rR).basename(e,".exe")&&t.unshift("/q"),{file:e,args:t,options:r,parsed:n};},aI=(e,t,r)=>"string"==typeof t||(0,rT.Buffer).isBuffer(t)?e.stripFinalNewline?v(t):t:void 0===r?void 0:"",aO=({input:e,inputFile:t,stdio:r})=>void 0===e&&void 0===t&&void 0===r?{stdin:"inherit"}:{},aA=(e={})=>({preferLocal:!0,...aO(e),...e});!function e(t){function r(n,...i){if(!Array.isArray(n))return e({...t,...n});let[o,...a]=ab(n,i);return S(o,a,aA(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]=ab(e,r);return D(n,i,aA(t));},r;}();const aC={stdio:"inherit",shell:!0},a_=/^~(?=$|\/|\\)/;rX=rG("ER74K"),nv={},nE=rG("bSUdl"),ny=rP.env.npm_package_json,nb=!!((nw=rP.env.npm_config_user_agent)&&nw.startsWith("npm")),nx=!!(ny&&ny.endsWith("package.json")),nS=nb||nx,nD=!!(nw&&nw.startsWith("yarn")),nN=nS||nD,nT=iv.homedir(),nR=process.env.XDG_CONFIG_HOME||iE.join(nT,".config","simple-update-notifier"),nI=function(e){return iE.join(nR,"".concat(e.replace("@","").replace("/","__"),".json"));},nO=function(){iy.existsSync(nR)||iy.mkdirSync(nR,{recursive:!0});},nA=function(e){var t=nI(e);try{if(!iy.existsSync(t))return;return JSON.parse(iy.readFileSync(t,"utf8")).lastUpdateCheck;}catch(e){return;}},nC=function(e){var t=nI(e);iy.writeFileSync(t,JSON.stringify({lastUpdateCheck:new Date().getTime()}));},n_=function(e,t){return _(void 0,void 0,void 0,function(){var r;return L(this,function(n){return r="https://registry.npmjs.org/-/package/".concat(e,"/dist-tags"),[2,new Promise(function(e,n){ix.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);});})];});});},nL=function(e){var t=e.pkg,r=e.updateCheckInterval,n=void 0===r?864e5:r,i=e.distTag,o=void 0===i?"latest":i,a=e.alwaysRun,s=e.debug;return _(void 0,void 0,void 0,function(){var e,r;return L(this,function(i){switch(i.label){case 0:if(nO(),e=nA(t.name),!(a||!e||e<new Date().getTime()-n))return[3,2];return[4,n_(t.name,o)];case 1:if(r=i.sent(),nC(t.name),nE.gt(r,t.version))return[2,r];return s&&console.error("Latest version (".concat(r,") not newer than current version (").concat(t.version,")")),[3,3];case 2:s&&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];}});});},n$=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");},nv=function(e){return _(void 0,void 0,void 0,function(){var t,r;return L(this,function(n){switch(n.label){case 0:if(!e.alwaysRun&&(!process.stdout.isTTY||nN&&!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,nL(e)];case 2:return(t=n.sent())&&console.error(n$("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];}});});},nP={},nP=JSON.parse('{"name":"setup-cpp","version":"0.36.2"}'),nk=rG("4t50X"),rX=rG("ER74K"),rV
${n.message}`:h,v=[g,t,e].filter(Boolean).join("\n");return m?(n.originalMessage=n.message,n.message=v):n=Error(v),n.shortMessage=g,n.command=a,n.escapedCommand=s,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=u,n.killed=c&&!l,n;},aP=["stdin","stdout","stderr"],ak=e=>aP.some(t=>void 0!==e[t]),aU=e=>{if(!e)return;let{stdio:t}=e;if(void 0===t)return aP.map(t=>e[t]);if(ak(e))throw Error("It's not possible to provide `stdio` in combination with one of "+aP.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,aP.length)},(e,r)=>t[r]);},aM=(e,t="SIGTERM",r={})=>{let n=e(t);return aF(e,t,r,n),n;},aF=(e,t,r,n)=>{if(!aj(t,r,n))return;let i=setTimeout(()=>{e("SIGKILL");},aB(r));i.unref&&i.unref();},aj=(e,{forceKillAfterTimeout:t},r)=>aq(e)&&!1!==t&&r,aq=e=>e===p(rC).constants.signals.SIGTERM||"string"==typeof e&&"SIGTERM"===e.toUpperCase(),aB=({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;},aG=(e,t)=>{e.kill()&&(t.isCanceled=!0);},aH=(e,t,r)=>{e.kill(t),r(Object.assign(Error("Timed out"),{timedOut:!0,signal:t}));},aV=(e,{timeout:t,killSignal:r="SIGTERM"},n)=>{let i;return 0===t||void 0===t?n:Promise.race([new Promise((n,o)=>{i=setTimeout(()=>{aH(e,r,o);},t);}),n.finally(()=>{clearTimeout(i);})]);},aX=({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})`);},az=async(e,{cleanup:t,detached:r},n)=>{if(!t||r)return n;let i=p(nl)(()=>{e.kill();});return n.finally(()=>{i();});},aY=e=>e instanceof rI.ChildProcess&&"function"==typeof e.then,aK=(e,t,r)=>{if("string"==typeof r)return e[t].pipe((0,rx.createWriteStream)(r)),e;if(b(r))return e[t].pipe(r),e;if(!aY(r))throw TypeError("The second argument must be a string, a stream or an Execa child process.");if(!b(r.stdin))throw TypeError("The target child process's stdin must be available.");return e[t].pipe(r.stdin),r;},aW=e=>{null!==e.stdout&&(e.pipeStdout=aK.bind(void 0,e,"stdout")),null!==e.stderr&&(e.pipeStderr=aK.bind(void 0,e,"stderr")),void 0!==e.all&&(e.pipeAll=aK.bind(void 0,e,"all"));},aJ=e=>{if(void 0!==e)throw TypeError("The `input` and `inputFile` options cannot be both set.");},aQ=({input:e,inputFile:t})=>"string"!=typeof t?e:(aJ(e),(0,rx.readFileSync)(t)),aZ=e=>{let t=aQ(e);if(w(t))throw TypeError("The `input` option cannot be a stream in sync mode");return t;},a0=({input:e,inputFile:t})=>"string"!=typeof t?e:(aJ(e),(0,rx.createReadStream)(t)),a1=(e,t)=>{let r=a0(t);void 0!==r&&(w(r)?r.pipe(e.stdin):e.stdin.end(r));},a3=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;let r=p(nm)();return e.stdout&&r.add(e.stdout),e.stderr&&r.add(e.stderr),r;},a2=async(e,t)=>{if(e&&void 0!==t){e.destroy();try{return await t;}catch(e){return e.bufferedData;}}},a4=(e,{encoding:t,buffer:r,maxBuffer:n})=>{if(e&&r)return t?p(nc)(e,{encoding:t,maxBuffer:n}):p(nc).buffer(e,{maxBuffer:n});},a5=async({stdout:e,stderr:t,all:r},{encoding:n,buffer:i,maxBuffer:o},a)=>{let s=a4(e,{encoding:n,buffer:i,maxBuffer:o}),l=a4(t,{encoding:n,buffer:i,maxBuffer:o}),u=a4(r,{encoding:n,buffer:i,maxBuffer:2*o});try{return await Promise.all([a,s,l,u]);}catch(n){return Promise.all([{error:n,signal:n.signal,timedOut:n.timedOut},a2(e,s),a2(t,l),a2(r,u)]);}},a6=(async()=>{})().constructor.prototype,a8=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(a6,e)]),a9=(e,t)=>{for(let[r,n]of a8){let i="function"==typeof t?(...e)=>Reflect.apply(n.value,t(),e):n.value.bind(t);Reflect.defineProperty(e,r,{...n,value:i});}},a7=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)
`);},sd=({env:e,extendEnv:t,preferLocal:r,localDir:n,execPath:i})=>{let o=t?{...p(rO).env,...e}:e;return r?y({env:o,cwd:n,execPath:i}):o;},sf=(e,t,r={})=>{let n=p(r4)._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||p(rO).cwd(),execPath:p(rO).execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:sl,...r}).env=sd(r),r.stdio=aU(r),"win32"===p(rO).platform&&"cmd"===p(rR).basename(e,".exe")&&t.unshift("/q"),{file:e,args:t,options:r,parsed:n};},sh=(e,t,r)=>"string"==typeof t||(0,rT.Buffer).isBuffer(t)?e.stripFinalNewline?v(t):t:void 0===r?void 0:"",sm=({input:e,inputFile:t,stdio:r})=>void 0===e&&void 0===t&&void 0===r?{stdin:"inherit"}:{},sg=(e={})=>({preferLocal:!0,...sm(e),...e});!function e(t){function r(n,...i){if(!Array.isArray(n))return e({...t,...n});let[o,...a]=ss(n,i);return k(o,a,sg(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]=ss(e,r);return function(e,t,r){let n;let i=sf(e,t,r),o=sr(e,t),a=sn(e,t);sp(a,i.options);let s=aZ(i.options);try{n=p(rI).spawnSync(i.file,i.args,{...i.options,input:s});}catch(e){throw a$({error:e,stdout:"",stderr:"",all:"",command:o,escapedCommand:a,parsed:i,timedOut:!1,isCanceled:!1,killed:!1});}let l=sh(i.options,n.stdout,n.error),u=sh(i.options,n.stderr,n.error);if(n.error||0!==n.status||null!==n.signal){let e=a$({stdout:l,stderr:u,error:n.error,signal:n.signal,exitCode:n.status,command:o,escapedCommand:a,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:a,exitCode:0,stdout:l,stderr:u,failed:!1,timedOut:!1,isCanceled:!1,killed:!1};}(n,i,sg(t));},r;}(),nU={};const sv="win32"!==iv.platform(),sE=iv.release(),sy=(e="",t="")=>/1\d+\.\d+/.test(e)&&+t>=17134.1184;nU=function(e){return sv?e.replace(/(\s+)/g,"\\$1"):sy(.../(\d+\.\d+)\.(\d+)/.exec(sE).splice(1))?e:e.replace(/(\s+)/g,"%20");},function(){var e,t;e=rG("i8A01"),t=function(e){return e.split("").reverse().join("");},nM=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(nM={}),nF=rG("kY0n1");const sw={shouldEscapeSpace:!1,shouldAddOnlyIfNotDefined:!1},sb=[/\/usr\/bin\/?/,/\/usr\/local\/bin\/?/],sx=C("~/.cpprc");let sS=!1;nF=rG("kY0n1"),nj=rG("iNGpn"),rX=rG("ER74K");const{appendFile:sD}=iy.promises;let sN=!1,sT=!1;const sR=["E: Could not get lock","dpkg: error processing archive","dpkg: error: dpkg status database is locked by another process"];(rm=nq||(nq={}))[rm.NameDashVersion=0]="NameDashVersion",rm[rm.NameEqualsVersion=1]="NameEqualsVersion",rm[rm.Name=2]="Name",rm[rm.None=3]="None",nk=rG("4t50X"),nB=rG("bzNgi"),nB=rG("bzNgi"),nG=rG("hZdK0");let sI=!1;nF=rG("kY0n1"),nB=rG("bzNgi"),rX=rG("ER74K");let sO=!1;rX=rG("ER74K"),rX=rG("ER74K");let sA=!1,sC=!1;const s_=/Version\s*:\s*(.*)/g;nH={},nV=iE.resolve(__dirname,"../../node_modules/@actions/tool-cache/lib"),nX=nH&&nH.__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];}),nz=nH&&nH.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t});}:function(e,t){e.default=t;}),nY=nH&&nH.__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)&&nX(t,e,r);return nz(t,e),t;},nK=nH&&nH.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(e){try{l(n.next(e));}catch(e){o(e);}}function s(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(a,s);}l((n=n.apply(e,t||[])).next());});},nW=nH&&nH.__importDefault||function(e){return e&&e.__esModule?e:{default:e};},Object.defineProperty(nH,"__e
2023-07-16 06:41:58 +08:00
//# sourceMappingURL=setup-cpp.js.map