Skip to content

Commit

Permalink
Added Ubuntu 24.04
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Apr 27, 2024
1 parent 03bcc46 commit 18ba6f2
Show file tree
Hide file tree
Showing 46 changed files with 470 additions and 14 deletions.
21 changes: 11 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:
matrix:
image:
# Run slower jobs first to give them a headstart and reduce waiting time
- "ubuntu-22.04-jammy-arm64v8"
- "ubuntu-22.04-jammy-ppc64le"
- "ubuntu-22.04-jammy-s390x"
- "ubuntu-24.04-noble-arm64v8"
- "ubuntu-24.04-noble-ppc64le"
- "ubuntu-24.04-noble-s390x"
# test image for manylinux-wheel build
- "ubuntu-22.04-jammy-amd64"
- "ubuntu-24.04-noble-amd64"
# Then run the remainder
- "alpine"
- "amazon-2-amd64"
Expand All @@ -34,20 +34,21 @@ jobs:
- "fedora-40-amd64"
- "gentoo"
- "ubuntu-20.04-focal-amd64"
- "ubuntu-22.04-jammy-amd64-valgrind"
- "ubuntu-22.04-jammy-amd64"
- "ubuntu-24.04-noble-amd64-valgrind"
# has a dependency on the test image
- "manylinux2014-wheel-build"
- "manylinux_2_28-wheel-build"
include:
- image: "manylinux2014-wheel-build"
test-image: "ubuntu-22.04-jammy-amd64"
test-image: "ubuntu-24.04-noble-amd64"
- image: "manylinux_2_28-wheel-build"
test-image: "ubuntu-22.04-jammy-amd64"
- image: "ubuntu-22.04-jammy-arm64v8"
test-image: "ubuntu-24.04-noble-amd64"
- image: "ubuntu-24.04-noble-arm64v8"
qemu-arch: "aarch64"
- image: "ubuntu-22.04-jammy-ppc64le"
- image: "ubuntu-24.04-noble-ppc64le"
qemu-arch: "ppc64le"
- image: "ubuntu-22.04-jammy-s390x"
- image: "ubuntu-24.04-noble-s390x"
qemu-arch: "s390x"

steps:
Expand Down
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ TARGETS = \
manylinux_2_28-wheel-build \
ubuntu-20.04-focal-amd64 \
ubuntu-22.04-jammy-amd64 \
ubuntu-22.04-jammy-amd64-valgrind \
ubuntu-22.04-jammy-arm64v8 \
ubuntu-22.04-jammy-ppc64le \
ubuntu-22.04-jammy-s390x
ubuntu-24.04-noble-amd64 \
ubuntu-24.04-noble-amd64-valgrind \
ubuntu-24.04-noble-arm64v8 \
ubuntu-24.04-noble-ppc64le \
ubuntu-24.04-noble-s390x

BUILDDIRS = $(TARGETS:%=build-%)
PUSHDIRS = $(TARGETS:%=push-%)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
55 changes: 55 additions & 0 deletions ubuntu-24.04-noble-amd64-valgrind/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
FROM ubuntu:noble

RUN apt-get -qq update && DEBIAN_FRONTEND=noninteractive apt-get -y install \
cmake \
ghostscript \
git \
libffi-dev \
libfreetype6-dev \
libfribidi-dev \
libharfbuzz-dev \
libimagequant-dev \
libjpeg-turbo-progs \
libjpeg8-dev \
liblcms2-dev \
libopenjp2-7-dev \
libssl-dev \
libtiff5-dev \
libwebp-dev \
meson \
netpbm \
python3.12-dbg \
python3-dev \
python3-numpy \
python3-setuptools \
python3-tk \
sudo \
tcl8.6-dev \
tk8.6-dev \
virtualenv \
wget \
xvfb \
zlib1g-dev \
valgrind \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

RUN useradd pillow \
&& addgroup pillow sudo \
&& mkdir /home/pillow \
&& chown pillow:pillow /home/pillow

RUN virtualenv -p /usr/bin/python3.12-dbg --system-site-packages /vpy3 \
&& /vpy3/bin/pip install --no-cache-dir --upgrade pip \
&& /vpy3/bin/pip install --no-cache-dir cffi olefile pytest pytest-cov pytest-timeout pytest-valgrind \
&& chown -R pillow:pillow /vpy3

ADD depends /depends
RUN cd /depends \
&& ./install_raqm.sh

COPY python.supp /depends

USER pillow
CMD ["depends/test.sh"]

#docker run -v $TRAVIS_BUILD_DIR:/Pillow pythonpillow/ubuntu-24.04-noble-amd64
26 changes: 26 additions & 0 deletions ubuntu-24.04-noble-amd64-valgrind/Dockerfile-dbg
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM ubuntu-22.04-noble-amd64-valgrind

USER root
RUN apt-get -qq update && apt-get install -y ubuntu-dbgsym-keyring

RUN echo "deb http://ddebs.ubuntu.com noble main restricted universe multiverse" > /etc/apt/sources.list.d/ddebs.list
RUN echo "deb http://ddebs.ubuntu.com noble-updates main restricted universe multiverse" >> /etc/apt/sources.list.d/ddebs.list
RUN perl -pi -e 's/# deb-src/deb-src/;' /etc/apt/sources.list

RUN apt-get -qq update && DEBIAN_FRONTEND=noninteractive apt-get -y install \
libfreetype6-dbgsym \
libtiff5-dbgsym \
libwebpmux3-dbgsym \
libwebp7-dbgsym \
libwebpdemux2-dbgsym \
libwebpmux3-dbgsym \
libopenjp2-7-dbgsym \
libharfbuzz0b-dbgsym \
libfribidi0-dbgsym \
emacs-nox

RUN cd /usr/src && apt-get source freetype tiff libwebp libopenjp2-7 harfbuzz fribidi

COPY setup.sh /depends/setup.sh
USER pillow
CMD ["/depends/setup.sh"]
40 changes: 40 additions & 0 deletions ubuntu-24.04-noble-amd64-valgrind/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
WD = $(shell pwd)
USERNAME := $(shell docker info | grep Username | xargs | cut -d ' ' -f 2)
TARGET := $(notdir $(WD))
ROOT := $(abspath $(WD)/../Pillow)
IMAGENAME := $(if $(USERNAME), $(USERNAME)/$(TARGET), $(TARGET))
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)

.PHONY: build
build:
cp -r ../Pillow/depends .
cp test.sh depends
docker build -t $(IMAGENAME):$(BRANCH) .

.PHONY: update
update:
./update.sh

.PHONY: test
test:
docker run --rm -e "PILLOW_VALGRIND_TEST=true" -v $(ROOT):/Pillow $(IMAGENAME):$(BRANCH)

.PHONY: push
push:
docker push $(IMAGENAME):$(BRANCH)

.PHONY: clean
clean:
rm -r depends

.PHONY: shell
shell:
docker run --rm -it -v $(ROOT):/Pillow $(IMAGENAME):$(BRANCH) /bin/bash

build-dbg:
docker build -t $(IMAGENAME)-dbg:$(BRANCH) -f Dockerfile-dbg .

dbg:
docker run --privileged --rm -it -v $(ROOT):/Pillow $(IMAGENAME)-dbg:$(BRANCH)


52 changes: 52 additions & 0 deletions ubuntu-24.04-noble-amd64-valgrind/README-dbg.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Debug image

Sometimes we'll get an error that's most easily reproduced in the
valgrind docker image. [citation needed]

The `build-dbg` and `dbg` shell provide some symbols and debugging
tools to fix that. Emacs is provided, as are some of the source packages.

You may need to set source directories with the `set substitute-path`
command.

e.g.:

```
pillow@2f7a4ea5c959:/Pillow/oss-fuzz-tests$ gdb python
GNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from python...
(gdb) b _imagingft.c:922
No source file named _imagingft.c.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (_imagingft.c:922) pending.
(gdb) r f.py DejaVuSans-24-8-stripped.ttf
Starting program: /vpy3/bin/python f.py DejaVuSans-24-8-stripped.ttf
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Breakpoint 1, font_render (self=0x7ffff70e9780, args=<optimized out>) at src/_imagingft.c:922
922 if (!bitmap.buffer) {
...
0x00007ffff6fe4d6a in FT_Bitmap_Convert (library=<optimized out>, source=source@entry=0x7fffffffdff0, target=target@entry=0x7fffffffe020, alignment=alignment@entry=1) at ./src/base/ftbitmap.c:633
633 ./src/base/ftbitmap.c: No such file or directory.
(gdb) set substitute-path ./src /usr/src/freetype-2.11.1+dfsg/src/
(gdb) f
#0 0x00007ffff6fe4d6a in FT_Bitmap_Convert (library=<optimized out>, source=source@entry=0x7fffffffdff0, target=target@entry=0x7fffffffe020,
alignment=alignment@entry=1) at ./src/base/ftbitmap.c:633
633 FT_Int val = *ss;
```
6 changes: 6 additions & 0 deletions ubuntu-24.04-noble-amd64-valgrind/python.supp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
<py3_8_encode_current_locale>
Memcheck:Cond
...
fun:encode_current_locale
}
7 changes: 7 additions & 0 deletions ubuntu-24.04-noble-amd64-valgrind/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
source /vpy3/bin/activate
cd /Pillow
make clean
make install

bash
16 changes: 16 additions & 0 deletions ubuntu-24.04-noble-amd64-valgrind/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
source /vpy3/bin/activate
cd /Pillow
make clean
make install-coverage

PYTHONMALLOC=malloc valgrind --suppressions=/depends/python.supp --leak-check=no \
--log-file=/tmp/valgrind-output \
python3 -m pytest --no-memcheck -vv --valgrind --valgrind-log=/tmp/valgrind-output

# To run one test in the image:
# make bash
# PYTHONMALLOC=malloc valgrind --leak-check=no --suppressions=/depends/python.supp pytest -vv --valgrind --no-memcheck Tests/test_file_eps.py

# to run one test with GDB support:
# PYTHONMALLOC=malloc valgrind --vgdb-error=0 --suppressions=../../test/python.supp pytest Tests/test_file_libtiff.py::TestFileLibTiff::test_custom_metadata
2 changes: 2 additions & 0 deletions ubuntu-24.04-noble-amd64-valgrind/update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
docker pull ubuntu:noble
61 changes: 61 additions & 0 deletions ubuntu-24.04-noble-amd64/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
FROM ubuntu:noble

RUN apt-get -qq update && DEBIAN_FRONTEND=noninteractive apt-get -y install \
cmake \
ghostscript \
git \
libegl-dev \
libffi-dev \
libfreetype6-dev \
libfribidi-dev \
libharfbuzz-dev \
libimagequant-dev \
libjpeg-turbo-progs \
libjpeg8-dev \
liblcms2-dev \
libopengl-dev \
libopenjp2-7-dev \
libssl-dev \
libtiff5-dev \
libwebp-dev \
libxcb-cursor0 \
libxcb-icccm4 \
libxcb-image0 \
libxcb-keysyms1 \
libxcb-randr0 \
libxcb-render-util0 \
libxcb-shape0 \
libxkbcommon-x11-0 \
meson \
netpbm \
python3-dev \
python3-numpy \
python3-setuptools \
python3-tk \
sudo \
tcl8.6-dev \
tk8.6-dev \
virtualenv \
wget \
xvfb \
zlib1g-dev \
&& rm -rf /var/lib/apt/lists/*

RUN useradd pillow \
&& addgroup pillow sudo \
&& mkdir /home/pillow \
&& chown pillow:pillow /home/pillow

RUN virtualenv -p /usr/bin/python3.12 --system-site-packages /vpy3 \
&& /vpy3/bin/pip install --no-cache-dir --upgrade pip \
&& /vpy3/bin/pip install --no-cache-dir cffi olefile pyside6 pytest pytest-cov pytest-timeout \
&& chown -R pillow:pillow /vpy3

ADD depends /depends
RUN cd /depends \
&& ./install_raqm.sh

USER pillow
CMD ["depends/test.sh"]

#docker run -v $GITHUB_WORKSPACE:/Pillow pythonpillow/ubuntu-24.04-noble-amd64
1 change: 1 addition & 0 deletions ubuntu-24.04-noble-amd64/Makefile
7 changes: 7 additions & 0 deletions ubuntu-24.04-noble-amd64/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
source /vpy3/bin/activate
cd /Pillow
make clean
make install-coverage
python3 -c "from PIL import Image"
/usr/bin/xvfb-run -a pytest -vx --cov PIL --cov-report term Tests
2 changes: 2 additions & 0 deletions ubuntu-24.04-noble-amd64/update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
docker pull ubuntu:noble
51 changes: 51 additions & 0 deletions ubuntu-24.04-noble-arm64v8/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
FROM arm64v8/ubuntu:noble

RUN apt-get -qq update && DEBIAN_FRONTEND=noninteractive apt-get -y install \
cmake \
ghostscript \
git \
libffi-dev \
libfreetype6-dev \
libfribidi-dev \
libharfbuzz-dev \
libimagequant-dev \
libjpeg-turbo-progs \
libjpeg8-dev \
liblcms2-dev \
libopenjp2-7-dev \
libssl-dev \
libtiff5-dev \
libwebp-dev \
meson \
netpbm \
python3-dev \
python3-numpy \
python3-setuptools \
python3-tk \
sudo \
tcl8.6-dev \
tk8.6-dev \
virtualenv \
wget \
xvfb \
zlib1g-dev \
&& rm -rf /var/lib/apt/lists/*

RUN useradd pillow \
&& addgroup pillow sudo \
&& mkdir /home/pillow \
&& chown pillow:pillow /home/pillow

RUN virtualenv -p /usr/bin/python3.12 --system-site-packages /vpy3 \
&& /vpy3/bin/pip install --no-cache-dir --upgrade pip \
&& /vpy3/bin/pip install --no-cache-dir cffi olefile pytest pytest-cov pytest-timeout \
&& chown -R pillow:pillow /vpy3

ADD depends /depends
RUN cd /depends \
&& ./install_raqm.sh

USER pillow
CMD ["depends/test.sh"]

#docker run -v $GITHUB_WORKSPACE:/Pillow pythonpillow/ubuntu-24.04-noble-arm64v8
Loading

0 comments on commit 18ba6f2

Please sign in to comment.