-
Notifications
You must be signed in to change notification settings - Fork 87
[native_toolchain_c] Consider ANDROID_HOME environment variable
#2736
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
base: main
Are you sure you want to change the base?
Conversation
pkgs/native_toolchain_c/lib/src/native_toolchain/android_ndk.dart
Outdated
Show resolved
Hide resolved
dcharkes
left a comment
There was a problem hiding this 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_HOMEorANDROID_NDK_ROOTare 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! 🚀
pkgs/native_toolchain_c/lib/src/native_toolchain/android_ndk.dart
Outdated
Show resolved
Hide resolved
pkgs/native_toolchain_c/lib/src/native_toolchain/android_ndk.dart
Outdated
Show resolved
Hide resolved
PR HealthLicense Headers ✔️
All source files should start with a license header. Unrelated files missing license headers
This check can be disabled by tagging the PR with API leaks ✔️The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.
This check can be disabled by tagging the PR with Breaking changes ✔️
This check can be disabled by tagging the PR with Changelog Entry ✔️
Changes to files need to be accounted for in their respective changelogs. This check can be disabled by tagging the PR with |
|
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. 🙃 |
3f2ef80 to
70ef9af
Compare
70ef9af to
25a5e74
Compare
25a5e74 to
473d7d0
Compare
473d7d0 to
9ed0184
Compare
|
I believe the Linux tests are failing here because we arbitrarily pick one tool out of the list returned ( I'm not sure what the best way to fix this would be, should |
Yeah that seems reasonable. Why is the order arbitrary? I believe we should avoid this, I'd like the resolvers to have deterministic behavior. If we do file listing, we should order alphabetically (or descending if we want newest). And if we have async code we should not call |
|
Sorry, I meant arbitrary in the sense that we pick the first one instead of one that might make more sense semantically :D I don't think there's a race here, but I'll check versions to use the latest NDK consistently. |
When searching for an NDK, this now considers:
$ANDROID_HOME/ndk/*/directories.ANDROID_NDK,ANROID_NDK_HOME,ANDROID_NDK_LATEST_HOMEorANDROID_NDK_ROOTare 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.environmentwithIOOverrides), this replaces theloggerpassed to tool resolvers with aToolResolvingContextclass that allows mocking environment variables (well, kind of. Most resolvers shell out and we can't mock that yet).Closes #2632.