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
Fix build failure in Alpha architecture #2986
Conversation
Taken from debian/patches See https://bugs.debian.org/962676
Hi @henrich! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
@@ -167,7 +167,7 @@ int UTIL_utime(const char* filename, const stat_t *statbuf) | |||
* that struct stat has a struct timespec st_mtim member. We need this | |||
* check because there are some platforms that claim to be POSIX 2008 | |||
* compliant but which do not have st_mtim... */ | |||
#if (PLATFORM_POSIX_VERSION >= 200809L) && defined(st_mtime) | |||
#if (PLATFORM_POSIX_VERSION >= 200809L) && defined(st_mtime) || defined(__alpha__) |
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.
So I guess it means __alpha__
platform never claims POSIX 2008 compliance, since it probably is not,
yet nonetheless support struct timespec
and st_mtime
as extended features ?
The surprising part here is that, in this construction, __alpha__
is presumed enough of a hint to guarantee the support of struct timespec
, no matter the software level. I would have expected __alpha__
to be much older than struct timespec
, and therefore logically, older variants of software for __alpha__
would not provide struct timespec
. Though I don't know enough about __alpha__
history to be sure about that.
Another avenue could have been to declare PLATFORM_POSIX_VERSION = 200809L
when the right set of conditions is present (__alpha__
and maybe another condition), but this would imply support of other stuff beyond struct timespec
.
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.
What about :
#if (PLATFORM_POSIX_VERSION >= 200809L || defined(__alpha__)) && defined(st_mtime)
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.
@Cyan4973, as the linked bug states, Alpha does not define st_mtime
(which makes it non-compliant with POSIX...). So that won't work.
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.
okay,
so st_mtime
is in fact not required,
it's just employed as a way to improve odds that struct timespec.st_mtim
is actually supported ?
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.
Correct. We previously found some platform (I forget which) which claims to be POSIX 2008 but doesn't have struct timespec
and we detect that by observing that they don't define st_mtime
.
I'm uncomfortable with this fix as proposed. While this is a reasonable patch for Debian to ship, since they can make guarantees about the environment this code is being shipped in, I don't think we can do the same. So I agree with @Cyan4973--I can only assume there are old or maybe even current OS runtimes for Alpha that define We need a good signal to detect this capability. It sounds like this might be difficult, since it's apparent the environment is non-trivially non-compliant with POSIX. (For what it's worth, the linked bug is incorrect: POSIX 2008 requires that In the absence of anything better, we could just disable the |
@@ -167,7 +167,7 @@ int UTIL_utime(const char* filename, const stat_t *statbuf) | |||
* that struct stat has a struct timespec st_mtim member. We need this | |||
* check because there are some platforms that claim to be POSIX 2008 | |||
* compliant but which do not have st_mtim... */ | |||
#if (PLATFORM_POSIX_VERSION >= 200809L) && defined(st_mtime) | |||
#if (PLATFORM_POSIX_VERSION >= 200809L) && defined(st_mtime) || defined(__alpha__) |
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.
nit: Can you add parenthesis to clarify the statement?
#if (PLATFORM_POSIX_VERSION >= 200809L) && defined(st_mtime) || defined(__alpha__) | |
#if ((PLATFORM_POSIX_VERSION >= 200809L) && defined(st_mtime)) || defined(__alpha__) |
FYI, this is actually a bug in glibc itself. I'm working on a fix upstream and will report back. |
Sorry, I was wrong - there is a glibc bug on microblaze, but on alpha the issue is really in zstd itself. Sorry for the noise. |
@henrich, @arnout, we're ramping up to our next release and I'd like to get a fix for this issue merged. I can make the test as follows: #if ((PLATFORM_POSIX_VERSION >= 200809L) && (defined(st_mtime) || defined(__alpha__)))
struct timespec timebuf;
// ...
#elif (PLATFORM_POSIX_VERSION >= 200112L)
struct utimbuf timebuf;
// ...
#else
// do nothing
#endif Is it correct to assume all Alpha systems with |
In the absence of any activity, I'm going to close this. If anyone with an alpha system can comment on the appropriateness of the proposed fix, I'm happy to re-open this and get a fix merged. |
Taken from Debian package, see https://bugs.debian.org/962676
If it would be merged, we Debian can reduce distro-specific patches.
Please consider applying, thanks.