mozilla / mozilla/rust-android-gradle

Help specifying toolchain

Open
#39 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Kotlin
Stars
1.3k
Forks
95
Avg merge
15m
Merged PRs (30d)
2

Description

By default, the build runs the following command:

rustc --crate-name lusna_ffi --edition=2018 lusna_ffi\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type cdylib --emit=dep-info,link -Cembed-bitcode=no -C debuginfo=2 -C metadata=fcf7fc3e883754d2 --out-dir C:\hyxe_wave\target\x86_64-linux-android\debug\deps --target x86_64-linux-android -C linker=C:\Users\tbrau\AndroidStudioProjects\Lusna\build\linker-wrapper\linker-wrapper.bat -C incremental=C:\hyxe_wave\target\x86_64-linux-android\debug\incremental -L dependency=C:\hyxe_wave\target\x86_64-linux-android\debug\deps -L dependency=C:\hyxe_wave\target\debug\deps --extern libc=C:\hyxe_wave\target\x86_64-linux-android\debug\deps\liblibc-f65a499a1c08d6d0.rlib -Ctarget-feature=+aes,+sse2,+sse4.1,+ssse3

Notice: linker=C:\Users\tbrau\AndroidStudioProjects\Lusna\build\linker-wrapper\linker-wrapper.bat

This fails with a nonzero exit code.

However, when I run the command in the command prompt with:

rustc --crate-name lusna_ffi --edition=2018 lusna_ffi\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type cdylib --emit=dep-info,link -Cembed-bitcode=no -C debuginfo=2 -C metadata=fcf7fc3e883754d2 --out-dir C:\hyxe_wave\target\x86_64-linux-android\debug\deps --target x86_64-linux-android -C linker=C:/android-ndk-r21d/toolchains/llvm/prebuilt/windows-x86_64/bin/x86_64-linux-android30-clang.cmd -C incremental=C:\hyxe_wave\target\x86_64-linux-android\debug\incremental -L dependency=C:\hyxe_wave\target\x86_64-linux-android\debug\deps -L dependency=C:\hyxe_wave\target\debug\deps --extern libc=C:\hyxe_wave\target\x86_64-linux-android\debug\deps\liblibc-f65a499a1c08d6d0.rlib -Ctarget-feature=+aes,+sse2,+sse4.1,+ssse3

where linker=C:/android-ndk-r21d/toolchains/llvm/prebuilt/windows-x86_64/bin/x86_64-linux-android30-clang.cmd, it runs perfectly (zero exit code). I see that I can change the local.properties to specify the ndk toolchain location, but which directory should be input therein? Thanks

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the failing linker-wrapper.bat command with the working Android NDK clang.cmd command shown in the report. Inspect how local.properties supplies the NDK toolchain location and determine the directory format needed for the linker configuration. Done means the default build uses the intended NDK linker and exits successfully on the reported Windows setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin, rust
Domain
build-system, mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.