Merge pull request #135 from abeimler/bugfix/issue-125-2 [skip ci]

This commit is contained in:
Amin Yahyaabadi 2022-10-29 01:36:52 -07:00 committed by GitHub
commit 3dbe25a6dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 23 additions and 22 deletions

View File

@ -63,6 +63,7 @@ words:
- patha
- pnpm
- pwsh
- pygments
- pypy
- setupcpp
- setx

View File

@ -9,16 +9,12 @@ commandTests:
command: g++
args: ["--version"]
expectedOutput: [".*g\\+\\+.*GCC.*"]
- name: cmake
command: cmake
args: ["--version"]
expectedOutput: [".*cmake version.*"]
- name: make
command: make
args: ["--version"]
expectedOutput: [".*GNU Make.*"]
- name: ninja
command: ninja
command: /root/ninja/ninja
args: ["--version"]
expectedOutput: [".*1.*"]
- name: gcovr

View File

@ -9,16 +9,12 @@ commandTests:
command: g++
args: ["--version"]
expectedOutput: [".*g\\+\\+.*GCC.*"]
- name: cmake
command: cmake
args: ["--version"]
expectedOutput: [".*cmake version.*"]
- name: make
command: make
args: ["--version"]
expectedOutput: [".*GNU Make.*"]
- name: ninja
command: ninja
command: /root/ninja/ninja
args: ["--version"]
expectedOutput: [".*1.*"]
- name: gcovr
@ -33,10 +29,6 @@ commandTests:
command: doxygen
args: ["--version"]
expectedOutput: [".*1.*"]
- name: cppcheck
command: cppcheck
args: ["--version"]
expectedOutput: [".*Cppcheck.*"]
fileExistenceTests:
- name: "vcpkg"

View File

@ -15,7 +15,7 @@ COPY "./dist/node12" "/"
WORKDIR "/"
# run installation
RUN node ./setup_cpp.js --compiler llvm --cmake true --ninja true --ccache true --vcpkg true --doxygen true --gcovr true --task true
RUN node ./setup_cpp.js --compiler llvm --cmake true --ninja true --cppcheck true --ccache true --vcpkg true --doxygen true --gcovr true --task true
# TODO fails!
# --cppcheck true

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -45,6 +45,8 @@ import { setupGraphviz } from "./graphviz/graphviz"
import { setupNala } from "./nala/nala"
import { setupBazel } from "./bazel/bazel"
import { setupPowershell } from "./powershell/powershell"
import { isArch } from "./utils/env/isArch"
import { setupPacmanPack } from "./utils/setup/setupPacmanPack"
/** The setup functions */
const setups = {
@ -162,6 +164,15 @@ export async function main(args: string[]): Promise<number> {
let hasLLVM = false // used to unset CPPFLAGS of LLVM when other compilers are used as the main compiler
// install python-pygments to avoid conflicts with cppcheck and gcovr on arch linux
if (process.platform === "linux") {
if (isArch()) {
if (opts.cppcheck && opts.gcovr) {
setupPacmanPack("python-pygments")
}
}
}
// loop over the tools and run their setup function
for (const tool of tools) {
// get the version or "true" or undefined for this tool from the options

View File

@ -12,14 +12,15 @@ export function setupPacmanPack(name: string, version?: string, aur?: string): I
const pacman = "pacman"
if (!didUpdate) {
execRootSync(pacman, ["-Syuu", "--noconfirm"])
// yay can't run as root, so skip update
if (!didUpdate && aur !== "yay") {
execRootSync(pacman, ["-Sy", "--noconfirm"])
didUpdate = true
}
if (!didInit) {
// install base-devel
execRootSync(pacman, ["-Sy", "--noconfirm", "base-devel"])
execRootSync(pacman, ["-S", "--noconfirm", "base-devel"])
didInit = true
}