pavkam / tzdb

Delphi/FPC Time Zone Database
https://www.iana.org/time-zones
BSD 3-Clause "New" or "Revised" License
84 stars 27 forks source link

Unhandled exception EInvalidOp compiling recent IANA sources #11

Closed Pamoho closed 5 years ago

Pamoho commented 5 years ago

G'day Alex,

We try to apply each IANA DB version as they are published. I've written a utility that takes the download and performs all the steps we need to get it compile in the right places. This includes running TZcompile against the "latest DB".

Many times the compile step will fail with a message like: Screenshot 2019-07-07 14 31 16

We've identified three Links that are problematic:

The problem is with the data in Backward and Backzone files. We commented out the lines in these files, and the TZcompile completes AOK.

The two files change infrequently, but when they do we lose our mods and the TZcompile exception is raised again.

Annoying but not a show stopper. I apologise for not drilling into the code yet to work out a more permanent solution...

Below are some scans showing the duplicate Links.

Cheers, Paul

Screenshot 2019-07-07 21 41 23 Screenshot 2019-07-07 21 53 35 Screenshot 2019-07-07 21 41 56

pavkam commented 5 years ago

Thanks Paul,

I have added some code to relax the fail in such cases. The compilation will emit a warning but will continue.

Give master a check and let me know if this is solved for you.

Alex.

Pamoho commented 5 years ago

Evening Alex,

[Great turnaround on these Issues BTW!]

Tested just now and looks good. I especially like the "verbose output". Very helpful.

Only one extremely small "niggle". How is the order of the files compiled selected? It looks alphabetical to me. If the "Backward" and "Backzone" files are "second tier" data, there is a danger that they could be the first to define an Alias (e.g. before the "Europe" file) and the declaration in any later "first tier" file would be lost.

Right now the three (well four if you count "UTC") Aliases affected are not significant.

Let me know what you think. I am happy to close this on the strength of the work already done, but if you want more info / testing, happy to help.

Cheers, Paul

Screenshot 2019-07-08 23 11 41

pavkam commented 5 years ago

They were never an issue before, though I checked the code and it seems that order is important. I am thinking of caching all alias requests and finalizing them all at the end.

I'll try to put something together tonight.

Alex.

pavkam commented 5 years ago

I checked in a buffered approach to aliases. I can't say I see a difference but it's good to have.

There might be some compilation issues in the test module. I am trying to fix some naming issues from some previous merges.

Pamoho commented 5 years ago

Noted the changes throughout TZdb.pas!

Think this can close now 🤗