Skip to content

Commit 1617269

Browse files
authored
Merge branch 'develop' into fix/34794/run-doc-server-along-with-jupyter
2 parents 055f7d2 + 744939e commit 1617269

File tree

338 files changed

+7012
-5688
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

338 files changed

+7012
-5688
lines changed

.ci/create-changes-html.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ diffParagraphs.forEach(paragraph => {
5151
EOF
5252
echo '</head>' >> CHANGES.html
5353
echo '<body>' >> CHANGES.html
54-
(cd $DOC_REPOSITORY && git diff $BASE_DOC_COMMIT -- *.html) > diff.txt
54+
(cd $DOC_REPOSITORY && git diff $BASE_DOC_COMMIT -- "*.html") > diff.txt
5555
python3 - << EOF
5656
import os, re, html
5757
with open('diff.txt', 'r') as f:

.ci/docker-exec-script.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/sh -x
2+
if [ $# -lt 3 ]; then
3+
echo >&2 "usage: docker-exec-script.sh CONTAINER WORKDIR [VAR=VALUE...] SCRIPT"
4+
exit 1
5+
fi
6+
CONTAINER=$1
7+
WORKDIR=$2
8+
shift 2
9+
(echo "cd \"$WORKDIR\"";
10+
while [ $# -gt 1 ]; do
11+
echo "export \"$1\""
12+
shift
13+
done;
14+
cat "$1") | docker exec -i $CONTAINER bash -ex

build/bin/write-dockerfile.sh renamed to .ci/write-dockerfile.sh

Lines changed: 56 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ for SPKG in $(sage-package list --has-file=spkg-configure.m4 $SAGE_PACKAGE_LIST_
2727
CONFIGURE_ARGS+="--with-system-${SPKG}=${WITH_SYSTEM_SPKG} "
2828
fi
2929
done
30-
echo "# Automatically generated by SAGE_ROOT/build/bin/write-dockerfile.sh"
30+
echo "# Automatically generated by SAGE_ROOT/.ci/write-dockerfile.sh"
3131
echo "# the :comments: separate the generated file into sections"
3232
echo "# to simplify writing scripts that customize this file"
3333
ADD="ADD $__CHOWN"
3434
RUN=RUN
3535
cat <<EOF
36-
ARG BASE_IMAGE
36+
ARG BASE_IMAGE=$(eval echo "${FULL_BASE_IMAGE_AND_TAG}")
3737
FROM \${BASE_IMAGE} as with-system-packages
3838
EOF
3939
case $SYSTEM in
@@ -54,8 +54,21 @@ case $SYSTEM in
5454
1|y*|Y*)
5555
;;
5656
*)
57+
#
58+
# The Ubuntu Docker images are "minimized", meaning that some large
59+
# bits such as documentation has been removed. We have to unminimize
60+
# once (which reinstalls the full versions of some minimized packages),
61+
# or e.g. the maxima documentation (which we depend on for correct operation)
62+
# will be missing.
63+
#
64+
# But we only have to do this once. To save time in incremental builds,
65+
# we remove the unminimize binary here after it has done its job.
66+
#
5767
cat <<EOF
58-
RUN (yes | unminimize) || echo "(ignored)"
68+
RUN if command -v unminimize > /dev/null; then \
69+
(yes | unminimize) || echo "(ignored)"; \
70+
rm -f "$(command -v unminimize)"; \
71+
fi
5972
EOF
6073
if [ -n "$DIST_UPGRADE" ]; then
6174
cat <<EOF
@@ -143,7 +156,7 @@ EOF
143156
;;
144157
*)
145158
cat <<EOF
146-
ARG USE_CONDARC=condarc.yml
159+
ARG USE_CONDARC=${USE_CONDARC-condarc.yml}
147160
ADD *condarc*.yml /tmp/
148161
RUN echo \${CONDARC}; cd /tmp && conda config --stdin < \${USE_CONDARC}
149162
RUN conda update -n base conda
@@ -230,24 +243,41 @@ cat <<EOF
230243
231244
FROM with-system-packages as bootstrapped
232245
#:bootstrapping:
233-
RUN if [ -d /sage ]; then echo "### Incremental build from \$(cat /sage/VERSION.txt)" && mv /sage /sage-old && mkdir /sage && for a in local logs; do if [ -d /sage-old/\$a ]; then mv /sage-old/\$a /sage; fi; done; rm -rf /sage-old; else mkdir -p /sage; fi
246+
$ADD Makefile VERSION.txt COPYING.txt condarc.yml README.md bootstrap bootstrap-conda configure.ac sage .homebrew-build-env tox.ini Pipfile.m4 .gitignore /new/
247+
$ADD config/config.rpath /new/config/config.rpath
248+
$ADD src/doc/bootstrap /new/src/doc/bootstrap
249+
$ADD src/bin /new/src/bin
250+
$ADD src/Pipfile.m4 src/pyproject.toml.m4 src/requirements.txt.m4 src/setup.cfg.m4 src/VERSION.txt /new/src/
251+
$ADD m4 /new/m4
252+
$ADD pkgs /new/pkgs
253+
$ADD build /new/build
254+
$ADD .ci /new/.ci
255+
$ADD .upstream.d /new/.upstream.d
256+
RUN if [ -d /sage ]; then \
257+
echo "### Incremental build from \$(cat /sage/VERSION.txt)" && \
258+
if command -v git; then \
259+
(cd /new && \
260+
echo /src >> .gitignore && \
261+
./.ci/retrofit-worktree.sh worktree-image /sage); \
262+
else \
263+
for a in local logs; do \
264+
if [ -d /sage/\$a ]; then mv /sage/\$a /new/; fi; \
265+
done; \
266+
rm -rf /sage; \
267+
mv /new /sage; \
268+
fi; \
269+
else \
270+
mv /new /sage; \
271+
fi
234272
WORKDIR /sage
235-
$ADD Makefile VERSION.txt COPYING.txt condarc.yml README.md bootstrap bootstrap-conda configure.ac sage .homebrew-build-env tox.ini Pipfile.m4 ./
236-
$ADD config/config.rpath config/config.rpath
237-
$ADD src/doc/bootstrap src/doc/bootstrap
238-
$ADD src/bin src/bin
239-
$ADD src/Pipfile.m4 src/pyproject.toml.m4 src/requirements.txt.m4 src/setup.cfg.m4 src/VERSION.txt src/
240-
$ADD m4 ./m4
241-
$ADD pkgs pkgs
242-
$ADD build ./build
243-
$ADD .upstream.d ./.upstream.d
244-
ARG BOOTSTRAP=./bootstrap
273+
274+
ARG BOOTSTRAP=${BOOTSTRAP-./bootstrap}
245275
$RUN sh -x -c "\${BOOTSTRAP}" $ENDRUN $THEN_SAVE_STATUS
246276
247277
FROM bootstrapped as configured
248278
#:configuring:
249279
RUN $CHECK_STATUS_THEN mkdir -p logs/pkgs; rm -f config.log; ln -s logs/pkgs/config.log config.log
250-
ARG EXTRA_CONFIGURE_ARGS=""
280+
ARG EXTRA_CONFIGURE_ARGS="${CONFIGURE_ARGS}"
251281
EOF
252282
if [ ${WITH_SYSTEM_SPKG} = "force" ]; then
253283
cat <<EOF
@@ -286,7 +316,16 @@ ENV MAKE="make -j\${NUMPROC}"
286316
ARG USE_MAKEFLAGS="-k V=0"
287317
ENV SAGE_CHECK=warn
288318
ENV SAGE_CHECK_PACKAGES="!cython,!r,!python3,!gap,!cysignals,!linbox,!git,!ppl,!cmake,!rpy2,!sage_sws2rst"
289-
$ADD src src
319+
$ADD .gitignore /new/.gitignore
320+
$ADD src /new/src
321+
RUN if command -v git; then \
322+
cd /new && rm -rf .git && \
323+
./.ci/retrofit-worktree.sh worktree-pre /sage; \
324+
else \
325+
rm -rf /sage/src; \
326+
mv /new/src /sage/src; \
327+
fi
328+
290329
ARG TARGETS="build"
291330
$RUN $CHECK_STATUS_THEN make SAGE_SPKG="sage-spkg -y -o" \${USE_MAKEFLAGS} \${TARGETS} $ENDRUN $THEN_SAVE_STATUS
292331

0 commit comments

Comments
 (0)