fix: use an info level message for reboot requirements for choco

This commit is contained in:
Amin Yahyaabadi 2023-09-06 21:29:38 -07:00
parent 6af571471a
commit 678aa3361f
7 changed files with 14 additions and 15 deletions

View File

@ -1018,9 +1018,9 @@ if [ $UID -eq 0 ]; then update-alternatives --install /usr/bin/${e} ${e} ${t} 40
`));}async function iR(e){try{// check if a package matching the regexp is installed
let{stdout:t}=await nI("dpkg",["-l",e]),r=t.split("\n");// check if the output contains any lines that start with "ii"
return r.some(e=>e.startsWith("ii"));}catch{return!1;}}(l=u||(u={}))[l.NameDashVersion=0]="NameDashVersion",l[l.NameEqualsVersion=1]="NameEqualsVersion",l[l.Name=2]="Name",l[l.None=3]="None";/* eslint-disable require-atomic-updates */var ry=V("i5trn"),iP=(V("eq4yW"),V("eq4yW")),iA=V("jtqY0");async function iN(e,r,n){if(!["darwin","linux"].includes(process.platform))return;if("string"==typeof t)return{binDir:t};let i=/*@__PURE__*/G(nQ).sync("brew",{nothrow:!0});if(null!==i)return{binDir:t=(0,iP.dirname)(i)};// brew is not thread-safe
let o=G(h).join((0,f.tmpdir)(),"setup-cpp","brew");await(0,iA.mkdirP)(o),nT("curl",["-LJO","https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh"],{cwd:o});let s=(0,h.join)(o,"install.sh");if("linux"===process.platform){let e=(0,m.readFileSync)(s,"utf-8");e.replace("#!/bin/bash","");}return nT("/bin/bash",[s],{stdio:"inherit",env:{NONINTERACTIVE:"1"}}),t=iL(),await nq(t),{binDir:t};}function iL(){return"linux"===process.platform?"/home/linuxbrew/.linuxbrew/bin/":"/usr/local/bin/";}let ik=!1;async function iD(e,t,r=[]){(0,ry.info)(`Installing ${e} ${t??""} via brew`),ik&&null!==/*@__PURE__*/G(nQ).sync("brew",{nothrow:!0})||(await iN("","",process.arch),ik=!0);let n=iL();return nT((0,iP.join)(n,"brew"),["install",void 0!==t&&""!==t?`${e}@${t}`:e,...r],{stdio:"inherit"}),{binDir:n};}/* eslint-disable require-atomic-updates */ /* eslint-disable require-atomic-updates */var nF=V("bOuKS"),iP=V("eq4yW");async function iU(e,t,n){if("win32"!==process.platform)return;if("string"==typeof r)return{binDir:r};let i=/*@__PURE__*/G(nQ).sync("choco",{nothrow:!0});if(null!==i)return{binDir:r=(0,iP.dirname)(i)};let o="powershell.exe",s=/*@__PURE__*/G(nQ).sync(`${process.env.SystemRoot}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,{nothrow:!0});null!==s&&(o=s),nT(o,["-NoProfile","-InputFormat","None","-ExecutionPolicy","Bypass","-Command","[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))"],{stdio:"inherit"});let a=`${process.env.ALLUSERSPROFILE}\\chocolatey\\bin`;await nq(a);let l=/*@__PURE__*/G(nQ).sync("choco",{nothrow:!0});if(r=null!==l?(0,iP.dirname)(l):`${process.env.ChocolateyInstall??"C:/ProgramData/chocolatey"}/bin`,await(0,nF.pathExists)(r))return{binDir:r};}var ry=V("i5trn"),z=V("7Lz0k");let ij=!1;async function iM(e,t,r=[]){(0,ry.info)(`Installing ${e} ${t??""} via chocolatey`),ij&&null!==/*@__PURE__*/G(nQ).sync("choco",{nothrow:!0})||(await iU("","",process.arch),ij=!0);// https://github.com/jberezanski/ChocolateyPackages/issues/97#issuecomment-986825694
let o=G(h).join((0,f.tmpdir)(),"setup-cpp","brew");await(0,iA.mkdirP)(o),nT("curl",["-LJO","https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh"],{cwd:o});let s=(0,h.join)(o,"install.sh");if("linux"===process.platform){let e=(0,m.readFileSync)(s,"utf-8");e.replace("#!/bin/bash","");}return nT("/bin/bash",[s],{stdio:"inherit",env:{NONINTERACTIVE:"1"}}),t=iL(),await nq(t),{binDir:t};}function iL(){return"linux"===process.platform?"/home/linuxbrew/.linuxbrew/bin/":"/usr/local/bin/";}let ik=!1;async function iD(e,t,r=[]){(0,ry.info)(`Installing ${e} ${t??""} via brew`),ik&&null!==/*@__PURE__*/G(nQ).sync("brew",{nothrow:!0})||(await iN("","",process.arch),ik=!0);let n=iL();return nT((0,iP.join)(n,"brew"),["install",void 0!==t&&""!==t?`${e}@${t}`:e,...r],{stdio:"inherit"}),{binDir:n};}/* eslint-disable require-atomic-updates */ /* eslint-disable require-atomic-updates */var nF=V("bOuKS"),iP=V("eq4yW");async function iU(e,t,n){if("win32"!==process.platform)return;if("string"==typeof r)return{binDir:r};let i=/*@__PURE__*/G(nQ).sync("choco",{nothrow:!0});if(null!==i)return{binDir:r=(0,iP.dirname)(i)};let o="powershell.exe",s=/*@__PURE__*/G(nQ).sync(`${process.env.SystemRoot}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,{nothrow:!0});null!==s&&(o=s),nT(o,["-NoProfile","-InputFormat","None","-ExecutionPolicy","Bypass","-Command","[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))"],{stdio:"inherit"});let a=`${process.env.ALLUSERSPROFILE}\\chocolatey\\bin`;await nq(a);let l=/*@__PURE__*/G(nQ).sync("choco",{nothrow:!0});if(r=null!==l?(0,iP.dirname)(l):`${process.env.ChocolateyInstall??"C:/ProgramData/chocolatey"}/bin`,await(0,nF.pathExists)(r))return{binDir:r};}var z=V("7Lz0k");let ij=!1;async function iM(e,t,r=[]){(0,z.info)(`Installing ${e} ${t??""} via chocolatey`),ij&&null!==/*@__PURE__*/G(nQ).sync("choco",{nothrow:!0})||(await iU("","",process.arch),ij=!0);// https://github.com/jberezanski/ChocolateyPackages/issues/97#issuecomment-986825694
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)nT("choco",["install","-y",e,`--version=${t}`,...r],{env:i,extendEnv:!1,stdio:"inherit"});else try{nT("choco",["install","-y",e,...r],{env:i,extendEnv:!1,stdio:"inherit"});}catch(t){// if the package requires a reboot, downgrade the error to a notice
if(t.message.includes("exit code 3010"))(0,z.notice)(`${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 nq(o),{binDir:o};}function iF(){return"linux"===process.platform&&(void 0===o&&(o=null!==/*@__PURE__*/G(nQ).sync("pacman",{nothrow:!0})),o);}function iG(){return"linux"===process.platform&&(void 0===s&&(s=null!==/*@__PURE__*/G(nQ).sync("dnf",{nothrow:!0})),s);}async function iB(e){for(let{name:t,version:r}of e)(0,z.info)(`Installing ${t} ${r??""} via dnf`);let t=await Promise.all(e.map(e=>iH(e.name,e.version)));return t6("dnf",["-y","install",...t]),{binDir:"/usr/bin/"};}async function iH(e,t){if(void 0!==t&&""!==t){// check if name-version is available
if(t.message.includes("exit code 3010"))(0,z.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 nq(o),{binDir:o};}function iF(){return"linux"===process.platform&&(void 0===o&&(o=null!==/*@__PURE__*/G(nQ).sync("pacman",{nothrow:!0})),o);}function iG(){return"linux"===process.platform&&(void 0===s&&(s=null!==/*@__PURE__*/G(nQ).sync("dnf",{nothrow:!0})),s);}async function iB(e){for(let{name:t,version:r}of e)(0,z.info)(`Installing ${t} ${r??""} via dnf`);let t=await Promise.all(e.map(e=>iH(e.name,e.version)));return t6("dnf",["-y","install",...t]),{binDir:"/usr/bin/"};}async function iH(e,t){if(void 0!==t&&""!==t){// check if name-version is available
let{stdout:r}=await nI("dnf",["search","-q",`${e}-${t}`]);if(""!==r.trim())return`${e}-${t}`;{// try with ${name}${version}
// eslint-disable-next-line @typescript-eslint/no-shadow
let{stdout:r}=await nI("dnf",["search","-q",`${e}${t}`]);if(""!==r.trim())return`${e}${t}`;(0,z.warning)(`Failed to install ${e} ${t} via dnf, trying without version`);}}return e;}function iq(){return"linux"===process.platform&&(void 0===a&&(a=null!==/*@__PURE__*/G(nQ).sync("apt-get",{nothrow:!0})),a);}async function iV(e,t,r){switch(process.platform){case"win32":// install bazelisk because it contains both
@ -1244,7 +1244,7 @@ t.push((0,iP.join)(r,"Scripts"),(0,iP.join)(r,"Scripts","bin"),(0,iP.join)(r,"bi
function(e,t){let r=e[0],n=Object.keys(t).map(e=>parseInt(e,10)).sort((e,t)=>t-e)// sort in descending order
.find(e=>r>=e);return void 0===n?"":t[n];}(r,o6[e]):sd(t)&&e in o4?o4[e]:"true"===t?"":t??"";}function sd(e){return"true"===e||void 0===e;}var z=V("7Lz0k"),sp={};async function sf(){var e,t;if("linux"!==process.platform)return[];let r=await(e="lsb_release",t=["-a"],new Promise((r,n)=>{$.execFile(e,t,{encoding:"utf8",shell:!1},(i,o,s)=>{if(i){if("errno"in i&&"ENOENT"===i.code){r(null);// When lsb_release is not found
return;}n(Error(`Could not execute \`${e} ${t.join(" ")}\`: ${i} (stderr=${s})`));return;}r(o);});}));if(null===r)return[];let n=/^Distributor ID:\s*(.+)$/,i=/^Description:\s*Ubuntu\s+(\d+)\.(\d+)(?:\.(\d+))?/,o=/^Release:\s*(\d+)\.(\d+)(?:\.(\d+))?$/,s=null,a=null,l=!1;for(let e of r.split("\n")){let t=e.match(n);if(null!==t){let e=t[1];if("Ubuntu"!==e)return[];l=!0;}let r=e.match(i);r&&(s=r);let c=e.match(o);if(c&&(a=c),l&&s&&a)break;}if(!l)return[];for(let e of[s,a])if(e){let t=[e[1],e[2]];return e[3]&&t.push(e[3]),t.map(e=>parseInt(e,10));}return[];}async function sh(){try{if(!iq())return null;{try{null===/*@__PURE__*/G(nQ).sync("lsb_release",{nothrow:!0})&&(await ix([{name:"lsb-release"}]));}catch{return sg();}let e=await(0,sp.getUbuntuVersion)();if(0===e.length)return sg();return e;}}catch(e){return(0,z.warning)(e.toString()),null;}}Object.defineProperty(sp,"__esModule",{value:!0}),sp.getUbuntuVersion=void 0,sp.getUbuntuVersion=sf;const sm=oV(sh);/** Detect Ubuntu version using os.version() for Ubuntu based distros */function sg(){// #46~22.04.1-Ubuntu SMP ...
let e=G(f).version(),t=e.split("."),r=parseInt(t[0].replace("#",""),10),n=parseInt(t[1].replace("~",""),10),i=parseInt(t[2].split("-")[0],10);return[r,n,i];}async function sv(e,t,r={}){return sy(await sE(),e,t,r);}async function sy(e,t,r,n={}){let{usePipx:i=!0,user:o=!0,upgrade:s=!1,isLibrary:a=!1}=n,l=i&&!a&&(await sw(e)),c=l?"pipx":"pip";(0,ry.info)(`Installing ${t} ${r??""} via ${c}`);try{let n=void 0!==r&&""!==r?`${t}==${r}`:t,i=!l&&o?["--user"]:[];nT(e,["-m",c,...(s?l?["upgrade"]:["install","--upgrade"]:["install"]),...i,n],{stdio:"inherit"});}catch(e){if((await sS(t))===null)throw Error(`Failed to install ${t} via ${c} ${e}`);}let u=await sc(e),d=await sb(u,t);return await nq(d),{binDir:d};}async function sw(e){return 0===(await nI(e,["-m","pipx","--help"],{stdio:"ignore",reject:!1})).exitCode;}async function sx(){let e=(await o5(su("python",void 0,await sm()),"",process.arch)).bin;if(void 0===e)throw Error("Python binary was not found");return e;}const sE=oV(sx);async function sb(e,t){let r=await Promise.all(e.map(e=>(0,nF.pathExists)((0,iP.join)(e,(0,iP.addExeExt)(t))))),n=r.findIndex(e=>e);if(-1!==n){let t=e[n];return t;}let i=/*@__PURE__*/G(nQ).sync((0,iP.addExeExt)(t),{nothrow:!0});return null!==i?(0,iP.dirname)(i):e[e.length-1];}function sS(e){if("linux"===process.platform){if(iF())return iK(`python-${e}`);if(iG())return iB([{name:`python3-${e}`}]);if(iq())return ix([{name:`python3-${e}`}]);}return null;}async function s$(e,t,r){switch(process.platform){case"win32":{await iM("cppcheck",e);let t=await sO();return{binDir:t};}case"darwin":return iD("cppcheck",e);case"linux":if(iF())return iK("cppcheck",e);if(iG())return iB([{name:"ccache",version:e}]);if(iq())return ix([{name:"cppcheck",version:e}]);throw Error("Unsupported linux distribution");default:throw Error("Unsupported platform");}}async function sO(){let e="C:/Program Files/Cppcheck";return await nq(e),e;}var iP=V("eq4yW"),z=V("7Lz0k");async function s_(e,t,r){switch(process.platform){case"win32":return await iM("graphviz",e),sC();case"darwin":return iD("graphviz",e);case"linux":if(iF())return iK("graphviz",e);if(iG())return iB([{name:"graphviz",version:e}]);if(iq())return ix([{name:"graphviz",version:e}]);throw Error("Unsupported linux distribution");default:throw Error("Unsupported platform");}}async function sC(){if("win32"===process.platform){let e="C:/Program Files/Graphviz/bin";return await nq(e),{binDir:e};}throw Error("Unsupported platform");}var nF=V("bOuKS");/** Get the platform data for cmake */ // eslint-disable-next-line @typescript-eslint/no-unused-vars
let e=G(f).version(),t=e.split("."),r=parseInt(t[0].replace("#",""),10),n=parseInt(t[1].replace("~",""),10),i=parseInt(t[2].split("-")[0],10);return[r,n,i];}async function sv(e,t,r={}){return sy(await sE(),e,t,r);}async function sy(e,t,r,n={}){let{usePipx:i=!0,user:o=!0,upgrade:s=!1,isLibrary:a=!1}=n,l=i&&!a&&(await sw(e)),c=l?"pipx":"pip";(0,ry.info)(`Installing ${t} ${r??""} via ${c}`);try{let n=void 0!==r&&""!==r?`${t}==${r}`:t,i=!l&&o?["--user"]:[];nT(e,["-m",c,...(s?l?["upgrade"]:["install","--upgrade"]:["install"]),...i,n],{stdio:"inherit"});}catch(e){if((0,ry.info)(`Failed to install ${t} via ${c}: ${e}.`),(await sS(t))===null)throw Error(`Failed to install ${t} via ${c}: ${e}.`);}let u=await sc(e),d=await sb(u,t);return await nq(d),{binDir:d};}async function sw(e){return 0===(await nI(e,["-m","pipx","--help"],{stdio:"ignore",reject:!1})).exitCode;}async function sx(){let e=(await o5(su("python",void 0,await sm()),"",process.arch)).bin;if(void 0===e)throw Error("Python binary was not found");return e;}const sE=oV(sx);async function sb(e,t){let r=await Promise.all(e.map(e=>(0,nF.pathExists)((0,iP.join)(e,(0,iP.addExeExt)(t))))),n=r.findIndex(e=>e);if(-1!==n){let t=e[n];return t;}let i=/*@__PURE__*/G(nQ).sync((0,iP.addExeExt)(t),{nothrow:!0});return null!==i?(0,iP.dirname)(i):e[e.length-1];}function sS(e){if("linux"===process.platform){if((0,ry.info)(`Installing ${e} via the system package manager`),iF())return iK(`python-${e}`);if(iG())return iB([{name:`python3-${e}`}]);if(iq())return ix([{name:`python3-${e}`}]);}return null;}async function s$(e,t,r){switch(process.platform){case"win32":{await iM("cppcheck",e);let t=await sO();return{binDir:t};}case"darwin":return iD("cppcheck",e);case"linux":if(iF())return iK("cppcheck",e);if(iG())return iB([{name:"ccache",version:e}]);if(iq())return ix([{name:"cppcheck",version:e}]);throw Error("Unsupported linux distribution");default:throw Error("Unsupported platform");}}async function sO(){let e="C:/Program Files/Cppcheck";return await nq(e),e;}var iP=V("eq4yW"),z=V("7Lz0k");async function s_(e,t,r){switch(process.platform){case"win32":return await iM("graphviz",e),sC();case"darwin":return iD("graphviz",e);case"linux":if(iF())return iK("graphviz",e);if(iG())return iB([{name:"graphviz",version:e}]);if(iq())return ix([{name:"graphviz",version:e}]);throw Error("Unsupported linux distribution");default:throw Error("Unsupported platform");}}async function sC(){if("win32"===process.platform){let e="C:/Program Files/Graphviz/bin";return await nq(e),{binDir:e};}throw Error("Unsupported platform");}var nF=V("bOuKS");/** Get the platform data for cmake */ // eslint-disable-next-line @typescript-eslint/no-unused-vars
function sI(e,t,r){switch(t){case"linux":{let t=`doxygen-${e}`;return{binRelativeDir:"bin/",binFileName:(0,iP.addExeExt)("doxygen"),extractedFolderName:t,extractFunction:iJ.extractTar,url:`https://www.doxygen.nl/files/${t}.linux.bin.tar.gz`};}case"win32":{let t=`doxygen-${e}`;return{binRelativeDir:"",binFileName:(0,iP.addExeExt)("doxygen"),extractedFolderName:t,extractFunction:ok,url:`https://www.doxygen.nl/files/${t}.windows.x64.bin.zip`};}default:throw Error(`Unsupported platform '${t}'`);}}async function sT(e,t,r){switch(process.platform){case"win32":{// try to download the package 4 times with 2 seconds delay
await/*@__PURE__*/G(o_)(()=>iM("doxygen.install",e),{name:"doxygen.install",max:4,backoffBase:2e3,report:e=>(0,z.info)(e)});let t=await sR();return await s_(su("graphviz",void 0),"",r),{binDir:t};}case"darwin":{let e=await iD("doxygen",void 0);return await s_(su("graphviz",void 0),"",r),e;}case"linux":{let n;if(""===e||iF()||iG()){if(iF())n=await iK("doxygen",e);else if(iG())return iB([{name:"doxygen",version:e}]);else if(iq())n=await ix([{name:"doxygen",version:e}]);else throw Error("Unsupported linux distributions");}else if(iq())try{// doxygen on stable Ubuntu repositories is very old. So, we use get the binary from the website itself
n=await oR("doxygen",e,sI,t,r),await ix([{name:"libclang-cpp9"}]);}catch(e){(0,z.notice)(`Failed to download doxygen binary. ${e}. Falling back to apt-get.`),n=await ix([{name:"doxygen"}]);}else throw Error("Unsupported linux distributions");return await s_(su("graphviz",void 0,await sm()),"",r),n;}default:throw Error("Unsupported platform");}}async function sR(){if("win32"===process.platform){for(let e of["C:/ProgramData/chocolatey/bin","C:/Program Files/doxygen/bin","C:/Program Files (x86)/doxygen"])if(await(0,nF.pathExists)((0,iP.join)(e,"doxygen.exe")))return(// eslint-disable-next-line no-await-in-loop

File diff suppressed because one or more lines are too long

View File

@ -1018,9 +1018,9 @@ if [ $UID -eq 0 ]; then update-alternatives --install /usr/bin/${e} ${e} ${t} 40
`));}async function iR(e){try{// check if a package matching the regexp is installed
let{stdout:t}=await nI("dpkg",["-l",e]),r=t.split("\n");// check if the output contains any lines that start with "ii"
return r.some(e=>e.startsWith("ii"));}catch{return!1;}}(l=u||(u={}))[l.NameDashVersion=0]="NameDashVersion",l[l.NameEqualsVersion=1]="NameEqualsVersion",l[l.Name=2]="Name",l[l.None=3]="None";/* eslint-disable require-atomic-updates */var ry=V("2heqc"),iA=(V("A8hFE"),V("A8hFE")),iP=V("kSdX3");async function iN(e,r,n){if(!["darwin","linux"].includes(process.platform))return;if("string"==typeof t)return{binDir:t};let i=/*@__PURE__*/G(nJ).sync("brew",{nothrow:!0});if(null!==i)return{binDir:t=(0,iA.dirname)(i)};// brew is not thread-safe
let o=G(h).join((0,f.tmpdir)(),"setup-cpp","brew");await(0,iP.mkdirP)(o),nT("curl",["-LJO","https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh"],{cwd:o});let s=(0,h.join)(o,"install.sh");if("linux"===process.platform){let e=(0,m.readFileSync)(s,"utf-8");e.replace("#!/bin/bash","");}return nT("/bin/bash",[s],{stdio:"inherit",env:{NONINTERACTIVE:"1"}}),t=iL(),await nq(t),{binDir:t};}function iL(){return"linux"===process.platform?"/home/linuxbrew/.linuxbrew/bin/":"/usr/local/bin/";}let ik=!1;async function iD(e,t,r=[]){(0,ry.info)(`Installing ${e} ${null!=t?t:""} via brew`),ik&&null!==/*@__PURE__*/G(nJ).sync("brew",{nothrow:!0})||(await iN("","",process.arch),ik=!0);let n=iL();return nT((0,iA.join)(n,"brew"),["install",void 0!==t&&""!==t?`${e}@${t}`:e,...r],{stdio:"inherit"}),{binDir:n};}/* eslint-disable require-atomic-updates */ /* eslint-disable require-atomic-updates */var nM=V("3WkGD"),iA=V("A8hFE");async function iU(e,t,n){var i;if("win32"!==process.platform)return;if("string"==typeof r)return{binDir:r};let o=/*@__PURE__*/G(nJ).sync("choco",{nothrow:!0});if(null!==o)return{binDir:r=(0,iA.dirname)(o)};let s="powershell.exe",a=/*@__PURE__*/G(nJ).sync(`${process.env.SystemRoot}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,{nothrow:!0});null!==a&&(s=a),nT(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 nq(l);let c=/*@__PURE__*/G(nJ).sync("choco",{nothrow:!0});if(r=null!==c?(0,iA.dirname)(c):`${null!==(i=process.env.ChocolateyInstall)&&void 0!==i?i:"C:/ProgramData/chocolatey"}/bin`,await(0,nM.pathExists)(r))return{binDir:r};}var ry=V("2heqc"),W=V("hHq4F");let ij=!1;async function iF(e,t,r=[]){var n;(0,ry.info)(`Installing ${e} ${null!=t?t:""} via chocolatey`),ij&&null!==/*@__PURE__*/G(nJ).sync("choco",{nothrow:!0})||(await iU("","",process.arch),ij=!0);// https://github.com/jberezanski/ChocolateyPackages/issues/97#issuecomment-986825694
let o=G(h).join((0,f.tmpdir)(),"setup-cpp","brew");await(0,iP.mkdirP)(o),nT("curl",["-LJO","https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh"],{cwd:o});let s=(0,h.join)(o,"install.sh");if("linux"===process.platform){let e=(0,m.readFileSync)(s,"utf-8");e.replace("#!/bin/bash","");}return nT("/bin/bash",[s],{stdio:"inherit",env:{NONINTERACTIVE:"1"}}),t=iL(),await nq(t),{binDir:t};}function iL(){return"linux"===process.platform?"/home/linuxbrew/.linuxbrew/bin/":"/usr/local/bin/";}let ik=!1;async function iD(e,t,r=[]){(0,ry.info)(`Installing ${e} ${null!=t?t:""} via brew`),ik&&null!==/*@__PURE__*/G(nJ).sync("brew",{nothrow:!0})||(await iN("","",process.arch),ik=!0);let n=iL();return nT((0,iA.join)(n,"brew"),["install",void 0!==t&&""!==t?`${e}@${t}`:e,...r],{stdio:"inherit"}),{binDir:n};}/* eslint-disable require-atomic-updates */ /* eslint-disable require-atomic-updates */var nM=V("3WkGD"),iA=V("A8hFE");async function iU(e,t,n){var i;if("win32"!==process.platform)return;if("string"==typeof r)return{binDir:r};let o=/*@__PURE__*/G(nJ).sync("choco",{nothrow:!0});if(null!==o)return{binDir:r=(0,iA.dirname)(o)};let s="powershell.exe",a=/*@__PURE__*/G(nJ).sync(`${process.env.SystemRoot}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,{nothrow:!0});null!==a&&(s=a),nT(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 nq(l);let c=/*@__PURE__*/G(nJ).sync("choco",{nothrow:!0});if(r=null!==c?(0,iA.dirname)(c):`${null!==(i=process.env.ChocolateyInstall)&&void 0!==i?i:"C:/ProgramData/chocolatey"}/bin`,await(0,nM.pathExists)(r))return{binDir:r};}var W=V("hHq4F");let ij=!1;async function iF(e,t,r=[]){var n;(0,W.info)(`Installing ${e} ${null!=t?t:""} via chocolatey`),ij&&null!==/*@__PURE__*/G(nJ).sync("choco",{nothrow:!0})||(await iU("","",process.arch),ij=!0);// https://github.com/jberezanski/ChocolateyPackages/issues/97#issuecomment-986825694
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)nT("choco",["install","-y",e,`--version=${t}`,...r],{env:o,extendEnv:!1,stdio:"inherit"});else try{nT("choco",["install","-y",e,...r],{env:o,extendEnv:!1,stdio:"inherit"});}catch(t){// if the package requires a reboot, downgrade the error to a notice
if(t.message.includes("exit code 3010"))(0,W.notice)(`${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 nq(s),{binDir:s};}function iM(){return"linux"===process.platform&&(void 0===o&&(o=null!==/*@__PURE__*/G(nJ).sync("pacman",{nothrow:!0})),o);}function iG(){return"linux"===process.platform&&(void 0===s&&(s=null!==/*@__PURE__*/G(nJ).sync("dnf",{nothrow:!0})),s);}async function iB(e){for(let{name:t,version:r}of e)(0,W.info)(`Installing ${t} ${null!=r?r:""} via dnf`);let t=await Promise.all(e.map(e=>iH(e.name,e.version)));return t6("dnf",["-y","install",...t]),{binDir:"/usr/bin/"};}async function iH(e,t){if(void 0!==t&&""!==t){// check if name-version is available
if(t.message.includes("exit code 3010"))(0,W.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 nq(s),{binDir:s};}function iM(){return"linux"===process.platform&&(void 0===o&&(o=null!==/*@__PURE__*/G(nJ).sync("pacman",{nothrow:!0})),o);}function iG(){return"linux"===process.platform&&(void 0===s&&(s=null!==/*@__PURE__*/G(nJ).sync("dnf",{nothrow:!0})),s);}async function iB(e){for(let{name:t,version:r}of e)(0,W.info)(`Installing ${t} ${null!=r?r:""} via dnf`);let t=await Promise.all(e.map(e=>iH(e.name,e.version)));return t6("dnf",["-y","install",...t]),{binDir:"/usr/bin/"};}async function iH(e,t){if(void 0!==t&&""!==t){// check if name-version is available
let{stdout:r}=await nI("dnf",["search","-q",`${e}-${t}`]);if(""!==r.trim())return`${e}-${t}`;{// try with ${name}${version}
// eslint-disable-next-line @typescript-eslint/no-shadow
let{stdout:r}=await nI("dnf",["search","-q",`${e}${t}`]);if(""!==r.trim())return`${e}${t}`;(0,W.warning)(`Failed to install ${e} ${t} via dnf, trying without version`);}}return e;}function iq(){return"linux"===process.platform&&(void 0===a&&(a=null!==/*@__PURE__*/G(nJ).sync("apt-get",{nothrow:!0})),a);}async function iV(e,t,r){switch(process.platform){case"win32":// install bazelisk because it contains both
@ -1244,7 +1244,7 @@ t.push((0,iA.join)(r,"Scripts"),(0,iA.join)(r,"Scripts","bin"),(0,iA.join)(r,"bi
function(e,t){let r=e[0],n=Object.keys(t).map(e=>parseInt(e,10)).sort((e,t)=>t-e)// sort in descending order
.find(e=>r>=e);return void 0===n?"":t[n];}(r,o6[e]):sd(t)&&e in o4?o4[e]:"true"===t?"":null!=t?t:"";}function sd(e){return"true"===e||void 0===e;}var W=V("hHq4F"),sp={};async function sf(){var e,t;if("linux"!==process.platform)return[];let r=await(e="lsb_release",t=["-a"],new Promise((r,n)=>{$.execFile(e,t,{encoding:"utf8",shell:!1},(i,o,s)=>{if(i){if("errno"in i&&"ENOENT"===i.code){r(null);// When lsb_release is not found
return;}n(Error(`Could not execute \`${e} ${t.join(" ")}\`: ${i} (stderr=${s})`));return;}r(o);});}));if(null===r)return[];let n=/^Distributor ID:\s*(.+)$/,i=/^Description:\s*Ubuntu\s+(\d+)\.(\d+)(?:\.(\d+))?/,o=/^Release:\s*(\d+)\.(\d+)(?:\.(\d+))?$/,s=null,a=null,l=!1;for(let e of r.split("\n")){let t=e.match(n);if(null!==t){let e=t[1];if("Ubuntu"!==e)return[];l=!0;}let r=e.match(i);r&&(s=r);let c=e.match(o);if(c&&(a=c),l&&s&&a)break;}if(!l)return[];for(let e of[s,a])if(e){let t=[e[1],e[2]];return e[3]&&t.push(e[3]),t.map(e=>parseInt(e,10));}return[];}async function sh(){try{if(!iq())return null;{try{null===/*@__PURE__*/G(nJ).sync("lsb_release",{nothrow:!0})&&(await ix([{name:"lsb-release"}]));}catch{return sv();}let e=await(0,sp.getUbuntuVersion)();if(0===e.length)return sv();return e;}}catch(e){return(0,W.warning)(e.toString()),null;}}Object.defineProperty(sp,"__esModule",{value:!0}),sp.getUbuntuVersion=void 0,sp.getUbuntuVersion=sf;const sm=oV(sh);/** Detect Ubuntu version using os.version() for Ubuntu based distros */function sv(){// #46~22.04.1-Ubuntu SMP ...
let e=G(f).version(),t=e.split("."),r=parseInt(t[0].replace("#",""),10),n=parseInt(t[1].replace("~",""),10),i=parseInt(t[2].split("-")[0],10);return[r,n,i];}async function sg(e,t,r={}){return sy(await sE(),e,t,r);}async function sy(e,t,r,n={}){let{usePipx:i=!0,user:o=!0,upgrade:s=!1,isLibrary:a=!1}=n,l=i&&!a&&(await sw(e)),c=l?"pipx":"pip";(0,ry.info)(`Installing ${t} ${null!=r?r:""} via ${c}`);try{let n=void 0!==r&&""!==r?`${t}==${r}`:t,i=!l&&o?["--user"]:[];nT(e,["-m",c,...(s?l?["upgrade"]:["install","--upgrade"]:["install"]),...i,n],{stdio:"inherit"});}catch(e){if((await sS(t))===null)throw Error(`Failed to install ${t} via ${c} ${e}`);}let u=await sc(e),d=await sb(u,t);return await nq(d),{binDir:d};}async function sw(e){return 0===(await nI(e,["-m","pipx","--help"],{stdio:"ignore",reject:!1})).exitCode;}async function sx(){let e=(await o8(su("python",void 0,await sm()),"",process.arch)).bin;if(void 0===e)throw Error("Python binary was not found");return e;}const sE=oV(sx);async function sb(e,t){let r=await Promise.all(e.map(e=>(0,nM.pathExists)((0,iA.join)(e,(0,iA.addExeExt)(t))))),n=r.findIndex(e=>e);if(-1!==n){let t=e[n];return t;}let i=/*@__PURE__*/G(nJ).sync((0,iA.addExeExt)(t),{nothrow:!0});return null!==i?(0,iA.dirname)(i):e[e.length-1];}function sS(e){if("linux"===process.platform){if(iM())return iX(`python-${e}`);if(iG())return iB([{name:`python3-${e}`}]);if(iq())return ix([{name:`python3-${e}`}]);}return null;}async function s$(e,t,r){switch(process.platform){case"win32":{await iF("cppcheck",e);let t=await sO();return{binDir:t};}case"darwin":return iD("cppcheck",e);case"linux":if(iM())return iX("cppcheck",e);if(iG())return iB([{name:"ccache",version:e}]);if(iq())return ix([{name:"cppcheck",version:e}]);throw Error("Unsupported linux distribution");default:throw Error("Unsupported platform");}}async function sO(){let e="C:/Program Files/Cppcheck";return await nq(e),e;}var iA=V("A8hFE"),W=V("hHq4F");async function s_(e,t,r){switch(process.platform){case"win32":return await iF("graphviz",e),sC();case"darwin":return iD("graphviz",e);case"linux":if(iM())return iX("graphviz",e);if(iG())return iB([{name:"graphviz",version:e}]);if(iq())return ix([{name:"graphviz",version:e}]);throw Error("Unsupported linux distribution");default:throw Error("Unsupported platform");}}async function sC(){if("win32"===process.platform){let e="C:/Program Files/Graphviz/bin";return await nq(e),{binDir:e};}throw Error("Unsupported platform");}var nM=V("3WkGD");/** Get the platform data for cmake */ // eslint-disable-next-line @typescript-eslint/no-unused-vars
let e=G(f).version(),t=e.split("."),r=parseInt(t[0].replace("#",""),10),n=parseInt(t[1].replace("~",""),10),i=parseInt(t[2].split("-")[0],10);return[r,n,i];}async function sg(e,t,r={}){return sy(await sE(),e,t,r);}async function sy(e,t,r,n={}){let{usePipx:i=!0,user:o=!0,upgrade:s=!1,isLibrary:a=!1}=n,l=i&&!a&&(await sw(e)),c=l?"pipx":"pip";(0,ry.info)(`Installing ${t} ${null!=r?r:""} via ${c}`);try{let n=void 0!==r&&""!==r?`${t}==${r}`:t,i=!l&&o?["--user"]:[];nT(e,["-m",c,...(s?l?["upgrade"]:["install","--upgrade"]:["install"]),...i,n],{stdio:"inherit"});}catch(e){if((0,ry.info)(`Failed to install ${t} via ${c}: ${e}.`),(await sS(t))===null)throw Error(`Failed to install ${t} via ${c}: ${e}.`);}let u=await sc(e),d=await sb(u,t);return await nq(d),{binDir:d};}async function sw(e){return 0===(await nI(e,["-m","pipx","--help"],{stdio:"ignore",reject:!1})).exitCode;}async function sx(){let e=(await o8(su("python",void 0,await sm()),"",process.arch)).bin;if(void 0===e)throw Error("Python binary was not found");return e;}const sE=oV(sx);async function sb(e,t){let r=await Promise.all(e.map(e=>(0,nM.pathExists)((0,iA.join)(e,(0,iA.addExeExt)(t))))),n=r.findIndex(e=>e);if(-1!==n){let t=e[n];return t;}let i=/*@__PURE__*/G(nJ).sync((0,iA.addExeExt)(t),{nothrow:!0});return null!==i?(0,iA.dirname)(i):e[e.length-1];}function sS(e){if("linux"===process.platform){if((0,ry.info)(`Installing ${e} via the system package manager`),iM())return iX(`python-${e}`);if(iG())return iB([{name:`python3-${e}`}]);if(iq())return ix([{name:`python3-${e}`}]);}return null;}async function s$(e,t,r){switch(process.platform){case"win32":{await iF("cppcheck",e);let t=await sO();return{binDir:t};}case"darwin":return iD("cppcheck",e);case"linux":if(iM())return iX("cppcheck",e);if(iG())return iB([{name:"ccache",version:e}]);if(iq())return ix([{name:"cppcheck",version:e}]);throw Error("Unsupported linux distribution");default:throw Error("Unsupported platform");}}async function sO(){let e="C:/Program Files/Cppcheck";return await nq(e),e;}var iA=V("A8hFE"),W=V("hHq4F");async function s_(e,t,r){switch(process.platform){case"win32":return await iF("graphviz",e),sC();case"darwin":return iD("graphviz",e);case"linux":if(iM())return iX("graphviz",e);if(iG())return iB([{name:"graphviz",version:e}]);if(iq())return ix([{name:"graphviz",version:e}]);throw Error("Unsupported linux distribution");default:throw Error("Unsupported platform");}}async function sC(){if("win32"===process.platform){let e="C:/Program Files/Graphviz/bin";return await nq(e),{binDir:e};}throw Error("Unsupported platform");}var nM=V("3WkGD");/** Get the platform data for cmake */ // eslint-disable-next-line @typescript-eslint/no-unused-vars
function sI(e,t,r){switch(t){case"linux":{let t=`doxygen-${e}`;return{binRelativeDir:"bin/",binFileName:(0,iA.addExeExt)("doxygen"),extractedFolderName:t,extractFunction:iQ.extractTar,url:`https://www.doxygen.nl/files/${t}.linux.bin.tar.gz`};}case"win32":{let t=`doxygen-${e}`;return{binRelativeDir:"",binFileName:(0,iA.addExeExt)("doxygen"),extractedFolderName:t,extractFunction:ok,url:`https://www.doxygen.nl/files/${t}.windows.x64.bin.zip`};}default:throw Error(`Unsupported platform '${t}'`);}}async function sT(e,t,r){switch(process.platform){case"win32":{// try to download the package 4 times with 2 seconds delay
await/*@__PURE__*/G(o_)(()=>iF("doxygen.install",e),{name:"doxygen.install",max:4,backoffBase:2e3,report:e=>(0,W.info)(e)});let t=await sR();return await s_(su("graphviz",void 0),"",r),{binDir:t};}case"darwin":{let e=await iD("doxygen",void 0);return await s_(su("graphviz",void 0),"",r),e;}case"linux":{let n;if(""===e||iM()||iG()){if(iM())n=await iX("doxygen",e);else if(iG())return iB([{name:"doxygen",version:e}]);else if(iq())n=await ix([{name:"doxygen",version:e}]);else throw Error("Unsupported linux distributions");}else if(iq())try{// doxygen on stable Ubuntu repositories is very old. So, we use get the binary from the website itself
n=await oR("doxygen",e,sI,t,r),await ix([{name:"libclang-cpp9"}]);}catch(e){(0,W.notice)(`Failed to download doxygen binary. ${e}. Falling back to apt-get.`),n=await ix([{name:"doxygen"}]);}else throw Error("Unsupported linux distributions");return await s_(su("graphviz",void 0,await sm()),"",r),n;}default:throw Error("Unsupported platform");}}async function sR(){if("win32"===process.platform){for(let e of["C:/ProgramData/chocolatey/bin","C:/Program Files/doxygen/bin","C:/Program Files (x86)/doxygen"])if(await(0,nM.pathExists)((0,iA.join)(e,"doxygen.exe")))return(// eslint-disable-next-line no-await-in-loop

File diff suppressed because one or more lines are too long

View File

@ -1018,9 +1018,9 @@ if [ $UID -eq 0 ]; then update-alternatives --install /usr/bin/${e} ${e} ${t} 40
`));}async function iR(e){try{// check if a package matching the regexp is installed
let{stdout:t}=await nI("dpkg",["-l",e]),r=t.split("\n");// check if the output contains any lines that start with "ii"
return r.some(e=>e.startsWith("ii"));}catch{return!1;}}(l=u||(u={}))[l.NameDashVersion=0]="NameDashVersion",l[l.NameEqualsVersion=1]="NameEqualsVersion",l[l.Name=2]="Name",l[l.None=3]="None";/* eslint-disable require-atomic-updates */var ry=q("lcRzN"),iP=(q("ceI0e"),q("ceI0e")),iA=q("fcBgE");async function iN(e,r,n){if(!["darwin","linux"].includes(process.platform))return;if("string"==typeof t)return{binDir:t};let i=/*@__PURE__*/B(nQ).sync("brew",{nothrow:!0});if(null!==i)return{binDir:t=(0,iP.dirname)(i)};// brew is not thread-safe
let o=B(h).join((0,f.tmpdir)(),"setup-cpp","brew");await(0,iA.mkdirP)(o),nT("curl",["-LJO","https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh"],{cwd:o});let s=(0,h.join)(o,"install.sh");if("linux"===process.platform){let e=(0,m.readFileSync)(s,"utf-8");e.replace("#!/bin/bash","");}return nT("/bin/bash",[s],{stdio:"inherit",env:{NONINTERACTIVE:"1"}}),t=iL(),await nV(t),{binDir:t};}function iL(){return"linux"===process.platform?"/home/linuxbrew/.linuxbrew/bin/":"/usr/local/bin/";}let ik=!1;async function iD(e,t,r=[]){(0,ry.info)(`Installing ${e} ${t??""} via brew`),ik&&null!==/*@__PURE__*/B(nQ).sync("brew",{nothrow:!0})||(await iN("","",process.arch),ik=!0);let n=iL();return nT((0,iP.join)(n,"brew"),["install",void 0!==t&&""!==t?`${e}@${t}`:e,...r],{stdio:"inherit"}),{binDir:n};}/* eslint-disable require-atomic-updates */ /* eslint-disable require-atomic-updates */var nF=q("dOmbL"),iP=q("ceI0e");async function iU(e,t,n){if("win32"!==process.platform)return;if("string"==typeof r)return{binDir:r};let i=/*@__PURE__*/B(nQ).sync("choco",{nothrow:!0});if(null!==i)return{binDir:r=(0,iP.dirname)(i)};let o="powershell.exe",s=/*@__PURE__*/B(nQ).sync(`${process.env.SystemRoot}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,{nothrow:!0});null!==s&&(o=s),nT(o,["-NoProfile","-InputFormat","None","-ExecutionPolicy","Bypass","-Command","[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))"],{stdio:"inherit"});let a=`${process.env.ALLUSERSPROFILE}\\chocolatey\\bin`;await nV(a);let l=/*@__PURE__*/B(nQ).sync("choco",{nothrow:!0});if(r=null!==l?(0,iP.dirname)(l):`${process.env.ChocolateyInstall??"C:/ProgramData/chocolatey"}/bin`,await(0,nF.pathExists)(r))return{binDir:r};}var ry=q("lcRzN"),K=q("ER74K");let ij=!1;async function iM(e,t,r=[]){(0,ry.info)(`Installing ${e} ${t??""} via chocolatey`),ij&&null!==/*@__PURE__*/B(nQ).sync("choco",{nothrow:!0})||(await iU("","",process.arch),ij=!0);// https://github.com/jberezanski/ChocolateyPackages/issues/97#issuecomment-986825694
let o=B(h).join((0,f.tmpdir)(),"setup-cpp","brew");await(0,iA.mkdirP)(o),nT("curl",["-LJO","https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh"],{cwd:o});let s=(0,h.join)(o,"install.sh");if("linux"===process.platform){let e=(0,m.readFileSync)(s,"utf-8");e.replace("#!/bin/bash","");}return nT("/bin/bash",[s],{stdio:"inherit",env:{NONINTERACTIVE:"1"}}),t=iL(),await nV(t),{binDir:t};}function iL(){return"linux"===process.platform?"/home/linuxbrew/.linuxbrew/bin/":"/usr/local/bin/";}let ik=!1;async function iD(e,t,r=[]){(0,ry.info)(`Installing ${e} ${t??""} via brew`),ik&&null!==/*@__PURE__*/B(nQ).sync("brew",{nothrow:!0})||(await iN("","",process.arch),ik=!0);let n=iL();return nT((0,iP.join)(n,"brew"),["install",void 0!==t&&""!==t?`${e}@${t}`:e,...r],{stdio:"inherit"}),{binDir:n};}/* eslint-disable require-atomic-updates */ /* eslint-disable require-atomic-updates */var nF=q("dOmbL"),iP=q("ceI0e");async function iU(e,t,n){if("win32"!==process.platform)return;if("string"==typeof r)return{binDir:r};let i=/*@__PURE__*/B(nQ).sync("choco",{nothrow:!0});if(null!==i)return{binDir:r=(0,iP.dirname)(i)};let o="powershell.exe",s=/*@__PURE__*/B(nQ).sync(`${process.env.SystemRoot}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,{nothrow:!0});null!==s&&(o=s),nT(o,["-NoProfile","-InputFormat","None","-ExecutionPolicy","Bypass","-Command","[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))"],{stdio:"inherit"});let a=`${process.env.ALLUSERSPROFILE}\\chocolatey\\bin`;await nV(a);let l=/*@__PURE__*/B(nQ).sync("choco",{nothrow:!0});if(r=null!==l?(0,iP.dirname)(l):`${process.env.ChocolateyInstall??"C:/ProgramData/chocolatey"}/bin`,await(0,nF.pathExists)(r))return{binDir:r};}var K=q("ER74K");let ij=!1;async function iM(e,t,r=[]){(0,K.info)(`Installing ${e} ${t??""} via chocolatey`),ij&&null!==/*@__PURE__*/B(nQ).sync("choco",{nothrow:!0})||(await iU("","",process.arch),ij=!0);// https://github.com/jberezanski/ChocolateyPackages/issues/97#issuecomment-986825694
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)nT("choco",["install","-y",e,`--version=${t}`,...r],{env:i,extendEnv:!1,stdio:"inherit"});else try{nT("choco",["install","-y",e,...r],{env:i,extendEnv:!1,stdio:"inherit"});}catch(t){// if the package requires a reboot, downgrade the error to a notice
if(t.message.includes("exit code 3010"))(0,K.notice)(`${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 nV(o),{binDir:o};}function iF(){return"linux"===process.platform&&(void 0===o&&(o=null!==/*@__PURE__*/B(nQ).sync("pacman",{nothrow:!0})),o);}function iB(){return"linux"===process.platform&&(void 0===s&&(s=null!==/*@__PURE__*/B(nQ).sync("dnf",{nothrow:!0})),s);}async function iG(e){for(let{name:t,version:r}of e)(0,K.info)(`Installing ${t} ${r??""} via dnf`);let t=await Promise.all(e.map(e=>iH(e.name,e.version)));return t6("dnf",["-y","install",...t]),{binDir:"/usr/bin/"};}async function iH(e,t){if(void 0!==t&&""!==t){// check if name-version is available
if(t.message.includes("exit code 3010"))(0,K.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 nV(o),{binDir:o};}function iF(){return"linux"===process.platform&&(void 0===o&&(o=null!==/*@__PURE__*/B(nQ).sync("pacman",{nothrow:!0})),o);}function iB(){return"linux"===process.platform&&(void 0===s&&(s=null!==/*@__PURE__*/B(nQ).sync("dnf",{nothrow:!0})),s);}async function iG(e){for(let{name:t,version:r}of e)(0,K.info)(`Installing ${t} ${r??""} via dnf`);let t=await Promise.all(e.map(e=>iH(e.name,e.version)));return t6("dnf",["-y","install",...t]),{binDir:"/usr/bin/"};}async function iH(e,t){if(void 0!==t&&""!==t){// check if name-version is available
let{stdout:r}=await nI("dnf",["search","-q",`${e}-${t}`]);if(""!==r.trim())return`${e}-${t}`;{// try with ${name}${version}
// eslint-disable-next-line @typescript-eslint/no-shadow
let{stdout:r}=await nI("dnf",["search","-q",`${e}${t}`]);if(""!==r.trim())return`${e}${t}`;(0,K.warning)(`Failed to install ${e} ${t} via dnf, trying without version`);}}return e;}function iV(){return"linux"===process.platform&&(void 0===a&&(a=null!==/*@__PURE__*/B(nQ).sync("apt-get",{nothrow:!0})),a);}async function iq(e,t,r){switch(process.platform){case"win32":// install bazelisk because it contains both
@ -1244,7 +1244,7 @@ t.push((0,iP.join)(r,"Scripts"),(0,iP.join)(r,"Scripts","bin"),(0,iP.join)(r,"bi
function(e,t){let r=e[0],n=Object.keys(t).map(e=>parseInt(e,10)).sort((e,t)=>t-e)// sort in descending order
.find(e=>r>=e);return void 0===n?"":t[n];}(r,o6[e]):sd(t)&&e in o4?o4[e]:"true"===t?"":t??"";}function sd(e){return"true"===e||void 0===e;}var K=q("ER74K"),sp={};async function sf(){var e,t;if("linux"!==process.platform)return[];let r=await(e="lsb_release",t=["-a"],new Promise((r,n)=>{$.execFile(e,t,{encoding:"utf8",shell:!1},(i,o,s)=>{if(i){if("errno"in i&&"ENOENT"===i.code){r(null);// When lsb_release is not found
return;}n(Error(`Could not execute \`${e} ${t.join(" ")}\`: ${i} (stderr=${s})`));return;}r(o);});}));if(null===r)return[];let n=/^Distributor ID:\s*(.+)$/,i=/^Description:\s*Ubuntu\s+(\d+)\.(\d+)(?:\.(\d+))?/,o=/^Release:\s*(\d+)\.(\d+)(?:\.(\d+))?$/,s=null,a=null,l=!1;for(let e of r.split("\n")){let t=e.match(n);if(null!==t){let e=t[1];if("Ubuntu"!==e)return[];l=!0;}let r=e.match(i);r&&(s=r);let c=e.match(o);if(c&&(a=c),l&&s&&a)break;}if(!l)return[];for(let e of[s,a])if(e){let t=[e[1],e[2]];return e[3]&&t.push(e[3]),t.map(e=>parseInt(e,10));}return[];}async function sh(){try{if(!iV())return null;{try{null===/*@__PURE__*/B(nQ).sync("lsb_release",{nothrow:!0})&&(await ix([{name:"lsb-release"}]));}catch{return sg();}let e=await(0,sp.getUbuntuVersion)();if(0===e.length)return sg();return e;}}catch(e){return(0,K.warning)(e.toString()),null;}}Object.defineProperty(sp,"__esModule",{value:!0}),sp.getUbuntuVersion=void 0,sp.getUbuntuVersion=sf;const sm=oq(sh);/** Detect Ubuntu version using os.version() for Ubuntu based distros */function sg(){// #46~22.04.1-Ubuntu SMP ...
let e=B(f).version(),t=e.split("."),r=parseInt(t[0].replace("#",""),10),n=parseInt(t[1].replace("~",""),10),i=parseInt(t[2].split("-")[0],10);return[r,n,i];}async function sv(e,t,r={}){return sy(await sE(),e,t,r);}async function sy(e,t,r,n={}){let{usePipx:i=!0,user:o=!0,upgrade:s=!1,isLibrary:a=!1}=n,l=i&&!a&&(await sw(e)),c=l?"pipx":"pip";(0,ry.info)(`Installing ${t} ${r??""} via ${c}`);try{let n=void 0!==r&&""!==r?`${t}==${r}`:t,i=!l&&o?["--user"]:[];nT(e,["-m",c,...(s?l?["upgrade"]:["install","--upgrade"]:["install"]),...i,n],{stdio:"inherit"});}catch(e){if((await sS(t))===null)throw Error(`Failed to install ${t} via ${c} ${e}`);}let u=await sc(e),d=await sb(u,t);return await nV(d),{binDir:d};}async function sw(e){return 0===(await nI(e,["-m","pipx","--help"],{stdio:"ignore",reject:!1})).exitCode;}async function sx(){let e=(await o5(su("python",void 0,await sm()),"",process.arch)).bin;if(void 0===e)throw Error("Python binary was not found");return e;}const sE=oq(sx);async function sb(e,t){let r=await Promise.all(e.map(e=>(0,nF.pathExists)((0,iP.join)(e,(0,iP.addExeExt)(t))))),n=r.findIndex(e=>e);if(-1!==n){let t=e[n];return t;}let i=/*@__PURE__*/B(nQ).sync((0,iP.addExeExt)(t),{nothrow:!0});return null!==i?(0,iP.dirname)(i):e[e.length-1];}function sS(e){if("linux"===process.platform){if(iF())return iz(`python-${e}`);if(iB())return iG([{name:`python3-${e}`}]);if(iV())return ix([{name:`python3-${e}`}]);}return null;}async function s$(e,t,r){switch(process.platform){case"win32":{await iM("cppcheck",e);let t=await s_();return{binDir:t};}case"darwin":return iD("cppcheck",e);case"linux":if(iF())return iz("cppcheck",e);if(iB())return iG([{name:"ccache",version:e}]);if(iV())return ix([{name:"cppcheck",version:e}]);throw Error("Unsupported linux distribution");default:throw Error("Unsupported platform");}}async function s_(){let e="C:/Program Files/Cppcheck";return await nV(e),e;}var iP=q("ceI0e"),K=q("ER74K");async function sO(e,t,r){switch(process.platform){case"win32":return await iM("graphviz",e),sC();case"darwin":return iD("graphviz",e);case"linux":if(iF())return iz("graphviz",e);if(iB())return iG([{name:"graphviz",version:e}]);if(iV())return ix([{name:"graphviz",version:e}]);throw Error("Unsupported linux distribution");default:throw Error("Unsupported platform");}}async function sC(){if("win32"===process.platform){let e="C:/Program Files/Graphviz/bin";return await nV(e),{binDir:e};}throw Error("Unsupported platform");}var nF=q("dOmbL");/** Get the platform data for cmake */ // eslint-disable-next-line @typescript-eslint/no-unused-vars
let e=B(f).version(),t=e.split("."),r=parseInt(t[0].replace("#",""),10),n=parseInt(t[1].replace("~",""),10),i=parseInt(t[2].split("-")[0],10);return[r,n,i];}async function sv(e,t,r={}){return sy(await sE(),e,t,r);}async function sy(e,t,r,n={}){let{usePipx:i=!0,user:o=!0,upgrade:s=!1,isLibrary:a=!1}=n,l=i&&!a&&(await sw(e)),c=l?"pipx":"pip";(0,ry.info)(`Installing ${t} ${r??""} via ${c}`);try{let n=void 0!==r&&""!==r?`${t}==${r}`:t,i=!l&&o?["--user"]:[];nT(e,["-m",c,...(s?l?["upgrade"]:["install","--upgrade"]:["install"]),...i,n],{stdio:"inherit"});}catch(e){if((0,ry.info)(`Failed to install ${t} via ${c}: ${e}.`),(await sS(t))===null)throw Error(`Failed to install ${t} via ${c}: ${e}.`);}let u=await sc(e),d=await sb(u,t);return await nV(d),{binDir:d};}async function sw(e){return 0===(await nI(e,["-m","pipx","--help"],{stdio:"ignore",reject:!1})).exitCode;}async function sx(){let e=(await o5(su("python",void 0,await sm()),"",process.arch)).bin;if(void 0===e)throw Error("Python binary was not found");return e;}const sE=oq(sx);async function sb(e,t){let r=await Promise.all(e.map(e=>(0,nF.pathExists)((0,iP.join)(e,(0,iP.addExeExt)(t))))),n=r.findIndex(e=>e);if(-1!==n){let t=e[n];return t;}let i=/*@__PURE__*/B(nQ).sync((0,iP.addExeExt)(t),{nothrow:!0});return null!==i?(0,iP.dirname)(i):e[e.length-1];}function sS(e){if("linux"===process.platform){if((0,ry.info)(`Installing ${e} via the system package manager`),iF())return iz(`python-${e}`);if(iB())return iG([{name:`python3-${e}`}]);if(iV())return ix([{name:`python3-${e}`}]);}return null;}async function s$(e,t,r){switch(process.platform){case"win32":{await iM("cppcheck",e);let t=await s_();return{binDir:t};}case"darwin":return iD("cppcheck",e);case"linux":if(iF())return iz("cppcheck",e);if(iB())return iG([{name:"ccache",version:e}]);if(iV())return ix([{name:"cppcheck",version:e}]);throw Error("Unsupported linux distribution");default:throw Error("Unsupported platform");}}async function s_(){let e="C:/Program Files/Cppcheck";return await nV(e),e;}var iP=q("ceI0e"),K=q("ER74K");async function sO(e,t,r){switch(process.platform){case"win32":return await iM("graphviz",e),sC();case"darwin":return iD("graphviz",e);case"linux":if(iF())return iz("graphviz",e);if(iB())return iG([{name:"graphviz",version:e}]);if(iV())return ix([{name:"graphviz",version:e}]);throw Error("Unsupported linux distribution");default:throw Error("Unsupported platform");}}async function sC(){if("win32"===process.platform){let e="C:/Program Files/Graphviz/bin";return await nV(e),{binDir:e};}throw Error("Unsupported platform");}var nF=q("dOmbL");/** Get the platform data for cmake */ // eslint-disable-next-line @typescript-eslint/no-unused-vars
function sI(e,t,r){switch(t){case"linux":{let t=`doxygen-${e}`;return{binRelativeDir:"bin/",binFileName:(0,iP.addExeExt)("doxygen"),extractedFolderName:t,extractFunction:iJ.extractTar,url:`https://www.doxygen.nl/files/${t}.linux.bin.tar.gz`};}case"win32":{let t=`doxygen-${e}`;return{binRelativeDir:"",binFileName:(0,iP.addExeExt)("doxygen"),extractedFolderName:t,extractFunction:ok,url:`https://www.doxygen.nl/files/${t}.windows.x64.bin.zip`};}default:throw Error(`Unsupported platform '${t}'`);}}async function sT(e,t,r){switch(process.platform){case"win32":{// try to download the package 4 times with 2 seconds delay
await/*@__PURE__*/B(oO)(()=>iM("doxygen.install",e),{name:"doxygen.install",max:4,backoffBase:2e3,report:e=>(0,K.info)(e)});let t=await sR();return await sO(su("graphviz",void 0),"",r),{binDir:t};}case"darwin":{let e=await iD("doxygen",void 0);return await sO(su("graphviz",void 0),"",r),e;}case"linux":{let n;if(""===e||iF()||iB()){if(iF())n=await iz("doxygen",e);else if(iB())return iG([{name:"doxygen",version:e}]);else if(iV())n=await ix([{name:"doxygen",version:e}]);else throw Error("Unsupported linux distributions");}else if(iV())try{// doxygen on stable Ubuntu repositories is very old. So, we use get the binary from the website itself
n=await oR("doxygen",e,sI,t,r),await ix([{name:"libclang-cpp9"}]);}catch(e){(0,K.notice)(`Failed to download doxygen binary. ${e}. Falling back to apt-get.`),n=await ix([{name:"doxygen"}]);}else throw Error("Unsupported linux distributions");return await sO(su("graphviz",void 0,await sm()),"",r),n;}default:throw Error("Unsupported platform");}}async function sR(){if("win32"===process.platform){for(let e of["C:/ProgramData/chocolatey/bin","C:/Program Files/doxygen/bin","C:/Program Files (x86)/doxygen"])if(await(0,nF.pathExists)((0,iP.join)(e,"doxygen.exe")))return(// eslint-disable-next-line no-await-in-loop

File diff suppressed because one or more lines are too long

View File

@ -4,8 +4,7 @@ import which from "which"
import { setupChocolatey } from "../../chocolatey/chocolatey"
import { InstallationInfo } from "./setupBin"
import { execaSync } from "execa"
import { info } from "@actions/core"
import { notice } from "ci-log"
import { info } from "ci-log"
let hasChoco = false
@ -38,7 +37,7 @@ export async function setupChocoPack(name: string, version?: string, args: strin
} catch (err) {
// if the package requires a reboot, downgrade the error to a notice
if ((err as Error).message.includes("exit code 3010")) {
notice(`${name} might require a reboot for the completion of the installation.`)
info(`${name} might require a reboot for the completion of the installation.`)
} else {
throw err
}