forked from libre-chip/fayalite
		
	add fake which for miri
This commit is contained in:
		
							parent
							
								
									b08a747e20
								
							
						
					
					
						commit
						122c08d3cf
					
				
					 1 changed files with 9 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -258,7 +258,7 @@ pub struct VerilogArgs {
 | 
			
		|||
        default_value = "firtool",
 | 
			
		||||
        env = "FIRTOOL",
 | 
			
		||||
        value_hint = ValueHint::CommandName,
 | 
			
		||||
        value_parser = OsStringValueParser::new().try_map(which::which)
 | 
			
		||||
        value_parser = OsStringValueParser::new().try_map(which)
 | 
			
		||||
    )]
 | 
			
		||||
    pub firtool: PathBuf,
 | 
			
		||||
    #[arg(long)]
 | 
			
		||||
| 
						 | 
				
			
			@ -428,6 +428,13 @@ impl clap::Args for FormalAdjustArgs {
 | 
			
		|||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
fn which(v: std::ffi::OsString) -> which::Result<PathBuf> {
 | 
			
		||||
    #[cfg(not(miri))]
 | 
			
		||||
    return which::which(v);
 | 
			
		||||
    #[cfg(miri)]
 | 
			
		||||
    return Ok(Path::new("/").join(v));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#[derive(Parser, Clone)]
 | 
			
		||||
#[non_exhaustive]
 | 
			
		||||
pub struct FormalArgs {
 | 
			
		||||
| 
						 | 
				
			
			@ -438,7 +445,7 @@ pub struct FormalArgs {
 | 
			
		|||
        default_value = "sby",
 | 
			
		||||
        env = "SBY",
 | 
			
		||||
        value_hint = ValueHint::CommandName,
 | 
			
		||||
        value_parser = OsStringValueParser::new().try_map(which::which)
 | 
			
		||||
        value_parser = OsStringValueParser::new().try_map(which)
 | 
			
		||||
    )]
 | 
			
		||||
    pub sby: PathBuf,
 | 
			
		||||
    #[arg(long)]
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue