Re: RFR: 8286122: [macos]: App bundle cannot upload to Mac App Store due to info.plist embedded in java exe [v2]

2022-05-17 Thread Kevin Rushforth
On Thu, 12 May 2022 04:15:50 GMT, Alexander Matveev  
wrote:

>> - It is not possible to support native JDK commands such as "java" inside 
>> Mac App Store bundles due to embedded info.plist. Workarounds suggested in 
>> JDK-8286122 does not seems to be visible.
>>  - With proposed fix we will enforce "--strip-native-commands" option for 
>> jlink, so native JDK commands are not included when generating Mac App Store 
>> bundles.
>>  - Custom runtime provided via --runtime-image should not contain native 
>> commands as well, otherwise jpackage will throw error.
>>  - Added two tests to validate fix.
>
> Alexander Matveev has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   8286122: [macos]: App bundle cannot upload to Mac App Store due to 
> info.plist embedded in java exe [v2]

I'm just catching up with this thread. Based on the analysis, it's pretty clear 
that any solution that actually allows bundling native launchers is going to 
take more research, and is out of scope for this bug. Some combination of 
[JDK-8286850](https://bugs.openjdk.java.net/browse/JDK-8286850) and/or 
providing Java launchers that don't have an `Info.plist` is likely needed to 
provide a complete solution.

Given that, I think that this PR seems a reasonable fix to avoid creating an 
app bundle that can't be uploaded to the app store.

-

Marked as reviewed by kcr (Author).

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


Re: RFR: 8286122: [macos]: App bundle cannot upload to Mac App Store due to info.plist embedded in java exe [v2]

2022-05-12 Thread Michael Hall



> On May 12, 2022, at 3:13 PM, Magnus Ihse Bursie  wrote:
> 
> On Thu, 12 May 2022 04:15:50 GMT, Alexander Matveev  
> wrote:
> 
>>> - It is not possible to support native JDK commands such as "java" inside 
>>> Mac App Store bundles due to embedded info.plist. Workarounds suggested in 
>>> JDK-8286122 does not seems to be visible.
>>> - With proposed fix we will enforce "--strip-native-commands" option for 
>>> jlink, so native JDK commands are not included when generating Mac App 
>>> Store bundles.
>>> - Custom runtime provided via --runtime-image should not contain native 
>>> commands as well, otherwise jpackage will throw error.
>>> - Added two tests to validate fix.
>> 
>> Alexander Matveev has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>  8286122: [macos]: App bundle cannot upload to Mac App Store due to 
>> info.plist embedded in java exe [v2]
> 
> We have the `NSMicrophoneUsageDescription` permission on the `java` launcher 
> in the JDK, since otherwise no Java program can access the mike, even though 
> most won't care. I agree that the situation is different for a jpackaged app, 
> where the developer knows if that permission is needed or not.

I’d have to agree with Apple DTS that this is an interesting exception. 

> 
> Yes, plistbuddy is an official Apple program.
> 
> My understanding of the PR was that native commands are removed by jlink if 
> the user is packaging on a mac for the App Store. I thought this was a 
> workaround that solved the immediate problem of not being able to submit the 
> app to App Store. (However, I don't know how the app is supposed to be 
> started without a launcher…)
> 

I thought that if the app was indicated as intended for the App Store and 
native commands were also indicated an error would be thrown and the app not 
built. It doesn’t allow apps that will fail to attempt the App Store but does 
nothing for getting them there. Switching from an error to a warning and 
forcing the native commands to be stripped would allow the app into the app 
store but with unknown functionality probably not working. My understanding. 



Re: RFR: 8286122: [macos]: App bundle cannot upload to Mac App Store due to info.plist embedded in java exe [v2]

2022-05-12 Thread Magnus Ihse Bursie
On Thu, 12 May 2022 04:15:50 GMT, Alexander Matveev  
wrote:

>> - It is not possible to support native JDK commands such as "java" inside 
>> Mac App Store bundles due to embedded info.plist. Workarounds suggested in 
>> JDK-8286122 does not seems to be visible.
>>  - With proposed fix we will enforce "--strip-native-commands" option for 
>> jlink, so native JDK commands are not included when generating Mac App Store 
>> bundles.
>>  - Custom runtime provided via --runtime-image should not contain native 
>> commands as well, otherwise jpackage will throw error.
>>  - Added two tests to validate fix.
>
> Alexander Matveev has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   8286122: [macos]: App bundle cannot upload to Mac App Store due to 
> info.plist embedded in java exe [v2]

We have the `NSMicrophoneUsageDescription` permission on the `java` launcher in 
the JDK, since otherwise no Java program can access the mike, even though most 
won't care. I agree that the situation is different for a jpackaged app, where 
the developer knows if that permission is needed or not.

Yes, plistbuddy is an official Apple program.

My understanding of the PR was that native commands are removed by jlink if the 
user is packaging on a mac for the App Store. I thought this was a workaround 
that solved the immediate problem of not being able to submit the app to App 
Store. (However, I don't know how the app is supposed to be started without a 
launcher...)

-

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


Re: RFR: 8286122: [macos]: App bundle cannot upload to Mac App Store due to info.plist embedded in java exe [v2]

2022-05-12 Thread Alexey Semenyuk
On Thu, 12 May 2022 04:15:50 GMT, Alexander Matveev  
wrote:

>> - It is not possible to support native JDK commands such as "java" inside 
>> Mac App Store bundles due to embedded info.plist. Workarounds suggested in 
>> JDK-8286122 does not seems to be visible.
>>  - With proposed fix we will enforce "--strip-native-commands" option for 
>> jlink, so native JDK commands are not included when generating Mac App Store 
>> bundles.
>>  - Custom runtime provided via --runtime-image should not contain native 
>> commands as well, otherwise jpackage will throw error.
>>  - Added two tests to validate fix.
>
> Alexander Matveev has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   8286122: [macos]: App bundle cannot upload to Mac App Store due to 
> info.plist embedded in java exe [v2]

Marked as reviewed by asemenyuk (Reviewer).

-

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


Re: RFR: 8286122: [macos]: App bundle cannot upload to Mac App Store due to info.plist embedded in java exe [v2]

2022-05-11 Thread Alexander Matveev
On Wed, 11 May 2022 21:58:46 GMT, Alexey Semenyuk  wrote:

>> Alexander Matveev has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   8286122: [macos]: App bundle cannot upload to Mac App Store due to 
>> info.plist embedded in java exe [v2]
>
> test/jdk/tools/jpackage/macosx/MacAppStoreJlinkOptionsTest.java line 48:
> 
>> 46: 
>> 47: @Test
>> 48: public static void test() throws Exception {
> 
> I'd give some more descriptive names to test functions than `test` and 
> `test2`. Something like `testWithStripNativeCommands` and 
> `testWithoutStripNativeCommands` maybe?

Fixed.

> test/jdk/tools/jpackage/macosx/MacAppStoreRuntimeTest.java line 102:
> 
>> 100: 
>> 101: cmd.execute(1);
>> 102: }
> 
> @Test
> @Parameter("true")
> @Parameter("false")
> public static void test(boolean stripNativeCommands) throws Exception {
> JPackageCommand cmd = JPackageCommand.helloAppImage();
> cmd.addArguments("--mac-app-store", "--runtime-image", 
> getRuntimeImage(stripNativeCommands));
> 
> if (stripNativeCommands) {
> cmd.executeAndAssertHelloAppImageCreated();
> } else {
> cmd.execute(1);
> }
> }

Fixed.

-

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


Re: RFR: 8286122: [macos]: App bundle cannot upload to Mac App Store due to info.plist embedded in java exe [v2]

2022-05-11 Thread Alexander Matveev
> - It is not possible to support native JDK commands such as "java" inside Mac 
> App Store bundles due to embedded info.plist. Workarounds suggested in 
> JDK-8286122 does not seems to be visible.
>  - With proposed fix we will enforce "--strip-native-commands" option for 
> jlink, so native JDK commands are not included when generating Mac App Store 
> bundles.
>  - Custom runtime provided via --runtime-image should not contain native 
> commands as well, otherwise jpackage will throw error.
>  - Added two tests to validate fix.

Alexander Matveev has updated the pull request incrementally with one 
additional commit since the last revision:

  8286122: [macos]: App bundle cannot upload to Mac App Store due to info.plist 
embedded in java exe [v2]

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/8666/files
  - new: https://git.openjdk.java.net/jdk/pull/8666/files/4b3c8754..c9ebcee1

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

  Stats: 16 lines in 2 files changed: 3 ins; 4 del; 9 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8666.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8666/head:pull/8666

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