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 otp_spec_fix.erl from escript #74

Closed
gomoripeti opened this issue Nov 5, 2018 · 4 comments
Closed

Error loading otp_spec_fix.erl from escript #74

gomoripeti opened this issue Nov 5, 2018 · 4 comments
Labels

Comments

@gomoripeti
Copy link
Collaborator

When gradualizer is run as an escript (as on travis) it crashes with the below error:

{"init terminating in do_boot",{{badmatch,{error,enotdir}},
[{gradualizer_db,import_erl_files,2,[{file,"/home/travis/build/josefs/Gradualizer/_build/default/lib/gradualizer/src/gradualizer_db.erl"},{line,333}]},
 {gradualizer_db,init,1,[{file,"/home/travis/build/josefs/Gradualizer/_build/default/lib/gradualizer/src/gradualizer_db.erl"},{line,151}]}...

This can probably have something to do with code:priv_dir(gradualizer) => "/home/travis/build/josefs/Gradualizer/gradualizer/gradualizer/priv" because it is running from an escript archive.

(https://travis-ci.com/josefs/Gradualizer/jobs/156473749)

@gomoripeti gomoripeti added the bug label Nov 5, 2018
@zuiderkwast
Copy link
Collaborator

Oops!

@zuiderkwast
Copy link
Collaborator

I checked what the escript zip container (using unzip -l gradualizer) and it contains no priv dir.

I've tried adding it using escript_incl_extra in the rebar conf as mentioned here http://erlang.2086793.n4.nabble.com/priv-dir-in-escript-td4724193.html but without luck so far.

@Zalastax
Copy link
Collaborator

Zalastax commented Nov 9, 2018

It's being looked into! erlang/rebar3#1936

zuiderkwast added a commit to zuiderkwast/Gradualizer that referenced this issue Nov 11, 2018
This fixes josefs#74, the problem of packaging the priv dir into an
escript archive.
zuiderkwast added a commit to zuiderkwast/Gradualizer that referenced this issue Nov 11, 2018
This fixes josefs#74, the problem of packaging the priv dir into an
escript archive.
@zuiderkwast zuiderkwast modified the milestone: Beta release Nov 11, 2018
@zuiderkwast
Copy link
Collaborator

Sorry, reopening. I wanted to close the other PR..

@zuiderkwast zuiderkwast reopened this Nov 15, 2018
berbiche pushed a commit to berbiche/Gradualizer that referenced this issue Feb 9, 2021
Use erl_prim_loader to get our prelude file using the same mechanism as
the code server.

An exception is when the file cover compiled. Then we load it from the
source code, assuming it is in the same directory as the source of the
current module. Thus, cover compiled prelude when running as an escript
archive doesn't work but we can live with that.

Fixes josefs#74.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants