fix: docker mingw build (test)

This commit is contained in:
abeimler 2023-07-20 12:26:09 +02:00
parent fb48106188
commit f849ee113e
5 changed files with 28 additions and 8 deletions

@ -1 +1 @@
Subproject commit b10f2e841835b93cee67dff1eb70d6fa5c0ac0cd
Subproject commit c30589196b2c59a3055dfc7c24244b4a1f48b081

View File

@ -1,13 +1,29 @@
## base image
FROM archlinux:base as setup-cpp-arch-mingw
FROM archlinux:base-devel as setup-cpp-arch-mingw
COPY "./dist/legacy" "/usr/lib/setup-cpp/"
# install git
RUN pacman -Syuu --noconfirm && \
pacman-db-upgrade && \
pacman -S --noconfirm --needed git
# install yay
RUN useradd -m -G nobody -s /bin/bash yay && passwd -d yay && echo "yay ALL=(ALL) ALL" >> /etc/sudoers
RUN git clone --depth 1 https://aur.archlinux.org/yay.git /opt/yay
WORKDIR /opt/yay
RUN chown -R yay:root . && chmod -R 775 .
USER yay
WORKDIR /opt/yay
RUN makepkg -si --noprogressbar --noconfirm
## clean up
USER root
WORKDIR /
RUN rm -rf /opt/yay
RUN pacman -Syuu --noconfirm && \
pacman-db-upgrade && \
# install nodejs
pacman -S --noconfirm --needed nodejs npm && \
# install the compiler and tools
node /usr/lib/setup-cpp/setup-cpp.js \
--compiler mingw \
@ -21,7 +37,7 @@ RUN pacman -Syuu --noconfirm && \
--gcovr true \
--doxygen true \
--ccache true \
--powerchell true && \
--powershell true && \
# arch cleanup
pacman -Scc --noconfirm && \
rm -rf /var/cache/pacman/pkg/* && \

View File

@ -19,7 +19,7 @@ RUN dnf -y install nodejs npm && \
--gcovr true \
--doxygen true \
--ccache true \
--powerchell true && \
--powershell true && \
# cleanup
dnf clean all && \
rm -rf /tmp/*
@ -27,7 +27,7 @@ RUN dnf -y install nodejs npm && \
ENTRYPOINT ["/bin/bash"]
#### Building (example)
FROM setup-cpp-fedora AS builder
FROM setup-cpp-fedora-mingw AS builder
COPY ./dev/cpp_vcpkg_project /home/app
WORKDIR /home/app

View File

@ -21,7 +21,7 @@ RUN apt-get update -qq && \
--gcovr true \
--doxygen true \
--ccache true \
--powerchell true && \
--powershell true && \
# cleanup
nala autoremove -y && \
nala autopurge -y && \

View File

@ -1,7 +1,7 @@
import { InstallationInfo } from "./setupBin"
import { execRootSync } from "admina"
import { info, warning } from "ci-log"
import { execa } from "execa"
import { execa, execaSync } from "execa"
/* eslint-disable require-atomic-updates */
let didUpdate: boolean = false
@ -26,6 +26,10 @@ export async function setupPacmanPack(name: string, version?: string, aur?: stri
}
const runInstall = (arg: string) => {
if (aur === "yay") {
// run yay as non-root, ERROR: Running makepkg as root is not allowed as it can cause permanent, catastrophic damage to your system.
return execaSync(aur, ["-S", "--noconfirm", arg])
}
return execRootSync(aur ?? pacman, ["-S", "--noconfirm", arg])
}