Skip to content

Commit 39b7372

Browse files
committed
wip
1 parent f9fc4c9 commit 39b7372

File tree

8 files changed

+551
-56
lines changed

8 files changed

+551
-56
lines changed

.github/Dockerfile

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ COPY ./deno.lock /work/deno.lock
1111
RUN cd /work && find ./brewkit -name \*.ts | xargs pkgx deno cache
1212
RUN pkgx deno cache /work/.github/scripts/generate-versions
1313

14-
RUN apt-get install libgcc-8-dev --yes
14+
# RUN apt-get install libgcc-8-dev --yes
1515

16-
RUN dpkg -L libgcc-8-dev | \
17-
while read -r file; do \
18-
case "$file" in \
19-
/usr/include/*|/usr/lib/*|/lib/*) [ -f "$file" ] && echo "$file" | tee;; \
20-
esac; \
21-
done > files.txt
16+
# RUN dpkg -L libgcc-8-dev | \
17+
# while read -r file; do \
18+
# case "$file" in \
19+
# /usr/include/*|/usr/lib/*|/lib/*) [ -f "$file" ] && echo "$file" | tee;; \
20+
# esac; \
21+
# done > files.txt
2222

2323
# we still need glibc for the pkgx ecosystem
2424
# linux headers are generally needed but we should provide
@@ -45,25 +45,28 @@ RUN dpkg -L libgcc-8-dev | \
4545
# RUN echo /lib/x86_64-linux-gnu/libtinfo.so.6.1 >> files.txt; \
4646
# echo /lib/x86_64-linux-gnu/libtinfo.so.6 >> files.txt
4747

48-
RUN tar czf /root/base.tgz -T files.txt
48+
# RUN tar czf /root/base.tgz -T files.txt
4949

5050

5151
#TODO we need a real bash for `ldd` which apparently is a bash script
5252
# symlinking /bin/sh doesn’t work
5353

5454

5555
# we want a tiny image with the right glibc, busybox works for now
56-
FROM debian:buster-slim AS stage2
56+
FROM debian:latest AS stage2
5757
COPY --from=stage1 /usr/local/bin/pkgx /usr/bin/pkgx
5858
COPY --from=stage1 /root/.pkgx /root/.pkgx
5959
COPY --from=stage1 /root/.cache/deno /root/.cache/deno
60-
COPY --from=stage1 /root/base.tgz /root/base.tgz
60+
# COPY --from=stage1 /root/base.tgz /root/base.tgz
6161

6262
RUN apt-get update && \
63-
apt-get install --yes libc6-dev linux-libc-dev libgcc-8-dev libgcc1 && \
64-
echo "Yes, do as I say!" | apt-get remove libstdc++6 libncursesw6 ncurses-base ncurses-bin
63+
apt-get install --yes libc6-dev linux-libc-dev libgcc-11-dev libgcc1 gcc g++
6564

6665
# restore libgcc-8-dev
67-
RUN tar xzf /root/base.tgz -C / && rm /root/base.tgz
66+
# RUN tar xzf /root/base.tgz -C / && rm /root/base.tgz
6867

6968
ENV PKGX_DIST_URL="https://dist.pkgx.dev/v2"
69+
70+
# fix terminal arrow keys and backspace etc.
71+
# needed because we unintall curses or something above
72+
ENV TERM="linux"

bin/pkg-build

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,19 +60,19 @@ async function prep_toolchain(tmpdir: Path, srcroot: Path) {
6060
const llvm_bin = new Path(await backticks_quiet`pkgx -q +llvm.org -- which clang`).parent();
6161
const ln = (tool: string, llvm_tool: string) =>
6262
bin.join(tool).ln('s', { target: llvm_bin.join(llvm_tool) });
63-
ln('cc', 'clang');
64-
ln('gcc', 'clang');
65-
ln('clang', 'clang');
66-
ln('c++', 'clang++');
67-
ln('g++', 'clang++');
68-
ln('clang++', 'clang++');
69-
ln('cpp', 'clang-cpp');
70-
ln('ld', 'ld.lld');
71-
ln('ar', 'llvm-ar');
72-
ln('as', 'llvm-as');
73-
ln('nm', 'llvm-nm');
74-
ln('strings', 'llvm-strings');
75-
ln('ranlib', 'llvm-ranlib');
63+
// ln('cc', 'clang');
64+
// ln('gcc', 'clang');
65+
// ln('clang', 'clang');
66+
// ln('c++', 'clang++');
67+
// ln('g++', 'clang++');
68+
// ln('clang++', 'clang++');
69+
// ln('cpp', 'clang-cpp');
70+
// ln('ld', 'ld.lld');
71+
// ln('ar', 'llvm-ar');
72+
// ln('as', 'llvm-as');
73+
// ln('nm', 'llvm-nm');
74+
// ln('strings', 'llvm-strings');
75+
// ln('ranlib', 'llvm-ranlib');
7676

7777
env["PATH"] = `${bin}:/usr/bin:/bin:/usr/sbin:/sbin`;
7878
// stops ./configure from erroring in our container

brewkit/run.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function run_f(args: string[]) {
66

77
const pretty_args = args.map((arg) => {
88
if (arg.includes(" ")) {
9-
return arg.replace(/s+/, "\\ ");
9+
return arg.replaceAll(/\s+/g, "\\ ");
1010
} else {
1111
return arg;
1212
}
@@ -87,7 +87,7 @@ function splitArgs(input: string): string[] {
8787
input = input.replace(/#.*$/gm, "");
8888

8989
while ((match = regex.exec(input)) !== null) {
90-
args.push(match[1] || match[2] || match[3]);
90+
args.push((match[1] || match[2] || match[3]).trim());
9191
}
9292

9393
return args;

0 commit comments

Comments
 (0)