-
Notifications
You must be signed in to change notification settings - Fork 370
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
tzdata crash at startup in escript #86
Comments
I've got the same error =( |
OK, escript builds do not support well data embeded in Anyway, I guess to properly embed Timex/Tzdata in standalone executables, I´ll have to try some |
@sdanzan Actually escripts do support reading data from their embedded archive (via @lau Is there a relatively straightforward fallback solution we can use with |
A feature that I am considering implementing soon is to be able to configure (using the elixir config system) an alternative dir location for the files that are currently in the |
I'm also seeing this error but in a slightly different context. I'm not sure if this will help, but I have configured my .iex.exs file to have the following function that uses date bindings call_service_with_cache = fn ->
params = {credentials, App.get_yesterdays_date_format, App.get_todays_date_format}
garden_data = ApiCache.call_api(params, fn credentials, date_from, date_to ->
Api.get_garden_data(credentials, date_from, date_to)
end)
end I see this error when trying to format the date to a string. |
@lau Yeah the same problem will still exist for escript builds, since the only way to read files from the escript is via Since datetime parsing/formatting/etc. is probably not an uncommon scenario for some escript use cases, I think it's worth the time to figure out a good solution. |
@Korbin73 In your .iex.exs, add above that code snippet:
That should fix your particular issue. |
Excellent! That worked. Thanks @bitwalker |
@bitwalker I see. Having two different file formats might be messy, but going down that route might be a good idea. Maybe with the alternative file format as a separate package if possible. Using tzdata |
@lau I've changed the requirements in @sdanzan You can put the following in your def deps do
[..., {:tzdata, "== 0.1.8", override: true}]
end I'll update this thread when we have a longer term solution in place. |
This is currently required to get escript.build properly working (see: bitwalker/timex#86)
Yes, it works, thanks! |
I had this issue, but had a little trouble finding this github issue via google, so will add the stacktrace to make this easier to find for others
|
It works tzdata 0.1.8, Thanks @bitwalker |
I would use "~> 0.1.8" instead of "== 0.1.8". Because when the next version of the timezone data comes out, you would want 0.1.9 instead of 0.1.8. And ~> 0.1.8 allows "0.1.9", "0.1.10" and so on. |
Changed :) |
Hi to all! |
downgrade tzdata version [issue #86 bitwalker/timex#86]
This is documented in 2.0, and I'm going to look in to a PR for a solution to fix this in more recent versions as soon as I can. |
@bitwalker Any word on a fix for this issue? Downgrading tzdata fixes the problem but its not the best solution in the world. Any reason the issue is closed if its not really resolved? |
For more details, see: bitwalker/timex#86
The fundamental issue is that it's not possible to load ETS tables from files in an escript. The |
- added ability to create annotated tag prior to release - updated build to use tar.gz as extension - updated version and changelog - updated timex to latest - updated bypass - updated Timex - use `DateTime` instead of `Timex.Date` - set logger to `:warn` on test - added function to create tag - added function to create tags ref - fixed warnings - display github error and fallback to defaults - updated tests to reflect additional calls to fetch full commit sha - fixed crash issue on compile by downgrading tzdata to 0.1.8 For more details, see: bitwalker/timex#86
[Issue](#40) - added ability to create annotated tag prior to release - updated build to use tar.gz as extension - updated version and changelog - updated timex to latest - updated bypass - updated Timex - use `DateTime` instead of `Timex.Date` - set logger to `:warn` on test - added function to create tag - added function to create tags ref - fixed warnings - display github error and fallback to defaults - updated tests to reflect additional calls to fetch full commit sha - fixed crash issue on compile by downgrading tzdata to 0.1.8 For more details, see: bitwalker/timex#86
[Issue](#40) - added ability to create annotated tag prior to release - updated build to use tar.gz as extension - updated version and changelog - updated timex to latest - updated bypass - updated Timex - use `DateTime` instead of `Timex.Date` - set logger to `:warn` on test - added function to create tag - added function to create tags ref - fixed warnings - display github error and fallback to defaults - updated tests to reflect additional calls to fetch full commit sha - fixed crash issue on compile by downgrading tzdata to 0.1.8 For more details, see: bitwalker/timex#86
[Issue](#40) - added ability to create annotated tag prior to release - updated build to use tar.gz as extension - updated version and changelog - updated timex to latest - updated bypass - updated Timex - use `DateTime` instead of `Timex.Date` - set logger to `:warn` on test - added function to create tag - added function to create tags ref - fixed warnings - display github error and fallback to defaults - updated tests to reflect additional calls to fetch full commit sha - fixed crash issue on compile by downgrading tzdata to 0.1.8 For more details, see: bitwalker/timex#86
[Issue](#40) - added ability to create annotated tag prior to release - updated build to use tar.gz as extension - updated version and changelog - updated timex to latest - updated bypass - updated Timex - use `DateTime` instead of `Timex.Date` - set logger to `:warn` on test - added function to create tag - added function to create tags ref - fixed warnings - display github error and fallback to defaults - updated tests to reflect additional calls to fetch full commit sha - fixed crash issue on compile by downgrading tzdata to 0.1.8 For more details, see: bitwalker/timex#86
[Issue](#40) - added ability to create annotated tag prior to release - updated build to use tar.gz as extension - updated version and changelog - updated timex to latest - updated bypass - updated Timex - use `DateTime` instead of `Timex.Date` - set logger to `:warn` on test - added function to create tag - added function to create tags ref - fixed warnings - display github error and fallback to defaults - updated tests to reflect additional calls to fetch full commit sha - fixed crash issue on compile by downgrading tzdata to 0.1.8 For more details, see: bitwalker/timex#86
[Issue](#40) - added ability to create annotated tag prior to release - updated build to use tar.gz as extension - updated version and changelog - created binary - updated timex to latest - updated bypass - updated Timex - use `DateTime` instead of `Timex.Date` - set logger to `:warn` on test - added function to create tag - added function to create tags ref - fixed warnings - display github error and fallback to defaults - updated tests to reflect additional calls to fetch full commit sha - fixed crash issue on compile by downgrading tzdata to 0.1.8 For more details, see: bitwalker/timex#86
I have an application packaged as a standalone executable (generated with
mix escript.build
) that uses Timex to parse dates.When the application is run from the command line, it crashes in first call to Timex.DateFormat.parse with the "classic" stack trace:
When I call the
main
function of my application directly from withiniex -S mix
with the same arguments, it does not crash. In both case thetzdata
application is loaded and started (I checked by printinginspect(Application.loaded_applications)
andinspect(Application.started_applications)
at the beginning of mymain
function.I use Timex 0.19.5 and tzdata 0.5.3.
The text was updated successfully, but these errors were encountered: