Skip to content
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

Permission regression with deno compile #23715

Closed
NeKzor opened this issue May 6, 2024 · 1 comment · Fixed by #23719
Closed

Permission regression with deno compile #23715

NeKzor opened this issue May 6, 2024 · 1 comment · Fixed by #23719
Assignees
Labels
bug Something isn't working compile related to the `deno compile` feature

Comments

@NeKzor
Copy link

NeKzor commented May 6, 2024

Executing a compiled binary from any path that is not the same as the current working directory when invoking deno compile returns a permission error even when the permission flags have been set. This started to happen since Deno 1.42.

Minimal reproducible example:

$ cat main.ts
try { Deno.readTextFileSync('a.txt') }
catch (err) { console.log(err.message); }

$ deno compile --output=bin/a.out --no-prompt --allow-read=a.txt main.ts

Expected output:

$ ./bin/a.out
No such file or directory (os error 2): readfile 'a.txt'

$ cd bin && ./a.out
No such file or directory (os error 2): readfile 'a.txt'

Actual output:

$ ./bin/a.out
No such file or directory (os error 2): readfile 'a.txt'

$ cd bin && ./a.out
Requires read access to "a.txt", run again with the --allow-read flag
@NeKzor
Copy link
Author

NeKzor commented May 6, 2024

Found the commit that introduced this bug: 5403e4f

@nathanwhit nathanwhit added the bug Something isn't working label May 6, 2024
@dsherret dsherret added the compile related to the `deno compile` feature label May 6, 2024
@dsherret dsherret self-assigned this May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compile related to the `deno compile` feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants