Skip to content

feat(runtime): add Deno.build.standalone for telling if running in self-contained executable #28750

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

Merged
merged 4 commits into from
Apr 15, 2025

Conversation

dsherret
Copy link
Member

@dsherret dsherret commented Apr 4, 2025

Implements #15996 (comment)

Closes #15996

@dsherret dsherret added this to the 2.3.0 milestone Apr 4, 2025
@dsherret dsherret requested a review from lucacasonato April 4, 2025 15:46
Copy link
Contributor

@marvinhagemeister marvinhagemeister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but we should probably update the types too

Copy link
Contributor

@marvinhagemeister marvinhagemeister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh apologies, missed that the types were already there! LGTM

@dsherret dsherret enabled auto-merge (squash) April 15, 2025 17:06
@dsherret dsherret merged commit ef431b2 into denoland:main Apr 15, 2025
17 checks passed
rivy added a commit to rivy/deno.dxx that referenced this pull request Apr 16, 2025
…one binary

- include testing via the Deno-v2.3+ built-in `Deno.build.standalone`

## notes

- determining process execution from a standalone binary enables correct command line
  argument processing for both standalone and deno/deno-like script runners
- classification tests are still heuristic but now more robust, based on discussions at SO
  and within issues/PRs at the deno main repo

## refs

- [SO ~ [deno] Determine if compiled](https://stackoverflow.com/questions/76647896/determine-if-running-uncompiled-ts-script-or-compiled-deno-executa> @@ <https://archive.is/g7xws>
- [deno ~ Runtime API for 'standalone'](denoland/deno#15996) @@ <https://archive.is/Sooka>
- [deno ~ PR - add `Deno.standalone` API](denoland/deno#18402) @@ <https://archive.is/rNZS7>
- [deno ~ PR - feat(runtime): add `Deno.build.standalone`...](denoland/deno#28750) @@ <https://archive.is/4IXQe>
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

Successfully merging this pull request may close these issues.

Runtime API to check whether in self-contained exe
3 participants