Skip to content

Commit 0c3b851

Browse files
authored
Merge pull request #182 from aminya/llvm-system [skip ci]
2 parents 1c504ab + d5232dc commit 0c3b851

35 files changed

+342
-211
lines changed

.vscode/extensions.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["orta.vscode-jest", "esbenp.prettier-vscode", "dbaeumer.vscode-eslint"]
3+
}

.vscode/launch.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"type": "node",
6+
"request": "launch",
7+
"name": "Jest Current File",
8+
"runtimeExecutable": "sh",
9+
"program": "node_modules/.bin/jest",
10+
"args": ["${relativeFile}"],
11+
"console": "integratedTerminal",
12+
"internalConsoleOptions": "openOnFirstSessionStart"
13+
}
14+
]
15+
}

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ If you want to build the ones included, then run:
209209
```shell
210210
git clone --recurse-submodules https://github.com/aminya/setup-cpp
211211
cd ./setup-cpp
212-
docker build -f ./dev/docker/setup-cpp-ubuntu.dockerfile -t setup-cpp .
212+
docker build -f ./dev/docker/setup-cpp-ubuntu.dockerfile -t setup-cpp-ubuntu .
213213
```
214214

215215
Where you should use the path to the dockerfile after `-f`.

cspell.config.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ ignorePaths:
99
- dist/
1010
- dev/cpp_vcpkg_project
1111
- "**/node_modules/"
12+
- .vscode/extensions.json
1213
words:
1314
- aarch
1415
- clangd

dev/docker/__tests__/arch.dockerfile

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ RUN pacman -Syuu --noconfirm && \
77
pacman-db-upgrade && \
88
# install nodejs
99
pacman -S --noconfirm --needed nodejs npm && \
10-
# install setup-cpp
11-
npm install -g [email protected] && \
10+
1211
# install the compiler and tools
1312
node /usr/lib/setup-cpp/setup-cpp.js \
1413
--compiler llvm \

dev/docker/__tests__/fedora.dockerfile

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ COPY "./dist/legacy" "/usr/lib/setup-cpp/"
55

66
# install nodejs
77
RUN dnf -y install nodejs npm && \
8-
# install setup-cpp
9-
npm install -g [email protected] && \
8+
109
# install the compiler and tools
1110
node /usr/lib/setup-cpp/setup-cpp.js \
1211
--compiler llvm \

dev/docker/__tests__/ubuntu.dockerfile

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ COPY "./dist/legacy" "/usr/lib/setup-cpp/"
66
RUN apt-get update -qq && \
77
# install nodejs
88
apt-get install -y --no-install-recommends nodejs npm && \
9-
# install setup-cpp
10-
npm install -g [email protected] && \
9+
1110
# install the compiler and tools
1211
node /usr/lib/setup-cpp/setup-cpp.js \
1312
--nala true \

dev/scripts/generate-docker-tests.mjs

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ async function main() {
77
const dockerFileContent = await readFile(`./dev/docker/setup-cpp-${dockerFile}.dockerfile`, "utf-8")
88
const builderExample = await readFile(`./dev/docker/${dockerFile}.dockerfile`, "utf-8")
99

10-
// after the first FROM, add COPY "./dist/legacy" "/"
1110
const modifiedDockerFile = dockerFileContent
11+
// load the externally built setup-cpp
1212
.replace(/FROM (.*)/g, `FROM $1\n\nCOPY "./dist/legacy" "/usr/lib/setup-cpp/"`)
1313
.replace("setup-cpp ", "node /usr/lib/setup-cpp/setup-cpp.js ")
14+
// remove the npm install line
15+
.replace(/# install setup-cpp\n\s*npm install -g setup-cpp.*/, "")
1416

1517
// concat the two files
1618
const newDockerFileContent = `${modifiedDockerFile}\n${builderExample}`

dist/actions/setup-cpp.js

+16-18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/actions/setup-cpp.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/legacy/setup-cpp.js

+16-18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/legacy/setup-cpp.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/modern/setup-cpp.js

+16-18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/modern/setup-cpp.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,8 @@
151151
],
152152
"alias": {
153153
"electron": false,
154-
"patha": "patha/dist/index.node.mjs"
154+
"patha": "patha/dist/index.node.mjs",
155+
"admina": "admina/dist/index.mjs"
155156
},
156157
"pnpm": {
157158
"overrides": {

src/bazel/bazel.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ export async function setupBazel(version: string, _setupDir: string, _arch: stri
2323
throw new Error("installing bazel on Arch linux is not supported yet")
2424
} else if (hasDnf()) {
2525
// https://bazel.build/install/redhat
26-
setupDnfPack("dnf-plugins-core", undefined)
26+
await setupDnfPack([{ name: "dnf-plugins-core" }])
2727
execRootSync("dnf", ["copr", "enable", "vbatts/bazel"])
28-
return setupDnfPack("bazel4", undefined)
28+
return setupDnfPack([{ name: "bazel4" }])
2929
} else if (isUbuntu()) {
3030
// https://bazel.build/install/ubuntu
3131
const keyFileName = await addAptKeyViaDownload(

src/ccache/ccache.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export function setupCcache(version: string, _setupDir: string, _arch: string) {
2020
if (isArch()) {
2121
return setupPacmanPack("ccache", version)
2222
} else if (hasDnf()) {
23-
return setupDnfPack("ccache", version)
23+
return setupDnfPack([{ name: "ccache", version }])
2424
} else if (isUbuntu()) {
2525
return setupAptPack([{ name: "ccache", version }])
2626
}

src/cppcheck/cppcheck.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export async function setupCppcheck(version: string | undefined, _setupDir: stri
2323
if (isArch()) {
2424
return setupPacmanPack("cppcheck", version)
2525
} else if (hasDnf()) {
26-
return setupDnfPack("ccache", version)
26+
return setupDnfPack([{ name: "ccache", version }])
2727
} else if (isUbuntu()) {
2828
return setupAptPack([{ name: "cppcheck", version }])
2929
}

src/doxygen/doxygen.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export async function setupDoxygen(version: string, setupDir: string, arch: stri
7373
if (isArch()) {
7474
installationInfo = await setupPacmanPack("doxygen", version)
7575
} else if (hasDnf()) {
76-
return setupDnfPack("doxygen", version)
76+
return setupDnfPack([{ name: "doxygen", version }])
7777
} else if (isUbuntu()) {
7878
installationInfo = await setupAptPack([{ name: "doxygen", version }])
7979
} else {

src/gcc/gcc.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,11 @@ export async function setupGcc(version: string, setupDir: string, arch: string)
9898
if (isArch()) {
9999
installationInfo = await setupPacmanPack("gcc", version)
100100
} else if (hasDnf()) {
101-
installationInfo = setupDnfPack("gcc", version)
102-
setupDnfPack("gcc-c++", version)
103-
setupDnfPack("libstdc++-devel", undefined)
101+
installationInfo = await setupDnfPack([
102+
{ name: "gcc", version },
103+
{ name: "gcc-c++", version },
104+
{ name: "libstdc++-devel" },
105+
])
104106
} else if (isUbuntu()) {
105107
installationInfo = await setupAptPack([
106108
{ name: "gcc", version, repositories: ["ppa:ubuntu-toolchain-r/test"] },

src/graphviz/graphviz.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export async function setupGraphviz(version: string, _setupDir: string, _arch: s
2323
if (isArch()) {
2424
return setupPacmanPack("graphviz", version)
2525
} else if (hasDnf()) {
26-
return setupDnfPack("graphviz", version)
26+
return setupDnfPack([{ name: "graphviz", version }])
2727
} else if (isUbuntu()) {
2828
return setupAptPack([{ name: "graphviz", version }])
2929
}

src/kcov/kcov.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ async function buildKcov(file: string, dest: string) {
4747
if (isArch()) {
4848
await Promise.all([setupPacmanPack("libdwarf"), setupPacmanPack("libcurl-openssl")])
4949
} else if (hasDnf()) {
50-
setupDnfPack("libdwarf-devel")
51-
setupDnfPack("libcurl-devel")
50+
await setupDnfPack([{ name: "libdwarf-devel" }, { name: "libcurl-devel" }])
5251
} else if (isUbuntu()) {
5352
await setupAptPack([{ name: "libdw-dev" }, { name: "libcurl4-openssl-dev" }])
5453
}
@@ -116,7 +115,7 @@ export async function setupKcov(versionGiven: string, setupDir: string, arch: st
116115
if (isArch()) {
117116
await setupPacmanPack("binutils")
118117
} else if (hasDnf()) {
119-
setupDnfPack("binutils")
118+
await setupDnfPack([{ name: "binutils" }])
120119
} else if (isUbuntu()) {
121120
await setupAptPack([{ name: "libbinutils" }])
122121
}

0 commit comments

Comments
 (0)