FastHTML issueshttps://git.pleroma.social/pleroma/elixir-libraries/fast_html/-/issues2024-03-12T09:18:07Zhttps://git.pleroma.social/pleroma/elixir-libraries/fast_html/-/issues/16bug: Error during FastHtml.Pool.init_worker/1 callback2024-03-12T09:18:07Za bbug: Error during FastHtml.Pool.init_worker/1 callbackFirst of all, thank you for the great package! I'm using it in combination with fast_sanitize.
## Error
Recently, I've started to see an error when running `mix phx.server` in development mode:
```
[error] Error during FastHtml.Pool.i...First of all, thank you for the great package! I'm using it in combination with fast_sanitize.
## Error
Recently, I've started to see an error when running `mix phx.server` in development mode:
```
[error] Error during FastHtml.Pool.init_worker/1 callback:
** (ErlangError) Erlang error: :enoent:
* 1st argument: invalid port name
:erlang.open_port({:spawn_executable, "/app/_build/dev/lib/fast_html/priv/fasthtml_worker"}, [:binary, {:packet, 4}, :use_stdio, :exit_status])
(fast_html 2.3.0) lib/fast_html/pool.ex:81: FastHtml.Pool.init_worker/1
(nimble_pool 0.2.6) lib/nimble_pool.ex:932: NimblePool.do_apply_worker_callback/4
(nimble_pool 0.2.6) lib/nimble_pool.ex:891: NimblePool.init_worker/5
(nimble_pool 0.2.6) lib/nimble_pool.ex:539: NimblePool.handle_info/2
(stdlib 5.2) gen_server.erl:1095: :gen_server.try_handle_info/3
(stdlib 5.2) gen_server.erl:1183: :gen_server.handle_msg/6
(stdlib 5.2) proc_lib.erl:241: :proc_lib.init_p_do_apply/3
```
The error comes up somewhat erratically. It can be solved by deleting the `_build` directory, so I assume there is some kind of caching or race condition underneath that causes the issue.
Unfortunately, I can't install the most recent nimble pool version (1.0.0), because nimble pool is locked to 0.2.x in fast_html.
## Versions
```
{:fast_sanitize, "0.2.3"},
{:fast_html, "2.3.0"},
ELIXIR_VERSION=1.15.7
OTP_VERSION=26.2.2
DEBIAN_VERSION=bullseye-20240130-slim
```
See the [mix.exs](https://github.com/b310-digital/qrstorage/blob/191-feature-recording-qr-codes-2/mix.exs) file for a full list of used packages.https://git.pleroma.social/pleroma/elixir-libraries/fast_html/-/issues/15Makefile: Put executables and CMake BUILD_DIR inside _build/…2024-01-29T17:40:42ZHaelwennMakefile: Put executables and CMake BUILD_DIR inside _build/…Currently both `c_src/lexbor` and `priv` end up with build artifacts, the latter is cleaned up properly with make/mix clean but the former isn't.Currently both `c_src/lexbor` and `priv` end up with build artifacts, the latter is cleaned up properly with make/mix clean but the former isn't.https://git.pleroma.social/pleroma/elixir-libraries/fast_html/-/issues/14Can't compile fasthtml on Debian 10 / ARM322023-08-22T11:55:41ZScriptFanixCan't compile fasthtml on Debian 10 / ARM32When I try to compile fasthtml, I get the following error:
```
cc -o priv/fasthtml_worker c_src/fasthtml_worker.c c_src/lexbor/liblexbor_static.a -g -O2 -std=c99 -pedantic -Wcomment -Wextra -Wno-old-style-declaration -Wall -Wno-unused-p...When I try to compile fasthtml, I get the following error:
```
cc -o priv/fasthtml_worker c_src/fasthtml_worker.c c_src/lexbor/liblexbor_static.a -g -O2 -std=c99 -pedantic -Wcomment -Wextra -Wno-old-style-declaration -Wall -Wno-unused-parameter -I/usr/local/lib/erlang/erts-13.2/include -Ic_src/lexbor/source -lpthread -L/usr/local/lib/erlang/erts-13.2/../lib/erl_interface-5.3 /usr/local/lib/erlang/erts-13.2/../lib/erl_interface-5.3.1/lib -I/usr/local/lib/erlang/erts-13.2/../lib/erl_interface-5.3 /usr/local/lib/erlang/erts-13.2/../lib/erl_interface-5.3.1/include -DOTP_22_OR_NEWER -lei -pthread
c_src/fasthtml_worker.c: In function ‘main’:
c_src/fasthtml_worker.c:82:3: warning: implicit declaration of function ‘ei_init’; did you mean ‘ei_x_new’? [-Wimplicit-function-declaration]
ei_init ();
^~~~~~~
ei_x_new
/usr/bin/ld : ne peut pas trouver /usr/local/lib/erlang/erts-13.2/../lib/erl_interface-5.3.1/lib : file format not recognized
/usr/bin/ld : ne peut pas trouver /usr/local/lib/erlang/erts-13.2/../lib/erl_interface-5.3.1/include : file format not recognized
collect2: error: ld returned 1 exit status
make: *** [Makefile:56: priv/fasthtml_worker] Error 1
```
Though I have:
```
pleroma@Furuneo:/opt/pleroma$ ls /usr/local/lib/erlang/lib/erl_interface-5.3.1/lib/
libei.a libei_st.a
pleroma@Furuneo:/opt/pleroma$ ls /usr/local/lib/erlang/lib/erl_interface-5.3.1/include/
eicode.h ei_connect.h ei.h
```https://git.pleroma.social/pleroma/elixir-libraries/fast_html/-/issues/10Issue with erlang port closing when running a build in a container2023-07-16T19:20:01ZToddIssue with erlang port closing when running a build in a containerBuilding in an `elixir:1.10.1-alpine`container then running the app in an `alpine:3.11` container I am getting the followwing error when starting my app:
```
18:00:58.299 [error] Error during FastHtml.Pool.terminate_worker/3 callback:
*...Building in an `elixir:1.10.1-alpine`container then running the app in an `alpine:3.11` container I am getting the followwing error when starting my app:
```
18:00:58.299 [error] Error during FastHtml.Pool.terminate_worker/3 callback:
** (ArgumentError) argument error
:erlang.port_close(#Port<0.14>)
(fast_html 2.0.4) lib/fast_html/pool.ex:95: FastHtml.Pool.terminate_worker/3
(nimble_pool 0.1.0) lib/nimble_pool.ex:618: NimblePool.apply_worker_callback/3
(nimble_pool 0.1.0) lib/nimble_pool.ex:562: NimblePool.maybe_terminate_worker/3
(nimble_pool 0.1.0) lib/nimble_pool.ex:551: NimblePool.remove/3
(nimble_pool 0.1.0) lib/nimble_pool.ex:474: anonymous fn/4 in NimblePool.maybe_handl
e_info/2
(elixir 1.10.1) lib/enum.ex:2111: Enum."-reduce/3-lists^foldl/2-0-"/3
(nimble_pool 0.1.0) lib/nimble_pool.ex:467: NimblePool.maybe_handle_info/2
```
Has anyone seen this issue when running a release in a container?
Thanks!