RFR: JDK-8264403: [macos]: App names containing '.' characters results in an error message when launching

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

RFR: JDK-8264403: [macos]: App names containing '.' characters results in an error message when launching

Andy Herrick-2
Deriving the cfg file name is broken on mac and linux when the application name has a "." in it.

-------------

Commit messages:
 - Merge branch 'master' into JDK-8264403
 - JDK-8264403: [macos]: App names containing '.' characters results in an error message when launching
 - 8264466: Cut-paste error in InterfaceCalls JMH
 - 8264149: BreakpointInfo::set allocates metaspace object in VM thread
 - 8264417: ParallelCompactData::region_offset should not accept pointers outside the current region
 - 8264112: (fs) Reorder methods/constructor/fields in UnixUserDefinedFileAttributeView.java
 - 8261957: [PPC64] Support for Concurrent Thread-Stack Processing
 - 8262894: [macos_aarch64] SIGBUS in Assembler::ld_st2
 - 8263582: WB_IsMethodCompilable ignores compiler directives
 - 8244540: Print more information with -XX:+PrintSharedArchiveAndExit
 - ... and 65 more: https://git.openjdk.java.net/jdk/compare/6225ae63...1fe2699e

Changes: https://git.openjdk.java.net/jdk/pull/3288/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3288&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8264403
  Stats: 82 lines in 5 files changed: 80 ins; 1 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/3288.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/3288/head:pull/3288

PR: https://git.openjdk.java.net/jdk/pull/3288
Reply | Threaded
Open this post in threaded view
|

Re: RFR: JDK-8264403: [macos]: App names containing '.' characters results in an error message when launching

Alexey Semenyuk-2
On Wed, 31 Mar 2021 19:30:10 GMT, Andy Herrick <[hidden email]> wrote:

> Deriving the cfg file name is broken on mac and linux when the application name has a "." in it.

Changes requested by asemenyuk (Reviewer).

src/jdk.jpackage/share/native/common/FileUtils.h line 76:

> 74:
> 75:     // extract the name from the launcher path
> 76:     tstring extractName(const tstring& path);

Function name seems to be misleading.
If it specifically designed to be applied to executables, I'd name it `stripExecutableSuffix()`. On Unix implementation would return passed in string as is without calling `basename()` and on Windows would just strip ".exe" suffix not calling `basename()` either.
The use would be: `FileUtils::mkpath() << appDirPath << (FileUtils::stripExecutableSuffix(FileUtils::basename(launcherPath)) + _T(".cfg"));`

-------------

PR: https://git.openjdk.java.net/jdk/pull/3288
Reply | Threaded
Open this post in threaded view
|

Re: RFR: JDK-8264403: [macos]: App names containing '.' characters results in an error message when launching [v2]

Andy Herrick-2
In reply to this post by Andy Herrick-2
> Deriving the cfg file name is broken on mac and linux when the application name has a "." in it.

Andy Herrick has updated the pull request incrementally with one additional commit since the last revision:

  JDK-8264403: [macos]: App names containing '.' characters results in an error message when launching

-------------

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/3288/files
  - new: https://git.openjdk.java.net/jdk/pull/3288/files/1fe2699e..25102702

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=3288&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=3288&range=00-01

  Stats: 12 lines in 4 files changed: 0 ins; 2 del; 10 mod
  Patch: https://git.openjdk.java.net/jdk/pull/3288.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/3288/head:pull/3288

PR: https://git.openjdk.java.net/jdk/pull/3288
Reply | Threaded
Open this post in threaded view
|

Re: RFR: JDK-8264403: [macos]: App names containing '.' characters results in an error message when launching [v2]

Andy Herrick-2
In reply to this post by Alexey Semenyuk-2
On Wed, 31 Mar 2021 21:59:55 GMT, Alexey Semenyuk <[hidden email]> wrote:

>> Andy Herrick has updated the pull request incrementally with one additional commit since the last revision:
>>
>>   JDK-8264403: [macos]: App names containing '.' characters results in an error message when launching
>
> src/jdk.jpackage/share/native/common/FileUtils.h line 76:
>
>> 74:
>> 75:     // extract the name from the launcher path
>> 76:     tstring extractName(const tstring& path);
>
> Function name seems to be misleading.
> If it specifically designed to be applied to executables, I'd name it `stripExecutableSuffix()`. On Unix implementation would return passed in string as is without calling `basename()` and on Windows would just strip ".exe" suffix not calling `basename()` either.
> The use would be: `FileUtils::mkpath() << appDirPath << (FileUtils::stripExecutableSuffix(FileUtils::basename(launcherPath)) + _T(".cfg"));`

makes sense - updated as requested

-------------

PR: https://git.openjdk.java.net/jdk/pull/3288
Reply | Threaded
Open this post in threaded view
|

Re: RFR: JDK-8264403: [macos]: App names containing '.' characters results in an error message when launching [v3]

Andy Herrick-2
In reply to this post by Andy Herrick-2
> Deriving the cfg file name is broken on mac and linux when the application name has a "." in it.

Andy Herrick has updated the pull request incrementally with one additional commit since the last revision:

  Fix trailing whitespace

-------------

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/3288/files
  - new: https://git.openjdk.java.net/jdk/pull/3288/files/25102702..b83578c2

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=3288&range=02
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=3288&range=01-02

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/3288.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/3288/head:pull/3288

PR: https://git.openjdk.java.net/jdk/pull/3288
Reply | Threaded
Open this post in threaded view
|

Re: RFR: JDK-8264403: [macos]: App names containing '.' characters results in an error message when launching [v3]

Alexey Semenyuk-2
On Thu, 1 Apr 2021 12:19:21 GMT, Andy Herrick <[hidden email]> wrote:

>> Deriving the cfg file name is broken on mac and linux when the application name has a "." in it.
>
> Andy Herrick has updated the pull request incrementally with one additional commit since the last revision:
>
>   Fix trailing whitespace

Marked as reviewed by asemenyuk (Reviewer).

-------------

PR: https://git.openjdk.java.net/jdk/pull/3288
Reply | Threaded
Open this post in threaded view
|

Integrated: JDK-8264403: [macos]: App names containing '.' characters results in an error message when launching

Andy Herrick-2
In reply to this post by Andy Herrick-2
On Wed, 31 Mar 2021 19:30:10 GMT, Andy Herrick <[hidden email]> wrote:

> Deriving the cfg file name is broken on mac and linux when the application name has a "." in it.

This pull request has now been integrated.

Changeset: 04f24fe9
Author:    Andy Herrick <[hidden email]>
URL:       https://git.openjdk.java.net/jdk/commit/04f24fe9
Stats:     81 lines in 5 files changed: 78 ins; 1 del; 2 mod

8264403: [macos]: App names containing '.' characters results in an error message when launching

Reviewed-by: asemenyuk

-------------

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