amazon-ion / ion-cli

Apache License 2.0
35 stars 15 forks source link

Unable to install on Windows via cargo install ion-cli #155

Closed aaron-meyers closed 4 weeks ago

aaron-meyers commented 1 month ago

Just tried installing this on my Windows machine via cargo install ion-cli, fails to compile with the following errors:

   Compiling ion-cli v0.7.0
error[E0004]: non-exhaustive patterns: `ion_rs::MacroExprKind::TemplateArgGroup(_)` not covered
   --> C:\Users\aaron\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ion-cli-0.7.0\src/bin/ion\commands\inspect.rs:449:27
    |
449 |                     match invocation.kind() {
    |                           ^^^^^^^^^^^^^^^^^ pattern `ion_rs::MacroExprKind::TemplateArgGroup(_)` not covered
    |
note: `ion_rs::MacroExprKind<'_, ion_rs::AnyEncoding>` defined here
   --> C:\Users\aaron\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ion-rs-1.0.0-rc.8\src\lazy\expanded\macro_evaluator.rs:155:1
    |
155 | pub enum MacroExprKind<'top, D: Decoder> {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
159 |     TemplateArgGroup(TemplateExprGroup<'top, D>),
    |     ---------------- not covered
    = note: the matched value is of type `ion_rs::MacroExprKind<'_, ion_rs::AnyEncoding>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
    |
454 ~                         },
455 +                         ion_rs::MacroExprKind::TemplateArgGroup(_) => todo!()
    |

error[E0004]: non-exhaustive patterns: `ion_rs::ExpandedSExpSource::Constructed(_, _)` not covered
   --> C:\Users\aaron\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ion-cli-0.7.0\src/bin/ion\commands\inspect.rs:532:15
    |
532 |         match sexp.expanded().source() {
    |               ^^^^^^^^^^^^^^^^^^^^^^^^ pattern `ion_rs::ExpandedSExpSource::Constructed(_, _)` not covered
    |
note: `ion_rs::ExpandedSExpSource<'_, ion_rs::AnyEncoding>` defined here
   --> C:\Users\aaron\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ion-rs-1.0.0-rc.8\src\lazy\expanded\sequence.rs:208:1
    |
208 | pub enum ExpandedSExpSource<'top, D: Decoder> {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
216 |     Constructed(Environment<'top, D>, MacroExprArgsIterator<'top, D>),
    |     ----------- not covered
    = note: the matched value is of type `ion_rs::ExpandedSExpSource<'_, ion_rs::AnyEncoding>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
    |
547 ~             },
548 +             ion_rs::ExpandedSExpSource::Constructed(_, _) => todo!()
    |

For more information about this error, try `rustc --explain E0004`.
error: could not compile `ion-cli` (bin "ion") due to 2 previous errors
error: failed to compile `ion-cli v0.7.0`, intermediate artifacts can be found at `C:\Users\aaron\AppData\Local\Temp\cargo-installtUxYuV`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
popematt commented 4 weeks ago

Thanks for bring this to our attention. I was also able to reproduce this on a (clean) linux machine.

It looks like in ion-rs@v1.0.0-rc.8 a breaking change was introduced that is normally behind an "experimental" feature gate, but ion-cli uses that feature, and so when cargo picked up the latest version of ion-rs it broke the build of the current version of ion-cli.

I think we will need to pin the ion-rs version to prevent this from happening in future as some of the feature-gated, experimental APIs change.

popematt commented 4 weeks ago

I've released a patch version (v0.7.1) that pins the ion-rs dependency, and I confirmed that my reproduction of the issue is now fixed.

I'm closing this as fixed, but please re-open this issue if you are still encountering the problem.