Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avm install latest #avm #cli #3131

Closed
jonathanwork opened this issue Jul 28, 2024 · 12 comments
Closed

avm install latest #avm #cli #3131

jonathanwork opened this issue Jul 28, 2024 · 12 comments
Labels
avm duplicate This issue or pull request already exists installation error Issues related to installation errors

Comments

@jonathanwork
Copy link

time-0.3.29

error[E0282]: type annotations needed for Box<_>

|
83 | let items = format_items
| ^^^^^
...
86 | Ok(items.into())
| ---- type must be known at this point
|
help: consider giving items an explicit type, where the placeholders _ are specified
|
83 | let items: Box<_> = format_items
| ++++++++

For more information about this error, try rustc --explain E0282.
error: could not compile time (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: failed to compile anchor-cli v0.30.0 (https://github.com/coral-xyz/anchor?tag=v0.30.0#852fcc77), intermediate artifacts can be found at /tmp/cargo-installEa5d5m.
To reuse those artifacts with a future compilation, set the environment variable CARGO_TARGET_DIR to that path.
Error: Failed to install 0.30.0, is it a valid version?

@acheroncrypto acheroncrypto added duplicate This issue or pull request already exists avm installation error Issues related to installation errors labels Jul 28, 2024
@acheroncrypto
Copy link
Collaborator

Please see the answer in #3126 (comment)

@krusher55
Copy link

@jonathanwork after racking my head i found a way to get it working

after running cargo install --git https://github.com/coral-xyz/anchor avm --locked --force,
go to ../time-0.3.29/src/format_description/parse/mod.rs file (get the path from compilation error)

and in line 83, update

let items = format_items

to

let items: Box<[format_item::Item]> = format_items

save the file and run

avm install latest

followed by

avm use latest

and check with

anchor --version

if it shows anchor version, we gucci

anchor-cli 0.30.1

hope this helps

@RasHQ-programmation
Copy link

IM GUCCI

@mcfriend99
Copy link

Can a PR be raised with this fix??

@Ex4m
Copy link

Ex4m commented Aug 21, 2024

None of the fixes were working for me except this one. Thank you sir, very well done

@paudeldipesh
Copy link

It works. Thank you, buddy.

@rishabhjamwal
Copy link

It works!
Thanks

@cprkrn
Copy link

cprkrn commented Sep 6, 2024

@jonathanwork after racking my head i found a way to get it working

after running cargo install --git https://github.com/coral-xyz/anchor avm --locked --force, go to ../time-0.3.29/src/format_description/parse/mod.rs file (get the path from compilation error)

and in line 83, update

let items = format_items

to

let items: Box<[format_item::Item]> = format_items

save the file and run

avm install latest

followed by

avm use latest

and check with

anchor --version

if it shows anchor version, we gucci

anchor-cli 0.30.1

hope this helps

Savior

@harpreettrader
Copy link

thanks it's working fine for me

@rolandeke
Copy link

@jonathanwork after racking my head i found a way to get it working

after running cargo install --git https://github.com/coral-xyz/anchor avm --locked --force, go to ../time-0.3.29/src/format_description/parse/mod.rs file (get the path from compilation error)

and in line 83, update

let items = format_items

to

let items: Box<[format_item::Item]> = format_items

save the file and run

avm install latest

followed by

avm use latest

and check with

anchor --version

if it shows anchor version, we gucci

anchor-cli 0.30.1

hope this helps

I tried doing this but then got another error

error: the `-Z unstable-options` flag must also be passed to enable the flag `check-cfg`

error: could not compile `dashmap` (lib)
warning: build failed, waiting for other jobs to finish...
error: failed to compile `anchor-cli v0.30.1 (https://github.com/coral-xyz/anchor?tag=v0.30.1#e6d7dafe)`, intermediate artifacts can be found at `/tmp/cargo-installPlwick`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
Error: Failed to install 0.30.1, is it a valid version?

any help with this?

@imsamad
Copy link

imsamad commented Sep 30, 2024

after hours of tinkering finally find a solution

go to file with the path as given in terminal
this might look like

  • ../time-0.3.29/src/format_description/parse/mod.rs file (get the path from compilation error)
  • /home/${USER}/.cargo/registry/src/index.crates.io-6f17d22bba15001f/time-0.3.29/src/format_description/parse/mod.rs:83:9

replace method parse_owned with following


pub fn parse_owned<const VERSION: usize>(
    s: &str,
) -> Result<crate::format_description::OwnedFormatItem, crate::error::InvalidFormatDescription> {
    validate_version!(VERSION);
    let mut lexed = lexer::lex::<VERSION>(s.as_bytes());
    let ast = ast::parse::<_, VERSION>(&mut lexed);
    let format_items = format_item::parse(ast);

    let items: Vec<crate::format_description::OwnedFormatItem> = format_items
        .map(|res| res.map(Into::into))
        .collect::<Result<_, _>>()?;

    // If there's only one item, return it directly
    if items.len() == 1 {
        Ok(items.into_iter().next().unwrap())
    } else {
        // If there are multiple items, create a compound item
        Ok(crate::format_description::OwnedFormatItem::Compound(items.into_boxed_slice()))
    }
}

@rishipatel9
Copy link

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
avm duplicate This issue or pull request already exists installation error Issues related to installation errors
Projects
None yet
Development

No branches or pull requests