-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Generate CFG_FILENAME_EXTRA from the version #25208
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
Conversation
The code takes a prefix of the MD5 hash of the version string. Since the hash command differs across GNU and BSD platforms, we scan for the right one in the configure script. Closes #25007
The old code simply scanned for the first digit, then munched anything after that. This didn't work for md5sum, as it would see the "5" and treat "5sum" as the version instead. This patch tweaks the algorithm so that it looks for a second consecutive digit (or dot) after the first. Since "md5sum" has only one digit, the new code skips over it as intended.
(rust_highfive has picked a reviewer for you, use r? to override) |
r? @brson |
CFG_FILENAME_EXTRA=4e7c5e5c | ||
# Append a version-dependent hash to each library, so we can install different | ||
# versions in the same place | ||
CFG_FILENAME_EXTRA=$(shell echo -n $(CFG_RELEASE) | $(CFG_HASH_COMMAND)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't remember the details but echo -n
can't be counted on to behave the same everywhere. Can you change this to just echo
? Hopefully that results in the same output everywhere - we need these hashes to come out the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I think I'll use printf '%s'
instead, which has more consistent behavior than echo
.
The configure script depends on printf
already, so it should be okay to use it.
According to POSIX, the behavior of `echo -n` is "implementation defined". So we can't guarantee that it gives the same result everywhere. See also: * http://pubs.opengroup.org/onlinepubs/9699919799/utilities/echo.html * http://unix.stackexchange.com/q/65803/9814
Ah good idea with printf. @bors: r+ |
📌 Commit 2c0db5e has been approved by |
⌛ Testing commit 2c0db5e with merge 32504ca... |
⛄ The build was interrupted to prioritize another pull request. |
⌛ Testing commit 2c0db5e with merge 4349cc8... |
⛄ The build was interrupted to prioritize another pull request. |
The code takes a prefix of the MD5 hash of the version string. Since the hash command differs across GNU and BSD platforms, we scan for the right one in the configure script. Closes #25007
The code takes a prefix of the MD5 hash of the version string.
Since the hash command differs across GNU and BSD platforms, we scan for
the right one in the configure script.
Closes #25007