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

8257620: Do not use objc_msgSend_stret to get macOS version #153

Closed
wants to merge 1 commit into from

Conversation

benty-amzn
Copy link
Contributor

@benty-amzn benty-amzn commented Nov 1, 2022

This backports JDK-8257620 for parity with Oracle JDK8 and OpenJDK 11+.

The backport is not clean because JDK-8269850 was applied first in 8u. If that change is backed out and reapplied after this backport, both are clean.

Change applied with:

  • git revert 43cfe27fa3a11dd6d4fffcb1c1336ac7fdd0233b (backout JDK-8269850)
  • git backport --from https://github.com/openjdk/jdk d4c7db5060978302382549246f9ad6831f19377d (apply JDK-8257620)
  • git backport --from https://github.com/openjdk/jdk 3b1b8fc646493eae5f4df828afe29abb75fa5e60 (re-apply JDK-8269850)
  • git rebase -i HEAD~3 (squash commits)

Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8257620: Do not use objc_msgSend_stret to get macOS version

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk8u-dev pull/153/head:pull/153
$ git checkout pull/153

Update a local copy of the PR:
$ git checkout pull/153
$ git pull https://git.openjdk.org/jdk8u-dev pull/153/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 153

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk8u-dev/pull/153.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 1, 2022

👋 Welcome back btaylor! 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 changed the title Backport d4c7db5060978302382549246f9ad6831f19377d 8257620: Do not use objc_msgSend_stret to get macOS version Nov 1, 2022
@openjdk
Copy link

openjdk bot commented Nov 1, 2022

This backport pull request has now been updated with issue from the original commit.

@openjdk openjdk bot added backport rfr Pull request is ready for review labels Nov 1, 2022
@mlbridge
Copy link

mlbridge bot commented Nov 1, 2022

Webrevs

Copy link
Member

@phohensee phohensee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean except for referenced context changes. Lgtm.

@openjdk
Copy link

openjdk bot commented Nov 2, 2022

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

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

8257620: Do not use objc_msgSend_stret to get macOS version

Reviewed-by: akozlov, phh, omikhaltcova

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 41 new commits pushed to the master branch:

  • a983a00: 6829250: Reg test: java/awt/Toolkit/ScreenInsetsTest/ScreenInsetsTest.java fails in Windows
  • 4388fa8: 8296485: BuildEEBasicConstraints.java test fails with SunCertPathBuilderException
  • 21a1236: 8296480: java/security/cert/pkix/policyChanges/TestPolicy.java is failing
  • c9007cd: 8231111: Cgroups v2: Rework Metrics in java.base so as to recognize unified hierarchy
  • 5510145: 8226236: win32: gc/metaspace/TestCapacityUntilGCWrapAround.java fails
  • 77403ed: 8286624: Regression Test CoordinateTruncationBug.java fails on OL8.3
  • 8356d04: 8295982: Failure in sun/security/tools/keytool/WeakAlg.java - ks: The process cannot access the file because it is being used by another process
  • fcd3c9c: 8247676: vcruntime140_1.dll is not needed on 32-bit Windows
  • 1ec7984: 8242468: VS2019 build missing vcruntime140_1.dll
  • 918a2ab: 8241087: Build failure with VS 2019 (16.5.0) due to C2039 and C2873
  • ... and 31 more: https://git.openjdk.org/jdk8u-dev/compare/f04ad96cf53385c9f8aa071a4167ad7790cb8466...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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@phohensee) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Nov 2, 2022
@omikhaltsova
Copy link

Patched file location difference:
JDK: ./src/java.base/macosx/native/libjava/java_props_macosx.c
JDK8: ./jdk/src/solaris/native/java/lang/java_props_macosx.c

It seems it's not possible to apply this patch avoiding manual merge in a way described, right?

@navyxliu
Copy link
Member

navyxliu commented Nov 8, 2022

Patched file location difference: JDK: ./src/java.base/macosx/native/libjava/java_props_macosx.c JDK8: ./jdk/src/solaris/native/java/lang/java_props_macosx.c

It seems it's not possible to apply this patch avoiding manual merge in a way described, right?

You are right. From my reading, @benty-amzn just reverted what you did(step-1) and re-applied it(step-3) after JDK-8257620. There's a typo in his description. It should be 'JDK-8269850' rather than 'JDK-826985' in step-3.

@benty-amzn
Copy link
Contributor Author

Xin is right, edited the PR to use the correct bug id.

@omikhaltsova
Copy link

I meant not that but the following:

jdk8u-dev-fork % git revert 43cfe27fa3a11dd6d4fffcb1c1336ac7fdd0233b
[master 9957f9f8aef] Revert "8269850: Most JDK releases report macOS version 12 as 10.16 instead of 12.0"
 1 file changed, 18 insertions(+), 13 deletions(-)

jdk8u-dev-fork % git backport --from https://github.com/openjdk/jdk d4c7db5060978302382549246f9ad6831f19377d
Fetching ...
Cherry picking ...
CONFLICT (modify/delete): src/java.base/macosx/native/libjava/java_props_macosx.c deleted in HEAD and modified in d4c7db50609 (8257620: Do not use objc_msgSend_stret to get macOS version). Version d4c7db50609 (8257620: Do not use objc_msgSend_stret to get macOS version) of src/java.base/macosx/native/libjava/java_props_macosx.c left in tree.
warning: inexact rename detection was skipped due to too many files.
warning: you may want to set your merge.renamelimit variable to at least 66423 and retry the command.
error: could not apply d4c7db50609... 8257620: Do not use objc_msgSend_stret to get macOS version
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'

It seems it's impossible to apply this patch following the way in this description.
I get conflicts because of the location difference of the patched file java_props_macosx.c:
JDK: ./src/java.base/macosx/native/libjava/java_props_macosx.c
JDK8: ./jdk/src/solaris/native/java/lang/java_props_macosx.c
So it seems to me you needn't blackout JDK-8269850 because the diffs (JDK-8269850 and JDK-8257620) are not intersected and additionally you have to resolve conflicts manually (or to apply patch manually) any way.
Am I right? Or I understand something wrong?

@benty-amzn
Copy link
Contributor Author

I think the reason your backport was unclean is related to these 2 lines:

warning: inexact rename detection was skipped due to too many files.
warning: you may want to set your merge.renamelimit variable to at least 66423 and retry the command.

I believe if you follow the instructions in the warning and raise the rename limit, inexact rename detection will find the correct file and no manual resolution will be required - that's what happened for me, at least.

@omikhaltsova
Copy link

@benty-amzn Thanks for this tip!
git config merge.renameLimit 70000 really helps to avoid manual resolving.

@benty-amzn
Copy link
Contributor Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Dec 5, 2022
@openjdk
Copy link

openjdk bot commented Dec 5, 2022

@benty-amzn
Your change (at version a19e36b) is now ready to be sponsored by a Committer.

@phohensee
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Dec 5, 2022

Going to push as commit 2abc206.
Since your change was applied there have been 42 commits pushed to the master branch:

  • 72269ee: 8296632: Write a test to verify the content change of TextArea sends TextEvent
  • a983a00: 6829250: Reg test: java/awt/Toolkit/ScreenInsetsTest/ScreenInsetsTest.java fails in Windows
  • 4388fa8: 8296485: BuildEEBasicConstraints.java test fails with SunCertPathBuilderException
  • 21a1236: 8296480: java/security/cert/pkix/policyChanges/TestPolicy.java is failing
  • c9007cd: 8231111: Cgroups v2: Rework Metrics in java.base so as to recognize unified hierarchy
  • 5510145: 8226236: win32: gc/metaspace/TestCapacityUntilGCWrapAround.java fails
  • 77403ed: 8286624: Regression Test CoordinateTruncationBug.java fails on OL8.3
  • 8356d04: 8295982: Failure in sun/security/tools/keytool/WeakAlg.java - ks: The process cannot access the file because it is being used by another process
  • fcd3c9c: 8247676: vcruntime140_1.dll is not needed on 32-bit Windows
  • 1ec7984: 8242468: VS2019 build missing vcruntime140_1.dll
  • ... and 32 more: https://git.openjdk.org/jdk8u-dev/compare/f04ad96cf53385c9f8aa071a4167ad7790cb8466...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Dec 5, 2022
@openjdk openjdk bot closed this Dec 5, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Dec 5, 2022
@openjdk
Copy link

openjdk bot commented Dec 5, 2022

@phohensee @benty-amzn Pushed as commit 2abc206.

💡 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
Labels
backport integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

5 participants