Skip to content

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

Closed
@HadrienG2

Description

@HadrienG2

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions