rustyscript icon indicating copy to clipboard operation
rustyscript copied to clipboard

Non-exhaustive Patterns Coverage due to External Dependency Updates

Open qazbnm456 opened this issue 9 months ago • 6 comments

Describe the bug deno_media_type just had an update, which includes 2 new media types that the current deno_ast used in this crate couldn't parse. You could update the deno_ast to its latest release, which fixes the issue, or pin the version of deno_media_type crate. Thanks!

To Reproduce Steps to reproduce the behavior:

  1. The issue would happen right after the installation.

Expected behavior Installed and run successfully.

Screenshots Image

Desktop (please complete the following information):

  • OS: macOS Sequoia
  • Browser: Chrome
  • Version: 15.3.1

Additional context N/A.

qazbnm456 avatar Mar 06 '25 08:03 qazbnm456

We have also run into this issue this morning.

deno_media_type is not explicitly used by this crate. It is brought in as a dependency of a dependency. Seeing as deno_ast is already pinned to 0.43.3, it seems that the downstream dependency is leaking into this crate elsewhere.

kh-aeros avatar Mar 10 '25 10:03 kh-aeros

For now you can pin working version by adding to your Cargo.toml:

# https://github.com/rscarson/rustyscript/issues/332
[patch.crates-io]
deno_media_type = { git = 'https://github.com/denoland/deno_media_type', tag = "0.2.6" }

utyfua avatar Mar 10 '25 11:03 utyfua

Fixed on master, will leave this open till release

rscarson avatar Mar 14 '25 13:03 rscarson

I added the above to my Cargo.toml and I get the output:

warning: Patch `deno_media_type v0.2.6 (https://github.com/denoland/deno_media_type?tag=0.2.6#86c7dd22)` was not used in the crate graph.
Check that the patched package version and available features are compatible
with the dependency requirements. If the patch has a different version from
what is locked in the Cargo.lock file, run `cargo update` to use the new
version. This may also occur with an optional dependency that is not enabled.

I also tried using the master git branch in my cargo file, and that also didn't help.

rustyscript = { git = "https://github.com/rscarson/rustyscript.git", branch = "master" }

That just gives the same non-exhaustive error as the release version.

Can we get a new release or another workaround? I'm trying rustyscript for the first time and really like to get it working.

mlilback avatar May 02 '25 14:05 mlilback

I'll try to post the update this weekend! We've got a new baby, so I haven't had much spare time lately, sorry!

rscarson avatar May 02 '25 16:05 rscarson

@mlilback you need to run cargo update just like the message says

@rscarson can you please pin the issue until we have a stable solution?

utyfua avatar May 11 '25 03:05 utyfua

Fixed in release 0.12.0

rscarson avatar Aug 16 '25 03:08 rscarson