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

install-vmod shebang does not work on linux/arm64 architecture #11

Open
thomasklinger1234 opened this issue Jul 16, 2024 · 0 comments
Open

Comments

@thomasklinger1234
Copy link

thomasklinger1234 commented Jul 16, 2024

Observed Behavior

When I run install-vmod -h in a Docker container (e.g. varnish:7.5.0) with --platform=linux/arm64 or similar it breaks with the following exception:

#10 [builder  4/13] RUN set -ex;     /usr/local/bin/install-vmod -h
#10 0.087 + /usr/local/bin/install-vmod -h
#10 0.096 Error while loading /usr/local/bin/install-vmod: Exec format error
#10 ERROR: process "/dev/.buildkit_qemu_emulator /bin/sh -c set -ex;     /usr/local/bin/install-vmod -h" did not complete successfully: exit code: 1
------
 > [builder  4/13] RUN set -ex;     /usr/local/bin/install-vmod -h:
/usr/local/bin/install-vmod -h
0.096 Error while loading /usr/local/bin/install-vmod: Exec format error
------
Dockerfile:31
--------------------
  30 |     
  31 | >>> RUN set -ex; \
  32 | >>>     /usr/local/bin/install-vmod -h
  33 |     
--------------------

Expected Behavior

I tracked it down to the shebang in https://github.com/varnish/toolbox/blob/master/install-vmod/install-vmod#L1 not being recognized somehow on ARM based docker images or runtimes.

Possible Solution

After changing the shebang to either #!/bin/sh or #!/usr/bin/env bash the script magically worked. To keep compatbility with the existing script and also keep minimal distros like Alpine in mind, the fixt might be:

- #/bin/sh
+ #!/bin/sh

Background

Wikipedia also mentiones the special syntax for shebangs as #! so the current implementation might only work due to luck or amd variants having special fallbacks or syntax for first-line during execution.

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