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

Fix examples build breakage with SecurityManager usage in examples apps. #1073

Merged
merged 1 commit into from
Mar 18, 2024

Conversation

jin
Copy link
Collaborator

@jin jin commented Mar 18, 2024

Both android_local_test and kt_android_local_test are failing to:

exec ${PAGER:-/usr/bin/less} "$0" || exit 1
Executing tests from //src/test:main_activity_test
-----------------------------------------------------------------------------
JUnit4 Test Runner
java.lang.UnsupportedOperationException: The Security Manager is deprecated and will be removed in a future release
	at java.base/java.lang.System.setSecurityManager(System.java:429)
	at com.google.testing.junit.runner.junit4.JUnit4Runner.installSecurityManager(JUnit4Runner.java:256)
	at com.google.testing.junit.runner.junit4.JUnit4Runner.run(JUnit4Runner.java:113)
	at com.google.testing.junit.runner.BazelTestRunner.runTestsInSuite(BazelTestRunner.java:145)
	at com.google.testing.junit.runner.BazelTestRunner.main(BazelTestRunner.java:76)

BazelTestRunner exiting with a return value of 1
JVM shutdown hooks (if any) will run now.
The JVM will exit once they complete.

-- JVM shutdown starting at 2024-03-18 04:03:24 --

bazelbuild/bazel@6783339 is the short-term fix that hardcodes the flag into android_local_test, but our CI is still using 7.1.0 which doesn't have the commit. For now, set the allowlist flag in the bazelrc files for these examples.

The long term fix is to cut the dependency from BazelTestRunner to the SecurityManager through Junit4.

Fixes #1067

@shs96c
Copy link
Collaborator

shs96c commented Mar 18, 2024

We solved this problem in contrib_rules_jvm with some fancy footwork: bazel-contrib/rules_jvm#132

Copy link
Collaborator

@shs96c shs96c left a comment

Choose a reason for hiding this comment

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

LGTM

@jin jin merged commit 4fb2170 into bazel-contrib:master Mar 18, 2024
7 of 8 checks passed
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.

[Bazel CI] main_activity_test failed at Bazel@HEAD
2 participants