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

Could not find alloc in {{root}} #18

Closed
HadrienG2 opened this issue Sep 18, 2018 · 3 comments
Closed

Could not find alloc in {{root}} #18

HadrienG2 opened this issue Sep 18, 2018 · 3 comments

Comments

@HadrienG2
Copy link
Contributor

Just tried giving uefi-rs a spin again after a hiatus from low-level dev, and I get these strange build errors on my first try at running the tests:

uefi-rs/uefi-test-runner> ./build.py run
   Compiling uefi-exts v0.1.0 (/home/hadrien/Bureau/Programmation/uefi-rs/uefi-exts)                                                                                                                                                                                                                                         
error[E0433]: failed to resolve. Could not find `alloc` in `{{root}}`                                                                                                                                                                                                                                                        
 --> uefi-exts/src/boot.rs:5:5                                                                                                                                                                                                                                                                                               
  |                                                                                                                                                                                                                                                                                                                          
5 | use alloc::vec::Vec;                                                                                                                                                                                                                                                                                                     
  |     ^^^^^ Could not find `alloc` in `{{root}}`                                                                                                                                                                                                                                                                           
                                                                                                                                                                                                                                                                                                                             
error[E0433]: failed to resolve. Use of undeclared type or module `Vec`                                                                                                                                                                                                                                                      
  --> uefi-exts/src/boot.rs:26:26                                                                                                                                                                                                                                                                                            
   |                                                                                                                                                                                                                                                                                                                         
26 |         let mut buffer = Vec::with_capacity(buffer_size);                                                                                                                                                                                                                                                               
   |                          ^^^ Use of undeclared type or module `Vec`                                                                                                                                                                                                                                                     
                                                                                                                                                                                                                                                                                                                             
error[E0412]: cannot find type `Vec` in this scope                                                                                                                                                                                                                                                                           
  --> uefi-exts/src/boot.rs:11:51                                                                                                                                                                                                                                                                                            
   |                                                                                                                                                                                                                                                                                                                         
11 |     fn find_handles<P: Protocol>(&self) -> Result<Vec<Handle>>;                                                                                                                                                                                                                                                         
   |                                                   ^^^ not found in this scope                                                                                                                                                                                                                                           
                                                                                                                                                                                                                                                                                                                             
error[E0412]: cannot find type `Vec` in this scope                                                                                                                                                                                                                                                                           
  --> uefi-exts/src/boot.rs:18:51                                                                                                                                                                                                                                                                                            
   |                                                                                                                                                                                                                                                                                                                         
18 |     fn find_handles<P: Protocol>(&self) -> Result<Vec<Handle>> {                                                                                                                                                                                                                                                        
   |                                                   ^^^ not found in this scope                                                                                                                                                                                                                                           
                                                                                                                                                                                                                                                                                                                             
warning: unused import: `alloc::vec::Vec`                                                                                                                                                                                                                                                                                    
 --> uefi-exts/src/boot.rs:5:5                                                                                                                                                                                                                                                                                               
  |                                                                                                                                                                                                                                                                                                                          
5 | use alloc::vec::Vec;                                                                                                                                                                                                                                                                                                     
  |     ^^^^^^^^^^^^^^^                                                                                                                                                                                                                                                                                                      
  |                                                                                                                                                                                                                                                                                                                          
  = note: #[warn(unused_imports)] on by default                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                                             
error: aborting due to 4 previous errors                                                                                                                                                                                                                                                                                     
                                                                                                                                                                                                                                                                                                                             
Some errors occurred: E0412, E0433.                                                                                                                                                                                                                                                                                          
For more information about an error, try `rustc --explain E0412`.                                                                                                                                                                                                                                                            
error: Could not compile `uefi-exts`.                                                                                                                                                                                                                                                                                        

To learn more, run the command again with --verbose.
Subprocess cargo exited with error code 101

I guess that for some reason, my toolchain does not find the standard alloc crate. Ever got this one and know how to handle it?

@HadrienG2
Copy link
Contributor Author

Possibly related things that I found around : rust-lang/rust#54006 and rust-lang/rust#54116

@mopp
Copy link

mopp commented Sep 19, 2018

Sorry, I incorrectly commented. (I deleted it)

@GabrielMajeri
Copy link
Collaborator

@HadrienG2 Thanks, it was indeed rust-lang/rust#54116.

Fixed on master in 994bfd6.

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

No branches or pull requests

3 participants