Skip to content

Custom linker in ~/.cargo/config.toml is ignored #2696

Description

@JeftavanderHorst

I have defined a custom linker and archiver in ~/.cargo/config.toml like so:

[target.aarch64-linux-android]
linker = "C:\\Users\\Jefta\\AppData\\Local\\Android\\Sdk\\ndk\\29.0.13846066\\toolchains\\llvm\\prebuilt\\windows-x86_64\\bin\\aarch64-linux-android21-clang.cmd"
ar = "C:\\Users\\Jefta\\AppData\\Local\\Android\\Sdk\\ndk\\29.0.13846066\\toolchains\\llvm\\prebuilt\\windows-x86_64\\bin\\llvm-ar.exe"

This is currently not respected by ring:

warning: ring@0.17.14: Compiler family detection failed due to error: ToolNotFound: failed to find tool "aarch64-linux-android-clang": program not found

Manually setting the TARGET_CC and TARGET_AR environment variables solves the issue.

Although this is not a huge issue, it is a bit annoying to remember to set the env variables every time. Is it possible to use the values defined in config.toml?

I'd be willing to spend some time on a PR given a bit of guidance how to tackle this.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions