Skip to content

[Feature Request]: RUSTC_AR is missing #12183

Closed as not planned
Closed as not planned
@lexi-the-cute

Description

@lexi-the-cute

Problem

RUSTC_AR is missing from the available build environment variables in build.rs.

This makes the below code not work.

    cc::Build::new()
        .compiler(PathBuf::from(env::var("RUSTC_LINKER").unwrap()))
        .archiver(PathBuf::from(env::var("RUSTC_AR").unwrap()))
        .file(lib_path.to_str().unwrap())
        .compile("browser");

Proposed Solution

I started work on lexi-the-cute@287fb2a and am currently compiling Cargo in order to make sure the variable works. 4 tests fail, so I temporarily disabled them. The 4 tests are listed below.

cargo test -j 8 build_script::custom_build_ar_bad_host
cargo test -j 8 build_script::custom_build_ar_bad_host_with_arch
cargo test -j 8 build_script::custom_build_ar_host_target_with_bad_host_config
cargo test -j 8 build_script::custom_build_env_var_rustc_ar_bad_host_target

Notes

I based my commit on #5394 and am waiting for approval to make a pull request to add this feature

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-needs-infoStatus: Needs more info, such as a reproduction or more background for a feature request.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions