Skip to content

Conversation

@plamentotev
Copy link

@plamentotev plamentotev commented Apr 14, 2020

Currently the resolved version is cached. For example something like 8.0.141. On other hand when a version is looked up in the cache the string provided by the user is used. This may lead to unexpected behavior. 1.8 will not match 8.0.141. Normalizing the version string before looking up in the tool cache will solve the problem. The normalized version (8.x) will match the entry in the cache as expected.

Normalizing the string in the beginning of the flow won't hurt as it is a valid version specification. What is more it the user can supply the normalized version directly so the code should be able to work with it.

Fixes #54

Currently the resolved version is cached. For example something like 8.0.141.
On other hand when a version is looked up in the cache the string provided
by the user is used. This may lead to unexpected behavior. 1.8 will not match
8.0.141. Normalizing the version string before looking up in the tool cache
will solve the problem. The normalized version (8.x) will match the
entry in the cache as expected.

Normalizing the string in the beginning of the flow won't hurt
as it is a valid version specification. What is more it the user can supply
the normalized version directly so the code should be able to work with it.
@plamentotev
Copy link
Author

plamentotev commented Apr 14, 2020

Judging by the failed test it is not the resolved version that is being stored in the cache but the version spec (the version string provided by the user.)

EDIT: Only when JDK file is provided.

@plamentotev
Copy link
Author

Hmm, I can update my change so that the version is normalized only if jdkFile is not provided. Then it will work.

Or at least kind of. It will work if the user entered version like 12 and not 12.x On one hand it makes sense - why would you enter version range if you supplied the file. But on other hand does it makes sense to use version and tool cache if you have supplied the jdk file? What would be the use case? To populate the cache for other jobs that does not provide jdkFile? Because if I provide the file then does it matter what version I provide and why would I like to take it from the cache?

@ZacSweers
Copy link

Is this PR being looked by anyone at github?

@maxim-lobanov
Copy link
Contributor

Closing according #54 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1.x versions does not work with the tools cache

3 participants