I am sucessfully using GitHub Actions in one of my open source projects, but I think I came across a small, but important issue in the "ubuntu-latest" worker environment which prevent one of my build jobs to sucessfully build. In this project I run long build jobs and build a complete OS image based on the buildroot.org linux distribution.
As said, for one of my matrix jobs the build fails and after some investigation I found the root cause of the issue being that within the "ubuntu-latest" runner/worker environment the shebang maximum line length limit (BINPRM_BUF_SIZE in /usr/include/linux/binfmts.h) seem to be 128 in the ubuntu-latest 18.04 workers, while in a standard ubuntu 19.10 environment the shebang limit is set to 256. See here:
Standard Ubuntu 19.10:
$ grep BINPRM_BUF_SIZE /usr/include/linux/binfmts.h #define BINPRM_BUF_SIZE 256
"ubuntu-latest" worker in GitHub Actions:
runner@fv-az32:$ grep BINPRM_BUF_SIZE /usr/include/linux/binfmts.h #define BINPRM_BUF_SIZE 128
As a result, shell scripts using the shebang qualifier (#! in the top-line of the script) are limited to path length of 128 characters rather than 256 which seem to be more sufficient these days, especially since the checked out directory on a worker is located in /home/runner/work/<PROJECTNAME>/<PROJECTNAME>, which can easily make up already quite a portion of the maximum allowed path/shebang line length limit. In my case this standard path already sums up to 48 out of 128 max characters (/home/runner/work/RaspberryMatic/RaspberryMatic).
So here, in one of the workers the following shell script cannot be executed successfully on the GitHub Actions "ubuntu-latest" workers:
#!/home/runner/work/RaspberryMatic/RaspberryMatic/build-raspmatic_ova/build/recovery-system-1.7.1-2019.11.1/output/host/bin/python3 # EASY-INSTALL-ENTRY-SCRIPT: 'meson==0.52.0','console_scripts','meson' __requires__ = 'meson==0.52.0' import re import sys from pkg_resources import load_entry_point if __name__ == '__main__': sys.argv = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv) sys.exit( load_entry_point('meson==0.52.0', 'console_scripts', 'meson')() )
And that's because the shebang at the top-line sums up to 132 characters.
After reducing the directory path length by renaming the last "RaspberryMatic" directory to a shortcut name the script can be successfully executed and the build runs correctly.
However, I still feel that the shebang limit should be increased to 256 characters like this already seem to be the case for newer ubuntu versions as otherwise build jobs like mine (which use a third party build environment with automatically generated pathes) may run into the same issue.
Solved! Solved! Go to Solution.
Looks like this is an OS limitation, not a virtual environment problem.
Currently the latest Linux virtual environment for GitHub-hosted runner is Ubuntu 18.04, I recommend you can try using a self-hosted runner which is installed on your local machine (or VM) with OS is Ubuntu 19.10 or later.
There is a similar case as reference: https://github.com/pypa/virtualenv/issues/596
Please note that I worked around this OS limitation issue within GitHub Actions by having added the following step snippet right after the checkout:
steps: - uses: actions/checkout@v2 - name: rename worker directory working-directory: ../ run: | mv RaspberryMatic b ln -s b RaspberryMatic
Thus, I am simply renaming my working directory from "RaspberryMatic" to "b" and added a symbolic link. This has the effect that during the buildroot build this drops the shebang length limit below 128 and thus the build finishes correctly.