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

Prefactor: Move get_hash from docker backend to strutil #18715

Merged
merged 14 commits into from
Apr 13, 2023

Conversation

thejcannon
Copy link
Member

Prefactor for #18708

@thejcannon thejcannon added needs-cherrypick category:internal CI, fixes for not-yet-released features, etc. labels Apr 11, 2023
@thejcannon thejcannon added this to the 2.16.x milestone Apr 11, 2023
@thejcannon thejcannon requested review from stuhood and kaos April 11, 2023 16:25
@thejcannon
Copy link
Member Author

Needs CP to 2.1.6.x because #18708 needs it

src/python/pants/util/strutil.py Outdated Show resolved Hide resolved
src/python/pants/util/strutil.py Outdated Show resolved Hide resolved
src/python/pants/util/strutil.py Outdated Show resolved Hide resolved
Copy link
Member

@kaos kaos left a comment

Choose a reason for hiding this comment

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

Might want to add a summary of what we've discussed here in the doc string for stable_hash()?

Co-authored-by: Jacob Floyd <cognifloyd@gmail.com>
Copy link
Member

@kaos kaos left a comment

Choose a reason for hiding this comment

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

Can leave it or take it regarding my comment on the json encoding.

@thejcannon
Copy link
Member Author

Hmm I guess one option here is hashing the pickled bytes. That might be more stable?

@cognifloyd
Copy link
Member

Hashing a pickle will not be consistent across versions of python.

@thejcannon
Copy link
Member Author

I think that's untrue, so long as we pin the pickle protocol version

@cognifloyd
Copy link
Member

I think that's untrue, so long as we pin the pickle protocol version

I haven't used pickle much. I didn't know you could pin the pickle protocol - I thought it was merely python-version specific. Good to know.

Copy link
Member

@kaos kaos left a comment

Choose a reason for hiding this comment

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

I'd say good enough. ;)

(I mean, to cover more bases I think we could do the class name thing for all os that is an instance of some class, but as I said.. enough already :p )

@thejcannon thejcannon merged commit 4ad4de8 into pantsbuild:main Apr 13, 2023
@thejcannon thejcannon deleted the dicthash branch April 13, 2023 16:25
thejcannon added a commit to thejcannon/pants that referenced this pull request Apr 13, 2023
thejcannon added a commit that referenced this pull request Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:internal CI, fixes for not-yet-released features, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants