stargazing/cosmo-all/Dockerfile

55 lines
1.8 KiB
Text
Raw Normal View History

2022-10-15 01:02:02 -07:00
FROM localhost/cosmo-bootstrap AS builder
ARG COSMO_FLAVOR=def
ARG COSMO_REBUILD=1
RUN : \
&& . ./env \
&& if [ "$COSMO_REBUILD" = 1 ] || [ "$flavor" != "$COSMO_FLAVOR" ] \
;then : \
&& rm -r o \
;else : \
&& mv o o.old \
;fi \
# create a mapping from flavor to mode (possibly an empty string) \
&& { [ "$COSMO_FLAVOR" != def ] && mode="$COSMO_FLAVOR" || mode= ;} \
&& printf '%s="%s"\n' >env \
commit "$commit" \
flavor "$COSMO_FLAVOR" \
mode "$mode" \
COSMO "$PWD" \
COSMO_DIST "$PWD/dist/$COSMO_FLAVOR" \
\
&& shed expand "s_o='o/[^']*'_o='o/$mode'_g" \
2022-10-15 01:02:02 -07:00
;
2022-10-18 19:02:19 -07:00
RUN --mount=type=tmpfs,target=/tmp : \
2022-10-15 01:02:02 -07:00
&& . ./env \
&& if [ -e o.old ] \
;then : \
&& cp o.old/* o/ \
&& rm -r o.old \
;fi \
\
2022-10-15 01:31:41 -07:00
&& skip() { mkdir -p "${1%/*}" && touch -d @2222222222 "$1" ;} \
2022-10-18 22:18:02 -07:00
# skip some checks that fail under podman: \
2022-10-15 01:31:41 -07:00
&& skip "o/$mode/test/libc/calls/getgroups_test.com.runs" \
&& skip "o/$mode/test/libc/calls/getpriority_test.com.runs" \
2022-10-18 22:18:02 -07:00
# these can fail when nesting podman: \
&& skip "o/$mode/test/libc/calls/ftruncate_test.com.runs" \
2022-10-15 01:31:41 -07:00
&& skip "o/$mode/test/libc/stdio/tmpfile_test.com.runs" \
2022-10-18 22:18:02 -07:00
&& skip "o/$mode/test/tool/net/lunix_test.lua.runs" \
&& skip "o/$mode/third_party/python/Lib/test/test_selectors.py.runs" \
2022-10-15 01:31:41 -07:00
# FIXME: SIGSEGV: \
&& skip "o/$mode/third_party/python/Lib/test/test_ioctl.py.runs" \
2022-10-15 01:02:02 -07:00
\
&& { ./makeit MODE="$mode" depend || find o -name '*.o' -delete ;} \
2022-10-15 01:02:02 -07:00
&& ./makeit MODE="$mode" all \
\
# install the binaries somewhere so we can retrieve them without mounting cache: \
&& find o '(' -name '*.com' -o -name '*.com.dbg' ')' \
'!' -name '*_test.*' '!' -name 'test_*' -exec \
install -m0755 -t /usr/local/bin {} \
+ \
2022-10-18 19:02:19 -07:00
# save some space: \
&& find o -type f '(' -name '*.com.dbg' -o -name '*_test.*' -o -name 'test_*' ')' -delete \
2022-10-15 01:02:02 -07:00
;