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

ubuntu2004 build fails with "error[E0283]: type annotations needed" #2550

Closed
1 of 7 tasks
henti opened this issue Jan 25, 2021 · 9 comments
Closed
1 of 7 tasks

ubuntu2004 build fails with "error[E0283]: type annotations needed" #2550

henti opened this issue Jan 25, 2021 · 9 comments

Comments

@henti
Copy link
Contributor

henti commented Jan 25, 2021

Description
Building ubuntu2004 image from ubuntu20/20210123.1 while building cargo I get the following error:

==> azure-arm: error[E0283]: type annotations needed
==> azure-arm:    --> /usr/share/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-0.50.0/src/cargo/util/config/de.rs:530:63
==> azure-arm:     |
==> azure-arm: 530 |                 seed.deserialize(Tuple2Deserializer(1i32, env.as_ref()))
==> azure-arm:     |                                                           ----^^^^^^--
==> azure-arm:     |                                                           |   |
==> azure-arm:     |                                                           |   cannot infer type for type parameter `T` declared on the trait `AsRef`
==> azure-arm:     |                                                           this method call resolves to `&T`
==> azure-arm:     |
==> azure-arm:     = note: cannot satisfy `std::string::String: AsRef<_>`
==> azure-arm:
==> azure-arm: error: aborting due to previous error
==> azure-arm:
==> azure-arm: For more information about this error, try `rustc --explain E0283`.
==> azure-arm: error: failed to compile `cargo-outdated v0.9.14`, intermediate artifacts can be found at `/tmp/cargo-installPzevWT`
==> azure-arm:
==> azure-arm: Caused by:
==> azure-arm:   could not compile `cargo`
==> azure-arm:
==> azure-arm: To learn more, run the command again with --verbose.
==> azure-arm: Script exited with non-zero exit status: 101.Allowed exit codes are: [0]

Area for Triage:
Rust

Question, Bug, or Feature?:
Bug

Virtual environments affected

  • Ubuntu 16.04
  • Ubuntu 18.04
  • Ubuntu 20.04
  • macOS 10.15
  • macOS 11.0
  • Windows Server 2016 R2
  • Windows Server 2019

Expected behavior
Image build succeeds

Actual behavior
Image build fails

Repro steps
A description with steps to reproduce the issue. If your have a public example or repo to share,
please provide the link.

  1. git clone git@github.com:actions/virtual-environments.git
  2. cd virtual-environments
  3. image="ubuntu2004"
  4. os="linux"
  5. ResourceGroupName="company-uk-south"
  6. AzureLocation="uksouth"
  7. ImageGenerationRepositoryRoot=$(pwd)
  8. builderScriptPath=${ImageGenerationRepositoryRoot}/images/$os/$image.json
  9. storageAccountName="$(echo $ResourceGroupName | sed 's/-//g')001"
  10. echo "GithubFeedToken=$PAT" > ~/.ssh/GitHubFeedToken
  11. . ~/.ssh/GitHubFeedToken
  12. packer build -on-error=ask
    -var subscription_id=$SubscriptionId
    -var location=$AzureLocation
    -var resource_group=$ResourceGroupName
    -var storage_account=$storageAccountName
    -var github_feed_token=$GithubFeedToken
    $builderScriptPath
@al-cheb
Copy link
Contributor

al-cheb commented Jan 25, 2021

Hello, @henti
Fixed #2545 PR. Please merge the latest changes from main branch.

@al-cheb al-cheb closed this as completed Jan 25, 2021
@henti
Copy link
Contributor Author

henti commented Jan 25, 2021

Hi @al-cheb

Fantastic, thank you. Will a new release be issued for this fix ?

@al-cheb
Copy link
Contributor

al-cheb commented Jan 26, 2021

Hi @al-cheb

Fantastic, thank you. Will a new release be issued for this fix ?

I hope so. Fix is already merged - rust-lang/cargo#9102. Discussion is in the thread - rust-lang/cargo#7169

@ktorn
Copy link

ktorn commented Jan 26, 2021

Also ran into this on Mac OS 10.15.6 whilst running the cargo install cargo-generate step from the Rust and Webassembly - Setup.

Will await the release.

@Antiarchitect
Copy link

Fedora 33, also.

@liushooter
Copy link

mac 10.15 Catalina, also.

@henti
Copy link
Contributor Author

henti commented Jan 28, 2021

I'm having the same issue with windows 2016 build and this error

==> vhd: error[E0283]: type annotations needed
==> vhd:    --> C:\Rust\.cargo\registry\src\github.com-1ecc6299db9ec823\cargo-0.50.0\src/cargo\util\config\de.rs:530:63
==> vhd:     |
==> vhd: 530 |                 seed.deserialize(Tuple2Deserializer(1i32, env.as_ref()))
==> vhd:     |                                                           ----^^^^^^--
==> vhd:     |                                                           |   |
==> vhd:     |                                                           |   cannot infer type for type parameter `T` declared on the trait `AsRef`
==> vhd:     |                                                           this method call resolves to `&T`
==> vhd:     |
==> vhd:     = note: cannot satisfy `std::string::String: AsRef<_>`
==> vhd:
==> vhd: error: aborting due to previous error
==> vhd:
==> vhd: For more information about this error, try `rustc --explain E0283`.
==> vhd: error: failed to compile `cargo-outdated v0.9.14`, intermediate artifacts can be found at `C:\Users\packer\AppData\Local\Temp\cargo-install
Dc86sw`
==> vhd:
==> vhd: Caused by:
==> vhd:   could not compile `cargo`
==> vhd:
==> vhd: To learn more, run the command again with --verbose.
==> vhd:      Summary Successfully installed bindgen, cbindgen, cargo-audit! Failed to install cargo-outdated (see error(s) above).

This is on the win16/20210118.1 tag and i've tested with 229234d1628cd4920413a6b0f68f663b8107f3f2 cherry-picked as well..

@al-cheb
Copy link
Contributor

al-cheb commented Jan 28, 2021

@henti , Fixed in the #2546 PR.

@henti
Copy link
Contributor Author

henti commented Jan 28, 2021

@al-cheb Fantastic, cherry-picked and rebuilding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants