<p dir="auto">I've been testing <code class="notranslate">1.7.0</code> while packaging it for nixpkgs and I usually test it with the <code class="notranslate">cat</code> example but it's now requiring <code class="notranslate">--allow-read</code> but it also doesn't accept the flag either during compile or using the compiled result.<br>
(cat src: <a href="https://deno.land/std@0.84.0/examples/cat.ts" rel="nofollow">https://deno.land/std@0.84.0/examples/cat.ts</a>)</p>
<p dir="auto">Since nixOS is pretty different I've also replicated the issue using a buster-slim container</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="cat /etc/os-release
PRETTY_NAME=&quot;Debian GNU/Linux 10 (buster)&quot;
NAME=&quot;Debian GNU/Linux&quot;
VERSION_ID=&quot;10&quot;
VERSION=&quot;10 (buster)&quot;
VERSION_CODENAME=buster
ID=debian
HOME_URL=&quot;https://www.debian.org/&quot;
SUPPORT_URL=&quot;https://www.debian.org/support&quot;
BUG_REPORT_URL=&quot;https://bugs.debian.org/&quot;

$ wget https://github.com/denoland/deno/releases/download/v1.7.0/deno-x86_64-unknown-linux-gnu.zip
# ...
2021-01-20 10:46:13 (1.89 MB/s) - 'deno-x86_64-unknown-linux-gnu.zip' saved [21261828/21261828]

$ unzip deno-x86_64-unknown-linux-gnu.zip
Archive:  deno-x86_64-unknown-linux-gnu.zip
  inflating: deno
$ ./deno --version
deno 1.7.0 (release, x86_64-unknown-linux-gnu)
v8 8.9.255.3
typescript 4.1.3"><pre class="notranslate"><code class="notranslate">cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

$ wget https://github.com/denoland/deno/releases/download/v1.7.0/deno-x86_64-unknown-linux-gnu.zip
# ...
2021-01-20 10:46:13 (1.89 MB/s) - 'deno-x86_64-unknown-linux-gnu.zip' saved [21261828/21261828]

$ unzip deno-x86_64-unknown-linux-gnu.zip
Archive:  deno-x86_64-unknown-linux-gnu.zip
  inflating: deno
$ ./deno --version
deno 1.7.0 (release, x86_64-unknown-linux-gnu)
v8 8.9.255.3
typescript 4.1.3
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ ./deno compile --unstable https://deno.land/std@0.84.0/examples/cat.ts
Download https://deno.land/std@0.84.0/examples/cat.ts
Check https://deno.land/std@0.84.0/examples/cat.ts
Bundle https://deno.land/std@0.84.0/examples/cat.ts
Compile https://deno.land/std@0.84.0/examples/cat.ts
Emit cat
$ ./cat file
error: PermissionDenied: read access to &quot;file&quot;, run again with the --allow-read flag
    at processResponse (deno:core/core.js:212:11)
    at Object.jsonOpAsync (deno:core/core.js:229:12)
    at async Object.open (deno:runtime/js/30_files.js:44:17)
    at async file://$deno$/bundle.js:3:18
$ ./cat --allow-read file
error: PermissionDenied: read access to &quot;--allow-read&quot;, run again with the --allow-read flag
    at processResponse (deno:core/core.js:212:11)
    at Object.jsonOpAsync (deno:core/core.js:229:12)
    at async Object.open (deno:runtime/js/30_files.js:44:17)
    at async file://$deno$/bundle.js:3:18
$ rm cat

$ ./deno compile --unstable https://deno.land/std@0.84.0/examples/cat.ts --allow-read
Check https://deno.land/std@0.84.0/examples/cat.ts
Bundle https://deno.land/std@0.84.0/examples/cat.ts
Compile https://deno.land/std@0.84.0/examples/cat.ts
Emit cat
$ ./cat file
error: PermissionDenied: read access to &quot;--allow-read&quot;, run again with the --allow-read flag
    at processResponse (deno:core/core.js:212:11)
    at Object.jsonOpAsync (deno:core/core.js:229:12)
    at async Object.open (deno:runtime/js/30_files.js:44:17)
    at async file://$deno$/bundle.js:3:18"><pre class="notranslate"><code class="notranslate">$ ./deno compile --unstable https://deno.land/std@0.84.0/examples/cat.ts
Download https://deno.land/std@0.84.0/examples/cat.ts
Check https://deno.land/std@0.84.0/examples/cat.ts
Bundle https://deno.land/std@0.84.0/examples/cat.ts
Compile https://deno.land/std@0.84.0/examples/cat.ts
Emit cat
$ ./cat file
error: PermissionDenied: read access to "file", run again with the --allow-read flag
    at processResponse (deno:core/core.js:212:11)
    at Object.jsonOpAsync (deno:core/core.js:229:12)
    at async Object.open (deno:runtime/js/30_files.js:44:17)
    at async file://$deno$/bundle.js:3:18
$ ./cat --allow-read file
error: PermissionDenied: read access to "--allow-read", run again with the --allow-read flag
    at processResponse (deno:core/core.js:212:11)
    at Object.jsonOpAsync (deno:core/core.js:229:12)
    at async Object.open (deno:runtime/js/30_files.js:44:17)
    at async file://$deno$/bundle.js:3:18
$ rm cat

$ ./deno compile --unstable https://deno.land/std@0.84.0/examples/cat.ts --allow-read
Check https://deno.land/std@0.84.0/examples/cat.ts
Bundle https://deno.land/std@0.84.0/examples/cat.ts
Compile https://deno.land/std@0.84.0/examples/cat.ts
Emit cat
$ ./cat file
error: PermissionDenied: read access to "--allow-read", run again with the --allow-read flag
    at processResponse (deno:core/core.js:212:11)
    at Object.jsonOpAsync (deno:core/core.js:229:12)
    at async Object.open (deno:runtime/js/30_files.js:44:17)
    at async file://$deno$/bundle.js:3:18
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="~/p/g/d/deno ❯❯❯ deno compile --unstable https://deno.land/std@0.79.0/examples/cat.ts CODE_OF_CONDUCT.md 
Check https://deno.land/std@0.79.0/examples/cat.ts
Bundle https://deno.land/std@0.79.0/examples/cat.ts
Compile https://deno.land/std@0.79.0/examples/cat.ts
Emit cat
~/p/g/d/deno ❯❯❯ ./cat
error: PermissionDenied: read access to &quot;CODE_OF_CONDUCT.md&quot;, run again with the --allow-read flag
    at processResponse (deno:core/core.js:223:11)
    at Object.jsonOpAsync (deno:core/core.js:240:12)
    at async Object.open (deno:runtime/js/30_files.js:44:17)
    at async file://$deno$/bundle.js:3:18"><pre class="notranslate"><code class="notranslate">~/p/g/d/deno ❯❯❯ deno compile --unstable https://deno.land/std@0.79.0/examples/cat.ts CODE_OF_CONDUCT.md 
Check https://deno.land/std@0.79.0/examples/cat.ts
Bundle https://deno.land/std@0.79.0/examples/cat.ts
Compile https://deno.land/std@0.79.0/examples/cat.ts
Emit cat
~/p/g/d/deno ❯❯❯ ./cat
error: PermissionDenied: read access to "CODE_OF_CONDUCT.md", run again with the --allow-read flag
    at processResponse (deno:core/core.js:223:11)
    at Object.jsonOpAsync (deno:core/core.js:240:12)
    at async Object.open (deno:runtime/js/30_files.js:44:17)
    at async file://$deno$/bundle.js:3:18
</code></pre></div>
<p dir="auto"><code class="notranslate">run again with the --allow-read flag</code> makes no sense in self-contained binaries because after (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="763922775" data-permission-text="Title is private" data-url="https://github.com/denoland/deno/issues/8738" data-hovercard-type="pull_request" data-hovercard-url="/denoland/deno/pull/8738/hovercard" href="https://github.com/denoland/deno/pull/8738">#8738</a>) permissions are embedded in the binary and can't be changed.</p>
<p dir="auto">In this situation we should provide different message.</p>
<p dir="auto">CC <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/lucacasonato/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/lucacasonato">@lucacasonato</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/nayeemrmn/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/nayeemrmn">@nayeemrmn</a></p>