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.
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:
> 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
> On Jun 20, 2011, at 5:57 PM, rvirding wrote:
> > 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.
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
On 21 June 2011 13:53, 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: > 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:
> 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
> On Jun 20, 8:40 pm, Kresten Krab Thorup <k...@trifork.com> wrote: >> 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
>> On Jun 20, 2011, at 5:57 PM, rvirding wrote:
>> > 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.
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.
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.
On 21 June 2011 16:01, Jetztgradnet <jetztgrad...@googlemail.com> wrote:
> 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.
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.
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.
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
On 23 June 2011 01:08, Kresten Krab Thorup <k...@trifork.com> wrote:
> 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.
> 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
> On 23 June 2011 01:08, Kresten Krab Thorup<k...@trifork.com> wrote:
>> 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.