[GH-ISSUE #217] Missing AGENT_TOOLSDIRECTORY env variable for setup-python@v2 #150

Closed
opened 2026-03-01 21:40:39 +03:00 by kerem · 1 comment
Owner

Originally created by @mjpieters on GitHub (May 1, 2020).
Original GitHub issue: https://github.com/nektos/act/issues/217

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
Originally created by @mjpieters on GitHub (May 1, 2020). Original GitHub issue: https://github.com/nektos/act/issues/217 The [setup-python@v2 action](https://github.com/actions/setup-python/) 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](https://github.com/actions/python-versions/blob/master/versions-manifest.json). 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](https://github.com/actions/python-versions/blob/master/installers/nix-setup-template.sh) 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: ```yaml 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: ```yaml 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 ```
kerem closed this issue 2026-03-01 21:40:40 +03:00
Author
Owner

@mjpieters commented on GitHub (May 1, 2020):

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.

<!-- gh-comment-id:622611519 --> @mjpieters commented on GitHub (May 1, 2020): This appears to be a `python-versions` bug instead. It was [already fixed in the Windows install script](https://github.com/actions/python-versions/pull/2), so I [proposed a fix for the Linux version](https://github.com/actions/python-versions/pull/21).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#150
No description provided.