fix: add workaround for arch package conflict (#125)

* fix: update arch database
* add cppcheck in docker tests
This commit is contained in:
abeimler 2022-10-28 22:54:02 +02:00
parent ccb81ee5d7
commit 8494f65eca
7 changed files with 20 additions and 20 deletions

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/" "/"
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

2
dist/setup_cpp.js vendored

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
}