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
Under Deno 1.39.1 and earlier, this shows cpu information, with 1.39.2 and newer, an error is shown (or when an interactive shell is used, a prompt):
error: Uncaught (in promise) PermissionDenied: Requires sys access to "cpus", run again with the --allow-sys flag
With Deno 1.39.2, we're now forced to just give a blanket --allow-sys permission for non-interactive deployments, rather than the granular osRelease like before, as allow-sys only allows providing granular permissions for functions in the Deno namespace.
(A solution could be to extend --allow-sys with something like node: prefixes, so that just granting cpus permission would be --allow-sys=node:cpus)
The text was updated successfully, but these errors were encountered:
os.cpus() was not implemented (It returned a list with empty fields) in 1.39.1 or before. Keeping --allow-sys=osRelease was wrong because os.cpus() relied on other platform system info. (eg: /proc/cpuinfo on Linux)
We actualy check for --allow-sys=cpus but this was not added as a valid option.
Adding "cpus" to this match arm will allow deno run --allow-sys=cpus:
Version: Deno 1.39.2 and newer (#21697)
Reproducer:
Run with
deno run --allow-sys=osRelease main.ts
.Under Deno 1.39.1 and earlier, this shows cpu information, with 1.39.2 and newer, an error is shown (or when an interactive shell is used, a prompt):
With Deno 1.39.2, we're now forced to just give a blanket
--allow-sys
permission for non-interactive deployments, rather than the granularosRelease
like before, asallow-sys
only allows providing granular permissions for functions in theDeno
namespace.(A solution could be to extend
--allow-sys
with something likenode:
prefixes, so that just grantingcpus
permission would be--allow-sys=node:cpus
)The text was updated successfully, but these errors were encountered: