Skip to content

Export Android platform vars from ndk-env#203

Merged
bbqsrc merged 1 commit into
bbqsrc:mainfrom
StantonMatt:fix-ndk-env-android-vars
Jun 2, 2026
Merged

Export Android platform vars from ndk-env#203
bbqsrc merged 1 commit into
bbqsrc:mainfrom
StantonMatt:fix-ndk-env-android-vars

Conversation

@StantonMatt

@StantonMatt StantonMatt commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Closes #198.

cargo ndk build already makes ANDROID_PLATFORM and ANDROID_ABI available to build scripts, but cargo ndk-env did not include them in its generated environment. This threads the selected platform and Android ABI through the shared environment builder so ndk-env, ndk-test, and the normal cargo command path use the same values.

I also added a focused regression test for the generated environment map.

Validation:

  • cargo fmt --all -- --check
  • cargo test build_env_exports_android_platform_and_abi --locked
  • cargo test --locked
  • cargo clippy -- -D warnings
  • cargo install --locked --path . --root .codex-tmp/cargo-install/cargo-ndk
  • cargo ndk-env --target arm64-v8a --platform 28 --json with a project-local fake NDK source.properties, checked ANDROID_PLATFORM=28, ANDROID_ABI=arm64-v8a, and CARGO_NDK_ANDROID_PLATFORM=28
  • same fake-NDK smoke for default shell export output and --powershell
  • git diff --check
  • review-fix-loop: no discrete regression introduced by the patch

Signed-off-by: Matthew Stanton <stantonmatthewj@gmail.com>
@bbqsrc bbqsrc merged commit e9fd58e into bbqsrc:main Jun 2, 2026
11 of 17 checks passed
@bbqsrc

bbqsrc commented Jun 2, 2026

Copy link
Copy Markdown
Owner

If you could add another PR that makes the nightly clippy happy, that would be appreciated. 😄

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cargo ndk-env does not export ANDROID_PLATFORM, ANDROID_ABI

2 participants