Also as I suggested in one of my older emails it might be worth to ponder
the idea of changing the default from java-isolated to java-non-isolated as
the former one requires java.beans package which does not exist in compact
profiles. Also java-isolated jar will not work in Java 9 without making
some significant changes as some of the deprecated methods in LogManager
(that relied on java.beans) were simply removed. So if think that
java-isolated is really dead-end at some point unless there is appetite to
invest into making it work under Java 9 and < Java 9.

Now I am aware that https://github.com/mikelangelo-project/capstan and
https://github.com/emc-advanced-dev/unik projects rely on presence of
/usr/mgmt/javamains file that is only used by
io.osv.isolated.MultiJarLoader. One possibility would be to make
io/osv/nonisolated/RunNonIsolatedJvmApp somehow be able to handle this
file.

On Thu, Dec 22, 2016 at 7:26 AM, Waldek Kozaczuk <[email protected]>
wrote:

> Please see my answers below:
>
> On Thu, Dec 22, 2016 at 5:24 AM, Nadav Har'El <[email protected]> wrote:
>
>> Hi, I committed this patch, but I also have a question below:
>>
>>
>> --
>> Nadav Har'El
>> [email protected]
>>
>> On Thu, Dec 22, 2016 at 7:20 AM, Waldemar Kozaczuk <[email protected]>
>> wrote:
>>
>>> This patch addresses a build issue where this build command would fail
>>> due to both jdk 7 and 8 included:
>>> scripts/build -j4 image=java-tests,openjdk8-fedora && scripts/test.py
>>> --name java.*
>>>
>>> Following build commands should work now:
>>> scripts/build -j4 image=java-tests && scripts/test.py --name java.*
>>> scripts/build -j4 image=openjdk8-fedora,java-tests && scripts/test.py
>>> --name java.*
>>>
>>> Signed-off-by: Waldemar Kozaczuk <[email protected]>
>>>
>>> ---
>>>  modules/java-tests/Makefile     |  5 +----
>>>  modules/java-tests/module.py    | 17 ++---------------
>>>  modules/java-tests/usr.manifest |  2 --
>>>  3 files changed, 3 insertions(+), 21 deletions(-)
>>>
>>> diff --git a/modules/java-tests/Makefile b/modules/java-tests/Makefile
>>> index 7ec7028..55ca28d 100644
>>> --- a/modules/java-tests/Makefile
>>> +++ b/modules/java-tests/Makefile
>>> @@ -4,12 +4,9 @@ include $(SRC)/modules/java-base/common.gmk
>>>  ifeq ($(arch),aarch64)
>>>  java-targets :=
>>>  else
>>> -java-targets := obj/java.so obj/java_non_isolated.so
>>> +java-targets := obj/java_non_isolated.so
>>>  endif
>>>
>>> -obj/java.o: $(SRC)/modules/java-base/java.cc | init
>>> -       $(call quiet, $(CXX) $(CXXFLAGS) -o $@ -c
>>> $(SRC)/modules/java-base/java.cc -MMD, CXX $@)
>>> -
>>>  obj/java_non_isolated.o: $(SRC)/modules/java-base/java.cc | init
>>>         $(call quiet, $(CXX) $(CXXFLAGS) -DRUN_JAVA_NON_ISOLATED -o $@
>>> -c $(SRC)/modules/java-base/java.cc -MMD, CXX $@)
>>>
>>
>> I don't understand what this does, or what the change changes...
>> If I understand correctly, you want to have two versions of java.so:
>> "isolated" and "non-isolated", to test both?
>> So now you're assuming that by default, because you are requiring "java"
>> and that defaults to "isolated", you only need to build the non-isolated
>> version specially?
>>
> So I guess if someone now explicitly lists java-non-isolated on the build
>> line with java-tests, it will fail?
>> This is not a big loss (why would anybody want to do that in the first
>> place...) but I am just wondering if that is what you expect to happen.
>>
>
> WK: Yes I am making this assumption and in general I don not like to make
> assumptions and I wish I did not have to do it here.  Maybe there is a
> better way but things got complicated when I tried to satisfy three a
> little conflicting requirements - backwards-compatibility (require 'java'
> thing in apps), modularization and jave-tests which requires both isolated
> and non-isolated things in single image. So the whole thing is less than
> ideal.
>
>
>>
>> There's another thing I don't understand - is compiling
>> java_non_isolated.so enough to add a non-isolated Java? Don't you need to
>> also add another jar to the image?
>>
>
> Yes this like java-tests/usr.manifest does this:
> /java/runjava-non-isolated.jar: ${OSV_BASE}/modules/java-base/
> runjava-non-isolated/target/runjava-non-isolated.jar
>
>>
>>
>>>
>>> diff --git a/modules/java-tests/module.py b/modules/java-tests/module.py
>>> index 18d64ab..1e872f6 100644
>>> --- a/modules/java-tests/module.py
>>> +++ b/modules/java-tests/module.py
>>> @@ -1,25 +1,12 @@
>>>  from osv.modules import api
>>>  from osv.modules.filemap import FileMap
>>> -import os, os.path
>>>
>>> -api.require('java-base')
>>> -
>>> -usr_files = FileMap()
>>> -jdkdir = os.path.basename(os.path.expandvars('${jdkbase}'))
>>> -
>>> -usr_files.add('${jdkbase}').to('/usr/lib/jvm/java') \
>>> -    .include('lib/**') \
>>> -    .include('jre/**') \
>>> -    .exclude('jre/lib/security/cacerts') \
>>> -    .exclude('jre/lib/audio/**')
>>> -
>>> -usr_files.link('/usr/lib/jvm/' + jdkdir).to('java')
>>> -usr_files.link('/usr/lib/jvm/jre').to('java/jre')
>>> -usr_files.link('/usr/lib/jvm/java/jre/lib/security/cacerts'
>>> ).to('/etc/pki/java/cacerts')
>>> +api.require('java')
>>>
>>>  _jar = '/tests/java/tests.jar'
>>>  _isolates_jar = '/tests/java/isolates.jar'
>>>
>>> +usr_files = FileMap()
>>>  usr_files.add('${OSV_BASE}/modules/java-tests/tests/target/
>>> runjava-tests.jar').to(_jar)
>>>  usr_files.add('${OSV_BASE}/modules/java-tests/tests-isolate
>>> s/target/tests-isolates-jar-with-dependencies.jar').to(_isolates_jar)
>>>
>>> diff --git a/modules/java-tests/usr.manifest
>>> b/modules/java-tests/usr.manifest
>>> index 8145b19..52dd94d 100644
>>> --- a/modules/java-tests/usr.manifest
>>> +++ b/modules/java-tests/usr.manifest
>>> @@ -6,8 +6,6 @@
>>>  #
>>>
>>>  [manifest]
>>> -/java.so: ${OSV_BASE}/modules/java-tests/obj/java.so
>>> -/java/runjava-isolated.jar: ${OSV_BASE}/modules/java-base/
>>> runjava-isolated/target/runjava-isolated.jar
>>>  /java_non_isolated.so: ${OSV_BASE}/modules/java-tests
>>> /obj/java_non_isolated.so
>>>  /java/runjava-non-isolated.jar: ${OSV_BASE}/modules/java-base/
>>> runjava-non-isolated/target/runjava-non-isolated.jar
>>>  /.java.policy: ${OSV_BASE}/modules/java-tests/.java.policy
>>> --
>>> 2.7.4
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "OSv Development" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to