Skip to content

Commit f849ee1

Browse files
committed
fix: docker mingw build (test)
1 parent fb48106 commit f849ee1

File tree

5 files changed

+28
-8
lines changed

5 files changed

+28
-8
lines changed

dev/docker/__tests__/arch.mingw.dockerfile

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,29 @@
11
## base image
2-
FROM archlinux:base as setup-cpp-arch-mingw
2+
FROM archlinux:base-devel as setup-cpp-arch-mingw
33

44
COPY "./dist/legacy" "/usr/lib/setup-cpp/"
55

6+
# install git
7+
RUN pacman -Syuu --noconfirm && \
8+
pacman-db-upgrade && \
9+
pacman -S --noconfirm --needed git
10+
# install yay
11+
RUN useradd -m -G nobody -s /bin/bash yay && passwd -d yay && echo "yay ALL=(ALL) ALL" >> /etc/sudoers
12+
RUN git clone --depth 1 https://aur.archlinux.org/yay.git /opt/yay
13+
WORKDIR /opt/yay
14+
RUN chown -R yay:root . && chmod -R 775 .
15+
USER yay
16+
WORKDIR /opt/yay
17+
RUN makepkg -si --noprogressbar --noconfirm
18+
## clean up
19+
USER root
20+
WORKDIR /
21+
RUN rm -rf /opt/yay
22+
623
RUN pacman -Syuu --noconfirm && \
724
pacman-db-upgrade && \
825
# install nodejs
926
pacman -S --noconfirm --needed nodejs npm && \
10-
1127
# install the compiler and tools
1228
node /usr/lib/setup-cpp/setup-cpp.js \
1329
--compiler mingw \
@@ -21,7 +37,7 @@ RUN pacman -Syuu --noconfirm && \
2137
--gcovr true \
2238
--doxygen true \
2339
--ccache true \
24-
--powerchell true && \
40+
--powershell true && \
2541
# arch cleanup
2642
pacman -Scc --noconfirm && \
2743
rm -rf /var/cache/pacman/pkg/* && \

dev/docker/__tests__/fedora.mingw.dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ RUN dnf -y install nodejs npm && \
1919
--gcovr true \
2020
--doxygen true \
2121
--ccache true \
22-
--powerchell true && \
22+
--powershell true && \
2323
# cleanup
2424
dnf clean all && \
2525
rm -rf /tmp/*
2626

2727
ENTRYPOINT ["/bin/bash"]
2828

2929
#### Building (example)
30-
FROM setup-cpp-fedora AS builder
30+
FROM setup-cpp-fedora-mingw AS builder
3131

3232
COPY ./dev/cpp_vcpkg_project /home/app
3333
WORKDIR /home/app

dev/docker/__tests__/ubuntu.mingw.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ RUN apt-get update -qq && \
2121
--gcovr true \
2222
--doxygen true \
2323
--ccache true \
24-
--powerchell true && \
24+
--powershell true && \
2525
# cleanup
2626
nala autoremove -y && \
2727
nala autopurge -y && \

src/utils/setup/setupPacmanPack.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { InstallationInfo } from "./setupBin"
22
import { execRootSync } from "admina"
33
import { info, warning } from "ci-log"
4-
import { execa } from "execa"
4+
import { execa, execaSync } from "execa"
55

66
/* eslint-disable require-atomic-updates */
77
let didUpdate: boolean = false
@@ -26,6 +26,10 @@ export async function setupPacmanPack(name: string, version?: string, aur?: stri
2626
}
2727

2828
const runInstall = (arg: string) => {
29+
if (aur === "yay") {
30+
// run yay as non-root, ERROR: Running makepkg as root is not allowed as it can cause permanent, catastrophic damage to your system.
31+
return execaSync(aur, ["-S", "--noconfirm", arg])
32+
}
2933
return execRootSync(aur ?? pacman, ["-S", "--noconfirm", arg])
3034
}
3135

0 commit comments

Comments
 (0)