Skip to content

Conversation

@simolus3
Copy link
Contributor

When searching for an NDK, this now considers:

  • $ANDROID_HOME/ndk/*/ directories.
  • If the environment variables ANDROID_NDK, ANROID_NDK_HOME, ANDROID_NDK_LATEST_HOME or ANDROID_NDK_ROOT are set (as they are in GitHub actions), those directories.

To make this testable (it's kind of odd there's no way to patch Platform.environment with IOOverrides), this replaces the logger passed to tool resolvers with a ToolResolvingContext class that allows mocking environment variables (well, kind of. Most resolvers shell out and we can't mock that yet).

Closes #2632.

Copy link
Collaborator

@dcharkes dcharkes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • If the environment variables ANDROID_NDK, ANROID_NDK_HOME, ANDROID_NDK_LATEST_HOME or ANDROID_NDK_ROOT are set (as they are in GitHub actions), those directories.

Some of these are filtered out in the build hooks, so we'd need to add those there too.

Thanks @simolus3! 🚀

@github-actions
Copy link

github-actions bot commented Oct 29, 2025

PR Health

Changelog Entry ✔️
Package Changed Files

Changes to files need to be accounted for in their respective changelogs.

This check can be disabled by tagging the PR with skip-changelog-check.

License Headers ✔️
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
Files
no missing headers

All source files should start with a license header.

Unrelated files missing license headers
Files
pkgs/objective_c/lib/src/ns_input_stream.dart

This check can be disabled by tagging the PR with skip-license-check.

@simolus3
Copy link
Contributor Author

It looks like the failing health checks may be an analyzer issue? Or at least I don't understand how these changes could cause the error from the logs.

@dcharkes
Copy link
Collaborator

It looks like the failing health checks may be an analyzer issue? Or at least I don't understand how these changes could cause the error from the logs.

I have filed dart-lang/sdk#61870. We're not using any dot-shorthands in the code yet, so it's kinda weird.

The new tests fail on Windows, backslashes. 🙃

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Could the Android NDK Resolver also check for ANDROID_HOME?

2 participants