Re: RFR: 8287254: Clean up Xcode sysroot logic

2022-05-24 Thread Erik Joelsson
On Tue, 24 May 2022 17:09:10 GMT, Magnus Ihse Bursie  wrote:

> The logic in BASIC_SETUP_DEVKIT for setting a correct sysroot for Xcode is 
> hard to follow. This should be straightened out. We also expose variables 
> that are no longer used. So there's a bit of related cleanup. 
> 
> The new code is more or less functionally equivalent to the old. There were 
> some corner cases which the old code did not handle well; this has now been 
> improved. I've also added yet another method of trying to get the SDK root 
> before falling back to the system library, by using `xcrun --show-sdk-path`.
> 
> In an ideal world, the sysroot flags to `mig` should be set in configure, 
> e.g. as `MIG_FLAGS` or `MIG_SYSROOT_FLAGS`. I can't be bothered to do that 
> for a single call to `mig`, though.
> 
> As always, changes like this that depend on the environment is tricky to 
> test. I've tried running it on a couple of different macs, with and without a 
> devkit.

Marked as reviewed by erikj (Reviewer).

-

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


RFR: 8287254: Clean up Xcode sysroot logic

2022-05-24 Thread Magnus Ihse Bursie
The logic in BASIC_SETUP_DEVKIT for setting a correct sysroot for Xcode is hard 
to follow. This should be straightened out. We also expose variables that are 
no longer used. So there's a bit of related cleanup. 

The new code is more or less functionally equivalent to the old. There were 
some corner cases which the old code did not handle well; this has now been 
improved. I've also added yet another method of trying to get the SDK root 
before falling back to the system library, by using `xcrun --show-sdk-path`.

In an ideal world, the sysroot flags to `mig` should be set in configure, e.g. 
as `MIG_FLAGS` or `MIG_SYSROOT_FLAGS`. I can't be bothered to do that for a 
single call to `mig`, though.

As always, changes like this that depend on the environment is tricky to test. 
I've tried running it on a couple of different macs, with and without a devkit.

-

Commit messages:
 - Make Xcode SDK locating more robust
 - * Clean up BASIC_SETUP_XCODE_SYSROOT
 - Don't export SDKROOT
 - Move sdk setup to BASIC_SETUP_XCODE_SYSROOT

Changes: https://git.openjdk.java.net/jdk/pull/8872/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk=8872=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8287254
  Stats: 200 lines in 4 files changed: 91 ins; 98 del; 11 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8872.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8872/head:pull/8872

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