-
Notifications
You must be signed in to change notification settings - Fork 255
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
rpn2 test fails on non-glibc Linux #1012
Comments
Out of curiosity, what does
|
musl doesn't have a |
Ouch, obviously this is an issue for weekly data, as its depends of the first day of the week (Monday or Sunday depending of local folklore). We are assuming this is Monday when HAVE__NL_TIME_WEEK_1STDAY is undefined. I can see rpn2 xport test runs with "LC_TIME=C" meaning that we expect the test to run with the first day of the week being Sunday. Two options:
Tobias: Any suggestion? |
I guess assuming sunday for the weekstart when HAVE__NL_TIME_WEEK_1STDAY is not present is the 'right thing' thing in the sense of least surprise ... after all this is all US centric and in the US sunday is the start of the week, so if the system has not bothered to support localization at that level we should keep it US-style. |
Then this should do the trick: diff --git a/src/rrd_graph.c b/src/rrd_graph.c
index f5d2cdec..62c3e645 100644
--- a/src/rrd_graph.c
+++ b/src/rrd_graph.c
@@ -1568,7 +1568,7 @@ static int find_first_weekday(
}
first_weekday = (week_1stday + first_weekday - 1) % 7;
#else
- first_weekday = 1;
+ first_weekday = 0;
#endif
}
return first_weekday;
diff --git a/src/rrd_rpncalc.c b/src/rrd_rpncalc.c
index 0f54c6be..84f69211 100644
--- a/src/rrd_rpncalc.c
+++ b/src/rrd_rpncalc.c
@@ -564,7 +564,7 @@ static int find_first_weekday(void){
}
first_weekday=(week_1stday + first_weekday - 1) % 7;
#else
- first_weekday = 1;
+ first_weekday = 0;
#endif
}
return first_weekday; |
indeed :) can you make a PR ? |
- Set first_weekday_to 0 (Sunday), when HAVE__NL_TIME_WEEK_1STDAY is not defined - Fixes: oetiker#1012
- Set first_weekday to 0 (Sunday), when HAVE__NL_TIME_WEEK_1STDAY is not defined - Fixes: oetiker#1012
Describe the bug
musl libc does not provide
_NL_TIME_FIRST_WEEKDAY
. This causesfind_first_weekday
to return 1 (Monday), and therpn2
test requires the first weekday to be 0 (Sunday).To Reproduce
Steps to reproduce the behavior:
make check
.Expected behavior
Passing tests (which do occur if either
rpn2
test is disabled, or hardcoded return value fromfind_first_weekday
is 0 instead of 1).Screenshots
![Test failure](https://user-images.githubusercontent.com/303838/58856580-b1401b00-8668-11e9-9ea8-e6b71beb2a4b.png)
Desktop (please complete the following information):
Additional context
This is similar to #661 but it isn't the same thing, because
_NL_TIME_FIRST_WEEKDAY
really doesn't exist on musl libc.The text was updated successfully, but these errors were encountered: