shebang limit breaks dune_extract_static.py
Dear all, I am not sure if this is the right place to report.
I got the following error when configuring dune-testtools
:
CMake Error at /.../dune-python/cmake/modules/DuneExecuteProcess.cmake:26 (message):
Error extracting static info from
/.../dune-testtools/dune/testtools/test/cmakediscard/discard.mini
Run
command:/.../environments/arch-minimal/build-gcc-relwithdebinfo/dune-testtools/dune-env;dune_extract_static.py;--ini;/.../dune-testtools/dune/testtools/test/cmakediscard/discard.mini;WORKING_DIRECTORY;/.../environments/arch-minimal/build-gcc-relwithdebinfo/dune-testtools/dune/testtools/test/cmakediscard
Return code: 126
Detailed log:
/.../environments/arch-minimal/build-gcc-relwithdebinfo/dune-testtools/dune-env:
/.../environments/arch-minimal/build-gcc-relwithdebinfo/dune-python/python-env/bin/dune_extract_static.py:
/.../environments/arch-minimal/build-gcc-relwithdebinfo/dune-python/python-env/bi:
bad interpreter: No such file or directory
Call Stack (most recent call first):
cmake/modules/DuneSystemtests.cmake:160 (dune_execute_process)
cmake/modules/DuneSystemtests.cmake:377 (add_static_variants)
dune/testtools/test/cmakediscard/CMakeLists.txt:4 (dune_add_system_test)
The cause is the shebang in the /.../environments/arch-minimal/build-gcc-relwithdebinfo/dune-python/python-env/bin/dune_extract_static.py
script:
#!/.../environments/arch-minimal/build-gcc-relwithdebinfo/dune-python/python-env/bin/python
While I stripped the path, the actual length of the shebang is 135 characters, which is more than the most linux kernels support by default (which is 128). The shebang stripped at 128 characters give the interpreter
#!/.../environments/arch-minimal/build-gcc-relwithdebinfo/dune-python/python-env/bi
which then breaks everything.
I have no idea how to fix this (apart from renaming my directory structure), some people propose wrapper scripts, but I am not sure if that idea is applicable here.