devcontainers-contrib / features

🐳 Extra add-in features for Devcontainers and GitHub Codespaces
MIT License
214 stars 111 forks source link

[Bug]: Codespaces creation fails when pre-commit feature is enabled #513

Closed alexef closed 10 months ago

alexef commented 10 months ago

Feature id and version

ghcr.io/devcontainers-contrib/features/pre-commit:2

Devcontainer base Image

mcr.microsoft.com/devcontainers/python:1-3.11-bullseye

What happened?

Broke a couple codespaces after changing image to python 3.11 and enabling precommit.

Here are the logs before codespace build becomes nonresponsive:

Relevant log output

#15 0.493 ===========================================================================
#15 0.493 Feature       : Pre-Commit (via pipx)
#15 0.493 Description   : Pre-Commit is a framework for managing and maintaining multi-language pre-commit hooks.
#15 0.493 Id            : ghcr.io/devcontainers-contrib/features/pre-commit
#15 0.493 Version       : 2.0.16
#15 0.493 Documentation : http://github.com/devcontainers-contrib/features/tree/main/src/pre-commit
#15 0.493 Options       :
#15 0.493     VERSION="latest"
#15 0.493 ===========================================================================
#15 0.499 bash: cannot set terminal process group (1): Inappropriate ioctl for device
#15 0.499 bash: no job control in this shell
#15 1.360 nanolayer
#15 4.147 cd /tmp/tmp4_gtvatu && chmod +x -R . && _REMOTE_USER="vscode" _REMOTE_USER_HOME="/home/vscode" PACKAGE="pre-commit" VERSION="latest" INJECTIONS="" INCLUDEDEPS="false" INTERPRETER="python3" NANOLAYER_VERBOSE="" NANOLAYER_FORCE_CLI_INSTALLATION="" NANOLAYER_PROPAGATE_CLI_LOCATION="1" NANOLAYER_CLI_LOCATION="/tmp/nanolayer-CNoE08Di4p/nanolayer" bash  -i  +H ./install.sh
#15 4.147 python3 is hashed (/usr/local/bin/python3)
#15 4.793 
#15 4.793 [notice] A new release of pip is available: 23.1.2 -> 23.2.1
#15 4.793 [notice] To update, run: pip install --upgrade pip
alexef commented 10 months ago

Nevermind, it took > 2 minutes, but seems to have gone through:


#15 4.147 python3 is hashed (/usr/local/bin/python3)
#15 4.793 
#15 4.793 [notice] A new release of pip is available: 23.1.2 -> 23.2.1
#15 4.793 [notice] To update, run: pip install --upgrade pip
#15 147.5 Collecting pipx
#15 147.5   Downloading pipx-1.2.0-py3-none-any.whl (57 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 57.8/57.8 kB 44.3 MB/s eta 0:00:00
#15 147.5 Collecting argcomplete>=1.9.4 (from pipx)
#15 147.5   Downloading argcomplete-3.1.1-py3-none-any.whl (41 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 41.5/41.5 kB 194.6 MB/s eta 0:00:00
#15 147.5 Collecting packaging>=20.0 (from pipx)
#15 147.6   Downloading packaging-23.1-py3-none-any.whl (48 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 48.9/48.9 kB 261.9 MB/s eta 0:00:00```
danielbraun89 commented 10 months ago

@alexef thanks for reporting! The performance issue was due to a re-installation of pipx in your container even though it already contained pipx a fixed version of pipx-package feature was released which skip pipx installation in this case, and pre-commit (alongside every other pipx based feature) was updated in #515

ghcr.io/devcontainers-contrib/features/pre-commit:2.0.17 should run run little faster now