[erlang-questions] Making changes to the erlang libs

Frans Schneider fchschneider@REDACTED
Wed Jan 24 19:21:21 CET 2018


The Debian box I am using has Erlang installed from Erlang Solutions. 
For personal use, I use kerl to install a version within my home 
directory and switch to it using the kerl activate command. The global 
version is 20.1 and the my own version is 20.2 as verified by running 
erl before and after activating.

What I do for installing and activating the local erlang install:

$ kerl build 20.2 20.2
...
Erlang/OTP 20.2 (20.2) has been successfully built

$ kerl install 20.2 ~/otp/20.2
Installing Erlang/OTP 20.2 (20.2) in /home/frans/otp/20.2...

$ . /home/frans/otp/20.2/activate

This changes $PATH and adds some _KERL* variables to the env.

In erl, I check where xmer_xsd resides:

2> code:which(xmerl_xsd).
"/home/frans/otp/20.2/lib/xmerl-1.3.16/ebin/xmerl_xsd.beam"

I edit file "/home/frans/otp/20.2/lib/xmerl-1.3.16/src/xmerl_xsd_erl" 
and compile using c(xmerl_xsd) and now I see why all this goes wrong. It 
recompiles 
"/home/frans/.kerl/builds/20.2/otp_src_20.2/lib/xmerl/src/xmerl_xsd.erl" 
and not the file I was editing.

Could somebody explain why it is using the sources from the .kerl 
directory and not the otp directory?

Now I can run some tests with little effort before even thinking about a 
bug report.

Thanks,

Frans


On 01/24/2018 05:14 PM, Wes James wrote:
> How is your initial erlang installed.  One way is to git clone the 
> source, git checkout the version you want to install, make your changes 
> to the file and then make, then rename /usr/local/lib/erlang to 
> something else, then sudo make install and the change should take 
> effect.  killall epmd or any other erlang apps that might be running, 
> then start your app.
> 
> On Wed, Jan 24, 2018 at 8:14 AM, Frans Schneider <fchschneider@REDACTED 
> <mailto:fchschneider@REDACTED>> wrote:
> 
>     Hi list,
> 
>     I want to make some changes to xmerl_xsd because I think there is a
>     bug in there. I use kerl and made an installation with the latest
>     20.2 release. So, I thought I would just edit the source of
>     xmerl_xsd where kerl installed the sources and use c(xmerl_xsd) to
>     compile the thing, however nothing happens. I see the beam file
>     getting a new time stamp after compiling but its size remains the
>     same, so I assume it compiles using some other source file than the
>     one I am editing.
> 
>     So, what is it I am doing wrong and what is the easiest way to make
>     changes to library modules and do some experiments?
> 
>     Thanks,
> 
>     Frans
>     _______________________________________________
>     erlang-questions mailing list
>     erlang-questions@REDACTED <mailto:erlang-questions@REDACTED>
>     http://erlang.org/mailman/listinfo/erlang-questions
>     <http://erlang.org/mailman/listinfo/erlang-questions>
> 
> 



More information about the erlang-questions mailing list