mirror of
https://github.com/oven-sh/bun
synced 2026-02-16 05:42:43 +00:00
feat(build): add --compile-executable-path CLI flag (#25934)
## Summary Adds a new CLI flag `--compile-executable-path` that allows specifying a custom Bun executable path for cross-compilation instead of downloading from the npm registry. ## Usage ```bash bun build --compile --target=bun-linux-x64 \ --compile-executable-path=/path/to/bun-linux-x64 app.ts ``` ## Motivation The `executablePath` option was already available in the JavaScript `Bun.build()` API. This exposes the same functionality from the CLI. ## Changes - Added `--compile-executable-path <STR>` CLI parameter in `src/cli/Arguments.zig` - Added `compile_executable_path` field to `BundlerOptions` in `src/cli.zig` - Wired the option through to `StandaloneModuleGraph.toExecutable()` in `src/cli/build_command.zig` --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -468,7 +468,7 @@ pub const BuildCommand = struct {
|
||||
this_transpiler.options.output_format,
|
||||
ctx.bundler_options.windows,
|
||||
ctx.bundler_options.compile_exec_argv orelse "",
|
||||
null,
|
||||
ctx.bundler_options.compile_executable_path,
|
||||
.{
|
||||
.disable_default_env_files = !ctx.bundler_options.compile_autoload_dotenv,
|
||||
.disable_autoload_bunfig = !ctx.bundler_options.compile_autoload_bunfig,
|
||||
|
||||
Reference in New Issue
Block a user