You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: bindgen.rs
    path of file: ./repos/embuild/src
    
    the code of the file until where you have to start completion: //! Bindgen utilities for generating bindings to C/C++ code.

use std::ffi::OsStr;
use std::path::{Path, PathBuf};
use std::{env, fs};

use anyhow::{anyhow, bail, Context, Error, Result};

use crate::cargo::out_dir;
use crate::utils::OsStrExt;
use crate::{cargo, cmd};

/// The environment variable name containing the file path of the file that contains the
/// generated bindings.
pub const VAR_BI
    
fn try_get_sysroot(linker: &Option<impl AsRef<Path>>) -> Result<PathBuf> {
    let linker = if let Some(ref linker) = linker {
        linker.as_ref().to_owned()
    } else if let Some(linker) = env::var_os("RUSTC_LINKER") {
        PathBuf::from(linker)
    } else {
        bail!("Could not determine linker: No explicit linker and `RUSTC_LINKER` not set");
    };

    let gcc_file_stem = linker
        .file_stem()
        .and_then(OsStr::to_str)
        .filter(|&s| s == "gcc" || s.ends_with("-gcc"));

    // For whatever reason, --print-sysroot does not work with GCC
    // Change it to LD
    let linker = if let Some(stem) = gcc_file_stem {
        let mut ld_linker =
            linker.with_file_name(format!("{}{}", stem.strip_suffix("gcc").unwrap(), "ld"));
        if let Some(ext) = linker.extension() {
            ld_linker.set_extension(ext);
        }
        ld_linker
    } else {
        linker
    };

    cmd!(&linker, "--print-sysroot")
        .stdout()
        .with_context(|| {
            anyhow!(
                "Could not determine sysroot from linker '{}'",
                linker.display()
            )
        })
        .map(PathBuf::from)
}