From 4ef5dd5a5e78b6605fc42ec5c54cb59ad7f7069e Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Tue, 11 Oct 2022 10:07:48 -0700 Subject: [PATCH] all: use cosmopolitan make.com everywhere --- cosmo-perl/Dockerfile | 8 ++++---- cosmo-yices/Dockerfile | 11 ++++++++++- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/cosmo-perl/Dockerfile b/cosmo-perl/Dockerfile index e775afe..0b38e38 100644 --- a/cosmo-perl/Dockerfile +++ b/cosmo-perl/Dockerfile @@ -25,9 +25,6 @@ RUN --mount=type=cache,id=common,target=/media/common,sharing=locked \ FROM localhost/cosmo AS builder -# TODO: this shouldn't be necessary! -RUN apk add --no-cache make - COPY --from=downloader /perl /perl RUN : \ && cd cosmopolitan \ @@ -51,12 +48,14 @@ RUN : \ && tar zxf dist/headers.tar.gz \ \ && for f in \ + bin/make.com \ bin/unzip.com \ bin/zip.com \ ;do : \ && cp -- "$f" /a.out \ - && /cosmopolitan/bin/ape bin/assimilate.com /a.out \ + && bin/ape bin/assimilate.com /a.out \ && install -m0755 /a.out "/usr/bin/$(basename "${f%.com}")" \ + || exit \ ;done \ \ && rm /usr/bin/strings \ @@ -64,6 +63,7 @@ RUN : \ ;do : \ && g="$(basename "$f")" \ && ln -s "$(realpath "$f")" "/usr/bin/${g#x86_64-linux-musl-}" \ + || exit \ ;done \ ; diff --git a/cosmo-yices/Dockerfile b/cosmo-yices/Dockerfile index 7fa4341..348475c 100644 --- a/cosmo-yices/Dockerfile +++ b/cosmo-yices/Dockerfile @@ -32,11 +32,13 @@ RUN --mount=type=cache,id=common,target=/media/common,sharing=locked \ FROM localhost/cosmo AS builder -RUN apk add --no-cache autoconf gperf make +RUN apk add --no-cache autoconf gperf RUN : \ && cd /cosmopolitan \ && tar zxf dist/headers.tar.gz \ + && install -m0755 bin/make.com /usr/bin/make \ + && bin/ape bin/assimilate.com /usr/bin/make \ ; COPY --chmod=0755 --from=localhost/notwa-util /nu/cosmocc /nu/quickconf /nu/shed /usr/bin/ @@ -47,6 +49,8 @@ RUN : \ && shed src/application.c '/#include /i\\#include ' \ # completely override CFLAGS: \ && shed configure '/passtocompiler -fpic/i\\CFLAGS=" -O2 -g -Wall"' \ +# mitigate issues with 'shell' command (this related to using landlocked make) \ + && shed makefile.in '/^INCLUDES=/c\INCLUDES=-I../build' \ # we don't need -static here because it's already part of cosmocc: \ && CC=cosmocc ./configure \ ; @@ -83,6 +87,11 @@ RUN : \ && shed src/terms/bv_constants.c 's/\bhextoint\b/&_/g' \ && shed src/terms/bv64_constants.c 's/\bhextoint\b/&_/g' \ && shed src/utils/timeout.c '/#include /i\\#include ' \ +# mitigate issues with 'shell' command (this related to using landlocked make) \ + && shed Makefile \ +'/^ARCH=/c\ARCH=x86_64-pc-linux-gnu' \ +'/^POSIXOS=/c\POSIXOS=linux' \ +'/^YICES_TOP_DIR=/c\YICES_TOP_DIR=/yices' \ # the static-lib target attempts to build a dynamic library. don't do that. \ && shed src/Makefile 's/ $(static_libyices_dynamic)//g' \ \