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

Missing AGENT_TOOLSDIRECTORY env variable for setup-python@v2 #217

Closed
mjpieters opened this issue May 1, 2020 · 1 comment
Closed

Missing AGENT_TOOLSDIRECTORY env variable for setup-python@v2 #217

mjpieters opened this issue May 1, 2020 · 1 comment

Comments

@mjpieters
Copy link

The setup-python@v2 action makes the following assumptions:

  • On linux, the /etc/lsb-release file is read and the DISTRIB_RELEASE=... value must match the platform_version keys in the Python versions manifest. In practice this means the container must be based on Ubuntu.
  • Once downloaded, each Python version has a setup.sh file, generated from a template that assumes the AGENT_TOOLSDIRECTORY env variable exists; this is just an alias for RUNNER_TOOL_CACHE.
  • The python -m pip install --ignore-installed pip upgrade step requires SSL libraries to be installed (openssl)

So I can make the action work by:

  • Using my own Ubuntu-based docker image (mjpieters/act-container:18.04, which is just node:buster-slim but using ubuntu:18.04 rather than Debian Buster, with openssl added; 180MB small, see https://hub.docker.com/repository/docker/mjpieters/act-container)

  • adding the following build step:

    env:
        AGENT_TOOLSDIRECTORY: ${{ runner.tool_cache }}

While I understand that the node:*-slim containers are only meant to be starter images, could act be updated to provide the AGENT_TOOLSDIRECTORY variable?

Test workflow:

name: Run testsuite

on:
  push

jobs:
  test:
    name: Run Python
    runs-on: ubuntu-latest
    env:
        AGENT_TOOLSDIRECTORY: ${{ runner.tool_cache }}
    steps:
    - name: Set up Python 3.7
      uses: actions/setup-python@v2
      with:
        python-version: 3.7
    - name: Test Python
      run: |
        python -V
@mjpieters
Copy link
Author

This appears to be a python-versions bug instead. It was already fixed in the Windows install script, so I proposed a fix for the Linux version.

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

No branches or pull requests

1 participant