Skip to content

Conversation

@Nerixyz
Copy link
Contributor

@Nerixyz Nerixyz commented Oct 16, 2025

I was trying to get the code generation to run through CMake (which would run lute in the build). When integrating this into luthier, I needed a way to identify the current lute executable to pass to CMake.

This adds execpath to @lute/process, which mirrors Node.js' process.execPath to get the lute executable path - this is immune to exec -a foo lute having foo as argv[0].

uv_setup_args can allocate on some platforms. That memory should be free'd with uv_library_shutdown. I'm not sure where it's appropriate to call this.

Passing around the argv0 also seems a bit wrong. Maybe this path shouldn't be stored in Runtime?

@Nerixyz
Copy link
Contributor Author

Nerixyz commented Oct 19, 2025

Looks like uv wants uv_library_shutdown to be called once per "process", because it uses a local static: https://github.com/libuv/libuv/blob/a944c422cca5522073e03710ca7fd08f53218358/src/uv-common.c#L975-L978. So in the tests, the library is shut down only once.
Not sure what's the best way to resolve this. Maybe uv's logic for getting the executable name should be implemented here?

@aatxe aatxe merged commit 59b1beb into luau-lang:primary Oct 20, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants