Skip to content

Pass -Djava.security.manager=allow in kt_rules_test #1132

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

Merged

Conversation

Bencodes
Copy link
Collaborator

@Bencodes Bencodes commented Mar 14, 2024

@Bencodes Bencodes force-pushed the pass-djava.security.manager-allow-in-kt_rules_test branch from b2362bf to 7685267 Compare March 14, 2024 19:30
@restingbull
Copy link
Collaborator

I tried this:


Error occurred during initialization of VM
--
  | java.lang.Error: Could not create SecurityManager
  | at java.lang.System.initPhase3([email protected]/System.java:2065)
  | Caused by: java.lang.ClassNotFoundException: allow
  | at jdk.internal.loader.BuiltinClassLoader.loadClass([email protected]/BuiltinClassLoader.java:581)
  | at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass([email protected]/ClassLoaders.java:178)
  | at java.lang.ClassLoader.loadClass([email protected]/ClassLoader.java:522)
  | at java.lang.Class.forName0([email protected]/Native Method)
  | at java.lang.Class.forName([email protected]/Class.java:398)
  | at java.lang.System.initPhase3([email protected]/System.java:2050)


There is some more subtlety here, haven't had a chance to dig in.

@Bencodes
Copy link
Collaborator Author

@restingbull we can also pass this at the bazelrc level which I believe solves the issue, at least locally.

@restingbull
Copy link
Collaborator

@restingbull we can also pass this at the bazelrc level which I believe solves the issue, at least locally.

Not as far as I can tell? The flag doesn't seem to do what we want it to in the later jvm versions -- that message is from the buildkite pass on this pr. The problem is that allow is not valid pre-18, according to the associated jep. Instead, it's considered to be an alternative security manager... I'm not clear on how we can sniff the java verio

e.g. this fails on 11, but passes on 18+. Until such time as it doesn't exist. This is why I moved us to junit5, and am in consideration how to fix the prod issue. The deprecation is gonna get us, one way of another.

Nevermind, figured it out. Have a patch momentarily.

@restingbull restingbull force-pushed the pass-djava.security.manager-allow-in-kt_rules_test branch from 7685267 to bfcee75 Compare March 15, 2024 20:16
@restingbull restingbull force-pushed the pass-djava.security.manager-allow-in-kt_rules_test branch from bfcee75 to d450c35 Compare March 15, 2024 20:22
@Bencodes
Copy link
Collaborator Author

👍

@restingbull restingbull merged commit 3a3bb0c into master Mar 24, 2024
@restingbull restingbull deleted the pass-djava.security.manager-allow-in-kt_rules_test branch March 24, 2024 03:32
Bencodes added a commit to Bencodes/rules_kotlin that referenced this pull request Jun 6, 2024
* Pass -Djava.security.manager=allow in kt_rules_test

* Add java.security.manager=allow when java 18 or higher

* debug statement

* Use runtime toolchain

* Use the java runtime toolchain to determine when to add the flag

---------

Co-authored-by: Corbin McNeely-Smith <[email protected]>
Bencodes added a commit to Bencodes/rules_kotlin that referenced this pull request Dec 17, 2024
* Pass -Djava.security.manager=allow in kt_rules_test

* Add java.security.manager=allow when java 18 or higher

* debug statement

* Use runtime toolchain

* Use the java runtime toolchain to determine when to add the flag

---------

Co-authored-by: Corbin McNeely-Smith <[email protected]>
Bencodes added a commit to Bencodes/rules_kotlin that referenced this pull request Dec 24, 2024
* Pass -Djava.security.manager=allow in kt_rules_test

* Add java.security.manager=allow when java 18 or higher

* debug statement

* Use runtime toolchain

* Use the java runtime toolchain to determine when to add the flag

---------

Co-authored-by: Corbin McNeely-Smith <[email protected]>
Bencodes added a commit to Bencodes/rules_kotlin that referenced this pull request Dec 30, 2024
* Pass -Djava.security.manager=allow in kt_rules_test

* Add java.security.manager=allow when java 18 or higher

* debug statement

* Use runtime toolchain

* Use the java runtime toolchain to determine when to add the flag

---------

Co-authored-by: Corbin McNeely-Smith <[email protected]>
Bencodes added a commit to Bencodes/rules_kotlin that referenced this pull request Jan 7, 2025
* Pass -Djava.security.manager=allow in kt_rules_test

* Add java.security.manager=allow when java 18 or higher

* debug statement

* Use runtime toolchain

* Use the java runtime toolchain to determine when to add the flag

---------

Co-authored-by: Corbin McNeely-Smith <[email protected]>
Bencodes added a commit to Bencodes/rules_kotlin that referenced this pull request Feb 18, 2025
* Pass -Djava.security.manager=allow in kt_rules_test

* Add java.security.manager=allow when java 18 or higher

* debug statement

* Use runtime toolchain

* Use the java runtime toolchain to determine when to add the flag

---------

Co-authored-by: Corbin McNeely-Smith <[email protected]>
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.

2 participants