Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use cargo-ndk as a RUSTC_WRAPPER to pass --target to Clang #107

Closed
wants to merge 1 commit into from

Commits on May 18, 2023

  1. Use cargo-ndk as a RUSTC_WRAPPER to pass --target to Clang

    This is an alternative workaround for bbqsrc#92 that's similar to the solution
    used in ndk-build except that the `-Clink-arg rustflag` is injected via
    a RUSTC_WRAPPER instead of trying to modify CARGO_ENCODED_RUSTFLAGS.
    
    It turned out to be practically impossible to be able to reliably
    set CARGO_ENCODED_RUSTFLAGS without risking trampling over rustflags
    that might be configured via Cargo (for example `target.<cfg>.rustflags`
    are especially difficult to read outside of cargo itself)
    
    This approach avoids hitting the command line length limitations of the
    current workaround and avoids needing temporary hard links or copying
    the cargo-ndk binary to the target/ directory.
    
    Even though we've only seen quoting issues with the Windows `.cmd`
    wrappers this change to avoid using the wrapper scripts is being
    applied consistently for all platforms. E.g. considering the upstream
    recommendation to avoid the wrapper scripts if possible:
    
    https://android-review.googlesource.com/c/platform/ndk/+/2134712
    
    Fixes: bbqsrc#92
    Fixes: bbqsrc#104
    Addresses: android/ndk#1856
    rib committed May 18, 2023
    Configuration menu
    Copy the full SHA
    51ff078 View commit details
    Browse the repository at this point in the history