From 0161989522e273f031ad68970de90cf7456ba598 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Tue, 14 Apr 2026 12:45:37 +0300 Subject: [PATCH] all: BusyBox shebang #!/usr/bin/env -S v run (fixes #26820) --- vlib/build/README.md | 7 +++++-- vlib/db/sqlite/install_thirdparty_sqlite.vsh | 2 +- vlib/x/crypto/mldsa/testdata/gen.vsh | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/vlib/build/README.md b/vlib/build/README.md index 7ffe7492c..8d716722e 100644 --- a/vlib/build/README.md +++ b/vlib/build/README.md @@ -7,7 +7,7 @@ > See also: [build_system example](https://github.com/vlang/v/tree/master/examples/build_system) ```v -#!/usr/bin/env -S v run +#!/usr/bin/env v import build // .vsh automatically imports `os`, so you don't need this typically @@ -38,6 +38,9 @@ context.task( context.run() ``` +For portable `.vsh` scripts, prefer `#!/usr/bin/env v`. +That works on BusyBox and OpenBSD too, where `/usr/bin/env -S` is not available. + ## Pre-Compiling Running VSH scripts requires V to compile the script before executing it, which can cause a delay @@ -49,4 +52,4 @@ If you want to fix this, you can "pre-compile" the buildscript by building the s > You will need to rebuild every time you change the buildscript, and you should also add `/build` > to your `.gitignore` -> If you want maximum speed, you can also `v -prod -skip-running build.vsh` \ No newline at end of file +> If you want maximum speed, you can also `v -prod -skip-running build.vsh` diff --git a/vlib/db/sqlite/install_thirdparty_sqlite.vsh b/vlib/db/sqlite/install_thirdparty_sqlite.vsh index ef1af83e3..1d0296959 100755 --- a/vlib/db/sqlite/install_thirdparty_sqlite.vsh +++ b/vlib/db/sqlite/install_thirdparty_sqlite.vsh @@ -1,4 +1,4 @@ -#!/usr/bin/env -S v run +#!/usr/bin/env v import os import net.http diff --git a/vlib/x/crypto/mldsa/testdata/gen.vsh b/vlib/x/crypto/mldsa/testdata/gen.vsh index 94ba9411a..c0274c906 100644 --- a/vlib/x/crypto/mldsa/testdata/gen.vsh +++ b/vlib/x/crypto/mldsa/testdata/gen.vsh @@ -1,4 +1,4 @@ -#!/usr/bin/env -S v run +#!/usr/bin/env v import os -- 2.39.5