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

8296904: Improve handling of macos xcode toolchain #11113

Closed
wants to merge 13 commits into from

Conversation

RealCLanger
Copy link
Contributor

@RealCLanger RealCLanger commented Nov 11, 2022

With this PR I'd like to make it easier to use dedicated installations of Xcode on Mac OS for OpenJDK builds without having to switch the active Xcode globally via xcode-select.

I propose adding a new configure flag --with-xcode-path that takes the path to an Xcode installation. If the option is set, this path is expanded to a valid TOOLCHAIN_PATH.

Furthermore, I fix detection of xcodebuild and correctly setting the sysroot from the toolchain by moving AC_SUBST(TOOLCHAIN_PATH) before calling BASIC_SETUP_XCODE_SYSROOT and honoring TOOLCHAIN_PATH in BASIC_SETUP_XCODE_SYSROOT in the case when no devkit is specified. As I see it, this is a viable fix, even if not introducing --with-xcode-path.


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-8296904: Improve handling of macos xcode toolchain

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/11113/head:pull/11113
$ git checkout pull/11113

Update a local copy of the PR:
$ git checkout pull/11113
$ git pull https://git.openjdk.org/jdk pull/11113/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 11113

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/11113.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 11, 2022

👋 Welcome back clanger! 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 JDK-8296904 8296904: Improve handling of macos xcode toolchain Nov 11, 2022
@openjdk openjdk bot added the rfr Pull request is ready for review label Nov 11, 2022
@openjdk
Copy link

openjdk bot commented Nov 11, 2022

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

  • build

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 build build-dev@openjdk.org label Nov 11, 2022
@mlbridge
Copy link

mlbridge bot commented Nov 11, 2022

@RealCLanger RealCLanger reopened this Nov 12, 2022
@openjdk-notifier
Copy link

@RealCLanger Please do not rebase or force-push to an active PR as it invalidates existing review comments. All changes will be squashed into a single commit automatically when integrating. See OpenJDK Developers’ Guide for more information.

Copy link
Member

@erikj79 erikj79 left a comment

Choose a reason for hiding this comment

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

I think this looks good. It's technically possible to achieve what you need using the existing --with-toolchain-path, but in the case of Xcode, that is rather cumbersome as you need to point to the internal bin directories in the Xcode installation instead of just the top level Xcode application dir.

make/autoconf/basic.m4 Outdated Show resolved Hide resolved
@openjdk
Copy link

openjdk bot commented Nov 15, 2022

@RealCLanger 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:

8296904: Improve handling of macos xcode toolchain

Reviewed-by: erikj, ihse

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

  • 4a544bb: 8297091: New langtools test jdk/javadoc/doclet/testValueTag/TestValueFormats.java fails on machines with unexpected number format
  • b6dddf4: 8239801: [macos] java/awt/Focus/UnaccessibleChoice/AccessibleChoiceTest.java fails
  • 260e4dc: 8295011: EC point multiplication improvement for secp256r1
  • fb6c992: 8296957: One more cast in SAFE_SIZE_NEW_ARRAY2
  • ccc6e16: 8291067: macOS should use O_CLOEXEC instead of FD_CLOEXEC
  • 0ac5b55: 8297349: Parallel: Use correct claim value for CLD oop iteration in PSScavengeCLDClosure
  • 932bf35: 8297333: Parallel: Remove unused methods in PCIterateMarkAndPushClosure

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
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 Pull request is ready to be integrated label Nov 15, 2022
@RealCLanger
Copy link
Contributor Author

Thanks for the review, I took over your suggestion. Will integrate shortly.

Copy link
Member

@magicus magicus left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for fixing this!

@magicus
Copy link
Member

magicus commented Nov 16, 2022

Is there perhaps some documentation in doc/building.md that needs updating? I know there is a bit written about Xcode, I can imagine some pointers to this new argument would fit in there.

@RealCLanger
Copy link
Contributor Author

Is there perhaps some documentation in doc/building.md that needs updating? I know there is a bit written about Xcode, I can imagine some pointers to this new argument would fit in there.

Good suggestion. I made some edits in building.md. Please have a look. Also, what about building.html? Is this generated and if so, how can I regenerate it?

@magicus
Copy link
Member

magicus commented Nov 18, 2022

It is generated, and you can re-generate it using make update-build-docs. However, you need to have the same version of pandoc installed and configured, otherwise you'll get a lot of spurious changes.

To help you out, I checked out your branch and regenerated it for you. You can find it at 66ef4b7 (from https://github.com/magicus/jdk/tree/xcode-toolchain). If you are not a git wrangling pro, you can download it as a diff and apply it locally by appending .diff: https://github.com/openjdk/jdk/commit/66ef4b730656daeb4108f7118b92dea3e8da6475.diff

@RealCLanger
Copy link
Contributor Author

It is generated, and you can re-generate it using make update-build-docs. However, you need to have the same version of pandoc installed and configured, otherwise you'll get a lot of spurious changes.

To help you out, I checked out your branch and regenerated it for you. You can find it at 66ef4b7 (from https://github.com/magicus/jdk/tree/xcode-toolchain). If you are not a git wrangling pro, you can download it as a diff and apply it locally by appending .diff: https://github.com/openjdk/jdk/commit/66ef4b730656daeb4108f7118b92dea3e8da6475.diff

Woho, [66ef4b7] is a super power trick 😄 I've added it and then figured out that my new enumeration isn't displayed well in html. Can you please regnerate it once more?

Other than that, are my edits ok?

@magicus
Copy link
Member

magicus commented Nov 18, 2022

Yes, I thought your edits were okay. I'll re-generated the html for you, and then I think you're good to go.

@magicus
Copy link
Member

magicus commented Nov 18, 2022

Hm, the changes you made to the markdown file does not result in any changes in the generated html file. :( I fixed it by adding an additional empty line in the markdown file. The commit including both these fixes are here: magicus@2844de1

@RealCLanger
Copy link
Contributor Author

@magicus Thanks for fixing my enumeration. I recognized that you have regenerated all the html files with a newer pandoc and I had to resolve with master. I guess you'll need to regenerate with my current branch once more - otherwise I think I'm breaking some of the new style.

@magicus
Copy link
Member

magicus commented Nov 22, 2022

@RealCLanger Finally regenerated once more: fcd20c73ed9f0a44c0614a54580c755a16387a6a

@RealCLanger
Copy link
Contributor Author

Thanks @magicus for your help.

/integrate

@openjdk
Copy link

openjdk bot commented Nov 23, 2022

Going to push as commit 470f342.
Since your change was applied there have been 15 commits pushed to the master branch:

  • b4bd287: 8191406: [hidpi] sun/java2d/SunGraphics2D/DrawImageBilinear.java test fails
  • 412b436: 6201035: Document NPE for passing null insets to constructors and methods of several javax.swing.border.* classes
  • faf48e6: 8296329: jar validator doesn't account for minor class file version
  • 09f70da: 8296265: Use modern HTML in the JVMTI spec
  • e661c5a: 8296323: JVMTI can_support_virtual_threads not available for agents loaded into running VM
  • 974cb83: 8297310: Remove unimplemented HeapInspection::iterate_over_heap
  • e174558: 8296742: Illegal X509 Extension should not be created
  • a6c418e: 8297168: Provide a bulk OopHandle release mechanism with the ServiceThread
  • 4a544bb: 8297091: New langtools test jdk/javadoc/doclet/testValueTag/TestValueFormats.java fails on machines with unexpected number format
  • b6dddf4: 8239801: [macos] java/awt/Focus/UnaccessibleChoice/AccessibleChoiceTest.java fails
  • ... and 5 more: https://git.openjdk.org/jdk/compare/42c2037429a8ee6f683bbbc99fb48c540519524c...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Nov 23, 2022

@RealCLanger Pushed as commit 470f342.

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

@RealCLanger RealCLanger deleted the xcode-toolchain branch November 23, 2022 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build build-dev@openjdk.org integrated Pull request has been integrated
3 participants