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

Error loading module enotify #24

Closed
brigadier opened this issue Nov 15, 2023 · 4 comments
Closed

Error loading module enotify #24

brigadier opened this issue Nov 15, 2023 · 4 comments

Comments

@brigadier
Copy link

erlang/rebar3#2845

rebar3 auto crashes on second change with

beam/beam_load.c(148): Error loading module enotify:
  please re-compile this module with an Erlang/OTP 26 compiler or update your Erlang/OTP version

Steps to reproduce:

rebar3 auto --config=/path/to/config.file
call a function from shell - success
change something, call the function again - success
change something again - crash

3> palette_pg_worker:conn().

DEBUG: palette_pg_worker:25
"2"
  2

{ok,<0.412.0>}
4> palette_pg_worker:conn().
{ok,<0.406.0>}
5> =ERROR REPORT==== 14-Nov-2023::19:23:25.870893 ===
beam/beam_load.c(148): Error loading module enotify:
  please re-compile this module with an Erlang/OTP 26 compiler or update your Erlang/OTP version


=WARNING REPORT==== 14-Nov-2023::19:23:25.871055 ===
** Undefined handle_info in enotify
** Unhandled message: {#Port<0.4>,
                       {data,{eol,"/home/evgeny/projects/palette/palette/apps/palette/src/ CREATE palette_pg_worker.erl~"}}}

=WARNING REPORT==== 14-Nov-2023::19:23:25.872147 ===
** Undefined handle_info in enotify
5> palette_pg_worker:conn().
{ok,<0.411.0>}

rebar3 report auto

Rebar3 report
 version 3.22.0+build.5284.refc46bec6a
 generated at 2023-11-14T16:27:16+00:00
=================
Please submit this along with your issue at https://github.com/erlang/rebar3/issues (and feel free to edit out private information, if any)
-----------------
Task: auto
Entered as:
  auto
-----------------
Operating System: x86_64-pc-linux-gnu
ERTS: Erlang/OTP 26 [erts-14.0] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]
Root Directory: /home/evgeny/erlang/26.0
Library directory: /home/evgeny/erlang/26.0/lib
-----------------
Loaded Applications:
bbmustache: 1.12.2
certifi: 2.11.0
cf: 0.3.1
common_test: 1.25
compiler: 8.3
crypto: 5.2
cth_readable: 1.5.1
dialyzer: 5.1
edoc: 1.2
erlware_commons: 1.6.0
eunit: 2.8.2
eunit_formatters: 0.5.0
getopt: 1.0.2
inets: 9.0
kernel: 9.0
providers: 1.9.0
public_key: 1.14
relx: 4.8.0
sasl: 4.2.1
snmp: 5.14
ssl_verify_fun: 1.1.6
stdlib: 5.0
syntax_tools: 3.1
tools: 3.6

-----------------
Escript path: /home/evgeny/.cache/rebar3/bin/rebar3
Providers:
  app_discovery as auto build clean compile compile compile cover ct cut deps dialyzer do edoc escriptize eunit get-deps help install install_deps list lock new organization owner path pkgs publish release relup report repos retire search shell state tar tree unlock update upgrade upgrade upgrade user vendor version xref 

I have multiple version of erlang managed by kerl

@vans163
Copy link
Owner

vans163 commented Nov 20, 2023

Thanks I think we willl need to switch over to https://github.com/5HT/fs as enotify is not maintained.

@vans163
Copy link
Owner

vans163 commented Jan 6, 2024

It seems this is a different issue. Is it possible when you compiled rebar3_auto you used version of OTP lower than 26?

Then you used kerl to switch to OTP26, but the local cached version of rebar3_auto was not recompiled?

Local cached version by default usually goes to

~/.cache/rebar3/plugins/rebar3_auto

so rm -rf it and do rebar3 update rebar3_auto

Give this a new try please. I have published v0.5.1 using fs module.

@brigadier
Copy link
Author

brigadier commented Jan 7, 2024

Yes, it works now fine after rm -rf ~/.cache/rebar3/plugins/rebar3_auto and heving deps in my app updaated to the new version of rebar3_auto.
I had tried 0.5.1 before removing the directory and it didn't crash on the second code change but nor it recompiled the sources. I think this ticket can be closed now but it would be nice to have some warning about that possible issue in the readme or whatnot because it is counterintuitive that the first time plugin code is executed from the app directory and the second time from the rebar cache.

Also a question: what would you suggest for the case when someone needs to work with different versions of OTP? Can something be done to remove dependency on the cached version altogether?

@vans163
Copy link
Owner

vans163 commented Jan 18, 2024

Also a question: what would you suggest for the case when someone needs to work with different versions of OTP? Can something be done to remove dependency on the cached version altogether?

https://rebar3.org/docs/configuration/configuration/#environment-configuration

Perhaps settings BASE dir or CACHE dir per version of OTP.

REBAR_CACHE_DIR              # override where Rebar3 stores cache data
REBAR_BASE_DIR               # override where Rebar3 stores build output

Rebar3 issue tracker might have suggestions for the recommended way to do this.

@vans163 vans163 closed this as completed Jan 18, 2024
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

No branches or pull requests

2 participants