Title: `RUNNER_TOOL_CACHE` and/or `AGENT_TOOLSDIRECTORY` not picked up on self hosted runner · Issue #914 · actions/setup-python · GitHub
Open Graph Title: `RUNNER_TOOL_CACHE` and/or `AGENT_TOOLSDIRECTORY` not picked up on self hosted runner · Issue #914 · actions/setup-python
X Title: `RUNNER_TOOL_CACHE` and/or `AGENT_TOOLSDIRECTORY` not picked up on self hosted runner · Issue #914 · actions/setup-python
Description: Description: I have exported RUNNER_TOOL_CACHE and AGENT_TOOLSDIRECTORY in the shell running the self-hosted runner, however a pip install in the workflow still uses /opt/hostedtoolcache directory. job-log.txt 2024-07-23T09:20:33.0492190...
Open Graph Description: Description: I have exported RUNNER_TOOL_CACHE and AGENT_TOOLSDIRECTORY in the shell running the self-hosted runner, however a pip install in the workflow still uses /opt/hostedtoolcache directory....
X Description: Description: I have exported RUNNER_TOOL_CACHE and AGENT_TOOLSDIRECTORY in the shell running the self-hosted runner, however a pip install in the workflow still uses /opt/hostedtoolcache directory....
Opengraph URL: https://github.com/actions/setup-python/issues/914
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`RUNNER_TOOL_CACHE` and/or `AGENT_TOOLSDIRECTORY` not picked up on self hosted runner","articleBody":"**Description:**\r\nI have exported `RUNNER_TOOL_CACHE` and `AGENT_TOOLSDIRECTORY` in the shell running the self-hosted runner, however a `pip install` in the workflow still uses `/opt/hostedtoolcache` directory.\r\n[job-log.txt](https://github.com/user-attachments/files/16347101/job-log.txt)\r\n```\r\n2024-07-23T09:20:33.0492190Z [1/41] Compiling C object gi/_gi.cpython-310-x86_64-linux-gnu.so.p/pygboxed.c.o\r\n2024-07-23T09:20:33.0493604Z FAILED: gi/_gi.cpython-310-x86_64-linux-gnu.so.p/pygboxed.c.o\r\n2024-07-23T09:20:33.0502062Z cc -Igi/_gi.cpython-310-x86_64-linux-gnu.so.p -Igi -I../gi -I. -I.. -I/opt/hostedtoolcache/Python/3.10.14/x64/include/python3.10 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/\r\nusr/include/gobject-introspection-1.0 -fvisibility=hidden -fdiagnostics-color=always -DNDEBUG -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O3 -fPIC -DPY_SSIZE_T_CLEAN -Wall -Warray-bounds -Wcast-align -Wduplicated-branches -Wextra -Wform\r\nat=2 -Wformat-nonliteral -Wformat-security -Wimplicit-function-declaration -Winit-self -Wjump-misses-init -Wlogical-op -Wmissing-declarations -Wmissing-format-attribute -Wmissing-include-dirs -Wmissing-noreturn -Wmissing-prototypes -Wne\r\nsted-externs -Wnull-dereference -Wold-style-definition -Wpacked -Wpointer-arith -Wrestrict -Wreturn-type -Wshadow -Wsign-compare -Wstrict-aliasing -Wstrict-prototypes -Wswitch-default -Wundef -Wunused-but-set-variable -Wwrite-strings -W\r\nno-missing-field-initializers -Wno-unused-parameter -Wno-discarded-qualifiers -Wno-sign-conversion -Wno-cast-function-type -Wno-int-conversion -fno-strict-aliasing -fvisibility=hidden -MD -MQ gi/_gi.cpython-310-x86_64-linux-gnu.so.p/pygboxed.c.o -MF gi/_gi.cpython-310-x86_64-linux-gnu.so.p/pygboxed.c.o.d -o gi/_gi.cpython-310-x86_64-linux-gnu.so.p/pygboxed.c.o -c ../gi/pygboxed.c\r\n2024-07-23T09:20:33.0511885Z cc1: warning: /opt/hostedtoolcache/Python/3.10.14/x64/include/python3.10: No such file or directory [-Wmissing-include-dirs]\r\n2024-07-23T09:20:33.0513997Z ../gi/pygboxed.c:23:10: fatal error: Python.h: No such file or directory\r\n2024-07-23T09:20:33.0515317Z 23 | #include \u003cPython.h>\r\n2024-07-23T09:20:33.0516190Z | ^~~~~~~~~~\r\n2024-07-23T09:20:33.0517073Z compilation terminated.\r\n```\r\n\r\n**Action version:**\r\n`actions/setup-python@v5`\r\n\r\n**Platform:**\r\n- [x] Ubuntu\r\n- [ ] macOS\r\n- [ ] Windows\r\n\r\n**Runner type:**\r\n- [ ] Hosted\r\n- [x] Self-hosted\r\n\r\n**Tools version:**\r\npython-version: '3.10'\r\n\r\n**Repro steps:** \r\n```yaml\r\nname: setup python on shr \r\n# Test pip install which requires compilation on host where include path is not correct \r\n# https://github.com/actions/setup-python/issues/485 \r\n# https://github.com/actions/setup-python/issues/489 \r\n \r\non: \r\n # Allows you to run this workflow manually from the Actions tab \r\n workflow_dispatch: \r\n push: \r\n branches: \r\n - setup-python-pip-install \r\n \r\njobs: \r\n test-python: \r\n name: Test Python pip install \r\n runs-on: [self-hosted, linux, test-python] \r\n steps: \r\n - name: Github Actions Context Information \r\n uses: SiemaApplications-attic/vossloh-gh-actions/debug/show-github-context@v7 \r\n \r\n - uses: actions/setup-python@v5 \r\n with: \r\n python-version: '3.10' \r\n \r\n - name: show env \r\n run: | \r\n env \r\n \r\n - name: python pkg install \r\n run: | \r\n pip install PyGObject\r\n```\r\nFrom the Self-hosted runner directory:\r\n```bash\r\nexport RUNNER_TOOL_CACHE=\"$(pwd)/_work/_tool\"\r\nexport AGENT_TOOLSDIRECTORY=\"$(pwd)/_work/_tool\"\r\n./run.sh\r\n```\r\n\r\n\r\n**Expected behavior:**\r\nI would expect the `pip install` step to set properly the `-I` flags without `/opt/hostedtoolcache`\r\n\r\n**Actual behavior:**\r\nThe logs (see above) show that it tried to add an include path (`-I/opt/hostedtoolcache/Python/3.10.14/x64/include/python3.10`) which do not exist on the self hosted runner.\r\n\r\n**Workaround I am not fond of**\r\n```\r\nexport CPATH=$(pwd)/_work/_tool/Python/3.10.14/x64/include/python3.10\r\n./run.sh\r\n```\r\nWith this workaround I manage to install the lib, however it looks like that pip cached some stuff in the default cache directory:\r\n```\r\n pip install PyGObject\r\n shell: /usr/bin/bash -e {0}\r\n env:\r\n pythonLocation: /home/nicolas/work/siema/be/shr/_work/_tool/Python/3.10.14/x64\r\n PKG_CONFIG_PATH: /home/nicolas/work/siema/be/shr/_work/_tool/Python/3.10.14/x64/lib/pkgconfig\r\n Python_ROOT_DIR: /home/nicolas/work/siema/be/shr/_work/_tool/Python/3.10.14/x64\r\n Python2_ROOT_DIR: /home/nicolas/work/siema/be/shr/_work/_tool/Python/3.10.14/x64\r\n Python3_ROOT_DIR: /home/nicolas/work/siema/be/shr/_work/_tool/Python/3.10.14/x64\r\n LD_LIBRARY_PATH: /home/nicolas/work/siema/be/shr/_work/_tool/Python/3.10.14/x64/lib\r\nCollecting PyGObject\r\n Using cached pygobject-3.48.2.tar.gz (715 kB)\r\n Installing build dependencies: started\r\n Installing build dependencies: finished with status 'done'\r\n Getting requirements to build wheel: started\r\n Getting requirements to build wheel: finished with status 'done'\r\n Installing backend dependencies: started\r\n Installing backend dependencies: finished with status 'done'\r\n Preparing metadata (pyproject.toml): started\r\n Preparing metadata (pyproject.toml): finished with status 'done'\r\nCollecting pycairo>=1.16 (from PyGObject)\r\n Using cached pycairo-1.26.1-cp310-cp310-linux_x86_64.whl\r\nBuilding wheels for collected packages: PyGObject\r\n Building wheel for PyGObject (pyproject.toml): started\r\n Building wheel for PyGObject (pyproject.toml): finished with status 'done'\r\n Created wheel for PyGObject: filename=pygobject-3.48.2-cp310-cp310-linux_x86_64.whl size=259354 sha256=fc1421f9adae4077d60198ee04309773969c33b2372d1cc93f2733967c3f3f96\r\n Stored in directory: /home/nicolas/.cache/pip/wheels/94/02/70/6ba5403853459b4afcbb7c0348deece9bbc5853d9e0889dc97\r\nSuccessfully built PyGObject\r\nInstalling collected packages: pycairo, PyGObject\r\nSuccessfully installed PyGObject-3.48.2 pycairo-1.26.1\r\n```\r\n(`Stored in directory: /home/nicolas/.cache/pip/wheels/94/02/70/6ba5403853459b4afcbb7c0348deece9bbc5853d9e0889dc97`)\r\neven though the `RUNNER_TOOL_CACHE` and `AGENT_TOOLSDIRECTORY` have been set up.\r\n\r\nI took the idea of this workaround from https://github.com/actions/setup-python/issues/489 and https://github.com/actions/setup-python/issues/485\r\nHowever I do not understand why the `RUNNER_TOOL_CACHE` and `AGENT_TOOLSDIRECTORY` are not used.\r\n\r\nBeside, if i run\r\n```bash\r\ngrep -R /opt/hostedtoolcache *\r\n```\r\nfrom `_work/_tool` I get a lot of match:\r\n\r\n```\r\n...\r\nPython/3.10.14/x64/lib/python3.10/config-3.10-x86_64-linux-gnu/Makefile:CONFIGURE_LDFLAGS= -Wl,--rpath=/opt/hostedtoolcache/Python/3.10.14/x64/lib\r\nPython/3.10.14/x64/lib/python3.10/config-3.10-x86_64-linux-gnu/Makefile:prefix= /opt/hostedtoolcache/Python/3.10.14/x64\r\nPython/3.10.14/x64/lib/python3.10/config-3.10-x86_64-linux-gnu/Makefile:CONFIG_ARGS= '--prefix=/opt/hostedtoolcache/Python/3.10.14/x64' '--enable-shared' '--enable-optimizations' '--enable-loadable-sqlite-extensions' 'LDFLAGS=-Wl,--rpath=/opt/hostedtoolcache/Python/3.10.14/x64/lib'\r\nPython/3.10.14/x64/lib/python3.10/config-3.10-x86_64-linux-gnu/python-config.py:#!/opt/hostedtoolcache/Python/3.10.14/x64/bin/python3.10\r\ngrep: Python/3.10.14/x64/lib/python3.10/config-3.10-x86_64-linux-gnu/libpython3.10.a: binary file matches\r\nPython/3.10.14/x64/lib/pkgconfig/python-3.10-embed.pc:prefix=/opt/hostedtoolcache/Python/3.10.14/x64\r\nPython/3.10.14/x64/lib/pkgconfig/python3.pc:prefix=/opt/hostedtoolcache/Python/3.10.14/x64\r\nPython/3.10.14/x64/lib/pkgconfig/python-3.10.pc:prefix=/opt/hostedtoolcache/Python/3.10.14/x64\r\nPython/3.10.14/x64/lib/pkgconfig/python3-embed.pc:prefix=/opt/hostedtoolcache/Python/3.10.14/x64\r\n...\r\n```\r\n\r\nI don't really know where pip gets the include path from, but I guess from one of the above files which clearly points to an invalid folder.\r\n\r\nThanks in advance for your help, let me know if you need more information.","author":{"url":"https://github.com/nvincent-vossloh","@type":"Person","name":"nvincent-vossloh"},"datePublished":"2024-07-23T10:39:42Z","url":"https://github.com/actions/setup-python/issues/914"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:10076c7e-f103-e12e-72cb-472bf31b5809 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ECD2:1F95:81AF70:A7F104:6B02619B |
| html-safe-nonce | fd73d4ce3bf7d8b09d751cdfc201daca474a0ca25a0018ec125b6f8f5570f3ea |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQ0QyOjFGOTU6ODFBRjcwOkE3RjEwNDo2QjAyNjE5QiIsInZpc2l0b3JfaWQiOiI0NDUwMTExNjU2OTQ0NjI0MDI3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 619cc5cec0b05002b530367c673ce27cb0f8847f6c330ba0abf38a88588474c9 |
| hovercard-subject-tag | issue:2424862814 |
| github-keyboard-shortcuts | repository,issues,actions,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/actions/setup-python/914/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0f7c92a8626d624c2f240a712be101caa77453fb3c4deb979f6d92463dfd10a3/actions/setup-python/issues/914 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0f7c92a8626d624c2f240a712be101caa77453fb3c4deb979f6d92463dfd10a3/actions/setup-python/issues/914 |
| og:image:alt | Description: I have exported RUNNER_TOOL_CACHE and AGENT_TOOLSDIRECTORY in the shell running the self-hosted runner, however a pip install in the workflow still uses /opt/hostedtoolcache directory.... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | nvincent-vossloh |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/actions/setup-python git https://github.com/actions/setup-python.git |
| octolytics-dimension-user_id | 44036562 |
| octolytics-dimension-user_login | actions |
| octolytics-dimension-repository_id | 192625525 |
| octolytics-dimension-repository_nwo | actions/setup-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 192625525 |
| octolytics-dimension-repository_network_root_nwo | actions/setup-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width