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

make desugar dependencies deterministic #16859

Conversation

mohamadk
Copy link
Contributor

Desugar dependencies are added to the result jar file as metadata, this desugar dependency object contains a few lists that we found out the order of this list can be different in different builds with the same inputs, therefore the final result will have a different hash and it cause cache miss in the builds solution is to make the lists in this object sorted. So for the same input, we always get the same output

@sgowroji sgowroji added awaiting-user-response Awaiting a response from the author team-Android Issues for Android team labels Nov 28, 2022
@mohamadk mohamadk force-pushed the desugare_dependencies_are_not_deterministic branch 3 times, most recently from d383b5a to 49e7027 Compare November 28, 2022 10:36
@sgowroji sgowroji added awaiting-review PR is awaiting review from an assigned reviewer and removed awaiting-user-response Awaiting a response from the author labels Nov 28, 2022
Copy link
Contributor

@ahumesky ahumesky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@mohamadk mohamadk force-pushed the desugare_dependencies_are_not_deterministic branch from 49e7027 to 8713a8e Compare November 30, 2022 02:19
Copy link
Contributor

@ahumesky ahumesky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@mohamadk mohamadk force-pushed the desugare_dependencies_are_not_deterministic branch from 8713a8e to 45b6a80 Compare November 30, 2022 03:55
desugar dependencies are added to the result jar file as metadata, this desugar dependency object contain few list that we found out the order of this list can be different in different build with same inputs, therefore final result will have a different hash and it cause cache miss in the builds
solution is to make the lists in this object sorted. so for the same input we always get same output
@mohamadk mohamadk force-pushed the desugare_dependencies_are_not_deterministic branch from 45b6a80 to 94b3d5e Compare November 30, 2022 03:55
@ahumesky
Copy link
Contributor

thanks, I can start the import and internal review today

ahumesky pushed a commit to ahumesky/bazel that referenced this pull request Jan 13, 2023
Desugar dependencies are added to the result jar file as metadata, this desugar dependency object contains a few lists that we found out the order of this list can be different in different builds with the same inputs, therefore the final result will have a different hash and it cause cache miss in the builds solution is to make the lists in this object sorted. So for the same input, we always get the same output

Closes bazelbuild#16859.

PiperOrigin-RevId: 500842557
Change-Id: I051e74e7147d590fcfe5cda9731b8e012396bb65
hvadehra pushed a commit that referenced this pull request Feb 14, 2023
Desugar dependencies are added to the result jar file as metadata, this desugar dependency object contains a few lists that we found out the order of this list can be different in different builds with the same inputs, therefore the final result will have a different hash and it cause cache miss in the builds solution is to make the lists in this object sorted. So for the same input, we always get the same output

Closes #16859.

PiperOrigin-RevId: 500842557
Change-Id: I051e74e7147d590fcfe5cda9731b8e012396bb65
@keertk keertk added this to the 6.1.0 release blockers milestone Feb 28, 2023
@keertk
Copy link
Member

keertk commented Feb 28, 2023

@bazel-io fork 6.1.0

ShreeM01 added a commit that referenced this pull request Feb 28, 2023
Desugar dependencies are added to the result jar file as metadata, this desugar dependency object contains a few lists that we found out the order of this list can be different in different builds with the same inputs, therefore the final result will have a different hash and it cause cache miss in the builds solution is to make the lists in this object sorted. So for the same input, we always get the same output

Closes #16859.

PiperOrigin-RevId: 500842557
Change-Id: I051e74e7147d590fcfe5cda9731b8e012396bb65

Co-authored-by: mohamadk <mohamad.khaleghy@gmail.com>
Co-authored-by: kshyanashree <109167932+kshyanashree@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-review PR is awaiting review from an assigned reviewer team-Android Issues for Android team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants