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

39 lines
239 KiB
JavaScript
Raw Normal View History

2023-07-16 06:41:58 +08:00
#!/usr/bin/env node
2024-02-17 17:30:22 +08:00
let e,t,r,n,i,o,s,a;function l(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0});}function c(e){return e&&e.__esModule?e.default:e;}function u(e,t,r){if("function"==typeof t&&(r=t,t={}),!r){if("function"!=typeof Promise)throw TypeError("callback not provided");return new Promise(function(r,n){u(e,t||{},function(e,t){e?n(e):r(t);});});}rM(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=rj.sync(e.command,{path:n[rG({env:n})],pathExt:t?n1.delimiter:void 0});}catch(e){}finally{s&&process.chdir(i);}return r&&(r=n1.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 iS&&1===e&&!t.file?d(t.original,"spawn"):null;}function h(e,t,r){let n=rk(e,t,r),i=rt.spawn(n.command,n.args,n.options);return rz.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(ra).env,...t}={}){let r=v({env:e={...e}});return t.path=e[r],e[r]=function(e={}){let t;let{cwd:r=c(ra).cwd(),path:n=c(ra).env[v()],execPath:i=c(ra).execPath}=e,o=i instanceof URL?c(rl).fileURLToPath(i):i,s=r instanceof URL?c(rl).fileURLToPath(r):r,a=c(ro).resolve(s),l=[];for(;t!==a;)l.push(c(ro).join(a,"node_modules/.bin")),t=a,a=c(ro).resolve(a,"..");return l.push(c(ro).resolve(s,o,"..")),[...l,n].join(c(ro).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=r0(t);return await new Promise((t,i)=>{let o=e=>{e&&n.getBufferedLength()<=rJ.MAX_LENGTH&&(e.bufferedData=n.getBufferedValue()),i(e);};(async()=>{try{await od(e,n),t();}catch(e){o(e);}})(),n.on("data",()=>{n.getBufferedLength()>r&&o(new of());});}),n.getBufferedValue();}function x(e,t,r){let n;let i=oG(e,t,r),o=oC(e,t),s=o$(e,t);oF(s,i.options),oa(i.options);try{n=c(rs).spawn(i.file,i.args,i.options);}catch(t){let e=new(c(rs).ChildProcess)();return oR(e,Promise.reject(iq({error:t,stdout:"",stderr:"",all:"",command:o,escapedCommand:s,parsed:i,timedOut:!1,isCanceled:!1,killed:!1}))),e;}let a=oO(n),l=os(n,i.options,a),u=ol(n,i.options,l),p={isCanceled:!1};n.kill=i7.bind(null,n.kill.bind(n)),n.cancel=oi.bind(null,n,p);let d=rW(async()=>{let[{error:e,exitCode:t,signal:r,timedOut:a},l,c,d]=await ob(n,i.options,u),f=oB(i.options,l),h=oB(i.options,c),m=oB(i.options,d);if(e||0!==t||null!==r){let l=iq({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 oE(n,i.options),n.all=oy(n,i.options),op(n),oR(n,d),n;}function b(e,t,r){let n;let i=oG(e,t,r),o=oC(e,t),s=o$(e,t);oF(s,i.options);let a=ov(i.options);try{n=c(rs).spawnSync(i.file,i.args,{...i.options,input:a});}catch(e){throw iq({error:e,stdout:"",stderr:"",all:"",command:o,escapedCommand:s,parsed:i,timedOut:!1,isCanceled:!1,killed:!1});}let l=oB(i.options,n.stdout,n.error),u=oB(i.options,n.stderr,n.error);if(n.error||0!==n.status||null!==n.signal){let e=iq({stdout:l,stderr:u,error:n.error,signal:n.signal,exitCode:n.status,command:o,escapedCommand:s,parsed:i,timedOut:n.er
2023-07-16 06:41:58 +08:00
if [ -z "\${${e}}" ]; then export ${e}="${n}"; fi
2024-02-17 17:30:22 +08:00
`),(0,nf.info)(`if not defined ${e} then ${e}="${n}" was added to "${sk}`)):((0,n2.appendFileSync)(sk,`
2023-07-16 06:41:58 +08:00
export ${e}="${n}"
2024-02-17 17:30:22 +08:00
`),(0,nf.info)(`${e}="${n}" was added to "${sk}`));return;}process.env[e]=n;}async function F(e){switch(process.platform){case"win32":await D(`$USER_PATH=([Environment]::GetEnvironmentVariable("PATH", "User")); [Environment]::SetEnvironmentVariable("PATH", "${e};$USER_PATH", "User")`),(0,nf.info)(`"${e}" was added to the PATH.`);return;case"linux":case"darwin":await M(),(0,n2.appendFileSync)(sk,`
2023-07-16 06:41:58 +08:00
export PATH="${e}:$PATH"
2024-02-17 17:30:22 +08:00
`),(0,nf.info)(`"${e}" was added to "${sk}"`);return;default:return;}}async function M(){if(sU)return;let e="# Automatically Generated by setup-cpp\nexport SOURCE_CPPRC=0";if((await(0,nv.pathExists)(sk))&&(0,n2.readFileSync)(sk,"utf8").includes(e))return;(0,n2.appendFileSync)(sk,`
2023-07-16 06:41:58 +08:00
${e}
2024-02-17 17:30:22 +08:00
`),(0,nf.info)(`Added ${e} to ${sk}`);let t=`
2023-07-16 06:41:58 +08:00
# source .cpprc if SOURCE_CPPRC is not set to 0
2024-02-17 17:30:22 +08:00
if [[ "$SOURCE_CPPRC" != 0 && -f "${sk}" ]]; then source "${sk}"; fi
`;try{let e=C("~/.profile");(0,n2.appendFileSync)(e,t),(0,nf.info)(`${t} was added to ${e}`);let r=C("~/.bashrc");(0,n2.appendFileSync)(r,t),(0,nf.info)(`${t} was added to ${r}`);}catch(e){(0,rb.warning)(`Failed to add ${t} to .profile or .bashrc. You should add it manually: ${e}`);}sU=!0;}async function G(){if(await(0,nv.pathExists)(sk)){let e=[...new Set((0,n2.readFileSync)(sk,"utf-8").split("\n").reverse())].reverse();(0,n2.writeFileSync)(sk,e.join("\n")),await A(sk);}}async function B(e,t=!1){let r;let n=V()?"nala":"apt-get";for(let{name:t,version:r}of e)(0,rb.info)(`Installing ${t} ${null!=r?r:""} via ${n}`);process.env.DEBIAN_FRONTEND="noninteractive",(!sF||t)&&(X(n),sF=!0),sM||(await z(n),sM=!0);let i=[...new Set(e.flatMap(e=>{var t;return null!==(t=e.repositories)&&void 0!==t?t:[];}))];if(0!==i.length){for(let e of i)I("add-apt-repository",["-y",e]);X(n);}let o=await Promise.all(e.map(e=>q(e.name,e.version)));try{I(n,["install","--fix-broken","-y",...o]);}catch(e){if("stderr"in e){let t=e.stderr;sG.some(e=>t.includes(e))&&((0,rb.warning)(`Failed to install packages ${o}. Retrying...`),I(n,["install","--fix-broken","-y",...o]));}else throw e;}return{binDir:"/usr/bin/"};}async function H(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 q(e,t){switch(await H(e,t)){case 0:return`${e}-${t}`;case 1:return`${e}=${t}`;case 2:return e;default:throw Error(`Could not find package ${e} ${null!=t?t:""}`);}}function V(){return null!==c(rT).sync("nala",{nothrow:!0});}function X(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=[K(["3B4FE6ACC0B21F32","40976EAF437D05B5"],"setup-cpp-ubuntu-archive.gpg"),K(["1E9377A2BA9EF27F"],"launchpad-toolchain.gpg")];"nala"===e&&t.push(k("LANG","C.UTF-8",{shouldAddOnlyIfNotDefined:!0}),k("LC_ALL","C.UTF-8",{shouldAddOnlyIfNotDefined:!0})),await Promise.all(t);}function W(){I("gpg",["-k"]);}async function K(e,t,r="keyserver.ubuntu.com"){try{let n="/etc/apt/trusted.gpg.d/"+t;return(await(0,nv.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,rb.warning)(`Failed to add apt key via server ${r}: ${e}`);return;}}async function Y(e,t){let r="/etc/apt/trusted.gpg.d/"+e;return(await(0,nv.pathExists)(r))||(W(),await B([{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 Q(e,t,r=40){return rx.GITHUB_ACTIONS?R("update-alternatives",["--install","/usr/bin/"+e,e,t,r.toString()]):(await M(),sj(sk,`
if [ $UID -eq 0 ]; then update-alternatives --install /usr/bin/${e} ${e} ${t} ${r}; fi
`));}async function J(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 Z(e,r,n){if(!["darwin","linux"].includes(process.platform))return;if("string"==typeof t)return{binDir:t};let i=c(rT).sync("brew",{nothrow:!0});if(null!==i)return{binDir:t=(0,ny.dirname)(i)};let o=c(n1).join((0,n0.tmpdir)(),"setup-cpp","brew");await(0,nw.mkdirP)(o),b("curl",["-LJO","https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh"],{cwd:o});let s=(0,n1.join)(o,"install.sh");return"linux"===process.platform&&(0,n2.readFileSync)(s,"utf-8").replace("#!/bin/bash",""),b("/bin/bash",[s],{stdio:"inherit",env:{NONINTERACTIVE:"1"}}),t=ee(),await U(t),{binDir:t};}function ee(){return"linux"===process.platform?"/home/linuxbrew/.linuxbrew/bin/":"/usr/local/bin/";}async function et(e,t,r=[]){(0,nf.info)(`Installing ${e} ${null!=t?t:""} via brew`),sB&&null!==c(rT).sync("brew",{nothrow:!0})||(await Z("","",process.arch),sB=!0);let n=ee();return b((0,ny.join)(n,"brew"),["install",void 0!==t&&""!==t?`${e}@${t}`:e,...r],{stdio:"inherit"}),{binDir:n};}async function er(e,t,n){var i;if("win32"!==process.platform)return;if("string"==typeof r)return{binDir:r};let o=c(rT).sync("choco",{nothrow:!0});if(null!==o)return{binDir:r=(0,ny.dirname)(o)};let s="powershell.exe",a=c(rT).sync(`${process.env.SystemRoot}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,{nothrow:!0});null!==a&&(s=a),b(s,["-NoProfile","-InputFormat","None","-ExecutionPolicy","Bypass","-Command","[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))"],{stdio:"inherit"});let l=`${process.env.ALLUSERSPROFILE}\\chocolatey\\bin`;await U(l);let u=c(rT).sync("choco",{nothrow:!0});if(r=null!==u?(0,ny.dirname)(u):`${null!==(i=process.env.ChocolateyInstall)&&void 0!==i?i:"C:/ProgramData/chocolatey"}/bin`,await(0,nv.pathExists)(r))return{binDir:r};}async function en(e,t,r=[]){var n;(0,rb.info)(`Installing ${e} ${null!=t?t:""} via chocolatey`),sH&&null!==c(rT).sync("choco",{nothrow:!0})||(await er("","",process.arch),sH=!0);let i=process.env.PATH,o={...process.env};if(delete o.TMP,delete o.TEMP,delete o.Path,o.PATH=i,void 0!==t&&""!==t)b("choco",["install","-y",e,"--version="+t,...r],{env:o,extendEnv:!1,stdio:"inherit"});else try{b("choco",["install","-y",e,...r],{env:o,extendEnv:!1,stdio:"inherit"});}catch(t){if(t.message.includes("exit code 3010"))(0,rb.info)(`${e} might require a reboot for the completion of the installation.`);else throw t;}let s=`${null!==(n=process.env.ChocolateyInstall)&&void 0!==n?n:"C:/ProgramData/chocolatey"}/bin`;return await U(s),{binDir:s};}function ei(){return"linux"===process.platform&&(void 0===o&&(o=null!==c(rT).sync("pacman",{nothrow:!0})),o);}function eo(){return"linux"===process.platform&&(void 0===s&&(s=null!==c(rT).sync("dnf",{nothrow:!0})),s);}async function es(e){for(let{name:t,version:r}of e)(0,rb.info)(`Installing ${t} ${null!=r?r:""} via dnf`);return I("dnf",["-y","install",...(await Promise.all(e.map(e=>ea(e.name,e.version))))]),{binDir:"/usr/bin/"};}async function ea(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,rb.warning)(`Failed to install ${e} ${t} via dnf, trying without version`);}}return e;}function el(){return"linux"===process.platform&&(void 0===a&&(a=null!==c(rT).sync("apt-get",{nothrow:!0})),a);}async function ec(e,t,r){switch(process.platform){case"win32":return en("bazelisk",e);case"darwin":return et("bazelisk",e);case"linux":if(ei())throw Error("installing bazel on Arch linux is not supported yet");if(eo())return await es([{name:"dnf-plugins-core"}]),I("dnf",["copr","enable","vbatts/bazel"]),es([{name:"bazel4"}]);if(el()){let t=await Y("bazel-archive-keyring.gpg","https://bazel.build/bazel-release.pub.gpg");return I("bash",["-c",`echo "deb [arch=amd64 signed-b
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 17:30:22 +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 l=null!==(t=a.architecture)&&void 0!==t?t:process.arch,u=null!==(r=process.env.SETUP_CPP_DIR)&&void 0!==r?r:C("~"),p=[],d=[],f=rR.create({autoloadLocales:!0});rR.addLocale(c(rO)),rS.addLocale(c(rI));let h=await ao();if(!function(e,t){let r=t.filter(t=>void 0!==e[t]),n=r.filter(t=>!e1(e[t])),i=n.length>=1?e[n[0]]:"true";return!n.some(t=>e[t]!==i)&&(r.forEach(t=>{e[t]=i;}),!0);}(a,["llvm","clangtidy","clangformat"]))return(0,rb.error)("The same version must be used for llvm, clangformat and clangtidy"),1;ei()&&"string"==typeof a.cppcheck&&"string"==typeof a.gcovr&&((0,rb.info)("installing python-pygments to avoid conflicts with cppcheck and gcovr on Arch linux"),await eu("python-pygments"));let m=!1,v=!1;for(let e of aJ){if(rx.isCI&&0!==d.length){v=!0;break;}let t=a[e];void 0!==t&&(i=Date.now(),m=await tC(e,t,h,l,u,p,d,6e4*parseFloat(null!==(n=a.timeout)&&void 0!==n?n:"20")),o=Date.now(),(0,rb.info)("took "+(f.format(i,o)||"0 seconds")));}if(!v){let e=a.compiler;if(void 0!==e){let t=Date.now();await t2(e,h,u,l,p,m,d);let r=Date.now();(0,rb.info)("took "+(f.format(t,r)||"0 seconds"));}}if(await G(),0===p.length&&0===d.length)return(0,rb.warning)("setup-cpp was called without any arguments. Nothing to do."),0;if(p.forEach(e=>(0,rb.success)(e)),d.forEach(e=>(0,rb.error)(e)),(0,rb.info)("setup-cpp finished"),!rx.GITHUB_ACTIONS)switch(process.platform){case"win32":(0,rb.warning)("Run `RefreshEnv.cmd` or restart your shell to update the environment.");break;case"linux":case"darwin":(0,rb.warning)("Run `source ~/.cpprc` or restart your shell to update the environment.");}return await s,0===d.length?0:1;}var t3,t6,t8,t5,t9,t7,re,rt,rr,rn,ri,ro,rs,ra,rl,rc,ru,rp,rd,rf,rh,rm,rv,rg,rE,ry,rw,rx,rb,rS,rI,rR,rO,rT,rA,rC,r$,r_,rP,rN,rL,rD,rk,rU,rj,rF,rM,rG,rB,rH,rq,rV,rX,rz,rW,rK,rY,rQ,rJ,rZ,r0,r1,r2,r4,r3,r6,r8,r5,r9,r7,ne,nt,nr,nn,ni,no,ns,na,nl,nc,nu,np,nd,nf,nh,nm,nv,ng,nE,ny,nw,nx,nb,nS,nI,nR,nO,nT,nA,nC,n$,n_,nP,nN,nL,nD,nk,nU,nj,nF,nM,nG,nB,nH,nq,nV,nX,nz,nW,nK,nY,nQ,nJ,nZ,n0=require("os"),n1=require("path"),n2=require("fs"),n4=require("crypto"),n3=require("http"),n6=require("https");require("net"),t8=require("tls"),t5=require("events"),t9=require("assert"),t7=require("util"),re=require("fs"),rt=require("child_process"),rr=require("string_decoder"),rn=require("timers"),ri=require("buffer"),ro=require("path"),rs=require("child_process"),ra=require("process"),rl=require("url"),rc=require("os"),ru=require("buffer"),rp=require("stream"),rd=require("util"),rf=require("process"),rh=require("url"),rm=require("console"),rg={},rE={},null==(ry=(rv=globalThis).parcelRequire810d)&&((ry=function(e){if(e in rg)return rg[e].exports;if(e in rE){var t=rE[e];delete rE[e];var r={id:e,exports:{}};return rg[e]=r,t.call(r.exports,r,r.exports),r.exports;}var n=Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n;}).register=function(e,t){rE[e]=t;},rv.parcelRequire810d=ry),(rw=ry.register)("dAuy6",function(e,t){var r;function n(e){return"string"==typeof e?!!i[e]:"env"in e?i[e.env]&&i[e.env].includes(e.includes):"any"in e?e.any.some(function(e){return!!i[e];}):Object.keys(e).every(function(t){return i[t]===e[t];});}r=ry("5vZJI");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
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=ry("dV9Cu"),Object.defineProperty(e.exports,"summary",{enumerable:!0,get:function(){return p.summary;}}),p=ry("dV9Cu"),Object.defineProperty(e.exports,"markdownSummary",{enumerable:!0,get:function(){return p.markdownSummary;}}),d=ry("9i0tI"),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;}});}),rw("1g3mY",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(n0);o=ry("5nnws"),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")));}}}),rw("5nnws",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}:{};};}),rw("8prV6",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}
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;}),rw("eamjo",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(n3),d=i(n6),f=i(ry("jnrYh")),h=i(ry("3RDK7"));(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-02-17 17:30:22 +08:00
${t}`,iA=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),iC=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),i$=(e,t,r)=>{let n=""===r?"":`with ${r.trim()}() `,i=iT.bind(null,n,t.toString());Object.defineProperty(i,"name",iC),Object.defineProperty(e,"toString",{...iA,value:i});},i_=new WeakMap(),iP=(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(i_.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))iI(e,t,n,r);iO(e,t),i$(e,t,n);}(o,e),i_.set(o,n),o;};iP.callCount=e=>{if(!i_.has(e))throw Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return i_.get(e);},rW=iP;const iN=()=>Array.from({length:ik-iD+1},iL),iL=(e,t)=>({name:"SIGRT"+(t+1),number:iD+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),iD=34,ik=64,iU=[{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;},iV=["stdin","stdout","stderr"],iX=e=>iV.some(t=>void 0!==e[t]),iz=e=>{if(!e)return;let{stdio:t}=e;if(void 0===t)return iV.map(t=>e[t]);if(iX(e))throw Error("It's not possible to provide `stdio` in combination with one of "+iV.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,iV.length)},(e,r)=>t[r]);};rK={};const iW=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(iW(rY=rv.process)){var iK,iY=t9,iQ=ry("dVIKq"),iJ=/^win/i.test(rY.platform),iZ=t5;"function"!=typeof iZ&&(iZ=iZ.EventEmitter),rY.__signal_exit_emitter__?iK=rY.__signal_exit_emitter__:((iK=rY.__signal_exit_emitter__=new iZ()).count=0,iK.emitted={}),iK.infinite||(iK.setMaxListeners(1/0),iK.infinite=!0);var i0=function(){i4&&iW(rv.process)&&(i4=!1,iQ.forEach(function(e){try{rY.removeListener(e,i2[e]);}catch(e){}}),rY.emit=i5,rY.reallyExit=i6,iK.count-=1);};(rK=function(e,t){if(!iW(rv.process))return function(){};iY.equal(typeof e,"function","a callback must be provided for exit handler"),!1===i4&&i3();var r="exit";return t&&t.alwaysLast&&(r="afterexit"),iK.on(r,e),function(){iK.removeListener(r,e),0===iK.listeners("exit").length&&0===iK.listeners("afterexit").length&&i0();};}).unload=i0;var i1=function(e,t,r){iK.emitted[e]||(iK.emitted[e]=!0,iK.emit(e,t,r));},i2={};iQ.forEach(function(e){i2[e]=function(){iW(rv.process)&&rY.listeners(e).length===iK.count&&(i0(),i1("exit",null,e),i1("afterexit",null,e),iJ&&"SIGHUP"===e&&(e="SIGINT"),rY.kill(rY.pid,e));};}),rK.signals=function(){return iQ;};var i4=!1,i3=function(){!i4&&iW(rv.process)&&(i4=!0,iK.count+=1,iQ=iQ.filter(function(e){try{return rY.on(e,i2[e]),!0;}catch(e){return!1;}}),rY.emit=i9,rY.reallyExit=i8);};rK.load=i3;var i6=rY.reallyExit,i8=function(e){iW(rv.process)&&(rY.exitCode=e||0,i1("exit",rY.exitCode,null),i1("afterexit",rY.exitCode,null),i6.call(rY,rY.exitCode));},i5=rY.emit,i9=function(e,t){if(!("exit"===e&&iW(rv.process)))return i5.apply(this,arguments);void 0!==t&&(rY.exitCode=t);var r=i5.apply(this,arguments);return i1("exit",rY.exitCode,null),i1("afterexit",rY.exitCode,null),r;};}else rK=function(){return function(){};};const i7=(e,t="SIGTERM",r={})=>{let n=e(t);return oe(e,t,r,n),n;},oe=(e,t,r,n)=>{if(!ot(t,r,n))return;let i=setTimeout(()=>{e("SIGKILL");},on(r));i.unref&&i.unref();},ot=(e,{forceKillAfterTimeout:t},r)=>or(e)&&!1!==t&&r,or=e=>e===c(rc).constants.signals.SIGTERM||"string"==typeof e&&"SIGTERM"===e.toUpperCase(),on=({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;},oi=(e,t)=>{e.kill()&&(t.isCanceled=!0);},oo=(e,t,r)=>{e.kill(t),r(Object.assign(Error("Timed out"),{timedOut:!0,signal:t}));},os=(e,{timeout:t,killSignal:r="SIGTERM"},n)=>{let i;return 0===t||void 0===t?n:Promise.race([new Promise((n,o)=>{i=setTimeout(()=>{oo(e,r,o);},t);}),n.finally(()=>{clearTimeout(i);})]);},oa=({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})`);},ol=async(e,{cleanup:t,detached:r},n)=>{if(!t||r)return n;let i=c(rK)(()=>{e.kill();});return n.finally(()=>{i();});},oc=e=>e instanceof rs.ChildProcess&&"function"==typeof e.then,ou=(e,t,r)=>{if("string"==typeof r)return e[t].pipe((0,re.createWriteStream)(r)),e;if(y
`);},oM=({env:e,extendEnv:t,preferLocal:r,localDir:n,execPath:i})=>{let o=t?{...c(ra).env,...e}:e;return r?g({env:o,cwd:n,execPath:i}):o;},oG=(e,t,r={})=>{let n=c(rD)._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(ra).cwd(),execPath:c(ra).execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:ok,...r}).env=oM(r),r.stdio=iz(r),"win32"===c(ra).platform&&"cmd"===c(ro).basename(e,".exe")&&t.unshift("/q"),{file:e,args:t,options:r,parsed:n};},oB=(e,t,r)=>"string"==typeof t||(0,ri.Buffer).isBuffer(t)?e.stripFinalNewline?m(t):t:void 0===r?void 0:"",oH=({input:e,inputFile:t,stdio:r})=>void 0===e&&void 0===t&&void 0===r?{stdin:"inherit"}:{},oq=(e={})=>({preferLocal:!0,...oH(e),...e});!function e(t){function r(n,...i){if(!Array.isArray(n))return e({...t,...n});let[o,...s]=oD(n,i);return x(o,s,oq(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]=oD(e,r);return b(n,i,oq(t));},r;}();const oV={stdio:"inherit",shell:!0},oX=/^~(?=$|\/|\\)/;rb=ry("hHq4F"),r3={},r6=ry("coVwk"),r8=rf.env.npm_package_json,r9=!!((r5=rf.env.npm_config_user_agent)&&r5.startsWith("npm")),r7=!!(r8&&r8.endsWith("package.json")),ne=r9||r7,nt=!!(r5&&r5.startsWith("yarn")),nr=ne||nt,nn=n0.homedir(),ni=process.env.XDG_CONFIG_HOME||n1.join(nn,".config","simple-update-notifier"),no=function(e){return n1.join(ni,"".concat(e.replace("@","").replace("/","__"),".json"));},ns=function(){n2.existsSync(ni)||n2.mkdirSync(ni,{recursive:!0});},na=function(e){var t=no(e);try{if(!n2.existsSync(t))return;return JSON.parse(n2.readFileSync(t,"utf8")).lastUpdateCheck;}catch(e){return;}},nl=function(e){var t=no(e);n2.writeFileSync(t,JSON.stringify({lastUpdateCheck:new Date().getTime()}));},nc=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){n6.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);});})];});});},nu=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(ns(),e=na(t.name),!(s||!e||e<new Date().getTime()-n))return[3,2];return[4,nc(t.name,o)];case 1:if(r=i.sent(),nl(t.name),r6.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];}});});},np=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");},r3=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||nr&&!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,nu(e)];case 2:return(t=n.sent())&&console.error(np("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];}});});},nd={},nd=JSON.parse('{"name":"setup-cpp","version":"0.36.2"}'),nf=ry("1o3Gj"),rb=ry("hHq4F"),rx
${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;},oK=["stdin","stdout","stderr"],oY=e=>oK.some(t=>void 0!==e[t]),oQ=e=>{if(!e)return;let{stdio:t}=e;if(void 0===t)return oK.map(t=>e[t]);if(oY(e))throw Error("It's not possible to provide `stdio` in combination with one of "+oK.map(e=>`\`${e}\``).join(", "));if("string"==typeof t)return t;if(!Array.isArray(t))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);return Array.from({length:Math.max(t.length,oK.length)},(e,r)=>t[r]);},oJ=(e,t="SIGTERM",r={})=>{let n=e(t);return oZ(e,t,r,n),n;},oZ=(e,t,r,n)=>{if(!o0(t,r,n))return;let i=setTimeout(()=>{e("SIGKILL");},o2(r));i.unref&&i.unref();},o0=(e,{forceKillAfterTimeout:t},r)=>o1(e)&&!1!==t&&r,o1=e=>e===c(rc).constants.signals.SIGTERM||"string"==typeof e&&"SIGTERM"===e.toUpperCase(),o2=({forceKillAfterTimeout:e=!0})=>{if(!0===e)return 5e3;if(!Number.isFinite(e)||e<0)throw TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e;},o4=(e,t)=>{e.kill()&&(t.isCanceled=!0);},o3=(e,t,r)=>{e.kill(t),r(Object.assign(Error("Timed out"),{timedOut:!0,signal:t}));},o6=(e,{timeout:t,killSignal:r="SIGTERM"},n)=>{let i;return 0===t||void 0===t?n:Promise.race([new Promise((n,o)=>{i=setTimeout(()=>{o3(e,r,o);},t);}),n.finally(()=>{clearTimeout(i);})]);},o8=({timeout:e})=>{if(void 0!==e&&(!Number.isFinite(e)||e<0))throw TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);},o5=async(e,{cleanup:t,detached:r},n)=>{if(!t||r)return n;let i=c(rK)(()=>{e.kill();});return n.finally(()=>{i();});},o9=e=>e instanceof rs.ChildProcess&&"function"==typeof e.then,o7=(e,t,r)=>{if("string"==typeof r)return e[t].pipe((0,re.createWriteStream)(r)),e;if(y(r))return e[t].pipe(r),e;if(!o9(r))throw TypeError("The second argument must be a string, a stream or an Execa child process.");if(!y(r.stdin))throw TypeError("The target child process's stdin must be available.");return e[t].pipe(r.stdin),r;},se=e=>{null!==e.stdout&&(e.pipeStdout=o7.bind(void 0,e,"stdout")),null!==e.stderr&&(e.pipeStderr=o7.bind(void 0,e,"stderr")),void 0!==e.all&&(e.pipeAll=o7.bind(void 0,e,"all"));},st=e=>{if(void 0!==e)throw TypeError("The `input` and `inputFile` options cannot be both set.");},sr=({input:e,inputFile:t})=>"string"!=typeof t?e:(st(e),(0,re.readFileSync)(t)),sn=e=>{let t=sr(e);if(E(t))throw TypeError("The `input` option cannot be a stream in sync mode");return t;},si=({input:e,inputFile:t})=>"string"!=typeof t?e:(st(e),(0,re.createReadStream)(t)),so=(e,t)=>{let r=si(t);void 0!==r&&(E(r)?r.pipe(e.stdin):e.stdin.end(r));},ss=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;let r=c(r2)();return e.stdout&&r.add(e.stdout),e.stderr&&r.add(e.stderr),r;},sa=async(e,t)=>{if(e&&void 0!==t){e.destroy();try{return await t;}catch(e){return e.bufferedData;}}},sl=(e,{encoding:t,buffer:r,maxBuffer:n})=>{if(e&&r)return t?c(rQ)(e,{encoding:t,maxBuffer:n}):c(rQ).buffer(e,{maxBuffer:n});},sc=async({stdout:e,stderr:t,all:r},{encoding:n,buffer:i,maxBuffer:o},s)=>{let a=sl(e,{encoding:n,buffer:i,maxBuffer:o}),l=sl(t,{encoding:n,buffer:i,maxBuffer:o}),c=sl(r,{encoding:n,buffer:i,maxBuffer:2*o});try{return await Promise.all([s,a,l,c]);}catch(n){return Promise.all([{error:n,signal:n.signal,timedOut:n.timedOut},sa(e,a),sa(t,l),sa(r,c)]);}},su=(async()=>{})().constructor.prototype,sp=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(su,e)]),sd=(e,t)=>{for(let[r,n]of sp){let i="function"==typeof t?(...e)=>Reflect.apply(n.value,t(),e):n.value.bind(t);Reflect.defineProperty(e,r,{...n,value:i});}},sf=e=>new Promise((t,r)=>{e.on("exit",(e,r)=>{t({exitCode:e,signal:r});}),e.on("error",e=>{r(e);}),e.stdin&&e.stdin.on("error",e=>{r(e)
2024-02-17 19:24:38 +08:00
`);},sO=({env:e,extendEnv:t,preferLocal:r,localDir:n,execPath:i})=>{let o=t?{...c(ra).env,...e}:e;return r?g({env:o,cwd:n,execPath:i}):o;},sT=(e,t,r={})=>{let n=c(rD)._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(ra).cwd(),execPath:c(ra).execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:sb,...r}).env=sO(r),r.stdio=oQ(r),"win32"===c(ra).platform&&"cmd"===c(ro).basename(e,".exe")&&t.unshift("/q"),{file:e,args:t,options:r,parsed:n};},sA=(e,t,r)=>"string"==typeof t||(0,ri.Buffer).isBuffer(t)?e.stripFinalNewline?m(t):t:void 0===r?void 0:"",sC=({input:e,inputFile:t,stdio:r})=>void 0===e&&void 0===t&&void 0===r?{stdin:"inherit"}:{},s$=(e={})=>({preferLocal:!0,...sC(e),...e});!function e(t){function r(n,...i){if(!Array.isArray(n))return e({...t,...n});let[o,...s]=sx(n,i);return L(o,s,s$(t));}return r.sync=(e,...r)=>{if(!Array.isArray(e))throw TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");let[n,...i]=sx(e,r);return function(e,t,r){let n;let i=sT(e,t,r),o=sv(e,t),s=sg(e,t);sR(s,i.options);let a=sn(i.options);try{n=c(rs).spawnSync(i.file,i.args,{...i.options,input:a});}catch(e){throw oW({error:e,stdout:"",stderr:"",all:"",command:o,escapedCommand:s,parsed:i,timedOut:!1,isCanceled:!1,killed:!1});}let l=sA(i.options,n.stdout,n.error),u=sA(i.options,n.stderr,n.error);if(n.error||0!==n.status||null!==n.signal){let e=oW({stdout:l,stderr:u,error:n.error,signal:n.signal,exitCode:n.status,command:o,escapedCommand:s,parsed:i,timedOut:n.error&&"ETIMEDOUT"===n.error.code,isCanceled:!1,killed:null!==n.signal});if(!i.options.reject)return e;throw e;}return{command:o,escapedCommand:s,exitCode:0,stdout:l,stderr:u,failed:!1,timedOut:!1,isCanceled:!1,killed:!1};}(n,i,s$(t));},r;}(),nh={};const s_="win32"!==n0.platform(),sP=n0.release(),sN=(e="",t="")=>/1\d+\.\d+/.test(e)&&+t>=17134.1184;nh=function(e){return s_?e.replace(/(\s+)/g,"\\$1"):sN(.../(\d+\.\d+)\.(\d+)/.exec(sP).splice(1))?e:e.replace(/(\s+)/g,"%20");},function(){var e,t;e=ry("8CJZb"),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={}),nv=ry("6t4SD");const sL={shouldEscapeSpace:!1,shouldAddOnlyIfNotDefined:!1},sD=[/\/usr\/bin\/?/,/\/usr\/local\/bin\/?/],sk=C("~/.cpprc");let sU=!1;nv=ry("6t4SD"),ng=ry("f44Uw"),rb=ry("hHq4F");const{appendFile:sj}=n2.promises;let sF=!1,sM=!1;const sG=["E: Could not get lock","dpkg: error processing archive","dpkg: error: dpkg status database is locked by another process"];(t3=nE||(nE={}))[t3.NameDashVersion=0]="NameDashVersion",t3[t3.NameEqualsVersion=1]="NameEqualsVersion",t3[t3.Name=2]="Name",t3[t3.None=3]="None",nf=ry("1o3Gj"),ny=ry("eAXk4"),ny=ry("eAXk4"),nw=ry("zdagz");let sB=!1;nv=ry("6t4SD"),ny=ry("eAXk4"),rb=ry("hHq4F");let sH=!1;rb=ry("hHq4F"),rb=ry("hHq4F");let sq=!1,sV=!1;const sX=/Version\s*:\s*(.*)/g;nx={},nb=n1.resolve(__dirname,"../../node_modules/@actions/tool-cache/lib"),nS=nx&&nx.__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];}),nI=nx&&nx.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t});}:function(e,t){e.default=t;}),nR=nx&&nx.__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)&&nS(t,e,r);return nI(t,e),t;},nO=nx&&nx.__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());});},nT=nx&&nx.__importDefault||function(e){return e&&e.__esModule?e:{default:e};},Object.defineProperty(nx,"__e
2023-07-16 06:41:58 +08:00
//# sourceMappingURL=setup-cpp.js.map