Adding `ex_cldr_collation` fails in docker release (debian runner image)

I’m trying to add ex_cldr_collation as a dependency to a standard phoenix application. I’m having an issue with the docker build.

I understood that the libicu-dev package is required for building, which got me one step further (at first compilation failed, but now the application at least compiles).

When the image starts the phoenix application, I get this error:

  crasher:
    initial call: application_master:init/4
    pid: <0.2044.0>
    registered_name: []
    exception exit: {{shutdown,
                      {failed_to_start_child,kernel_safe_sup,
                       {on_load_function_failed,'Elixir.Cldr.Collation',
                        {{badmatch,
                          {error,
                           {load_failed,
                            "Failed to load NIF library: '/app/lib/ex_cldr_collation-0.7.0/priv/ucol.so: undefined symbol: ucol_strcollIter_67'"}}},
                         [{'Elixir.Cldr.Collation',init,0,
                           [{file,"lib/cldr_collation.ex"},{line,20}]},
                          {init,'-run_on_load_handlers/2-fun-0-',1,[]}]}}}},
                     {kernel,start,[normal,[]]}}
      in function  application_master:init/4 (application_master.erl, line 142)
  ...

As far as I understand, the runner image also has to have an icu dependency although that’s not mentioned explicitly in the documentation of ex_cldr_collation. But I’m failing to understand which packages exactly would provide these undefined symbols (ucol_strcollIter_67). I’ve tried adding libicu-dev, just like in the builder image, but that didn’t work. The package libicu67 also didn’t resolve the problem.

There was some recent activity on the issue tracker of ex_cldr_collation, but that seems to be more related to ubuntu and alpine images. Moreover, there is no mention of packages required at runtime in the docs, only a mention of what’s required to build, which confuses me a bit.

Suggestions appreciated!

@linusdm, sorry for you not having much fun with this. The documentation definitely needs improvement in this area - my lack of knowledge of the various Linux denominations if the primary fault. I hope others more experienced than I am (probably everyone!) can chime in.

My reading suggests that installing the package icu should bring in the right versions of libicu-dev and libicu for whatever version of Debian you are on.

BTW, I’ve only recently become aware that while Ubuntu and MacOS come with libicu installed (the runtime requirement), Debian and Alpine do not. Which is why runtime requirements haven’t been mentioned - I will fix that now I have some more knowledge (albeit not enough!).

Please do open an issue so we can get to the bottom of this ASAP.

Thanks for the reply. I see you’ve improved the docs already.

There is no package literally called icu though, for debian based installs. There is libicu67 which should provide the missing symbol I think, but it doesn’t fix the error.

I’ve taken it to the issue tracker as you suggested: Can't load NIF library in the default phoenix debian docker image: undefined symbol: ucol_strcollIter_67 · Issue #6 · elixir-cldr/cldr_collation · GitHub
I’ll report back if there is any relevant news.

Thanks!