deno: š `deno` v1.13 breaks shims using `--allow-plugin`
With the change in v1.13 from --allow-plugin to --allow-ffi (PR #11152), prior shims using --allow-plugin are now brokenā¦
error: Found argument '--allow-plugin' which wasn't expected, or isn't valid in this context
Did you mean --allow-run?
USAGE:
deno run <SCRIPT_ARG>... --allow-env=<allow-env> --allow-net=<allow-net> --allow-read=<allow-read> --allow-run=<allow-run> --allow-write=<allow-write>
For more information try --help
IMO, --allow-plugin should have been deprecated but allowed until a later date (maybe v2). Changing the command line API like this can suddenly break working setups (as it did mine). To me, this seems to be the definition of a semver API change requiring a major version update.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 23 (20 by maintainers)
Commits related to this issue
- fix ~ repair semver breaking change to `--allow-plugin` # [why] Deno v1.13+ breaks prior correct shims using `--allow-plugin` by replacing it with `--allow-ffi` without deprecation. This changes fix... — committed to rivy/deno.dxx by rivy 3 years ago
- fix ~ repair semver breaking change to `--allow-plugin` # [why] Deno v1.13+ breaks prior correct shims using `--allow-plugin` by replacing it with `--allow-ffi` without deprecation. This changes fix... — committed to rivy/deno.dxx by rivy 3 years ago
- fix denoRunOptions for unstable flags within shim scripts - fixes <https://github.com/denoland/deno/issues/11819> — committed to rivy/deno.dxx by rivy 3 years ago
Opened #13325
If you have -A and that expands to include --allow-run what precisely could a future flag add that would be more powerful than --allow-run?
I get what it is trying to do, but I donāt think itās reasonable. If a user says they want -A then we should trust they want -A. (Maybe we can print a warning to say āyou installed with -A but we strongly recommend enumerating the permissionsā¦ā)
@MarkTiedemann , thanks for taking the time to look at this issue.
I do feel that Iām not correctly communicating the problem to you; Iāll try to restate it and improve my explanationā¦
I understand that
--unstableis necessary to use the unstable APIs. I also understand that people who want to use them are knowingly buying into the unstable API with all that entails. Iām not complaining or concerned about the proper use of the unstable command line flags by devs using an unstable API.But the important point here is that
deno, during ordinary usage, is adding the unstable--allow-plugin(and--allow-ffi?) command line flag to all app shims installed usingdeno install -A ...; eg, here is whatdeno install -A ...createsā¦and
This is not specifically requested by the user installing the app and is for the most part opaque to casual users. And, then, this acts as a future trip mine which, without any warning, breaks all those shims when upgrading from v1.12 to v1.13, blocking use of all the apps installed using that installation directive.
Again, I see this as a bug which needs to be addressed going forward to avoid tripping up ordinary users.
Likely, a good solution going forward is to never add unstable flags when installing using
deno install -A .... Teachdenoto add unstable command line flags only when explicitly requested, ie, for access to an unstable API, the dev must usedeno install -A --unstable --allow-ffi ....I believe requirement for
--unstableis already in place. I think @dsherretās PR should address the problem of forward compatibility.Not stale.
This should be addressed at least as a policy statement going forward so that it doesnāt happen againā¦
No, weāre not.
Iām saying that the bug is that
-Ashould not be expanded.There should not be a difference between
deno run -Aanddeno install -A. I expectdeno install -Ato produce a shim that executesdeno run -A.@rivy Thanks for clarifying!
I was not aware that
deno install -A ...produced adeno runshim including all--allow-*flags.This seems like a design issue IMO, too.
I would have expected
deno install -A ...to produce adeno run -A ...shim.They cannot be aliased because they are not the same thing: One is a native plugin API, the other is a FFI API. They are not compatible.
Yes, itās unstable, it may break. Denoās stability is described in more detail in the manual: https://deno.land/manual@v1.13.2/runtime/stability
āYou should be aware that many unstable APIs have not undergone a security review, are likely to have breaking API changes in the future, and are not ready for production.ā
PS: If you are not sure about the stability of an unstable API, sometimes it helps to check the roadmap (https://github.com/denoland/deno/issues/11168). Usually, if an unstable API is mentioned, itās either āstabilizeā or āremoveā. For example, āRemove native plugins API, introduce FFI APIā has been the number 1 item on the roadmap for a while now. An example of an unstable API being stabilized is the new HTTP server which is mentioned as āStabilize native HTTP server APIā.