[erlang-questions] compile time

Matwey V. Kornilov matwey.kornilov@REDACTED
Thu Nov 28 09:06:38 CET 2013


2013/11/28 Aggelos Giantsios <aggelgian@REDACTED>:
> Why is that a problem?
> If you use beam_lib:cmp/2 to compare the files that are otherwise the same,
> the result will be ok meaning that they are equal for Erlang.

The problem is that I am using cmp and getting something like the
following. It is from rpm build service, and this test must be common
for all binary files and it doesn't know what inside the beam. That is
the problem.

[   39s] /usr/lib/erlang/lib/meck-0.7.2/ebin/meck.beam differs (
Erlang BEAM file)
[   39s] --- /tmp/tmp.iR7IQpEoPU 2013-10-01 16:12:09.590793188 +0000
[   39s] +++ /tmp/tmp.0U2oEYv9tS 2013-10-01 16:12:09.606793188 +0000
[   39s] @@ -916,8 +916,8 @@
[   39s]  00003930  69 6e 66 6f 68 02 64 00  01 69 6b 00 07 69 6e 63
|infoh.d..ik..inc|
[   39s]  00003940  6c 75 64 65 6a 68 02 64  00 07 76 65 72 73 69 6f
|ludejh.d..versio|
[   39s]  00003950  6e 6b 00 05 34 2e 39 2e  33 68 02 64 00 04 74 69
|nk..4.9.3h.d..ti|
[   39s] -00003960  6d 65 68 06 62 00 00 07  dd 61 09 61 19 61 11 61
|meh.b....a.a.a.a|
[   39s] -00003970  32 61 32 68 02 64 00 06  73 6f 75 72 63 65 6b 00
|2a2h.d..sourcek.|
[   39s] +00003960  6d 65 68 06 62 00 00 07  dd 61 0a 61 01 61 10 61
|meh.b....a.a.a.a|
[   39s] +00003970  0c 61 04 68 02 64 00 06  73 6f 75 72 63 65 6b 00
|.a.h.d..sourcek.|
[   39s]  00003980  4a 2f 68 6f 6d 65 2f 61  62 75 69 6c 64 2f 72 70
|J/home/abuild/rp|
[   39s]  00003990  6d 62 75 69 6c 64 2f 42  55 49 4c 44 2f 6d 65 63
|mbuild/BUILD/mec|
[   39s]  000039a0  6b 2d 30 2e 37 2e 32 2b  67 69 74 2e 31 33 36 35
|k-0.7.2+git.1365|

> Anyhow, you can also use beam_lib:strip/1 on an existing beam file to remove
> the compile info chunk.

Yes, this may be a solution.

-- 
With best regards,
Matwey V. Kornilov
http://0x2207.blogspot.com
xmpp:0x2207@REDACTED



More information about the erlang-questions mailing list