Erjang and R14B

32 views
Skip to first unread message

rvirding

unread,
Jun 20, 2011, 11:57:18 AM6/20/11
to Erjang
Any idea when we will be able to run erjang on R14B? All I can do is
confirm that it doesn't work, it can't get the bootfile.

Robert

Kresten Krab Thorup

unread,
Jun 20, 2011, 2:40:57 PM6/20/11
to erj...@googlegroups.com
Hi Robert,

I won't have time to work on it soon, but perhaps you can try to run R14 with an R13 copy of prim_file and see how for you get. Problem is that the interface to the efile driver changed AFAIK.

It may not be so difficult to do ... Anyone want to take a grab at it feel free; you should start by looking at a diff of prim_file from R13 to R14.

Kresten

Jetztgradnet

unread,
Jun 21, 2011, 7:53:30 AM6/21/11
to Erjang
The reason might be the addition of file:advise/4 and file:datasync/1,
which require changes in the file driver:
in Erlang: erts/emulator/drivers/common/efile_drv.c,
in Erjang: src/main/java/erjang/driver/efile/EFile.java (class
erjang.driver.efile.EFile)

The correpsonding commits in Erlang/OTP probably are the following:

https://github.com/erlang/otp/commit/3f53a96a8bd0cd4a18f819b6857e6a764706ede5#erts/emulator/drivers/common/efile_drv.c
https://github.com/erlang/otp/commit/21a67b797e40df930b83bd407ffc165b3f4b91b2#erts/emulator/drivers/common/efile_drv.c

The commits show changes to the C driver implementation as well as to
modules pri_file and file. Others like ram file have been modified as
well.

Regards,

Wolfgang

Robert Virding

unread,
Jun 21, 2011, 9:54:59 AM6/21/11
to erj...@googlegroups.com
It also needs a corresponding function to the one in
erts/emulator/drivers/unix/unix_efile.c. The code in the BEAM files is
almost exactly same as for the fsync() call, FILE_FSYNC, so depending
on how this is done Java the changes which need to be made may be very
small.

Robert

Jetztgradnet

unread,
Jun 21, 2011, 10:01:19 AM6/21/11
to Erjang


On Jun 21, 1:53 pm, Jetztgradnet <jetztgrad...@googlemail.com> wrote:
> The reason might be the addition of file:advise/4 and file:datasync/1,
> which require changes in the file driver:

fdatasync() is the same as fsync, when not supported by the runtime
platform (e.g. under Windows), so it might suffice to implement the
command FILE_FDATASYNC similar to FILE_FSYNC.

fadvice() seems to be optional, in that it is ignored, when not
supported by the runtime platform (e.g. under Windows), so it might
suffice to implement the command FILE_FADVISE (and RAM_FILE_ADVISE in
src/main/java/erjang/driver/ram_file/RamFile.java) to simply return
error code 0.

Regards,

Wolfgang

Kresten Krab Thorup

unread,
Jun 22, 2011, 5:40:04 PM6/22/11
to erj...@googlegroups.com
The issue described here is also related to the R14 problem

https://github.com/trifork/erjang/issues/45

Especially notice @eriksoe's last comment.

<https://github.com/trifork/erjang/issues/45>Kresten

Robert Virding

unread,
Jun 22, 2011, 6:13:41 PM6/22/11
to erj...@googlegroups.com

I tried some initial tests along these lines without luck so far using R14B03:

- Copied over the preloaded .beam and .erl files from R14B03 to
src/main/erl/preloaded/{ebin,src}. My hope being that using the new
preloaded files would help work out what is needed to be added to the
java files. There was no extra information which surprised me as there
is code Efile.java calling log.warning if no option matched. How do
you see the warnings?

- I tried adding code for FILE_DATASYNC in the same way and place as
for FILE_FSYNC, which is how the BEAM code does, but to no avail. I
still get the same error message from Erlang and nothing from erjang:

{"init terminating in do_boot",{'cannot get
bootfile','/usr/local/lib/erlang/bin/start.boot'}}
Jun 23, 2011 12:10:22 AM erjang.m.erlang.ErlProc halt
SEVERE: halting system: init terminating in do_boot ()

Now someone who knows what they are doing will have to take over, or
at least advise me.

Robert

Kresten Krab Thorup

unread,
Jun 22, 2011, 7:08:44 PM6/22/11
to erj...@googlegroups.com

On Jun 23, 2011, at 12:13 AM, Robert Virding wrote:

> - Copied over the preloaded .beam and .erl files from R14B03 to
> src/main/erl/preloaded/{ebin,src}. My hope being that using the new
> preloaded files would help work out what is needed to be added to the
> java files.

I would try the other way around: copy R13 prim_efile to your R14 release, because that is what defines the API to the driver.

Kresten


Robert Virding

unread,
Jun 23, 2011, 5:48:51 AM6/23/11
to erj...@googlegroups.com
That seems so negative. :-) Also you might run into problems as the
old preloaded files might not contain functions which the newer
libraries expect.

Re issue #45, I might have been attacking the wrong functions in
trying to datasync to work, I will have a go later. I would still like
to get more info from java if there are things missing.

Robert

Wolfgang Schell

unread,
Jul 10, 2011, 7:40:24 PM7/10/11
to erj...@googlegroups.com
Hi all,

I got Erjang to work with R14B01. See pull request 56
(https://github.com/trifork/erjang/pull/56).

Regards,

Wolfgang

Am 23.06.11 11:48, schrieb Robert Virding:

Reply all
Reply to author
Forward
0 new messages