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

Move GraalVM Metadata from Micronaut Core and Modules to GraalVM Reachability Metadata #7805

Open
1 of 55 tasks
sdelamo opened this issue Aug 1, 2022 · 2 comments
Open
1 of 55 tasks
Assignees

Comments

@melix
Copy link
Contributor

melix commented Aug 1, 2022

To be clear, the reachability metadata repository should talk about libraries themselves and not the transitives, as far as I understand. So when we say "migrate Micronaut SQL" for example, it actually means looking at the features we have, the configuration files we have, and split them across as many configuration files as we need for external modules (e.g if the configuration for Micronaut SQL talks about MariaDB, then the configuration to be migrated to the config repo is the configuration for MariaDB).

Configuration for Micronaut itself should remain in the modules.

@melix
Copy link
Contributor

melix commented Sep 21, 2022

So, as soon as we do this, there are a few consequences which will require larger coordination.

  1. first of all, moving to the metadata repository requires releasing a new version of the Gradle plugin and Maven plugin to enable the metadata repository. This, itself, could have consequences as it's going to transparently add metadata to existing builds. For example, enabling the repository on an existing, out of the box, project, shows that we get metadata for both Netty and Logback. This could accidentally break applications, although the hope is precisely the opposite.
  2. every time a module is migrated, we will create a number of PRs on the GraalVM reachability metadata repository. Before we can release the module, those would have to be merged and a new version of the repository would have to be released.
  3. A consequence of 2. is that we don't handle the rollout of fixes anymore: by moving the configuration from a Micronaut module to the metadata repository, we can't fix a native image building problem by upgrading a Micronaut module version: we will need to wait for metadata repository releases.
  4. Another consequence of 2. is that the metadata repository version which is used defaults to the latest release when the Native Build Tools are released. So it also means that the metadata version is bound to our Maven or Gradle plugins, which depend transitively on the NBT release. Note, however, that users can override the default version of the repository, or use their own.
  5. We can decide to ship our own metadata repository zip and use it in our build plugins, if it happens that we have to wait too often on metadata repository releases: the NBT plugins already support custom zips or URLs, so we could potentially override the default.
  6. The responsibility of "making it work" is shifted to the end user, not the Micronaut modules: while Micronaut modules may ship with native image configuration, it should only be for their own code, not transitive dependencies. Therefore, knowledge about how to make library X or Y to work with native image is moved outside of Micronaut responsibility to the community (that's a direct consequence of the use of the metadata repository). This means that only the application of the NBT plugin, or the Micronaut GraalVM plugin will enable the use of this metadata. This isn't a problem per se: this is simply to recognize that the responsibility has shifted from the producer (Micronaut) to the consumer (the end user application).

A concrete problem is to understand whether we can start migrating our metadata and not do everything at once. At first glance, it should be possible, because use of the metadata repository doesn't disable use of metadata embedded into jar files (for good reasons, since each library should package it for its own classes, ideally). In case there are problems, there are flags which can be used on the NBT plugins side to disable metadata for a specific library, for example. We will probably need to document how to do it.

@melix melix changed the title Move GraalVM Metadata from Micronaut Core and Modules to GraalVM Rechability Metadata Move GraalVM Metadata from Micronaut Core and Modules to GraalVM Reachability Metadata Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants