Virtual-environments: Running yarn can uninstall Python in CI

Created on 22 Jan 2020  路  8Comments  路  Source: actions/virtual-environments

Describe the bug
Our application installs puppeteer inside the Python /share folder using yarn.
Since a few days ago, our CI builds that perform this install (both in Azure Workflows and Github Actions) started failing with the following output:

> chmod +x ./setup.sh && ./setup.sh

Check if Python hostedtoolcache folder exist...
Delete Python 3.7.* if installed
removed '/opt/hostedtoolcache/Python/3.7.6/x64/include/python3.7m/pystate.h'
removed '/opt/hostedtoolcache/Python/3.7.6/x64/include/python3.7m/pyconfig.h'
...

Area for Triage:

Containers
JavaScript and Node.js
Python

Question, Bug, or Feature?:

Bug

Virtual environments affected

  • [ ] macOS 10.15
  • [x] Ubuntu 16.04 LTS
  • [x] Ubuntu 18.04 LTS
  • [ ] Windows Server 2016 R2
  • [ ] Windows Server 2019

Expected behavior
Change directories into a subdirectory of /opt/hostedtoolcache/Python/3.7.6/x64 (e.g. /share).
Install a node dependency using yarn.

Actual behavior
After the yarn (or npm install) command is run, the Python directory is removed.

Run the following workflow:

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - name: Checkout
      uses: actions/checkout@v2
    - name: Install node
      uses: actions/setup-node@v1
      with:
       node-version: '10.x'
    - name: Install Python
      uses: actions/setup-python@v1
      with:
        python-version: '3.7'
        architecture: 'x64'
    - name: Run tests
      run: |
        cd $(dirname $(which python))
        mkdir temp
        cd temp
        yarn

Example: https://github.com/jupyterlab/extension-cookiecutter-ts/pull/53/checks?sha=0ec0ec9dfe3fcdd7d03336b8e69550beba9bcb96

I tried with both 16.04 and 18.04, and with both the system Node/Python and the hostedtoolcache versions.

It may be related to https://github.com/actions/virtual-environments/pull/216

Python Ubuntu awaiting-deployment bug

Most helpful comment

Quick update: we have a solution that should be rolled out fully by mid next week.

All 8 comments

@blink1073 thanks for reporting! We're working on a fix.
Could you try this temporary workaround, please?
Invoke these lines before yarn

cd $(dirname $(which python))
rm -rf ../package.json

Thanks @miketimofeev! I confirmed the work around unblocks us for now.

Wow, thanks for being so responsive!

Quick update: we have a solution that should be rolled out fully by mid next week.

We had a bit of a setback with the deployment and it's probably not going to be until early next week when the fix is in. Apologies for the delay, in the meantime please retain the workaround in your workflows. We'll update this issue and close it once the fix is deployed.

Thanks for the update @alepauly, we ended up using yarn init -y as a permanent solution to avoid any interference from parent folders.

Issue should be fixed for now. Please let us know if it still persists

Cheers!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ydnar picture ydnar  路  3Comments

frankieroberto picture frankieroberto  路  4Comments

Tnze picture Tnze  路  4Comments

trajano picture trajano  路  3Comments

zackijack picture zackijack  路  3Comments