Update to Xenial Focus results in failed zopfli build

Hello, We host a gatsby site at currently deploying on the old Xenial image. I’m testing the move to Xenial Focal, and it it failing almost immediately trying to build the wheel for Zopfli.

11:00:17 AM: Build ready to start
11:00:19 AM: build-image version: d05976bd3309b73a86eaa327bf80e105ff13f5e4 (focal)
11:00:19 AM: build-image tag: v4.13.0
11:00:19 AM: buildbot version: 3a000de5d3727998f3297394596d287d7e49aecd
11:00:19 AM: Fetching cached dependencies
11:00:19 AM: Failed to fetch cache, continuing with build
11:00:19 AM: Starting to prepare the repo for build
11:00:19 AM: No cached dependencies found. Cloning fresh repo
11:00:19 AM: git clone https://github.com/box/developer.box.com-framework
11:00:21 AM: Preparing Git Reference refs/heads/abtest
11:00:21 AM: Parsing package.json dependencies
11:00:23 AM: Starting build script
11:00:23 AM: Installing dependencies
11:00:23 AM: Python version set to 2.7
11:00:23 AM: Attempting node version '14.14.0' from .node-version
11:00:24 AM: Downloading and installing node v14.14.0...
11:00:24 AM: Downloading https://nodejs.org/dist/v14.14.0/node-v14.14.0-linux-x64.tar.xz...
11:00:24 AM: Computing checksum with sha256sum
11:00:24 AM: Checksums matched!
11:00:26 AM: Now using node v14.14.0 (npm v6.14.8)
11:00:26 AM: Started restoring cached build plugins
11:00:26 AM: Finished restoring cached build plugins
11:00:26 AM: Attempting ruby version 2.7.2, read from environment
11:00:27 AM: Using ruby version 2.7.2
11:00:27 AM: Using PHP version 8.0
11:00:27 AM: Installing pip dependencies
11:00:27 AM: Started restoring cached pip cache
11:00:27 AM: Finished restoring cached pip cache
11:00:28 AM: DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
11:00:28 AM: Collecting fonttools
11:00:28 AM:   Downloading fonttools-3.44.0-py2.py3-none-any.whl (728 kB)
11:00:28 AM: Collecting brotli
11:00:28 AM:   Downloading Brotli-1.0.9-cp27-cp27mu-manylinux1_x86_64.whl (355 kB)
11:00:29 AM: Collecting zopfli
11:00:29 AM:   Downloading zopfli-0.1.9.zip (79 kB)
11:00:30 AM: Building wheels for collected packages: zopfli
11:00:30 AM:   Building wheel for zopfli (setup.py): started
11:00:31 AM:   Building wheel for zopfli (setup.py): finished with status 'error'
11:00:31 AM:   ERROR: Command errored out with exit status 1:
11:00:31 AM:    command: /opt/buildhome/python2.7/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-oIt1ug/zopfli/setup.py'"'"'; __file__='"'"'/tmp/pip-install-oIt1ug/zopfli/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-6Djthb
11:00:31 AM:        cwd: /tmp/pip-install-oIt1ug/zopfli/
11:00:31 AM:   Complete output (42 lines):
11:00:31 AM:   running bdist_wheel
11:00:31 AM:   running build
11:00:31 AM:   running build_py
11:00:31 AM:   creating build
11:00:31 AM:   creating build/lib.linux-x86_64-2.7
11:00:31 AM:   creating build/lib.linux-x86_64-2.7/zopfli
11:00:31 AM:   copying src/zopfli/gzip.py -> build/lib.linux-x86_64-2.7/zopfli
11:00:31 AM:   copying src/zopfli/_version.py -> build/lib.linux-x86_64-2.7/zopfli
11:00:31 AM:   copying src/zopfli/__init__.py -> build/lib.linux-x86_64-2.7/zopfli
11:00:31 AM:   copying src/zopfli/zlib.py -> build/lib.linux-x86_64-2.7/zopfli
11:00:31 AM:   running egg_info
11:00:31 AM:   writing src/zopfli.egg-info/PKG-INFO
11:00:31 AM:   writing top-level names to src/zopfli.egg-info/top_level.txt
11:00:31 AM:   writing dependency_links to src/zopfli.egg-info/dependency_links.txt
11:00:31 AM:   reading manifest file 'src/zopfli.egg-info/SOURCES.txt'
11:00:31 AM:   reading manifest template 'MANIFEST.in'
11:00:31 AM:   writing manifest file 'src/zopfli.egg-info/SOURCES.txt'
11:00:31 AM:   running build_ext
11:00:31 AM:   building 'zopfli.zopfli' extension
11:00:31 AM:   creating build/temp.linux-x86_64-2.7
11:00:31 AM:   creating build/temp.linux-x86_64-2.7/zopfli
11:00:31 AM:   creating build/temp.linux-x86_64-2.7/zopfli/src
11:00:31 AM:   creating build/temp.linux-x86_64-2.7/zopfli/src/zopfli
11:00:31 AM:   creating build/temp.linux-x86_64-2.7/src
11:00:31 AM:   x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-W1mjrO/python2.7-2.7.18=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c zopfli/src/zopfli/blocksplitter.c -o build/temp.linux-x86_64-2.7/zopfli/src/zopfli/blocksplitter.o
11:00:31 AM:   x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-W1mjrO/python2.7-2.7.18=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c zopfli/src/zopfli/cache.c -o build/temp.linux-x86_64-2.7/zopfli/src/zopfli/cache.o
11:00:31 AM:   x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-W1mjrO/python2.7-2.7.18=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c zopfli/src/zopfli/deflate.c -o build/temp.linux-x86_64-2.7/zopfli/src/zopfli/deflate.o
11:00:31 AM:   x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-W1mjrO/python2.7-2.7.18=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c zopfli/src/zopfli/gzip_container.c -o build/temp.linux-x86_64-2.7/zopfli/src/zopfli/gzip_container.o
11:00:31 AM:   x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-W1mjrO/python2.7-2.7.18=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c zopfli/src/zopfli/squeeze.c -o build/temp.linux-x86_64-2.7/zopfli/src/zopfli/squeeze.o
11:00:31 AM:   x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-W1mjrO/python2.7-2.7.18=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c zopfli/src/zopfli/hash.c -o build/temp.linux-x86_64-2.7/zopfli/src/zopfli/hash.o
11:00:31 AM:   x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-W1mjrO/python2.7-2.7.18=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c zopfli/src/zopfli/katajainen.c -o build/temp.linux-x86_64-2.7/zopfli/src/zopfli/katajainen.o
11:00:31 AM:   x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-W1mjrO/python2.7-2.7.18=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c zopfli/src/zopfli/lz77.c -o build/temp.linux-x86_64-2.7/zopfli/src/zopfli/lz77.o
11:00:31 AM:   x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-W1mjrO/python2.7-2.7.18=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c zopfli/src/zopfli/tree.c -o build/temp.linux-x86_64-2.7/zopfli/src/zopfli/tree.o
11:00:31 AM:   x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-W1mjrO/python2.7-2.7.18=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c zopfli/src/zopfli/util.c -o build/temp.linux-x86_64-2.7/zopfli/src/zopfli/util.o
11:00:31 AM:   x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-W1mjrO/python2.7-2.7.18=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c zopfli/src/zopfli/zlib_container.c -o build/temp.linux-x86_64-2.7/zopfli/src/zopfli/zlib_container.o
11:00:31 AM:   x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-W1mjrO/python2.7-2.7.18=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c zopfli/src/zopfli/zopfli_lib.c -o build/temp.linux-x86_64-2.7/zopfli/src/zopfli/zopfli_lib.o
11:00:31 AM:   x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-W1mjrO/python2.7-2.7.18=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c src/zopflimodule.c -o build/temp.linux-x86_64-2.7/src/zopflimodule.o
11:00:31 AM:   src/zopflimodule.c:2:10: fatal error: Python.h: No such file or directory
11:00:31 AM:       2 | #include <Python.h>
11:00:31 AM:         |          ^~~~~~~~~~
11:00:31 AM:   compilation terminated.
11:00:31 AM:   error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
11:00:31 AM:   ----------------------------------------
11:00:31 AM:   ERROR: Failed building wheel for zopfli
11:00:31 AM:   Running setup.py clean for zopfli
11:00:31 AM: Failed to build zopfli
11:00:31 AM: Installing collected packages: fonttools, brotli, zopfli
11:00:31 AM:     Running setup.py install for zopfli: started
11:00:32 AM:     Running setup.py install for zopfli: finished with status 'error'
11:00:32 AM:     ERROR: Command errored out with exit status 1:
11:00:32 AM:      command: /opt/buildhome/python2.7/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-oIt1ug/zopfli/setup.py'"'"'; __file__='"'"'/tmp/pip-install-oIt1ug/zopfli/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-pd6ebQ/install-record.txt --single-version-externally-managed --compile --install-headers /opt/buildhome/python2.7/include/site/python2.7/zopfli
11:00:32 AM:          cwd: /tmp/pip-install-oIt1ug/zopfli/
11:00:32 AM:     Complete output (42 lines):
11:00:32 AM:     running install
11:00:32 AM:     running build
11:00:32 AM:     running build_py
11:00:32 AM:     creating build
11:00:32 AM:     creating build/lib.linux-x86_64-2.7
11:00:32 AM:     creating build/lib.linux-x86_64-2.7/zopfli
11:00:32 AM:     copying src/zopfli/gzip.py -> build/lib.linux-x86_64-2.7/zopfli
11:00:32 AM:     copying src/zopfli/_version.py -> build/lib.linux-x86_64-2.7/zopfli
11:00:32 AM:     copying src/zopfli/__init__.py -> build/lib.linux-x86_64-2.7/zopfli
11:00:32 AM:     copying src/zopfli/zlib.py -> build/lib.linux-x86_64-2.7/zopfli
11:00:32 AM:     running egg_info
11:00:32 AM:     writing src/zopfli.egg-info/PKG-INFO
11:00:32 AM:     writing top-level names to src/zopfli.egg-info/top_level.txt
11:00:32 AM:     writing dependency_links to src/zopfli.egg-info/dependency_links.txt
11:00:32 AM:     reading manifest file 'src/zopfli.egg-info/SOURCES.txt'
11:00:32 AM:     reading manifest template 'MANIFEST.in'
11:00:32 AM:     writing manifest file 'src/zopfli.egg-info/SOURCES.txt'
11:00:32 AM:     running build_ext
11:00:32 AM:     building 'zopfli.zopfli' extension
11:00:32 AM:     creating build/temp.linux-x86_64-2.7
11:00:32 AM:     creating build/temp.linux-x86_64-2.7/zopfli
11:00:32 AM:     creating build/temp.linux-x86_64-2.7/zopfli/src
11:00:32 AM:     creating build/temp.linux-x86_64-2.7/zopfli/src/zopfli
11:00:32 AM:     creating build/temp.linux-x86_64-2.7/src
11:00:32 AM:     x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-W1mjrO/python2.7-2.7.18=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c zopfli/src/zopfli/blocksplitter.c -o build/temp.linux-x86_64-2.7/zopfli/src/zopfli/blocksplitter.o
11:00:32 AM:     x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-W1mjrO/python2.7-2.7.18=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c zopfli/src/zopfli/cache.c -o build/temp.linux-x86_64-2.7/zopfli/src/zopfli/cache.o
11:00:32 AM:     x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-W1mjrO/python2.7-2.7.18=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c zopfli/src/zopfli/deflate.c -o build/temp.linux-x86_64-2.7/zopfli/src/zopfli/deflate.o
11:00:32 AM:     x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-W1mjrO/python2.7-2.7.18=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c zopfli/src/zopfli/gzip_container.c -o build/temp.linux-x86_64-2.7/zopfli/src/zopfli/gzip_container.o
11:00:32 AM:     x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-W1mjrO/python2.7-2.7.18=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c zopfli/src/zopfli/squeeze.c -o build/temp.linux-x86_64-2.7/zopfli/src/zopfli/squeeze.o
11:00:32 AM:     x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-W1mjrO/python2.7-2.7.18=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c zopfli/src/zopfli/hash.c -o build/temp.linux-x86_64-2.7/zopfli/src/zopfli/hash.o
11:00:32 AM:     x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-W1mjrO/python2.7-2.7.18=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c zopfli/src/zopfli/katajainen.c -o build/temp.linux-x86_64-2.7/zopfli/src/zopfli/katajainen.o
11:00:32 AM:     x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-W1mjrO/python2.7-2.7.18=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c zopfli/src/zopfli/lz77.c -o build/temp.linux-x86_64-2.7/zopfli/src/zopfli/lz77.o
11:00:32 AM:     x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-W1mjrO/python2.7-2.7.18=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c zopfli/src/zopfli/tree.c -o build/temp.linux-x86_64-2.7/zopfli/src/zopfli/tree.o
11:00:32 AM:     x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-W1mjrO/python2.7-2.7.18=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c zopfli/src/zopfli/util.c -o build/temp.linux-x86_64-2.7/zopfli/src/zopfli/util.o
11:00:32 AM:     x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-W1mjrO/python2.7-2.7.18=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c zopfli/src/zopfli/zlib_container.c -o build/temp.linux-x86_64-2.7/zopfli/src/zopfli/zlib_container.o
11:00:32 AM:     x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-W1mjrO/python2.7-2.7.18=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c zopfli/src/zopfli/zopfli_lib.c -o build/temp.linux-x86_64-2.7/zopfli/src/zopfli/zopfli_lib.o
11:00:32 AM:     x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-W1mjrO/python2.7-2.7.18=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c src/zopflimodule.c -o build/temp.linux-x86_64-2.7/src/zopflimodule.o
11:00:32 AM:     src/zopflimodule.c:2:10: fatal error: Python.h: No such file or directory
11:00:32 AM:         2 | #include <Python.h>
11:00:32 AM:           |          ^~~~~~~~~~
11:00:32 AM:     compilation terminated.
11:00:32 AM:     error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
11:00:32 AM:     ----------------------------------------
11:00:32 AM: ERROR: Command errored out with exit status 1: /opt/buildhome/python2.7/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-oIt1ug/zopfli/setup.py'"'"'; __file__='"'"'/tmp/pip-install-oIt1ug/zopfli/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-pd6ebQ/install-record.txt --single-version-externally-managed --compile --install-headers /opt/buildhome/python2.7/include/site/python2.7/zopfli Check the logs for full command output.
11:00:32 AM: Error installing pip dependencies
11:00:32 AM: Build was terminated: Build script returned non-zero exit code: 1
11:00:32 AM: Creating deploy upload records
11:00:32 AM: Failing build: Failed to build site
11:00:32 AM: Failed during stage 'building site': Build script returned non-zero exit code: 1 (https://ntl.fyi/exit-code-1)
11:00:32 AM: Finished processing build request in 13.502717058s

I noticed a lot of old languages, specifically python 2.7. I tried re-linking the Github repo as suggested in other threads when old languages were used, but the result was the same. Nov 15 is fast approaching, so appreciate any pointers some of you may have dealing with this stuff.

Set an environment variable for PYTHON_VERSION: 3.8 and got past that error. Wish me luck!

Hey there, @Scott_Hurrey :wave:

Glad to hear you got past the error! Please let us know if you encounter additional obstacles with this. Thanks!