-
Notifications
You must be signed in to change notification settings - Fork 33
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(java): initialize classes at build-time to fix Native Image compilation #874
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
fddce03
fix(java): initialize classes at build-time to Native Image support i…
mpeddada1 fe9fd7b
update comment in native-image.properties
mpeddada1 620c0c8
Merge branch 'main' of github.com:googleapis/java-storage-nio into na…
mpeddada1 3ac88f0
add missing classes
mpeddada1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
...resources/META-INF/native-image/com/google/cloud/google-cloud-nio/native-image.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Using META-INF/services with Native Image compilation results in | ||
# FileSystemProvider being initialized at build time. This results | ||
# CloudStorageFileSystemProvider and some classes referenced by | ||
# this class (for example, StorageOptions, StorageOptionsUtil, | ||
# DefaultStorageRetryStrategy) being unexpectedly and recursively initialized at | ||
# build time. | ||
Args = --initialize-at-build-time=com.google.cloud.storage.contrib.nio.CloudStorageFileSystemProvider,\ | ||
com.google.cloud.storage.contrib.nio.CloudStorageConfiguration,\ | ||
com.google.cloud.storage.contrib.nio.CloudStorageFileSystem,\ | ||
com.google.cloud.storage.contrib.nio.StorageOptionsUtil,\ | ||
com.google.cloud.storage.StorageException,\ | ||
com.google.cloud.storage.StorageOptions,\ | ||
com.google.cloud.storage.DefaultStorageRetryStrategy,\ | ||
com.google.api.client.http.OpenCensusUtils,\ | ||
com.google.api.client.http.GenericUrl,\ | ||
com.google.api.client.http.HttpRequest,\ | ||
com.google.api.client.http.HttpMediaType,\ | ||
com.google.api.client.http.javanet.NetHttpTransport,\ | ||
com.google.api.client.util.Data,\ | ||
com.google.api.client.util.DateTime,\ | ||
com.google.auth.oauth2,\ | ||
io.opencensus.trace,\ | ||
com.google.api.client.util.escape.CharEscapers,\ | ||
com.google.api.client.util.escape.PercentEscaper,\ | ||
io.opencensus.contrib.http.util.CloudTraceFormat,\ | ||
io.grpc.Context,\ | ||
io.grpc.Context$LazyStorage,\ | ||
io.grpc.ThreadLocalContextStorage,\ | ||
com.google.common.cache.LocalCache,\ | ||
com.google.common.cache.CacheBuilder,\ | ||
com.google.common.math.IntMath$1,\ | ||
com.google.common.collect.RegularImmutableMap,\ | ||
com.google.gson.stream.JsonReader,\ | ||
com.google.api.client.json.gson.GsonParser$1,\ | ||
com.google.api.client.json.JsonParser$1,\ | ||
com.google.cloud.PlatformInformation,\ | ||
com.google.cloud.ExceptionHandler,\ | ||
org.threeten.bp.Duration,\ | ||
com.google.common.io.BaseEncoding$Base16Encoding,\ | ||
com.google.common.io.BaseEncoding$Base64Encoding,\ | ||
com.google.common.io.BaseEncoding,\ | ||
com.google.common.io.BaseEncoding$StandardBaseEncoding,\ | ||
com.google.api.client.util.PemReader |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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'm curious about how you get the list)
If we don't have this
GenericUrl
line here, what kind of error do you get?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.
Removing
GenericUrl
results in:And removing all the other classes results in a similar error for the following classes:
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. Thank you for checking.