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

Allow incomplete classpath configuration to be more granular #3929

Open
galderz opened this issue Oct 20, 2021 · 4 comments
Open

Allow incomplete classpath configuration to be more granular #3929

galderz opened this issue Oct 20, 2021 · 4 comments
Assignees
Labels

Comments

@galderz
Copy link
Contributor

galderz commented Oct 20, 2021

Is your feature request related to a problem? Please describe.
Having 3rd party libraries define --allow-incomplete-classpath can be very problematic for frameworks such as Quarkus.

When the flag is there, errors start to become more difficult to understand. It would even seem that the native image itself behaves differently enough, that seemingly unrelated errors appear out of nowhere.

Quarkus tries as hard as possible to avoid any 3rd party libraries setting it, but at time some of those are proprietary or closed source, so there's nothing we can do about it.

The worst part of the flag is the fact that it has a global implication.

Describe the solution you'd like.
It would be nice to have an optional way to make the flag not global. That is, find a way to trim the code that is affected by this flag.

For example, could we find an idiomatic way to say: allow these methods/classes/packages to reference bytecode for which classes are not in the classpath. For any other part of the code, throw an error.

Describe who do you think will benefit the most.
Frameworks which depend on GraalVM, e.g. Quarkus.

Describe alternatives you've considered.
We don't see any other alternatives.

Additional context.
Add any other context about the feature request here.
For example, link to the relevant projects, documentation, standards.

Express whether you'd like to help contributing this feature
I'd be happy to implement it once we've found an agreement.

@Sanne
Copy link
Contributor

Sanne commented Oct 20, 2021

Describe alternatives you've considered.
We don't see any other alternatives.

For completeness, I'd add that we considered suggesting to deprecate --allow-incomplete-classpath without any alternative. But I'm afraid that might limit adoption and make it much more difficult to achieve compatibility with native images, as we have frequently encountered the need to use such flags, at least temporarily, to be able to make progress in iterative improvements.

Considering that the intent of --allow-incomplete-classpath is to allow incremental progress by temporarily accepting some specific technical debt in a project, we think it makes sense for [some evolved variant of this flag] to limit its impact to the specific need exclusively, and without potentially affecting other code beyond the code which is allowed to do this, most likely leading to unintentionally hiding problems in unrelated code.

@galderz
Copy link
Contributor Author

galderz commented Dec 16, 2021

For reference, Sanne wrote up some more thoughts about this in this discussion.

@christianwimmer
Copy link

PR with a proposed solution: #4305

@galderz
Copy link
Contributor Author

galderz commented Mar 3, 2022

@christianwimmer #4305 is not a solution for the problem specified above.

Using the nomenclature in #4305, Quarkus would be in the boat of using --link-at-build-time without arguments via the native-image, but we lack the ability to specify which classes/packages we'd want to be linked at run time. An alternative solution that Quarkus goes and specifies all packages+classes --link-at-build-time without mentioning the classes/packages that would need to be linked at run time is simply not scalable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants