DOMjudge / domjudge-packaging

DOMjudge packaging for (Linux) distributions and live image
31 stars 37 forks source link

Docker build script fails #150

Closed tossy310 closed 1 year ago

tossy310 commented 1 year ago

Docker container image building scripts are no longer working for me.

$ cd domjudge-packaging/docker
$ ./build.sh 8.2.1
[..] Downloading DOMjudge version 8.2.1...
[ok] DOMjudge version 8.2.1 downloaded as domjudge.tar.gz

[..] Building Docker image for domserver...
[+] Building 38.2s (8/19)                                                                                                                              
 => [internal] load build definition from Dockerfile                                                                                              0.0s
 => => transferring dockerfile: 2.91kB                                                                                                            0.0s
 => [internal] load .dockerignore                                                                                                                 0.0s
 => => transferring context: 2B                                                                                                                   0.0s
 => [internal] load metadata for docker.io/library/debian:stable-slim                                                                             0.0s
 => [internal] load build context                                                                                                                 0.2s
 => => transferring context: 39.43MB                                                                                                              0.2s
 => CACHED [domserver-build 1/7] FROM docker.io/library/debian:stable-slim                                                                        0.0s
 => [stage-1 2/9] RUN apt update  && apt install --no-install-recommends --no-install-suggests -y  acl curl zip unzip supervisor mariadb-client  27.5s
 => CANCELED [domserver-build 2/7] RUN apt update  && apt install --no-install-recommends --no-install-suggests -y  autoconf automake git  gcc   38.0s
 => ERROR [stage-1 3/9] RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"  && php composer-setup.php  && mv /compos  10.5s
------                                                                                                                                                 
 > [stage-1 3/9] RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"  && php composer-setup.php       && mv /composer.phar /usr/local/bin/composer:                                                                                                                                 
#0 0.353 PHP Warning:  PHP Startup: ^(text/|application/xhtml\+xml) (offset=0): unrecognised compile-time option bit(s) in Unknown on line 0           
#0 1.517 PHP Warning:  PHP Startup: ^(text/|application/xhtml\+xml) (offset=0): unrecognised compile-time option bit(s) in Unknown on line 0           
#0 1.519 PHP Warning:  preg_match(): Compilation failed: unrecognised compile-time option bit(s) at offset 0 in /composer-setup.php on line 468        
#0 1.520                                                                                                                                               
#0 1.520 Warning: preg_match(): Compilation failed: unrecognised compile-time option bit(s) at offset 0 in /composer-setup.php on line 468             
#0 1.520 All settings correct for using Composer                                                                                                       
#0 1.521 PHP Warning:  preg_replace(): Compilation failed: unrecognised compile-time option bit(s) at offset 0 in /composer-setup.php on line 1259     
#0 1.521 Downloading...                                                                                                                                
#0 1.521                                                                                                                                               
#0 1.521 Warning: preg_replace(): Compilation failed: unrecognised compile-time option bit(s) at offset 0 in /composer-setup.php on line 1259
#0 2.290 PHP Warning:  preg_replace(): Compilation failed: unrecognised compile-time option bit(s) at offset 0 in /composer-setup.php on line 1259
...
(repeats the same output many times)
...
#0 10.25 Warning: preg_match(): Compilation failed: unrecognised compile-time option bit(s) at offset 0 in /composer-setup.php on line 1083
#0 10.26 Signature mismatch, could not verify the phar file integrity
#0 10.26 The download failed repeatedly, aborting.
#0 10.26 
#0 10.26 Warning: preg_match(): Compilation failed: unrecognised compile-time option bit(s) at offset 0 in /composer-setup.php on line 711
#0 10.26 PHP Warning:  preg_match(): Compilation failed: unrecognised compile-time option bit(s) at offset 0 in /composer-setup.php on line 711
------
Dockerfile:63
--------------------
  62 |     # Install composer
  63 | >>> RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
  64 | >>>  && php composer-setup.php \
  65 | >>>  && mv /composer.phar /usr/local/bin/composer
  66 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c php -r \"copy('https://getcomposer.org/installer', 'composer-setup.php');\" \t&& php composer-setup.php \t&& mv /composer.phar /usr/local/bin/composer" did not complete successfully: exit code: 1

It was working last week, and apparently there was a Debian's stable roll-out on June 10th from bullseye (11) to bookworm (12). If I change all Docker base images in Dockerfile to bullseye from stable (and to bullseye-slim from stable-slim), I can successfully build them.

Docker images of stable and stable-slim are still bullseye, but their cat /etc/apt/sources.list points "stable", so apt update updates to the packages to new versions, and many dependencies are changing.


Note that the above error I pasted seems like coming from https://github.com/oerdnj/deb.sury.org/issues/1682. I can workaround it by doing apt install --only-upgrade libpcre2-8-0 after running apt install ... in Dockerfile. I don't think this is the best solution, and even after that, I also see another error during the document build, which I haven't investigated deeper.

nickygerritsen commented 1 year ago

I suggest that we change the from to bullseye for now then, although when bookworm is there fully as a docker image we should use that. A bit annoying that their docker images are in a semi broken state now

tossy310 commented 1 year ago

If I use bookworm, composer no longer throws an error, but I still see an error when building the doc as follows:

#0 17.91 (/usr/share/texlive/texmf-dist/tex/latex/txfonts/t1txtt.fd)
#0 17.91 ! Missing number, treated as zero.
#0 17.91 <to be read again> 
#0 17.91                    \spx@note@border@top 
#0 17.91 l.117 \begin{sphinxadmonition}{note}{Summary}
#0 17.91                                              
#0 17.91 ? 
#0 17.91 ! Emergency stop.
#0 17.91 <to be read again> 
#0 17.91                    \spx@note@border@top 
#0 17.91 l.117 \begin{sphinxadmonition}{note}{Summary}
#0 17.91                                              
#0 17.91 !  ==> Fatal error occurred, no output PDF file produced!
#0 17.91 Transcript written on domjudge-team-manual.log.
#0 17.97 Latexmk: Getting log file 'domjudge-team-manual.log'
#0 17.97 Latexmk: Examining 'domjudge-team-manual.fls'
#0 17.97 Latexmk: Examining 'domjudge-team-manual.log'
#0 17.97 Latexmk: Index file 'domjudge-team-manual.idx' was written
#0 17.97 Latexmk: Errors, so I did not complete making targets
#0 17.97 Collected error summary (may duplicate other messages):
#0 17.97   pdflatex: Command for 'pdflatex' gave return code 1
#0 17.97       Refer to 'domjudge-team-manual.log' and/or above output for details
#0 17.97 
#0 17.97 Latexmk: If appropriate, the -f option can be used to get latexmk
#0 17.97   to try to force complete processing.
#0 17.98 make[4]: Leaving directory '/domjudge-src/domjudge-8.2.1/doc/manual/build/team'
#0 17.98 make[4]: *** [Makefile:29: domjudge-team-manual.pdf] Error 12
#0 17.98 make[3]: *** [Makefile:65: team] Error 2
#0 17.98 make[3]: Leaving directory '/domjudge-src/domjudge-8.2.1/doc/manual'
#0 17.98 make[2]: *** [Makefile:29: distdocs] Error 2
#0 17.98 make[2]: Leaving directory '/domjudge-src/domjudge-8.2.1/doc/manual'
#0 17.98 make[1]: *** [/domjudge-src/domjudge-8.2.1/Makefile.global:81: distdocs] Error 1
#0 17.98 make[1]: Leaving directory '/domjudge-src/domjudge-8.2.1/doc'
#0 17.98 make: *** [Makefile:68: distdocs] Error 2

sphinx is updated from 3.4.3-2 to 5.3.0-4 (https://packages.debian.org/search?keywords=python3-sphinx), and this seems like https://github.com/sphinx-doc/sphinx/issues/11074, which was introduced in Sphinx 5.1.0 and fixed in 6.1.0.

I agree that, for a short term, pinning to bullseye seems like an easy solution.

nickygerritsen commented 1 year ago

Yeah sphinx is super annoying. On other Debian installs we tested on we used virtualenv to get the latest version, but that is also not ideal.

tossy310 commented 1 year ago

Sorry for the late reply. Thanks for merging the change. Because now that we can build the image without failure, I've closed this, but please let me know if it's needed to track to upgrade the FROM image from Debian bullseye to bookworm and/or need to have a separate issue filed.