Re: RFR: 8268974: jpackage fails to handle --dest option containing "bin" folder [v2]

2021-06-21 Thread Alexey Semenyuk
> GetApplicationHomeFromDll() fails if the path to libjli.so contains "bin" 
> component (/tmp/bin/HelloWorld/lib/runtime/lib/libjli.so). TruncatePath() 
> looks for "/bin/" first in "/tmp/bin/HelloWorld/lib/runtime/lib/libjli.so" 
> string and then it looks for "/lib/". But this is wrong order as it should 
> look for "/lib/" first. I.e. TruncatePath() should look for "/bin/" and then 
> for "/lib/" if called from GetApplicationHome() and for "/lib/" first and 
> then for "/bin/" if called from GetApplicationHomeFromDll().

Alexey Semenyuk has updated the pull request incrementally with one additional 
commit since the last revision:

  - Comments updated.
  - pathisso -> pathisdll.

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/4534/files
  - new: https://git.openjdk.java.net/jdk/pull/4534/files/7028e74f..18aa7427

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=4534=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=4534=00-01

  Stats: 13 lines in 1 file changed: 8 ins; 1 del; 4 mod
  Patch: https://git.openjdk.java.net/jdk/pull/4534.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/4534/head:pull/4534

PR: https://git.openjdk.java.net/jdk/pull/4534


Re: RFR: 8268974: jpackage fails to handle --dest option containing "bin" folder

2021-06-21 Thread Alexey Semenyuk
On Fri, 18 Jun 2021 22:46:24 GMT, Alexey Semenyuk  wrote:

> GetApplicationHomeFromDll() fails if the path to libjli.so contains "bin" 
> component (/tmp/bin/HelloWorld/lib/runtime/lib/libjli.so). TruncatePath() 
> looks for "/bin/" first in "/tmp/bin/HelloWorld/lib/runtime/lib/libjli.so" 
> string and then it looks for "/lib/". But this is wrong order as it should 
> look for "/lib/" first. I.e. TruncatePath() should look for "/bin/" and then 
> for "/lib/" if called from GetApplicationHome() and for "/lib/" first and 
> then for "/bin/" if called from GetApplicationHomeFromDll().

The test should use java launcher dynamically linked to libjli.so. So the 
standard java launcher wouldn't work. I can provide C source code of a test 
java launcher dynamically linked to libjli.so though. The test will need to 
compile java launcher from the source code. This looks more sophisticated 
compared to providing another jpackage test for this use case.

-

PR: https://git.openjdk.java.net/jdk/pull/4534


Re: RFR: 8268974: jpackage fails to handle --dest option containing "bin" folder

2021-06-20 Thread Alan Bateman
On Fri, 18 Jun 2021 22:46:24 GMT, Alexey Semenyuk  wrote:

> GetApplicationHomeFromDll() fails if the path to libjli.so contains "bin" 
> component (/tmp/bin/HelloWorld/lib/runtime/lib/libjli.so). TruncatePath() 
> looks for "/bin/" first in "/tmp/bin/HelloWorld/lib/runtime/lib/libjli.so" 
> string and then it looks for "/lib/". But this is wrong order as it should 
> look for "/lib/" first. I.e. TruncatePath() should look for "/bin/" and then 
> for "/lib/" if called from GetApplicationHome() and for "/lib/" first and 
> then for "/bin/" if called from GetApplicationHomeFromDll().

Is it possible to add a test for this that is completely independent of 
jpackage? I think there are a few existing tests that copy the run-time image 
to a new location for testing purposes.

We may need to rename the JBS description to make it clearer what this issue is 
about.

A minor nit is that "pathisso" will be confusing to anyone looking at this 
code, maybe find a better name or put a comment in TruncatePath to explain it. 
I assume the comments at the findLastPathComponent use site will also need to 
be clarified.

-

PR: https://git.openjdk.java.net/jdk/pull/4534


Re: RFR: 8268974: jpackage fails to handle --dest option containing "bin" folder

2021-06-19 Thread Andy Herrick
On Fri, 18 Jun 2021 22:46:24 GMT, Alexey Semenyuk  wrote:

> GetApplicationHomeFromDll() fails if the path to libjli.so contains "bin" 
> component (/tmp/bin/HelloWorld/lib/runtime/lib/libjli.so). TruncatePath() 
> looks for "/bin/" first in "/tmp/bin/HelloWorld/lib/runtime/lib/libjli.so" 
> string and then it looks for "/lib/". But this is wrong order as it should 
> look for "/lib/" first. I.e. TruncatePath() should look for "/bin/" and then 
> for "/lib/" if called from GetApplicationHome() and for "/lib/" first and 
> then for "/bin/" if called from GetApplicationHomeFromDll().

Marked as reviewed by herrick (Reviewer).

-

PR: https://git.openjdk.java.net/jdk/pull/4534


Re: RFR: 8268974: jpackage fails to handle --dest option containing "bin" folder

2021-06-18 Thread Alexander Matveev
On Fri, 18 Jun 2021 22:46:24 GMT, Alexey Semenyuk  wrote:

> GetApplicationHomeFromDll() fails if the path to libjli.so contains "bin" 
> component (/tmp/bin/HelloWorld/lib/runtime/lib/libjli.so). TruncatePath() 
> looks for "/bin/" first in "/tmp/bin/HelloWorld/lib/runtime/lib/libjli.so" 
> string and then it looks for "/lib/". But this is wrong order as it should 
> look for "/lib/" first. I.e. TruncatePath() should look for "/bin/" and then 
> for "/lib/" if called from GetApplicationHome() and for "/lib/" first and 
> then for "/bin/" if called from GetApplicationHomeFromDll().

Marked as reviewed by almatvee (Reviewer).

-

PR: https://git.openjdk.java.net/jdk/pull/4534


RFR: 8268974: jpackage fails to handle --dest option containing "bin" folder

2021-06-18 Thread Alexey Semenyuk
GetApplicationHomeFromDll() fails if the path to libjli.so contains "bin" 
component (/tmp/bin/HelloWorld/lib/runtime/lib/libjli.so). TruncatePath() looks 
for "/bin/" first in "/tmp/bin/HelloWorld/lib/runtime/lib/libjli.so" string and 
then it looks for "/lib/". But this is wrong order as it should look for 
"/lib/" first. I.e. TruncatePath() should look for "/bin/" and then for "/lib/" 
if called from GetApplicationHome() and for "/lib/" first and then for "/bin/" 
if called from GetApplicationHomeFromDll().

-

Commit messages:
 - 8268974: jpackage fails to handle --dest option containing "bin" folder

Changes: https://git.openjdk.java.net/jdk/pull/4534/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk=4534=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8268974
  Stats: 5 lines in 1 file changed: 0 ins; 0 del; 5 mod
  Patch: https://git.openjdk.java.net/jdk/pull/4534.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/4534/head:pull/4534

PR: https://git.openjdk.java.net/jdk/pull/4534