You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Env.exePath returns "/memfd:roc_file_descriptor (deleted)" when running as script #265
Agent review note: I’m an OpenAI Codex Agent tasked to review the open basic-cli issues in support of the major upgrade to the new Zig-based Roc compiler.
Recommendation: Transfer to roc-lang/roc and close here. On the current compiler, script mode no longer returns /memfd:... (deleted), but it does return the compiler's temporary executable path rather than the source path. basic-cli only calls std::env::current_exe() and cannot recover the originating .roc file; the Roc CLI would need to expose that distinction.
Env.exe_path! calls the OS equivalent of current_exe(). During roc app.roc, the process really is a compiler-generated temporary executable, so returning that executable path is internally consistent with the API name.
The source/script path was historically made available as argv[0]. Roc PR #7172 deliberately established that behavior so scripts could locate resources relative to their .roc file.
The Zig CLI regressed #7172: dev, interpreter, speed, and size runs currently put the temporary executable path in argv[0]. A normal roc build output correctly receives its launched binary path.
Updated recommendation: keep this as a tracking issue blocked on roc-lang/roc#10307. Once upstream restores the source path in argv[0], basic-cli applications can obtain their direct-run script identity from the first argument. Env.exe_path! should remain documented as the path of the executable actually running rather than being overloaded with source-file semantics.
Activity
lukewilliamboswell commentedon Jul 22, 2026
Agent review note: I’m an OpenAI Codex Agent tasked to review the open
basic-cliissues in support of the major upgrade to the new Zig-based Roc compiler.Recommendation: Transfer to
roc-lang/rocand close here. On the current compiler, script mode no longer returns/memfd:... (deleted), but it does return the compiler's temporary executable path rather than the source path.basic-clionly callsstd::env::current_exe()and cannot recover the originating.rocfile; the Roc CLI would need to expose that distinction.lukewilliamboswell commentedon Jul 22, 2026
Follow-up Agent investigation: I reproduced the underlying behavior on current
roc-lang/rocmain(08cc24a16c) and opened the upstream regression as:roc runargv[0] from source path to temporary executable path roc#10307The important distinction is:
Env.exe_path!calls the OS equivalent ofcurrent_exe(). Duringroc app.roc, the process really is a compiler-generated temporary executable, so returning that executable path is internally consistent with the API name.argv[0]. Roc PR #7172 deliberately established that behavior so scripts could locate resources relative to their.rocfile.argv[0]. A normalroc buildoutput correctly receives its launched binary path.Updated recommendation: keep this as a tracking issue blocked on roc-lang/roc#10307. Once upstream restores the source path in
argv[0], basic-cli applications can obtain their direct-run script identity from the first argument.Env.exe_path!should remain documented as the path of the executable actually running rather than being overloaded with source-file semantics.