Making changes to the erlang libs

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Making changes to the erlang libs

Frans Schneider-2
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
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Making changes to the erlang libs

Wes James
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 <[hidden email]> 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
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Making changes to the erlang libs

Guilherme Andrade
In reply to this post by Frans Schneider-2


On 24 January 2018 at 15:14, Frans Schneider <[hidden email]> wrote:
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?

You can avoid marking the directories containing key runtime modules as 'sticky'[1]. Would this allow you to load your modified copies of the modules, residing in your own application? I never tried it, so I'm not sure, but it seems worth a shot.

[1]: http://erlang.org/doc/man/code.html

--
Guilherme

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Making changes to the erlang libs

Guilherme Andrade
Unless your intention is to simply iterate over the development of this potential fix you mentioned, of course.

In that case it's probably easier to simply git clone the OTP repo, pick the appropriate branch or tag, and begin the usual 'change code -> 'recompile -> 'launch erlang or tests' cycle. This won't require you to install OTP system-wide or anything.


--
Guilherme

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Making changes to the erlang libs

Frans Schneider-2
In reply to this post by Wes James
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 <[hidden email]
> <mailto:[hidden email]>> 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
>     [hidden email] <mailto:[hidden email]>
>     http://erlang.org/mailman/listinfo/erlang-questions
>     <http://erlang.org/mailman/listinfo/erlang-questions>
>
>
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions