Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build Travis image locally #2548

Open
big-green-lemon opened this issue Feb 22, 2025 · 2 comments
Open

Cannot build Travis image locally #2548

big-green-lemon opened this issue Feb 22, 2025 · 2 comments

Comments

@big-green-lemon
Copy link

Can't seem to test my own fork locally, as Travis utterly fails to build when the Dockerfile tries to grab setuptools>=61.0 for Python 2. Can't think of a fix (be it dirty or not) to get past this issue.

Update Pwntools First

When reporting an issue, be sure that you are running the latest released version of pwntools (pip install --upgrade pwntools).

Current version : 4.14.0

Debug Output

$ make -C travis/docker image
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
            Install the buildx component to build images with BuildKit:
            https://docs.docker.com/go/buildx/

Sending build context to Docker daemon  40.96kB
Step 1/44 : FROM pwntools/pwntools:base
 ---> d181113b05dc
Step 2/44 : ENV HISTFILE=/home/pwntools/.history
 ---> Running in bfdfa2d5bde0
 ---> Removed intermediate container bfdfa2d5bde0
 ---> 55440f42752e
Step 3/44 : USER root
 ---> Running in f9490867f3b3
 ---> Removed intermediate container f9490867f3b3
 ---> 68a9a93b3e01
Step 4/44 : RUN python2.7 -m pip uninstall -q -y pwntools     && python3 -m pip uninstall -q -y pwntools
 ---> Running in 363be3245673
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. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable.It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning.
 ---> Removed intermediate container 363be3245673
 ---> a4fc700f149c
Step 5/44 : USER pwntools
 ---> Running in 6c24ca9be511
 ---> Removed intermediate container 6c24ca9be511
 ---> ed35c9cdedc8
Step 6/44 : WORKDIR /home/pwntools
 ---> Running in a7be56a2c7bd
 ---> Removed intermediate container a7be56a2c7bd
 ---> 18e1ae10c57e
Step 7/44 : ENV PATH="/home/pwntools/.local/bin:${PATH}"
 ---> Running in c6ac0f9e0e37
 ---> Removed intermediate container c6ac0f9e0e37
 ---> 226424bc22f1
Step 8/44 : RUN git clone https://github.com/Gallopsled/pwntools  && python2.7 -m pip install --upgrade --editable pwntools  && python3 -m pip install --upgrade --editable pwntools  && PWNLIB_NOTERM=1 pwn version
 ---> Running in ee7961e0f50e
Cloning into 'pwntools'...
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. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Defaulting to user installation because normal site-packages is not writeable
Obtaining file:///home/pwntools/pwntools
  Installing build dependencies: started
  Installing build dependencies: finished with status 'error'
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python2.7 /usr/local/lib/python2.7/dist-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-fshMRH/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=61.0' wheel
       cwd: None
  Complete output (3 lines):
  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. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
  ERROR: Could not find a version that satisfies the requirement setuptools>=61.0 (from versions: 0.6b1, 0.6b2, 0.6b3, 0.6b4, 0.6rc1, 0.6rc2, 0.6rc3, 0.6rc4, 0.6rc5, 0.6rc6, 0.6rc7, 0.6rc8, 0.6rc9, 0.6r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.1, 21.0.0, 21.1.0, 21.2.0, 21.2.1, 21.2.2, 22.0.0, 22.0.1, 22.0.2, 22.0.4, 22.0.5, 23.0.0, 23.1.0, 23.2.0, 23.2.1, 24.0.0, 24.0.1, 24.0.2, 24.0.3, 24.1.0, 24.1.1, 24.2.0, 24.2.1, 24.3.0, 24.3.1, 25.0.0, 25.0.1, 25.0.2, 25.1.0, 25.1.1, 25.1.2, 25.1.3, 25.1.4, 25.1.5, 25.1.6, 25.2.0, 25.3.0, 25.4.0, 26.0.0, 26.1.0, 26.1.1, 27.0.0, 27.1.0, 27.1.2, 27.2.0, 27.3.0, 27.3.1, 28.0.0, 28.1.0, 28.2.0, 28.3.0, 28.4.0, 28.5.0, 28.6.0, 28.6.1, 28.7.0, 28.7.1, 28.8.0, 28.8.1, 29.0.0, 29.0.1, 30.0.0, 30.1.0, 30.2.0, 30.2.1, 30.3.0, 30.4.0, 31.0.0, 31.0.1, 32.0.0, 32.1.0, 32.1.1, 32.1.2, 32.1.3, 32.2.0, 32.3.0, 32.3.1, 33.1.0, 33.1.1, 34.0.0, 34.0.1, 34.0.2, 34.0.3, 34.1.0, 34.1.1, 34.2.0, 34.3.0, 34.3.1, 34.3.2, 34.3.3, 34.4.0, 34.4.1, 35.0.0, 35.0.1, 35.0.2, 36.0.1, 36.1.0, 36.1.1, 36.2.0, 36.2.1, 36.2.2, 36.2.3, 36.2.4, 36.2.5, 36.2.6, 36.2.7, 36.3.0, 36.4.0, 36.5.0, 36.6.0, 36.6.1, 36.7.0, 36.7.1, 36.7.2, 36.8.0, 37.0.0, 38.0.0, 38.1.0, 38.2.0, 38.2.1, 38.2.3, 38.2.4, 38.2.5, 38.3.0, 38.4.0, 38.4.1, 38.5.0, 38.5.1, 38.5.2, 38.6.0, 38.6.1, 38.7.0, 39.0.0, 39.0.1, 39.1.0, 39.2.0, 40.0.0, 40.1.0, 40.1.1, 40.2.0, 40.3.0, 40.4.0, 40.4.1, 40.4.2, 40.4.3, 40.5.0, 40.6.0, 40.6.1, 40.6.2, 40.6.3, 40.7.0, 40.7.1, 40.7.2, 40.7.3, 40.8.0, 40.9.0, 41.0.0, 41.0.1, 41.1.0, 41.2.0, 41.3.0, 41.4.0, 41.5.0, 41.5.1, 41.6.0, 42.0.0, 42.0.1, 42.0.2, 43.0.0, 44.0.0, 44.1.0, 44.1.1)
  ERROR: No matching distribution found for setuptools>=61.0
  ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python2.7 /usr/local/lib/python2.7/dist-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-fshMRH/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=61.0' wheel Check the logs for full command output.
The command '/bin/sh -c git clone https://github.com/Gallopsled/pwntools  && python2.7 -m pip install --upgrade --editable pwntools  && python3 -m pip install --upgrade --editable pwntools  && PWNLIB_NOTERM=1 pwn version' returned a non-zero code: 1

Verify on Ubuntu

If possible, please verify that your issue occurs on 64-bit Ubuntu 22.04. We provide a Dockerfile based on Ubuntu 22.04 via docker.io to make this super simple, no VM required!

Building on Arch Linux (6.12.13-1-lts).

@peace-maker
Copy link
Member

The docker container on the dev branch is currently broken I think #2537

Python2 support was dropped recently, so try updating your branch on the latest dev (and maybe temporarily add the changes from the linked PR).

@big-green-lemon
Copy link
Author

big-green-lemon commented Feb 28, 2025

Merged dev branch from the official repo.

Travis builds fine, but seems to fail to run on a regular basis because of curses.setupterm(). Can't think of anything that could improve or worsen this issue so far.

$ make -C travis/docker ANDROID=no TARGET=fmtstr.rst
[TRUNCATED]
 * Starting OpenBSD Secure Shell server sshd                                              [ OK ] 
0
DOCTEST TARGET is /home/pwntools/pwntools/docs/source/fmtstr.rst
Running Sphinx v8.1.3
loading translations [en]... done
Converting `source_suffix = '.rst'` to `source_suffix = {'.rst': 'restructuredtext'}`.
loading pickled environment... The configuration has changed (1 option: 'linkcode_resolve')
done
[autosummary] generating autosummary for: about.rst, adb.rst, args.rst, asm.rst, atexception.rst, atexit.rst, commandline.rst, config.rst, constants.rst, context.rst, ..., util/iters.rst, util/lists.rst, util/misc.rst, util/net.rst, util/packing.rst, util/proc.rst, util/safeeval.rst, util/sh_string.rst, util/web.rst, windbg.rst
building [mo]: targets for 0 po files that are specified
writing output... 
building [doctest]: 1 source files given on command line
updating environment: 0 added, 3 changed, 0 removed
reading sources... [100%] protocols
looking for now-outdated files... none found
pickling environment... done
checking consistency... /home/pwntools/pwntools/docs/source/elf.rst: WARNING: document isn't included in any toctree
/home/pwntools/pwntools/docs/source/regsort.rst: WARNING: document isn't included in any toctree
/home/pwntools/pwntools/docs/source/rop.rst: WARNING: document isn't included in any toctree
/home/pwntools/pwntools/docs/source/elf/config.rst: document is referenced in multiple toctrees: ['elf', 'index'], selecting: index <- elf/config
/home/pwntools/pwntools/docs/source/elf/corefile.rst: document is referenced in multiple toctrees: ['elf', 'index'], selecting: index <- elf/corefile
/home/pwntools/pwntools/docs/source/elf/elf.rst: document is referenced in multiple toctrees: ['elf', 'index'], selecting: index <- elf/elf
/home/pwntools/pwntools/docs/source/rop/ret2dlresolve.rst: document is referenced in multiple toctrees: ['index', 'rop'], selecting: rop <- rop/ret2dlresolve
/home/pwntools/pwntools/docs/source/rop/rop.rst: document is referenced in multiple toctrees: ['index', 'rop'], selecting: rop <- rop/rop
/home/pwntools/pwntools/docs/source/rop/srop.rst: document is referenced in multiple toctrees: ['index', 'rop'], selecting: rop <- rop/srop
/home/pwntools/pwntools/docs/source/shellcraft/aarch64.rst: document is referenced in multiple toctrees: ['index', 'shellcraft'], selecting: shellcraft <- shellcraft/aarch64
/home/pwntools/pwntools/docs/source/shellcraft/amd64.rst: document is referenced in multiple toctrees: ['index', 'shellcraft'], selecting: shellcraft <- shellcraft/amd64
/home/pwntools/pwntools/docs/source/shellcraft/arm.rst: document is referenced in multiple toctrees: ['index', 'shellcraft'], selecting: shellcraft <- shellcraft/arm
/home/pwntools/pwntools/docs/source/shellcraft/common.rst: document is referenced in multiple toctrees: ['index', 'shellcraft'], selecting: shellcraft <- shellcraft/common
/home/pwntools/pwntools/docs/source/shellcraft/i386.rst: document is referenced in multiple toctrees: ['index', 'shellcraft'], selecting: shellcraft <- shellcraft/i386
/home/pwntools/pwntools/docs/source/shellcraft/loongarch64.rst: document is referenced in multiple toctrees: ['index', 'shellcraft'], selecting: shellcraft <- shellcraft/loongarch64
/home/pwntools/pwntools/docs/source/shellcraft/mips.rst: document is referenced in multiple toctrees: ['index', 'shellcraft'], selecting: shellcraft <- shellcraft/mips
/home/pwntools/pwntools/docs/source/shellcraft/riscv64.rst: document is referenced in multiple toctrees: ['index', 'shellcraft'], selecting: shellcraft <- shellcraft/riscv64
/home/pwntools/pwntools/docs/source/shellcraft/thumb.rst: document is referenced in multiple toctrees: ['index', 'shellcraft'], selecting: shellcraft <- shellcraft/thumb
/home/pwntools/pwntools/docs/source/tubes/buffer.rst: document is referenced in multiple toctrees: ['index', 'tubes'], selecting: tubes <- tubes/buffer
/home/pwntools/pwntools/docs/source/tubes/processes.rst: document is referenced in multiple toctrees: ['index', 'tubes'], selecting: tubes <- tubes/processes
/home/pwntools/pwntools/docs/source/tubes/serial.rst: document is referenced in multiple toctrees: ['index', 'tubes'], selecting: tubes <- tubes/serial
/home/pwntools/pwntools/docs/source/tubes/sockets.rst: document is referenced in multiple toctrees: ['index', 'tubes'], selecting: tubes <- tubes/sockets
/home/pwntools/pwntools/docs/source/tubes/ssh.rst: document is referenced in multiple toctrees: ['index', 'tubes'], selecting: tubes <- tubes/ssh
done
preparing documents... done
copying assets... 
copying assets: done
running tests...

Document: fmtstr
----------------
**********************************************************************
File "<global_setup>", line 1, in default (setup code)
Failed example:
    from pwn import *
    import tempfile
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python3.10/doctest.py", line 1350, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest default (setup code)[1]>", line 1, in <module>
        from pwn import *
      File "/home/pwntools/pwntools/pwn/__init__.py", line 4, in <module>
        from pwn.toplevel import *
      File "/home/pwntools/pwntools/pwn/toplevel.py", line 92, in <module>
        colored_traceback.add_hook()
      File "/usr/local/lib/python3.10/dist-packages/colored_traceback/colored_traceback.py", line 78, in add_hook
        colorizer = Colorizer(style, colors, debug)
      File "/usr/local/lib/python3.10/dist-packages/colored_traceback/colored_traceback.py", line 64, in __init__
        self.formatter = _determine_formatter(style, colors, debug)
      File "/usr/local/lib/python3.10/dist-packages/colored_traceback/colored_traceback.py", line 38, in _determine_formatter
        colors = colors or _get_term_color_support()
      File "/usr/local/lib/python3.10/dist-packages/colored_traceback/colored_traceback.py", line 34, in _get_term_color_support
        curses.setupterm()
    io.UnsupportedOperation: fileno
**********************************************************************
1 items had failures:
   1 of   2 in default (setup code)
***Test Failed*** 1 failures.

Doctest summary
===============
    0 tests
    0 failures in tests
    1 failure in setup code
    0 failures in cleanup code
build finished with problems, 3 warnings.
make: *** [Makefile:23: doctest3] Error 1
make: Leaving directory '/home/user/pwntools/travis/docker'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants