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

use absolute value of hash function to determine crate name #1064

Merged
merged 3 commits into from
Dec 14, 2021

Conversation

krasimirgg
Copy link
Collaborator

No functional changes intended.
Previously the library names of rlibs sometimes had two dashes, like
libslib--389267823.rlib. This happens because the hash() function may
return a negative value, so the second dash is the minus sign. However
such names are a bit confusing since they look like there's a missing
component between the two dashes that didn't get properly propagated,
which is not true.
For the unit test, since the hash() function is the standard Java String hashCode
function, I chose "slib" since that produces a negative hash code.

No functional changes intended.
Previously the library names of rlibs sometimes had two dashes, like
libslib--389267823.rlib.  This happens because the hash() function may
return a negative value, so the second dash is the minus sign. However
such names are a bit confusing since they look like there's a missing
component between the two dashes that didn't get properly propagated,
which is not true.
For the unit test, since the hash() function is the standard Java String hashCode
function, I chose "slib"  since that produces a negative hash code.
@krasimirgg krasimirgg marked this pull request as ready for review December 13, 2021 10:55
Copy link
Collaborator

@UebelAndre UebelAndre left a comment

Choose a reason for hiding this comment

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

The changes look good to me! Thanks!

test/unit/crate_name/crate_name_test.bzl Show resolved Hide resolved
@UebelAndre UebelAndre merged commit 5a79d72 into bazelbuild:main Dec 14, 2021
@krasimirgg krasimirgg deleted the rlib-names branch February 21, 2022 10:25
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.

None yet

2 participants