8000 [Bug]: Build timeout in fresh repository if git index is not fresh · Issue #29854 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
  • Insights
  • [Bug]: Build timeout in fresh repository if git index is not fresh #29854
    Open
    @scottshambaugh

    Description

    @scottshambaugh

    A combination of a slower machine and the git history getting really large results in a confusing error when building from a freshly cloned repository. My first instinct when seeing the 40 second timeout was that something was hanging, but it looks like this was actually just a too-short timeout threshold.

    We should either:

    • Increase the timeout (but this is a moving target)
    • Put a git status in the development installation instructions
    • Make the error message more helpful

    Steps to reproduce:

    • Clone the repository (do not run git status)
    • Build from source
    • setuptools_scm error, which results from a 40 second timeout
    • Run git status, which will refresh the git index (10-20 second task)
    • Building from source does not time out now
    (mpl-dev) scott@DESKTOP-M5S4AGS:~/coding/matplotlib$ pip install --verbose --no-build-isolation --editable ".[dev]"
    Using pip 25.0.1 from /home/scott/anaconda3/envs/mpl-dev/lib/python3.12/site-packages/pip (python 3.12)
    Obtaining file:///mnt/c/Users/Scott/Documents/Documents/Coding/matplotlib
      Running command Checking if build backend supports build_editable
      Checking if build backend supports build_editable ... done
      Running command Preparing editable metadata (pyproject.toml)
      + meson setup --reconfigure /mnt/c/Users/Scott/Documents/Documents/Coding/matplotlib /mnt/c/Users/Scott/Documents/Documents/Coding/matplotlib/build/cp312 -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=/mnt/c/Users/Scott/Documents/Documents/Coding/matplotlib/build/cp312/meson-python-native-file.ini
      The Meson build system
      Version: 1.7.0
      Source dir: /mnt/c/Users/Scott/Documents/Documents/Coding/matplotlib
      Build dir: /mnt/c/Users/Scott/Documents/Documents/Coding/matplotlib/build/cp312
      Build type: native build
      Program python3 found: YES (/home/scott/anaconda3/envs/mpl-dev/bin/python3)
    
      ../../meson.build:4:11: ERROR: Command `/home/scott/anaconda3/envs/mpl-dev/bin/python3 -m setuptools_scm` failed with status 1.
    
      A full log can be found at /mnt/c/Users/Scott/Documents/Documents/Coding/matplotlib/build/cp312/meson-logs/meson-log.txt
      error: subprocess-exited-with-error
    

    meson-log.txt looks like:

    Build started at 2025-04-01T13:04:59.883199
    Main binary: /home/scott/anaconda3/envs/mpl-dev/bin/python3.12
    Build Options: -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=/mnt/c/Users/Scott/Documents/Documents/Coding/matplotlib/build/cp312/meson-python-native-file.ini
    Python system: Linux
    The Meson build system
    Version: 1.7.0
    Source dir: /mnt/c/Users/Scott/Documents/Documents/Coding/matplotlib
    Build dir: /mnt/c/Users/Scott/Documents/Documents/Coding/matplotlib/build/cp312
    Build type: native build
    Program python3 found: YES (/home/scott/anaconda3/envs/mpl-dev/bin/python3)
    Running command: /home/scott/anaconda3/envs/mpl-dev/bin/python3 -m setuptools_scm
    --- stdout ---
    
    --- stderr ---
    Traceback (most recent call last):
      File "<frozen runpy>", line 198, in _run_module_as_main
      File "<frozen runpy>", line 88, in _run_code
      File "/home/scott/anaconda3/envs/mpl-dev/lib/python3.12/site-packages/setuptools_scm/__main__.py", line 6, in <module>
        raise SystemExit(main())
                         ^^^^^^
      File "/home/scott/anaconda3/envs/mpl-dev/lib/python3.12/site-packages/setuptools_scm/_cli.py", line 37, in main
        version = _get_version(
                  ^^^^^^^^^^^^^
      File "/home/scott/anaconda3/envs/mpl-dev/lib/python3.12/site-packages/setuptools_scm/_get_version_impl.py", line 98, in _get_version
        parsed_version = parse_version(config)
                         ^^^^^^^^^^^^^^^^^^^^^
      File "/home/scott/anaconda3/envs/mpl-dev/lib/python3.12/site-packages/setuptools_scm/_get_version_impl.py", line 61, in parse_version
        or parse_scm_version(config)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/scott/anaconda3/envs/mpl-dev/lib/python3.12/site-packages/setuptools_scm/_get_version_impl.py", line 40, in parse_scm_version
        return _entrypoints.version_from_entrypoint(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/scott/anaconda3/envs/mpl-dev/lib/python3.12/site-packages/setuptools_scm/_entrypoints.py", line 57, in version_from_entrypoint
        maybe_version: version.ScmVersion | None = fn(root, config=config)
                                                   ^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/scott/anaconda3/envs/mpl-dev/lib/python3.12/site-packages/setuptools_scm/git.py", line 215, in parse
        return _git_parse_inner(
               ^^^^^^^^^^^^^^^^^
      File "/home/scott/anaconda3/envs/mpl-dev/lib/python3.12/site-packages/setuptools_scm/git.py", line 257, in _git_parse_inner
        version = version_from_describe(wd, config, describe_command)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/scott/anaconda3/envs/mpl-dev/lib/python3.12/site-packages/setuptools_scm/git.py", line 239, in version_from_describe
        describe_res = wd.default_describe()
                       ^^^^^^^^^^^^^^^^^^^^^
      File "/home/scott/anaconda3/envs/mpl-dev/lib/python3.12/site-packages/setuptools_scm/git.py", line 161, in default_describe
        return run_git(DEFAULT_DESCRIBE[1:], self.path)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/scott/anaconda3/envs/mpl-dev/lib/python3.12/site-packages/setuptools_scm/git.py", line 61, in run_git
        return _run(
               ^^^^^
      File "/home/scott/anaconda3/envs/mpl-dev/lib/python3.12/site-packages/setuptools_scm/_run_cmd.py", line 151, in run
        res = subprocess.run(
              ^^^^^^^^^^^^^^^
      File "/home/scott/anaconda3/envs/mpl-dev/lib/python3.12/subprocess.py", line 550, in run
        stdout, stderr = process.communicate(input, timeout=timeout)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/scott/anaconda3/envs/mpl-dev/lib/python3.12/subprocess.py", line 1209, in communicate
        stdout, stderr = self._communicate(input, endtime, timeout)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/scott/anaconda3/envs/mpl-dev/lib/python3.12/subprocess.py", line 2109, in _communicate
        self._check_timeout(endtime, orig_timeout, stdout, stderr)
      File "/home/scott/anaconda3/envs/mpl-dev/lib/python3.12/subprocess.py", line 1253, in _check_timeout
        raise TimeoutExpired(
    subprocess.TimeoutExpired: Command '['git', '--git-dir', '/mnt/c/Users/Scott/Documents/Documents/Coding/matplotlib/.git', 'describe', '--dirty', '--tags', '--long', '--match', '*[0-9]*']' timed out after 40 seconds
    
    
    
    ../../meson.build:4:11: ERROR: Command `/home/scott/anaconda3/envs/mpl-dev/bin/python3 -m setuptools_scm` failed with status 1.
    

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      Type

      No type

      Projects

      No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        0