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

pip 19.0.2: IndexError when building wheel on osx #6252

Closed
gonzalocasas opened this issue Feb 10, 2019 · 7 comments · Fixed by #6253
Closed

pip 19.0.2: IndexError when building wheel on osx #6252

gonzalocasas opened this issue Feb 10, 2019 · 7 comments · Fixed by #6253
Labels
auto-locked Outdated issues that have been locked by automation C: wheel The wheel format and 'pip wheel' command kind: crash For situations where pip crashes type: bug A confirmed bug or unintended behavior
Milestone

Comments

@gonzalocasas
Copy link

Environment

  • pip version: 19.0.2
  • Python version: 3.6
  • OS: macos 10.13
  • Platform: Travis-ci

The error was observed on travis-ci build's using Miniconda with an environment that contains both conda and pip packages.

Description
It seems release 19.0.2 breaks something related to wheel building under certain circumstances.
The problem started happening yesterday and it popped up exactly after 19.0.2 was released. The build was succeeding on 19.0.1, and as soon as 19.0.2 was available, the build started failing. See successful build #10 and failed build #11. After pinning pip back to 19.0.1, the build started working again.

I don't have a clear idea of what exactly fails, but it seems to be related to cvxpy and its dependency scs, but it is not clear to me if this is in any way connected to the root cause, or is only the visible side-effect.

How to Reproduce

  1. Build using this travis file
  2. If pip version is not pinned, and it uses 19.0.2, an error occurs (see below for tracebacks and full output).

Output
The full build output is available directly on travis: https://travis-ci.com/gramaziokohler/robotic_assembly_workshop/builds/100338039

  Stored in directory: /Users/travis/Library/Caches/pip/wheels/1d/2f/99/1594715f229f93f235d8b370a3b6f16e2b00fbac1087a99902
  Building wheel for scs (setup.py) ... done
Exception:
Traceback (most recent call last):
  File "/Users/travis/miniconda3/envs/workshop/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 179, in main
    status = self.run(options, args)
  File "/Users/travis/miniconda3/envs/workshop/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 355, in run
    session=session, autobuilding=True
  File "/Users/travis/miniconda3/envs/workshop/lib/python3.6/site-packages/pip/_internal/wheel.py", line 980, in build
    python_tag=python_tag,
  File "/Users/travis/miniconda3/envs/workshop/lib/python3.6/site-packages/pip/_internal/wheel.py", line 813, in _build_one
    python_tag=python_tag)
  File "/Users/travis/miniconda3/envs/workshop/lib/python3.6/site-packages/pip/_internal/wheel.py", line 821, in _build_one_inside_env
    wheel_path = builder(req, temp_dir.path, python_tag=python_tag)
  File "/Users/travis/miniconda3/envs/workshop/lib/python3.6/site-packages/pip/_internal/wheel.py", line 898, in _build_one_legacy
    return os.path.join(tempd, sorted(os.listdir(tempd))[0])
IndexError: list index out of range
@cjerdonek
Copy link
Member

The line causing this exception was added in PR #6236.

@cjerdonek cjerdonek added the C: wheel The wheel format and 'pip wheel' command label Feb 10, 2019
@cjerdonek
Copy link
Member

It looks like before, the build in question (of scs) was hitting this line in _build_one_inside_env():
https://github.com/pypa/pip/pull/6236/files#diff-79304b3f74b6bf37043da4d96ccd3755L831
and then causing _build_one_inside_env() to return None. The line in question looked like this, so you can see the exception was being swallowed--

except Exception:
    pass

Now, however, the exception is bubbling up without being handled because the code causing the IndexError was refactored out of that try-except block.

If you look at the Travis log for the successful case (the older one), you can see here: https://travis-ci.com/gramaziokohler/robotic_assembly_workshop/builds/100329545#L284
that it says scs indeed failed to build:

Building wheel for scs (setup.py) ... done
Running setup.py clean for scs
Building wheel for future (setup.py) ... done
Stored in directory: /Users/travis/Library/Caches/pip/wheels/0c/61/d2/d6b7317325828fbb39ee6ad559dbe4664d0896da4721bf379e
Successfully built compas-assembly compas-rbe cvxpy future
Failed to build scs

But this wasn't causing pip to error out before because of the exception swallowing I mentioned above.

@cjerdonek cjerdonek added the type: bug A confirmed bug or unintended behavior label Feb 10, 2019
@cjerdonek
Copy link
Member

I posted a fix for this here: PR #6253.

@cjerdonek
Copy link
Member

@gonzalocasas I don’t think it’s absolutely necessary, but would you be able to test with the version from the PR?

@gonzalocasas
Copy link
Author

@cjerdonek thanks for the fix! it seems i was too slow to test and someone else already approved :)

thx!

@cjerdonek
Copy link
Member

@gonzalocasas Thanks! You might still want to try as it should give you the reason for the failing build in the console output (which even 19.0.1 didn't do). I would be curious to see what the output looks like for you.

@pradyunsg pradyunsg added the kind: crash For situations where pip crashes label Feb 12, 2019
@pradyunsg pradyunsg added this to the 19.0 milestone Feb 12, 2019
atipi referenced this issue in vilkasgroup/Pakettikauppa Mar 12, 2019



### Update [pip](https://pypi.org/project/pip) from **19.0.1** to **19.0.3**.


<details>
  <summary>Changelog</summary>
  
  
   ### 19.0.3
   ```
   ===================

Bug Fixes
---------

- Fix an ``IndexError`` crash when a legacy build of a wheel fails. (`6252 &lt;https://github.com/pypa/pip/issues/6252&gt;`_)
- Fix a regression introduced in 19.0.2 where the filename in a RECORD file
  of an installed file would not be updated when installing a wheel. (`6266 &lt;https://github.com/pypa/pip/issues/6266&gt;`_)
   ```
   
  
  
   ### 19.0.2
   ```
   ===================

Bug Fixes
---------

- Fix a crash where PEP 517-based builds using ``--no-cache-dir`` would fail in
  some circumstances with an ``AssertionError`` due to not finalizing a build
  directory internally. (`6197 &lt;https://github.com/pypa/pip/issues/6197&gt;`_)
- Provide a better error message if attempting an editable install of a
  directory with a ``pyproject.toml`` but no ``setup.py``. (`6170 &lt;https://github.com/pypa/pip/issues/6170&gt;`_)
- The implicit default backend used for projects that provide a ``pyproject.toml``
  file without explicitly specifying ``build-backend`` now behaves more like direct
  execution of ``setup.py``, and hence should restore compatibility with projects
  that were unable to be installed with ``pip`` 19.0. This raised the minimum
  required version of ``setuptools`` for such builds to 40.8.0. (`6163 &lt;https://github.com/pypa/pip/issues/6163&gt;`_)
- Allow ``RECORD`` lines with more than three elements, and display a warning. (`6165 &lt;https://github.com/pypa/pip/issues/6165&gt;`_)
- ``AdjacentTempDirectory`` fails on unwritable directory instead of locking up the uninstall command. (`6169 &lt;https://github.com/pypa/pip/issues/6169&gt;`_)
- Make failed uninstalls roll back more reliably and better at avoiding naming conflicts. (`6194 &lt;https://github.com/pypa/pip/issues/6194&gt;`_)
- Ensure the correct wheel file is copied when building PEP 517 distribution is built. (`6196 &lt;https://github.com/pypa/pip/issues/6196&gt;`_)
- The Python 2 end of life warning now only shows on CPython, which is the
  implementation that has announced end of life plans. (`6207 &lt;https://github.com/pypa/pip/issues/6207&gt;`_)

Improved Documentation
----------------------

- Re-write README and documentation index (`5815 &lt;https://github.com/pypa/pip/issues/5815&gt;`_)
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/pip
  - Changelog: https://pyup.io/changelogs/pip/
  - Homepage: https://pip.pypa.io/
</details>





### Update [wheel](https://pypi.org/project/wheel) from **0.32.3** to **0.33.1**.


<details>
  <summary>Changelog</summary>
  
  
   ### 0.33.1
   ```
   - Fixed the ``--build-number`` option for ``wheel pack`` not being applied
   ```
   
  
  
   ### 0.33.0
   ```
   - Added the ``--build-number`` option to the ``wheel pack`` command
- Fixed bad shebangs sneaking into wheels
- Fixed documentation issue with ``wheel pack`` erroneously being called
  ``wheel repack``
- Fixed filenames with &quot;bad&quot; characters (like commas) not being quoted in
  ``RECORD`` (PR by Paul Moore)
- Sort requirements extras to ensure deterministic builds
  (PR by PoncinMatthieu)
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/wheel
  - Changelog: https://pyup.io/changelogs/wheel/
  - Repo: https://github.com/pypa/wheel
</details>





### Update [PyYAML](https://pypi.org/project/PyYAML) from **4.2b4** to **5.1b3**.


*The bot wasn't able to find a changelog for this release. [Got an idea?](https://github.com/pyupio/changelogs/issues/new)*

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/pyyaml
  - Homepage: http://pyyaml.org/wiki/PyYAML
</details>
@lock
Copy link

lock bot commented May 28, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label May 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators May 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation C: wheel The wheel format and 'pip wheel' command kind: crash For situations where pip crashes type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants