pub fn new(flags: Flags, config: Config) -> Build {
        let cwd = t!(env::current_dir());
        let src = flags.src.clone().or_else(|| {
            env::var_os("SRC").map(|x| x.into())
        }).unwrap_or(cwd.clone());
        let out = cwd.join("build");

        let stage0_root = out.join(&config.build).join("stage0/bin");
        let rustc = match config.rustc {
            Some(ref s) => PathBuf::from(s),
            None => stage0_root.join(exe("rustc", &config.build)),
        };
        let cargo = match config.cargo {
            Some(ref s) => PathBuf::from(s),
            None => stage0_root.join(exe("cargo", &config.build)),
        };
        let local_rebuild = config.local_rebuild;

        let is_sudo = match env::var_os("SUDO_USER") {
            Some(sudo_user) => {
                match env::var_os("USER") {
                    Some(user) => user != sudo_user,
                    None => false,
                }
            }
            None => false,
        };

        Build {
            flags: flags,
            config: config,
            cargo: cargo,
            rustc: rustc,
            src: src,
            out: out,

            release: String::new(),
            unstable_features: false,
            ver_hash: None,
            short_ver_hash: None,
            ver_date: None,
            version: String::new(),
            local_rebuild: local_rebuild,
            package_vers: String::new(),
            cc: HashMap::new(),
            cxx: HashMap::new(),
            crates: HashMap::new(),
            lldb_version: None,
            lldb_python_dir: None,
            is_sudo: is_sudo,
            release_num: String::new(),
            prerelease_version: String::new(),
        }
    }
/// Creates a new set of build configuration from the `flags` on the command
/// line and the filesystem `config`.
///
/// By default all build output will be placed in the current directory.
Creates a new set of build configuration from the `flags` on the command
line and the filesystem `config`.

By default all build output will be placed in the current directory.
Creates a new set of build configuration from the ` flags ` on the command line and the filesystem ` config ` . By default all build output will be placed in the current directory .
pub fn new(flags: Flags, config: Config) -> Build {
        let cwd = t!(env::current_dir());
        let src = flags.src.clone().or_else(|| {
            env::var_os("SRC").map(|x| x.into())
        }).unwrap_or(cwd.clone());
        let out = cwd.join("build");
        let stage0_root = out.join(&config.build).join("stage0/bin");
        let rustc = match config.rustc {
            Some(ref s) => PathBuf::from(s),
            None => stage0_root.join(exe("rustc", &config.build)),
        };
        let cargo = match config.cargo {
            Some(ref s) => PathBuf::from(s),
            None => stage0_root.join(exe("cargo", &config.build)),
        };
        let local_rebuild = config.local_rebuild;
        let is_sudo = match env::var_os("SUDO_USER") {
            Some(sudo_user) => {
                match env::var_os("USER") {
                    Some(user) => user != sudo_user,
                    None => false,
                }
            }
            None => false,
        };
        Build {
            flags: flags,
            config: config,
            cargo: cargo,
            rustc: rustc,
            src: src,
            out: out,
            release: String::new(),
            unstable_features: false,
            ver_hash: None,
            short_ver_hash: None,
            ver_date: None,
            version: String::new(),
            local_rebuild: local_rebuild,
            package_vers: String::new(),
            cc: HashMap::new(),
            cxx: HashMap::new(),
            crates: HashMap::new(),
            lldb_version: None,
            lldb_python_dir: None,
            is_sudo: is_sudo,
            release_num: String::new(),
            prerelease_version: String::new(),
        }
    }
pub fn new ( flags : Flags , config : Config ) -> Build { let cwd = t ! ( env current_dir ( ) ) ; let src = flags . src . clone ( ) . or_else ( | | { env :: var_os ( " " ) . map ( | x | x . into ( ) ) } ) . unwrap_or ( cwd . clone ( ) ) ; let out = cwd . join ( " " ) ; let stage0_root = out . join ( & config . build ) . join ( " " ) ; let rustc = match config . rustc { Some ( ref s ) => PathBuf :: from ( s ) , None => stage0_root . join ( exe ( " " , & config . build ) ) , } ; let cargo = match config . cargo { Some ( ref s ) => PathBuf :: from ( s ) , None => stage0_root . join ( exe ( " " , & config . build ) ) , } ; let local_rebuild = config . local_rebuild ; let is_sudo = match env :: var_os ( " " ) { Some ( sudo_user ) => { match env :: var_os ( " " ) { Some ( user ) => user != sudo_user , None => false , } } None => false , } ; Build { flags : flags , config : config , cargo : cargo , rustc : rustc , src : src , out : out , release : String :: new ( ) , unstable_features : false , ver_hash : None , short_ver_hash : None , ver_date : None , version : String :: new ( ) , local_rebuild : local_rebuild , package_vers : String :: new ( ) , cc : HashMap :: new ( ) , cxx : HashMap :: new ( ) , crates : HashMap :: new ( ) , lldb_version : None , lldb_python_dir : None , is_sudo : is_sudo , release_num : String :: new ( ) , prerelease_version : String :: new ( ) , } }
Creates a new set of build configuration from the `flags` on the command
line and the filesystem `config`.
Creates a new set of build configuration from the ` flags ` on the command line and the filesystem ` config ` .
flags
Flags
config
Config