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

[xa-prep-tasks] Support single-digit versions #939

Merged
merged 1 commit into from
Oct 17, 2017

Conversation

jonpryor
Copy link
Member

JDK 9 reports a single-digit version value:

$ javac -version
javac 9

Unfortunately, this means that the <Which/> task won't properly
recognize JDK 9's javac as passing the
%(RequiredProgram.MinimumVersion) value of 1.8, because <Which/>
requires at least two digits, not one. (Because System.Version
required at least two digits; one would throw ArgumentException.)

Update the <Which/> task so that it supports single-digit version
values, treating them as if they had a "minor" value of 0.

JDK 9 reports a single-digit version value:

	$ javac -version
	javac 9

Unfortunately, this means that the `<Which/>` task won't properly
recognize JDK 9's `javac` as passing the
`%(RequiredProgram.MinimumVersion)` value of 1.8, because `<Which/>`
requires *at least* two digits, not one. (Because `System.Version`
required at least two digits; one would throw `ArgumentException`.)

Update the `<Which/>` task so that it supports single-digit version
values, treating them as if they had a "minor" value of `0`.
@dellis1972 dellis1972 merged commit d6ac14f into dotnet:master Oct 17, 2017
akoeplinger pushed a commit to akoeplinger/xamarin-android that referenced this pull request Oct 19, 2017
We've been noticing that emulator-based unit test execution is getting
"finicky", e.g. [PR Build dotnet#939][0]:

	Target AcquireAndroidTarget:
	Task "CheckAdbTarget"
	        Tool /Users/builder/android-toolchain/sdk/platform-tools/adb execution started with arguments:  shell getprop ro.build.version.sdk
	        Environment variables being passed to the tool:
	        21
	        Tool /Users/builder/android-toolchain/sdk/platform-tools/adb execution finished.
	          [Output] AdbTarget:
	          [Output] IsValidTarget: True
	Done executing task "CheckAdbTarget"

This means that there is already an Android device attached (emulator
or hardware...), as *something* is responding to `adb shell getprop`.

However...that attached device is b0rked:

	Target UndeployUnitTestApks:
	Task "Adb"
	        Task Adb
	          Arguments:   uninstall "Mono.Android_Tests"
	        Tool /Users/builder/android-toolchain/sdk/platform-tools/adb execution started with arguments:   uninstall "Mono.Android_Tests"
	        Environment variables being passed to the tool:
	        Error: Could not access the Package Manager.  Is the system running?
	        Tool /Users/builder/android-toolchain/sdk/platform-tools/adb execution finished.
	          [Output] Output:
	            Error: Could not access the Package Manager.  Is the system running?
	Done executing task "Adb"

*Every* attempt to "do something" with the device -- uninstall and
install packages, run applications, etc. -- results in the
"Could not access the Package Manager" error.

The device is dead, yet still present.

We want on-device unit test execution to be *reliable* (7450efc).
It isn't, and that's very annoying.

Manual investigation of the Jenkins build machine after these errors
occur indicates that after `adb TARGET emu kill` executes (as part of
`make run-apk-tests`), the `emulator` process *is still running*.

Hopefully, that's the problem: the emulator process isn't dead.

Fix the problem by *killing* the process, with not-quite-extreme
prejudice, by invoking `Process.Kill()` on the
`System.Diagnostics.Process` instance that represents `emulator`.
(If that doesn't kill it, we'll need to escalate to extreme
`kill -9` prejudice.)

*For good measure*, run `adb kill-server` within
`ReleaseAndroidTarget`, to keep the `adb` daemone from outlasting it's
usefulness.

[0]: https://jenkins.mono-project.com/view/Xamarin.Android/job/xamarin-android-pr-builder/939/
Redth pushed a commit to Redth/xamarin-android that referenced this pull request Oct 30, 2017
JDK 9 reports a single-digit version value:

	$ javac -version
	javac 9

Unfortunately, this means that the `<Which/>` task won't properly
recognize JDK 9's `javac` as passing the
`%(RequiredProgram.MinimumVersion)` value of 1.8, because `<Which/>`
requires *at least* two digits, not one. (Because `System.Version`
required at least two digits; one would throw `ArgumentException`.)

Update the `<Which/>` task so that it supports single-digit version
values, treating them as if they had a "minor" value of `0`.
@github-actions github-actions bot locked and limited conversation to collaborators Feb 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants