llb: don't include platform in fileop proto #3858
Merged
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.
Afaics FileOp has the same behavior independently from the target platform, so don't include the platform value in the LLB digest. The same already happens for MergeOp/DiffOp.
Atm. when doing multi-platform builds, copying the same files in both architectures can create different LLB. BuildKit solver will discover that the vertexes are the same after doing the cache key computation but this means that it goes to the "merging edges" code path and some vertexes will be canceled. This means inefficient and more complicated codepath as well as weird output to the user.
I also discovered #1889 but have no memory of the full intentions behind it.
While modifying the tests to make sure that platform is still carried over correctly if run steps happen after fileop I discovered that this was not working correctly (imho) for merge and diff op. The second commit is for that. If needed I could also separate it into another PR.
@sipsma