-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Conversation
core/deployment/src/main/java/io/quarkus/deployment/pkg/NativeConfig.java
Outdated
Show resolved
Hide resolved
...loyment/src/main/java/io/quarkus/deployment/builditem/NativeEnableAllTimeZonesBuildItem.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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.
core/deployment/src/main/java/io/quarkus/deployment/pkg/NativeConfig.java
Outdated
Show resolved
Hide resolved
core/deployment/src/main/java/io/quarkus/deployment/pkg/NativeConfig.java
Outdated
Show resolved
Hide resolved
if (nativeConfig.addAllTimeZones) { | ||
command.add("-H:+IncludeAllTimeZones"); | ||
} else { | ||
command.add("-H:-IncludeAllTimeZones"); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will need a rebase to fix CI |
48ebf01
to
cc04654
Compare
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. |
thanks @machi1990 ! I'll test it now.. |
There was a problem hiding this 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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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()); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 :-)
There was a problem hiding this comment.
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
toenableAllCharsets
in thenativeConfig
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"); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
many thanks @machi1990 , let's merge this. Sorry for the delay, I had an unfortunate combination of travel and some problems with my hardware. |
@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. |
… mode This fixes the issue by enabling all timezones by default when we have mysql extension Fixes quarkusio#5269
Just rebased with master to fix CI failure. |
Thanks @Sanne , no problem. |
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. |
thanks @gsmet and @machi1990 . Sure we can aim for a "symmetrical" solution, we can get there one step at a time :) |
Fixes #5269
/cc @johnaohara