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

Avoid duplication of platform descriptions and imported Platform Boms in the PlatformImporstImpl #44146

Open
cdsap opened this issue Oct 29, 2024 · 0 comments
Labels
area/housekeeping Issue type for generalized tasks not related to bugs or enhancements

Comments

@cdsap
Copy link
Contributor

cdsap commented Oct 29, 2024

Description

I'm currently testing the compatibility of tasks like QuarkusInfo with the configuration cache. The main challenge lies in providing a valid ApplicationModel generated by QuarkusApplicationModelTask. When executing the task, the output returns "no BOM or extensions are found."

Currently, we're supplying the platform configuration to the QuarkusApplicationModelTask, where we instantiate a new PlatformImportsImpl and attempt to set platform properties and descriptors. However, the platform configuration is not being resolved correctly.

The root cause is that the PlatformImports used in the ApplicationModelBuilder does not contain the platform BOM because the existing logic in the task isn't applied due to the platform configuration not being resolved.

To address this issue, we could use the PlatformImports instance of the ApplicationDeploymentClasspathBuilder as an input to the task. Additionally, to avoid issues like #43258, we should skip forcing the resolution and prevent breaking conditional dependencies by retrieving the FileCollection from the incoming dependencies of the Quarkus platform configuration without immediately resolving them. This approach actually fixes the current issue.

However, during my tests, I found that we're missing caching on the QuarkusGenerateCode and QuarkusBuildTasks tasks because PlatformImportsImpl isn't consistent across builds. When resolving the dependency, we're using the static platformImports of ApplicationDeploymentClasspathBuilder, which causes it to always go through(in PlatformImportsImpl):

platformImports.computeIfAbsent(bomCoords, c -> new PlatformImport()).descriptorFound = true;
platformBoms.add(bomCoords);

This creates new BOM coordinates for the same descriptor on every build. The same problem occurs with importedPlatformBoms:

importedPlatformBoms.computeIfAbsent(groupId, g -> new ArrayList<>()).add(bomCoords);

These inconsistencies prevent the build cache from working as expected.

Implementation ideas

Avoid the duplication in PlatformImporstImpl

@cdsap cdsap added the area/housekeeping Issue type for generalized tasks not related to bugs or enhancements label Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/housekeeping Issue type for generalized tasks not related to bugs or enhancements
Projects
None yet
Development

No branches or pull requests

1 participant