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

android: Migrate from ndk-glue to ndk-context #641

Merged
merged 1 commit into from
Feb 16, 2022

Commits on Feb 15, 2022

  1. android: Migrate from ndk-glue to ndk-context

    `ndk-glue` suffers one fatal flaw: it's "only" supposed to be used by
    the crate providing `fn main()` and only supposed to end up in the
    dependency graph once as it has `static` globals which get duplicated
    across versions.
    
    In the current case with `winit 0.26` still on `ndk-glue 0.5` but
    `cpal` on `ndk-glue 0.6` it'll always panic in `fn native_activity()` as
    the `static` globals on this version is not initialized.
    
    Introducing `ndk-context`: a crate that holds these `static`s, with the
    intention/premise to not see a breaking release /ever/ and make this a
    problem of the past.  The crate is currently initialized with the VM and
    Android Context on `ndk-glue` 0.5.1 and 0.6.1 (0.4.1 pending) making it
    compatible with whatever is current, and the possibility for backporting
    to older `ndk-glue` versions too.
    
    See also:
    rust-mobile/ndk#211
    rust-mobile/ndk#223
    MarijnS95 committed Feb 15, 2022
    Configuration menu
    Copy the full SHA
    f8b05ad View commit details
    Browse the repository at this point in the history