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

Start errors #40

Closed
dgud opened this issue Jan 11, 2013 · 6 comments
Closed

Start errors #40

dgud opened this issue Jan 11, 2013 · 6 comments

Comments

@dgud
Copy link
Contributor

dgud commented Jan 11, 2013

I had to patch edts with the following to get it up and running,
i.e. I had old beam files lying around in my ERL_LIBS path.
/Dan

diff --git a/lib/edts/src/edts_code.erl b/lib/edts/src/edts_code.erl
index 9809ad4..0c6d016 100644
--- a/lib/edts/src/edts_code.erl
+++ b/lib/edts/src/edts_code.erl
@@ -378,12 +378,22 @@ ensure_loaded(File) ->
M = list_to_atom(filename:basename(LoadFileName)),
Loaded =
case code:is_loaded(M) of

  •  {file, File} -> false;
    
  •  {file, _}    -> code:purge(M),
    
  •                  {module, M} = code:load_abs(LoadFileName),
    
  •                  true;
    
  •  false        -> {module, M} = code:load_abs(LoadFileName),
    
  •                  true
    
  •  {file, File}  -> false;
    
  •  {file, Orig} ->
    
  •   code:purge(M),
    
  •   case code:load_abs(LoadFileName) of
    
  •     {module, M} -> true;
    
  •     {error, Error} ->
    
  •       io:format("Loading Error: ~p ~s => ~s~n", [Error, Orig, File]),
    
  •       false
    
  •   end;
    
  •  false ->
    
  •   case code:load_abs(LoadFileName) of
    
  •     {module, M} -> true;
    
  •     {error, Reason} ->
    
  •       io:format("Loading Error: ~p ~s~n", [Reason, File]),
    
  •       false
    
  •   end
    
    end,
    {Loaded, M}.
@tjarvstrand
Copy link
Collaborator

Hi,

Thanks for the report. Have you tried the latest master? I posted a fix for this function yesterday evening and I think it should solve your problem.

@dgud
Copy link
Contributor Author

dgud commented Jan 11, 2013

Oh no, updated a day or so ago, didn't have time to debug until today.

Will try next week at work. :-D
Thanks
Den 11 jan 2013 17:14 skrev "Thomas Järvstrand" notifications@github.com:

Hi,

Thanks for the report. Have you tried the latest master? I posted a fix
for this function yesterday evening and I think it should solve your
problem.


Reply to this email directly or view it on GitHubhttps://github.com//issues/40#issuecomment-12150992.

@dgud
Copy link
Contributor Author

dgud commented Jan 14, 2013

I have viewed your commit, and removed my problematic files.
While this commit fixes the sticky file problem, I still believe you should add some error handling here,
so that the user can see what files caused the problem (and ignore them).
For instance I also had a "nif" file which tried to load a 32b so-file on my 64b system in path.

I want to be able to start my emacs mode even if have problems in my libpath.

@tjarvstrand
Copy link
Collaborator

Good point. I'll have a look at it as soon as I get a chance :)

@tjarvstrand
Copy link
Collaborator

Added some error handling...

@dgud
Copy link
Contributor Author

dgud commented Jan 15, 2013

Thanks

@dgud dgud closed this as completed Jan 15, 2013
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