Comments (8)
I can't get my CI to work with older Perls on macOS. I'll do a trial release with the fix and monitor CPAN Testers.
from datetime.pm.
Fixed in 1.65.
from datetime.pm.
I'm not familiar with the API in perl.h
at all but I tried to be naive and just removed the definition of dt_isfinite
if on macOS and with this diff all the tests now passes with make test
with perl 5.10.1:
diff --git a/DateTime.xs b/DateTime.xs
index 09778cf..9409144 100644
--- a/DateTime.xs
+++ b/DateTime.xs
@@ -13,7 +13,9 @@
# define dt_isfinite Perl_isfinite
# endif
# else
-# define dt_isfinite Perl_isfinite
+# ifndef __APPLE__
+# define dt_isfinite Perl_isfinite
+# endif
# endif
#define DAYS_PER_400_YEARS 146097
Looking at 🤔perl.h
bundled with perl 5.10.1 I don't even see they refer to Perl_isfinite
so that would explain why it's not defined on 5.10. Compared to on the blead
branch where it's mentioned 37 times and seems guaranteed to be set. No clue why it works on 5.10 on Linux in CI though
Never mind, it's for sure defined here: https://github.com/Perl/perl5/blob/5348debf9fd57fc15c26529386769684fab96e57/perl.h#L2140-L2154
Seems to be this line that fails which is the one calling Perl_is_inf
which fails: https://github.com/Perl/perl5/blob/5348debf9fd57fc15c26529386769684fab96e57/perl.h#L2150. Not sure if we should add an extra guard to this codebase and check if Perl_is_inf
is defined before setting dt_isfinite
or if we should just skip this for Apple on <= 5.10. Haven't tested if this works on versions between 5.10.1 and 5.32.0.
from datetime.pm.
Is this a typo that never got discovered somehow? Searching for Perl_is_inf
yields very few results.
It was originally added 2001 in Perl/perl5@758a5d7, updated in 2014 in Perl/perl5@4efd38a and then shortly after removed in Perl/perl5@25c46df but without any mention regarding the use of Perl_is_inf
and Perl_is_nan
. This was only ever used if Perl_fp_class_finite
wasn't defined so maybe that's why it doesn't affect Windows or Linux systems.
If this actually is a typo maybe we can fix this by redefining this given the same conditional as the original code? This fix also solves my issue:
diff --git a/DateTime.xs b/DateTime.xs
index 09778cf..c546d05 100644
--- a/DateTime.xs
+++ b/DateTime.xs
@@ -13,6 +13,10 @@
# define dt_isfinite Perl_isfinite
# endif
# else
+# if !defined(Perl_fp_class_finite)
+# define Perl_is_inf Perl_isinf
+# define Perl_is_nan Perl_isnan
+# endif
# define dt_isfinite Perl_isfinite
# endif
If you think that's reasonable I'll happily make a PR!
from datetime.pm.
I think the simplest thing is just to not worry about this on older macOS builds, similarly to how the code currently handles Windows pre-5.22.0. I'd note that 5.10.1 is now more than 14 years old. I don't want to invest a huge amount of effort in supporting it.
from datetime.pm.
I think the simplest thing is just to not worry about this on older macOS builds, similarly to how the code currently handles Windows pre-5.22.0. I'd note that 5.10.1 is now more than 14 years old. I don't want to invest a huge amount of effort in supporting it.
Yeah that sounds reasonable! I just wanted to do the right thing:tm: but I agree it's not worth spending effort on such old versions. Tbh I haven't used such old versions in a long time and the package I mentioned is probably not used much. It was mostly since both my package and this one claims to support this version.
I created a PR with your suggested fix. Closed this, missed your branch without PR.
I can't get my CI to work with older Perls on macOS. I'll do a trial release with the fix and monitor CPAN Testers.
Let me know if there's anything you want me to try for you if you don't have access to macOS!
from datetime.pm.
If you can try the trial release with an older Perl on macOS, I'd greatly appreciate it.
from datetime.pm.
Works fine both on my machine and in CI: https://github.com/personnummer/perl/actions/runs/6689612280/job/18173436632
Thank's a bunch!
from datetime.pm.
Related Issues (20)
- Implement `use DateTime ':hires'` HOT 1
- Do I miss something with timezones? HOT 2
- Improve add_duration HOT 2
- Add ability to lock/unlock DateTime objects through methods, which when locked causes an exception on in-place modification HOT 2
- Have from_epoch() support just getting seconds passed HOT 6
- calculated last day of month wrong HOT 2
- -Inf/Inf should be formatted as -infinity/infinity HOT 8
- constructor will not accept second => 60 HOT 3
- Can not compare two datetime objects HOT 3
- DateTime->from_epoch( epoch => 0 ) HOT 5
- Tests fail when PERL_DATETIME_DEFAULT_TZ is set on system HOT 2
- Typos in recent Duration documentation update HOT 1
- datetime.perl.org not found HOT 1
- DateTime::Duration::in_units('days') should not return completely wrong answers for durations over 1 month HOT 19
- Truncate ignores DST flag. Bug or intended behavior? HOT 3
- Europe/Dublin DST flag is backwards? HOT 3
- Clarify pod "our $App::LocalTZ = ..." (not legal Perl syntax) HOT 1
- [Win32 quadmath] isfinite() does not accommodate __float128 HOT 11
- Sub::Identify not being detected as a prerequisite HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from datetime.pm.