mirror of https://github.com/aminya/setup-cpp
fix: add workaround for arch package conflict (#125)
* fix: update arch database * add cppcheck in docker tests
This commit is contained in:
parent
ccb81ee5d7
commit
8494f65eca
|
@ -9,16 +9,12 @@ commandTests:
|
||||||
command: g++
|
command: g++
|
||||||
args: ["--version"]
|
args: ["--version"]
|
||||||
expectedOutput: [".*g\\+\\+.*GCC.*"]
|
expectedOutput: [".*g\\+\\+.*GCC.*"]
|
||||||
- name: cmake
|
|
||||||
command: cmake
|
|
||||||
args: ["--version"]
|
|
||||||
expectedOutput: [".*cmake version.*"]
|
|
||||||
- name: make
|
- name: make
|
||||||
command: make
|
command: make
|
||||||
args: ["--version"]
|
args: ["--version"]
|
||||||
expectedOutput: [".*GNU Make.*"]
|
expectedOutput: [".*GNU Make.*"]
|
||||||
- name: ninja
|
- name: ninja
|
||||||
command: ninja
|
command: /root/ninja/ninja
|
||||||
args: ["--version"]
|
args: ["--version"]
|
||||||
expectedOutput: [".*1.*"]
|
expectedOutput: [".*1.*"]
|
||||||
- name: gcovr
|
- name: gcovr
|
||||||
|
|
|
@ -9,16 +9,12 @@ commandTests:
|
||||||
command: g++
|
command: g++
|
||||||
args: ["--version"]
|
args: ["--version"]
|
||||||
expectedOutput: [".*g\\+\\+.*GCC.*"]
|
expectedOutput: [".*g\\+\\+.*GCC.*"]
|
||||||
- name: cmake
|
|
||||||
command: cmake
|
|
||||||
args: ["--version"]
|
|
||||||
expectedOutput: [".*cmake version.*"]
|
|
||||||
- name: make
|
- name: make
|
||||||
command: make
|
command: make
|
||||||
args: ["--version"]
|
args: ["--version"]
|
||||||
expectedOutput: [".*GNU Make.*"]
|
expectedOutput: [".*GNU Make.*"]
|
||||||
- name: ninja
|
- name: ninja
|
||||||
command: ninja
|
command: /root/ninja/ninja
|
||||||
args: ["--version"]
|
args: ["--version"]
|
||||||
expectedOutput: [".*1.*"]
|
expectedOutput: [".*1.*"]
|
||||||
- name: gcovr
|
- name: gcovr
|
||||||
|
@ -33,10 +29,6 @@ commandTests:
|
||||||
command: doxygen
|
command: doxygen
|
||||||
args: ["--version"]
|
args: ["--version"]
|
||||||
expectedOutput: [".*1.*"]
|
expectedOutput: [".*1.*"]
|
||||||
- name: cppcheck
|
|
||||||
command: cppcheck
|
|
||||||
args: ["--version"]
|
|
||||||
expectedOutput: [".*Cppcheck.*"]
|
|
||||||
|
|
||||||
fileExistenceTests:
|
fileExistenceTests:
|
||||||
- name: "vcpkg"
|
- name: "vcpkg"
|
||||||
|
|
|
@ -15,7 +15,7 @@ COPY "./dist/" "/"
|
||||||
WORKDIR "/"
|
WORKDIR "/"
|
||||||
|
|
||||||
# run installation
|
# 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!
|
# TODO fails!
|
||||||
# --cppcheck true
|
# --cppcheck true
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
11
src/main.ts
11
src/main.ts
|
@ -45,6 +45,8 @@ import { setupGraphviz } from "./graphviz/graphviz"
|
||||||
import { setupNala } from "./nala/nala"
|
import { setupNala } from "./nala/nala"
|
||||||
import { setupBazel } from "./bazel/bazel"
|
import { setupBazel } from "./bazel/bazel"
|
||||||
import { setupPowershell } from "./powershell/powershell"
|
import { setupPowershell } from "./powershell/powershell"
|
||||||
|
import { isArch } from "./utils/env/isArch"
|
||||||
|
import { setupPacmanPack } from "./utils/setup/setupPacmanPack"
|
||||||
|
|
||||||
/** The setup functions */
|
/** The setup functions */
|
||||||
const setups = {
|
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
|
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
|
// loop over the tools and run their setup function
|
||||||
for (const tool of tools) {
|
for (const tool of tools) {
|
||||||
// get the version or "true" or undefined for this tool from the options
|
// get the version or "true" or undefined for this tool from the options
|
||||||
|
|
|
@ -12,14 +12,15 @@ export function setupPacmanPack(name: string, version?: string, aur?: string): I
|
||||||
|
|
||||||
const pacman = "pacman"
|
const pacman = "pacman"
|
||||||
|
|
||||||
if (!didUpdate) {
|
// yay can't run as root, so skip update
|
||||||
execRootSync(pacman, ["-Syuu", "--noconfirm"])
|
if (!didUpdate && aur !== "yay") {
|
||||||
|
execRootSync(pacman, ["-Sy", "--noconfirm"])
|
||||||
didUpdate = true
|
didUpdate = true
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!didInit) {
|
if (!didInit) {
|
||||||
// install base-devel
|
// install base-devel
|
||||||
execRootSync(pacman, ["-Sy", "--noconfirm", "base-devel"])
|
execRootSync(pacman, ["-S", "--noconfirm", "base-devel"])
|
||||||
didInit = true
|
didInit = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue