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: timezone mappings missing for Mysql JDBC driver in native mode #5621

Merged
merged 2 commits into from
Dec 2, 2019

Conversation

machi1990
Copy link
Member

Fixes #5269

/cc @johnaohara

@machi1990 machi1990 requested a review from Sanne November 20, 2019 11:37
@machi1990 machi1990 added the area/persistence OBSOLETE, DO NOT USE label Nov 20, 2019
Copy link
Member

@gsmet gsmet left a comment

Choose a reason for hiding this comment

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

I added a few comments and questions.

if (nativeConfig.addAllTimeZones) {
command.add("-H:+IncludeAllTimeZones");
} else {
command.add("-H:-IncludeAllTimeZones");
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if it should be Optional and if we should do nothing if not defined.

Because it could not be defined in the config and then the user could override it with the additional build args.

Copy link
Member

Choose a reason for hiding this comment

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

GraalVM has the bad habit of adjusting their flags over time; setting them explicitly has been useful before.

But it's an interesting point that then the can't easily override it. Let's amit the explicit disablemnet until we introduce (later) a configuration option?

Copy link
Member

Choose a reason for hiding this comment

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

@machi1990 could you remove the command.add("-H:-IncludeAllTimeZones"); line to follow @gsmet 's suggestion?

Copy link
Member

Choose a reason for hiding this comment

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

Sorry I realize all the typos in my previous comment made it unclear :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for bringing this one, I had previously forgotten about it. I have pushed a new version without it @gsmet @Sanne

@geoand
Copy link
Contributor

geoand commented Nov 20, 2019

This will need a rebase to fix CI

@machi1990 machi1990 force-pushed the fix/5269 branch 2 times, most recently from 48ebf01 to cc04654 Compare November 20, 2019 21:37
@machi1990 machi1990 requested review from Sanne and removed request for Sanne November 22, 2019 08:47
@machi1990 machi1990 added this to the 1.1.0 milestone Nov 22, 2019
@machi1990 machi1990 requested a review from gsmet November 22, 2019 11:43
@Sanne
Copy link
Member

Sanne commented Nov 22, 2019

Thanks looks great, and I verified it works. I've added a very minor comment which you might want to address - but no strong opinion, I could merge it as-is if you prefer keeping that.

@machi1990
Copy link
Member Author

Thanks looks great, and I verified it works. I've added a very minor comment which you might want to address - but no strong opinion, I could merge it as-is if you prefer keeping that.

Hey @Sanne ping, I have force pushed a change to incorporate @gsmet suggestion. I think this PR is good to go :-)

@Sanne
Copy link
Member

Sanne commented Nov 27, 2019

thanks @machi1990 ! I'll test it now..

Copy link
Member

@gsmet gsmet left a comment

Choose a reason for hiding this comment

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

I added a couple more comments.

@@ -192,4 +194,9 @@
}
return newProps;
}

@BuildStep
NativeImageEnableAllCharsetsBuildItem enableAllCharSets(List<NativeEnableAllCharsetsBuildItem> oldProps) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
NativeImageEnableAllCharsetsBuildItem enableAllCharSets(List<NativeEnableAllCharsetsBuildItem> oldProps) {
NativeImageEnableAllCharsetsBuildItem enableAllCharsets(List<NativeEnableAllCharsetsBuildItem> oldProps) {

@@ -156,6 +157,8 @@ public NativeImageBuildItem build(NativeConfig nativeConfig, NativeImageSourceJa
nativeConfig.enableAllSecurityServices |= Boolean.parseBoolean(prop.getValue());
} else if (prop.getKey().equals("quarkus.native.enable-all-charsets") && prop.getValue() != null) {
nativeConfig.addAllCharsets |= Boolean.parseBoolean(prop.getValue());
} else if (prop.getKey().equals("quarkus.native.enable-all-timezones") && prop.getValue() != null) {
enableAllTimeZones = Boolean.parseBoolean(prop.getValue());
Copy link
Member

Choose a reason for hiding this comment

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

I don't think removing the configuration property here is the solution.

Let's tackle the issue now. I would rename addAllCharsets to enableAllCharsets in the nativeConfig and maybe deprecate the old property and still somehow support it.

Copy link
Member Author

Choose a reason for hiding this comment

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

I see your point and I agree. I'd have preferred to do it in another PR, since it is mostly unrelated :-)

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think removing the configuration property here is the solution.

Let's tackle the issue now. I would rename addAllCharsets to enableAllCharsets in the nativeConfig and maybe deprecate the old property and still somehow support it.

I'll create an issue for this.

@@ -225,6 +228,9 @@ public NativeImageBuildItem build(NativeConfig nativeConfig, NativeImageSourceJa
} else {
command.add("-H:-AddAllCharsets");
}
if (enableAllTimeZones) {
command.add("-H:+IncludeAllTimeZones");
Copy link
Member

Choose a reason for hiding this comment

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

If we have a proper property then I suppose we can ad the - version too as the user will be able to override it.

Copy link
Member

Choose a reason for hiding this comment

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

Sure that's the plan, as soon as we have a better way to expose this configuration.

@Sanne
Copy link
Member

Sanne commented Nov 29, 2019

many thanks @machi1990 , let's merge this. Sorry for the delay, I had an unfortunate combination of travel and some problems with my hardware.

@Sanne
Copy link
Member

Sanne commented Nov 29, 2019

@gsmet I see you blocked the merge. Are you ok to lift that? it's good to go IMO, we can polish further at another round.

@machi1990
Copy link
Member Author

Just rebased with master to fix CI failure.

@machi1990
Copy link
Member Author

many thanks @machi1990 , let's merge this. Sorry for the delay, I had an unfortunate combination of travel and some problems with my hardware.

Thanks @Sanne , no problem.

@gsmet
Copy link
Member

gsmet commented Dec 2, 2019

I suppose we can tweak things in a subsequent PR. But I really would like things to be symmetrical between charsets and timezones because it's exactly the same thing.

@gsmet gsmet merged commit f33a35b into quarkusio:master Dec 2, 2019
@machi1990 machi1990 deleted the fix/5269 branch December 2, 2019 16:22
@Sanne
Copy link
Member

Sanne commented Dec 2, 2019

thanks @gsmet and @machi1990 . Sure we can aim for a "symmetrical" solution, we can get there one step at a time :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/persistence OBSOLETE, DO NOT USE
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Timezone mappings missing for MySQL JDBC driver in native mode
5 participants