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

Throw an exception on redundant options #401

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

elkkhan
Copy link

@elkkhan elkkhan commented Jan 14, 2024

Some context in #399

Copy link
Author

@elkkhan elkkhan left a comment

Choose a reason for hiding this comment

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

sorry for the diff on the test class, had to wrap it in an enclosed test to add parameterised tests

import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameter;

@RunWith(Enclosed.class)
Copy link
Author

Choose a reason for hiding this comment

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

changed from @RunWith(Junit4.class)

import org.junit.runners.Parameterized.Parameter;

@RunWith(Enclosed.class)
public class EnclosedCompilationTest {
Copy link
Author

Choose a reason for hiding this comment

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

changed class name

Comment on lines +63 to +64
@RunWith(JUnit4.class)
public static class CompilationTest {
Copy link
Author

Choose a reason for hiding this comment

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

moved the original test class down a scope

Comment on lines +146 to +147
@RunWith(Parameterized.class)
public static class RedundantOptionsTest {
Copy link
Author

Choose a reason for hiding this comment

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

actual changes start here

Copy link
Member

@cpovirk cpovirk left a comment

Choose a reason for hiding this comment

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

Thanks. I'm going to approve this so that our internal tests run on it. I'll review it for real on a day that I'm "actually" working—ideally tomorrow, but no promises.

@cpovirk cpovirk self-assigned this Jan 15, 2024
@cpovirk cpovirk added type=enhancement Make an existing feature better P2 labels Jan 15, 2024
@cpovirk
Copy link
Member

cpovirk commented Jan 17, 2024

Our internal tests don't detect any problems with this. I'm now sending it to someone who knows Compile-Testing better than I do to see what he thinks.

@elkkhan
Copy link
Author

elkkhan commented Jan 26, 2024

Our internal tests don't detect any problems with this. I'm now sending it to someone who knows Compile-Testing better than I do to see what he thinks.

Hi @cpovirk! any thoughts on this?

@cpovirk
Copy link
Member

cpovirk commented Jan 26, 2024

Sorry, I looked now and discovered that I'd never sent the internal reviewer the message that I'd typed last week :( I've sent it now.

The big question we're discussing now is whether we need the configurability at all: Can we just change the behavior to always reject these options? We could release Compile-Testing soon after, so the release would contain few (if any) other changes. Thus, no one would be forced to upgrade, and if users did see trouble, we could easily follow with a release to roll back the change or add configurability.

@elkkhan
Copy link
Author

elkkhan commented Jan 26, 2024

@cpovirk sure, we can remove the configurability.
I think it's worth to consider this though:
Javac API still does expose and support those options - example here.
I'm not sure why they are exposed and supported - as we saw in #399, they don't work as one would expect them to.

But I still wonder whether forbidding users from passing in options that the Javac API itself supports would be a bit too assumptious.

I'm still fine with removing configurability for now and waiting to see whether it would cause issues for anyone though.
let me know :)

@elkkhan
Copy link
Author

elkkhan commented Feb 5, 2024

Hi @cpovirk! any thoughts on my comment above?
thanks

@cpovirk
Copy link
Member

cpovirk commented Feb 5, 2024

Agreed, the options are definitely supported, just apparently only when they're set when the VM is first created or something?

My main worry with dropping support would be that someone might have a system that automatically copies the options used from a build and tries to use them with Compile-Testing. And maybe the Compile-Testing run was working before (either because the required --add-exports, etc. options were set for this VM already or because the test didn't actually need them?), but now it will fail. Or maybe someone just kept pasting the options into new places until one finally worked :)

I still think that all of that is manageable. Compile-Testing doesn't have too many users, so we should be able to hear of problems before we affect too many people. And hopefully most people can just remove the non-functional options when they hear about them.

(Sorry that I've continued to be slow here. Things have gotten unexpectedly busy for me for various reasons.)

@cpovirk cpovirk added P3 and removed P2 labels Feb 5, 2024
@elkkhan
Copy link
Author

elkkhan commented Feb 6, 2024

no worries @cpovirk , thanks for your response!
Seeing that both of us are not a 100% sure how these options are supposed to work (whether they are only considered when the VM is booted up, or not), i'm not too comfortable removing the configurability - i'm afraid to forbid using options that are otherwise supported by the API this lib is using.
It might also be the case that those options shouldn't even be present in the Javac API and are mistakenly placed in there?

I will spend some time digging into this and will come back to this thread when I feel more confident about this.

have a good day!

@elkkhan elkkhan marked this pull request as draft February 17, 2024 09:14
@elkkhan elkkhan marked this pull request as ready for review April 11, 2024 13:16
@elkkhan
Copy link
Author

elkkhan commented Apr 11, 2024

Hi @cpovirk!
I tried to spend some time digging into this and unfortunately got lost in JDK internals and JEPs and decided not to spend more time on this.

If I understand your last comment correctly, you're okay with dropping support for the invalid options - please correct me if I'm wrong.

Is anything else needed on my side on this other than rebasing?

thanks!

@elkkhan
Copy link
Author

elkkhan commented May 22, 2024

hi @cpovirk!
any thoughts?

@cpovirk
Copy link
Member

cpovirk commented May 24, 2024

I'm sorry again. This is one of those things that needs me to set aside just enough time that I can't squeeze it in while waiting for other things. I'll keep trying to find that time, but I expect to keep you waiting still a while longer :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 type=enhancement Make an existing feature better
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants