Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8263154: [macos] DMG builds have finder errors #3505

Closed
wants to merge 1 commit into from

Conversation

@sashamatveev
Copy link
Member

@sashamatveev sashamatveev commented Apr 15, 2021

  • Issue was reproducible when install-dir points to some invalid location.
  • Fixed by defaulting DMG drag and drop location to /Applications folder and --install-dir will be ignored with warning for DMG.
  • I do not see any way to support other valid, but uncommon locations for drag and drop. For example: /Users/USERNAME/Applications is not possible to support since user name is not known. /usr/bin requires root privileges and should contain symbolic links. Locations which does not exist also not possible to support, since DMG cannot create paths. So /Applications/MyCompany is not possible for DMG.

Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3505/head:pull/3505
$ git checkout pull/3505

Update a local copy of the PR:
$ git checkout pull/3505
$ git pull https://git.openjdk.java.net/jdk pull/3505/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 3505

View PR using the GUI difftool:
$ git pr show -t 3505

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/3505.diff

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Apr 15, 2021

👋 Welcome back almatvee! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr label Apr 15, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Apr 15, 2021

@sashamatveev The following label will be automatically applied to this pull request:

  • core-libs

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the core-libs label Apr 15, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Apr 15, 2021

Webrevs

Copy link

@andyherrick andyherrick left a comment

Doesn't much of this argument apply to pkg builds too ?
I hate to abandon install-dir option entirely for dmg, and just printing a warning and ignoring the argument is contrary to what is done for other arguments.
Is there any way, in the apple script, to check if the install-dir exists, and to use it if it does ?
Also wouldn't it be useful (for both pkg and dmg) to have ability to install into the users home directory ?
just specifying ~ or ~/Applications gets expanded before going in script if not quoted, and doesn't work if it is quoted.
Unless we define a meaning for non-fully qualified path in install-dir that should probably be a hard error..

@sashamatveev
Copy link
Member Author

@sashamatveev sashamatveev commented Apr 15, 2021

Not sure if I understood question about PKG. PKG can create destination folders and will have root access once elevated, so user can specify any locations for --install-dir in case of PKG.
Well DMG is not an installer it is just disk image which contains app (think of it as archive file), so we cannot really support all functionality with DMG as with actual installers.
Yes, I can check if install-dir exist with apple script, but destination machine might not have this folder. Permissions might be different on folder on machine which generates DMG and machine which will install it.
If PKG cannot be install into user home Applications folder, then it is another bug.

Also, if someone really want --install-dir to some other location they can overwrite apple script we using via resource folder. This fix only affects apple script we generate to customize DMG. Extra step for user, but I think it will not be common anyway.

@andyherrick
Copy link

@andyherrick andyherrick commented Apr 16, 2021

Since target directory shown by apple script is only a suggestion, and user can drag app to anywhere in finder, I may be able to be convinced to ignore install-dir on dmg builds.
I don't think we should use Log.info() to say given install-dir is ignored, it should just be Log.verbose(). (I started the bad precedence when I used Log.info for messages about foreign app-image, this should have been Log.verbose() too).

@sashamatveev
Copy link
Member Author

@sashamatveev sashamatveev commented Apr 16, 2021

Should we always show warning messages, especially that output will be different from what user expected? I can switch to Log.verbose(), but I still think it should be displayed always.

@andyherrick
Copy link

@andyherrick andyherrick commented Apr 19, 2021

It's my feeling that there should probably be no stdout/stderr from the jpackage tool other than what is specified (--help, --version, and hard errors). If that is consensus we should also change the warnings about foreign app-image to Log.verbose, if not we can leave this Log.info() as is.

Copy link

@andyherrick andyherrick left a comment

Consensus is to leave as Log.info() - so all looks good.

@openjdk
Copy link

@openjdk openjdk bot commented Apr 19, 2021

@sashamatveev This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8263154: [macos] DMG builds have finder errors

Reviewed-by: herrick, asemenyuk

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 94 new commits pushed to the master branch:

  • b703e0a: 8264569: Remove obsolete error messages from CDSTestUtils.java
  • 235daea: 8265285: Unnecessary inclusion of bytecodeHistogram.hpp
  • 8bec6fe: 8264277: java.xml.crypto module should be granted FilePermission and SocketPermission
  • 5303ccb: 8265135: Reduce work initializing VarForms
  • d9e40dd: 8199407: Skip Rebuild Remset Phase if there are no rebuild candidates
  • 8dbf7aa: 8241306: Add SignatureMethodParameterSpec subclass for RSASSA-PSS params
  • b14e0ee: 8265371: Change to Visual Studio 2019 16.9.3 for building on Windows at Oracle
  • c887148: 8265079: Implement VarHandle invoker caching
  • b64a3fb: 8265325: Optimize StubRoutines::dpow() for Math.pow(x, 0.5)
  • d1c8c9e: 8197811: Test java/awt/Choice/PopupPosTest/PopupPosTest.java fails on Windows
  • ... and 84 more: https://git.openjdk.java.net/jdk/compare/283d64f81531ec3edc156f13278a9a284445b61d...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready label Apr 19, 2021
@sashamatveev
Copy link
Member Author

@sashamatveev sashamatveev commented Apr 19, 2021

/integrate

@openjdk openjdk bot closed this Apr 19, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Apr 19, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Apr 19, 2021

@sashamatveev Since your change was applied there have been 95 commits pushed to the master branch:

  • 54cb388: 8252600: [JVMCI] remove mx configuration
  • b703e0a: 8264569: Remove obsolete error messages from CDSTestUtils.java
  • 235daea: 8265285: Unnecessary inclusion of bytecodeHistogram.hpp
  • 8bec6fe: 8264277: java.xml.crypto module should be granted FilePermission and SocketPermission
  • 5303ccb: 8265135: Reduce work initializing VarForms
  • d9e40dd: 8199407: Skip Rebuild Remset Phase if there are no rebuild candidates
  • 8dbf7aa: 8241306: Add SignatureMethodParameterSpec subclass for RSASSA-PSS params
  • b14e0ee: 8265371: Change to Visual Studio 2019 16.9.3 for building on Windows at Oracle
  • c887148: 8265079: Implement VarHandle invoker caching
  • b64a3fb: 8265325: Optimize StubRoutines::dpow() for Math.pow(x, 0.5)
  • ... and 85 more: https://git.openjdk.java.net/jdk/compare/283d64f81531ec3edc156f13278a9a284445b61d...master

Your commit was automatically rebased without conflicts.

Pushed as commit 5b43b39.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants