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

Fix more Linux issues #93

Merged
merged 8 commits into from Nov 30, 2022
Merged

Fix more Linux issues #93

merged 8 commits into from Nov 30, 2022

Conversation

Gerzer
Copy link
Contributor

@Gerzer Gerzer commented Oct 31, 2021

I've fixed a runtime issue with date parsing on Linux and addressed some buildtime warnings.

@Gerzer
Copy link
Contributor Author

Gerzer commented Oct 31, 2021

@vincentneo By the way, if/when you merge this, I would appreciate it if you could tag a new release so that I don't have to make the Swift Package Manager depend on either master or a specific commit. Thanks!

@vincentneo vincentneo self-requested a review January 31, 2022 17:57
@vincentneo
Copy link
Owner

So sorry @Gerzer. I missed out on this. Will review soon.

@@ -55,15 +53,8 @@ final class GPXDateParser {
components.hour = hour.pointee
components.month = month.pointee
components.second = second.pointee

Copy link
Owner

Choose a reason for hiding this comment

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

Hi @Gerzer, I had modified a bit of the Test case code on my end, to include date parse check, but it seems like as compared to master branch, this branch fails to parse date, becoming nil.

This can be seen in the latest commit of this branch. Check testParseDualLinksWithURL(). To compare, can replace that function over to master branch.

I assume there is something to do with the code removal in the DateTimeParsers.

If you're able to rectify this issue without a performance loss, it should be good to go other wise. Thank you!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The tests all crash for me because the GPXTest-TrackPointOnly bundle resource isn't found. How do I resolve this so that I can reproduce the actual test failure?

Copy link
Owner

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The issue is that some of the calendar functions that you’re using aren’t available on Linux. Would it be acceptable to keep your existing code but to fall back on the less sophisticated code when compiling for Linux? The tests would pass on macOS, but they would continue to fail on Linux. I could modify those tests as well as the documentation to reflect the differences in behavior. From what I can tell, the issue occurs when trying to parse non-standard date strings.

Copy link
Owner

Choose a reason for hiding this comment

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

The current date parser was used as the default was fairly slow, when considering the scale. (like parsing 1000s of dates)

I reckon we could do a fallback to DateFormatter for linux? (assuming DateFormatter is available?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I apologize for the delay on moving forward with this. I was in a position for a few months in which I wasn’t able to contribute to open-source projects. However, that situation is over, so I’ll follow up here soon.

Copy link
Owner

Choose a reason for hiding this comment

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

It's alright, welcome back!

@vincentneo
Copy link
Owner

looks good to me!

Thank you so much @Gerzer!

@vincentneo vincentneo merged commit 437a435 into vincentneo:master Nov 30, 2022
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