Skip to content

MacOSX.sdk: add SDK subports for 10.3-10.5 & 13-14 #23312

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

MarcusCalhoun-Lopez
Copy link
Contributor

Description

Type(s)
  • bugfix
  • enhancement
  • security fix
Tested on

macOS x.y
Xcode x.y / Command Line Tools x.y.z

Verification

Have you

  • followed our Commit Message Guidelines?
  • squashed and minimized your commits?
  • checked that there aren't other open pull requests for the same change?
  • referenced existing tickets on Trac with full URL in commit message?
  • checked your Portfile with port lint --nitpick?
  • tried existing tests with sudo port test?
  • tried a full install with sudo port -vst install?
  • tested basic functionality of all binary files?
  • checked that the Portfile's most important variants haven't been broken?

@macportsbot
Copy link

Notifying maintainers:
@ryandesign for port MacOSX.sdk.

Copy link
Contributor

@ryandesign ryandesign left a comment

Choose a reason for hiding this comment

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

When I first saw the email notification of this PR I thought you were adding the missing current SDKs.

@@ -4,7 +4,7 @@ PortSystem 1.0

name MacOSX.sdk
categories devel
platforms macosx
platforms {macosx any}
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a good idea.

It will trigger rebuilds of every subport so I will need to load the distfiles that can't be downloaded automatically onto one of the build machines manually before merging this PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

Unfortunately it looks like this port has bitrotted. For newer SDKs it downloaded them direct from Apple's CDN but now Apple is delivering a 403 response, e.g.:

% curl -I https://swcdn.apple.com/content/downloads/28/19/071-82714-A_HUFJRGID6Y/nnmlg28zs93jdbrsqtk6krr4mmaize40hb/CLTools_macOSLMOS_SDK.pkg

HTTP/1.1 403 Forbidden
…

so we either need a new URL from which to download the packages that used to be available via Apple's CDN or we need to revert to the old strategy of manually downloading the CLT dmgs from the Apple Developer web site and adjust the port's programming accordingly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How does one determine the proper URL from swcdn.apple.com?
There are various posts with URLs from swcdn.apple.com, but none of them seem to mention how to find them.

Copy link
Contributor

Choose a reason for hiding this comment

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

I probably had just found one of those posts at the time. I don't remember.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It would seem that someone has taken the time to search for this information.
I have updated the pull request to remove nonexistent files.
However, I believe the fix (e48c336) constitutes a stealth update, but fixing it would disrupt the existing distfile naming convention.

I also added SDKs for macOS 13-14 (fe83f2f), but I do not know how to find the release dates of the distfiles.

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe the fix (e48c336) constitutes a stealth update, but fixing it would disrupt the existing distfile naming convention.

And the SDK version is still exactly the same? Can you compare the old and new distfiles to see what the difference is? If you don't have the old distfiles, I can check if I saved them, which I was in the habit of doing for this port.

This will fix https://trac.macports.org/ticket/69952 by the way.

I also added SDKs for macOS 13-14 (fe83f2f), but I do not know how to find the release dates of the distfiles.

You could check if there is an HTTP Last-Modified header. If not, you could check the Internet; if not Apple, then surely somebody has posted something to announce these releases. You could also look at the modification date of the dmg or the files in it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And the SDK version is still exactly the same? Can you compare the old and new distfiles to see what the difference is? If you don't have the old distfiles, I can check if I saved them, which I was in the habit of doing for this port.

As far as I can tell, they have the same SDK version.
Unfortunately, I do not have access to the old distfiles, so I do not know what the differences are.

This will fix https://trac.macports.org/ticket/69952 by the way.

Thank you for pointing this out.
I have updated the commit message.

You could check if there is an HTTP Last-Modified header. If not, you could check the Internet; if not Apple, then surely somebody has posted something to announce these releases. You could also look at the modification date of the dmg or the files in it.

I have updated the dates using the HTTP Last-Modified header.

# variant_set universal
#}
#
supported_archs noarch
Copy link
Contributor

@ryandesign ryandesign Apr 2, 2024

Choose a reason for hiding this comment

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

This is certainly inaccurate but this port is a very special case so maybe this is an acceptable simplification.

Do you know if this would do anything to fix https://trac.macports.org/ticket/66918? Does rev-upgrade skip scanning ports marked noarch? If so, that would be an argument in favor of this change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is certainly inaccurate but this port is a very special case so maybe this is an acceptable simplification.

I would be happy to revert the change.
Setting configure.cxx_stdlib to empty is similarly inaccurate.
Should configure.cxx_stdlib also be set to either libc++ or libstdc++ depending on the SDK version?

Do you know if this would do anything to fix https://trac.macports.org/ticket/66918? Does rev-upgrade skip scanning ports marked noarch? If so, that would be an argument in favor of this change.

I am afraid the rev-upgrade issue persists even with the change.

Copy link
Contributor

Choose a reason for hiding this comment

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

I would be happy to revert the change.

I'm not saying yet that we should revert it. It certainly would reduce the number of systems on which the port needs to build, and the archives that get produced would indeed be the same.

Setting configure.cxx_stdlib to empty is similarly inaccurate.

That is true… the comment in the port explains that this was done to eliminate an unnecessary clang dependency. If there is a better solution to that, that's fine.

Should configure.cxx_stdlib also be set to either libc++ or libstdc++ depending on the SDK version?

I'm not sure if that would have the same effect.

Copy link
Contributor

@RJVB RJVB May 13, 2024

Choose a reason for hiding this comment

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

Does rev-upgrade skip scanning ports marked noarch?

No, and that's probably because it also scans for missing files. This issue will require a change in "base", I'm afraid. But maybe that can be as simple as making noarch skip the registration of binary files. IIRC this is basically what I did to have a semi-functional rev-upgrade feature in my LinuxPorts adaptation (I made isBinary() a stub returning false unconditionally so).

This would make some sort of sense ... treating all files installed by a port claiming that it has only "noarch" files as if they were not "binary" even if some of them would actually fit that description. I think it can be argued that no port setting this expects or should expect to have its files checked for shared library dependencies.

The safer alternative would be a new rev_upgrade_skip_archceck option.

Copy link
Contributor

@RJVB RJVB May 13, 2024

Choose a reason for hiding this comment

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

This issue will require a change in "base", I'm afraid.

Or an unorthodox approach: create a nicely compressed DMG of the SDK directory and install that, plus a script that handles the mounting so the user doesn't have to remember where the DMG is installed. Ports that get their content off a DMG know how to mount them on custom mountpoint not under /Volumes so that script could make the DMG content appear under the same path as where it's found now.

I think there are additional advantages to this; these SDKs install a really large number of (small) files which make them potentially SSD-unfriendly and costly for both the registry and the rev-upgrade scan. Is there any indication that people who install these ports actually use them more than occasionally? I suppose a startupitem could be provided for those who do, so the DMG gets mounted when they log in?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixing the rev-upgrade issue would definitely be nice.
However, as you point out, it must either be fixed in the base or in the Portfile with an "unorthodox approach."
The ideas are interesting, but I think they are a bit outside the scope of this PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

create a nicely compressed DMG of the SDK directory and install that

Yuck!

I suppose a startupitem could be provided for those who do, so the DMG gets mounted when they log in?

Eww!

@MarcusCalhoun-Lopez MarcusCalhoun-Lopez force-pushed the more-sdks branch 2 times, most recently from fbceab4 to fe83f2f Compare April 9, 2024 11:25
@MarcusCalhoun-Lopez MarcusCalhoun-Lopez changed the title MacOSX.sdk: add SDK subports for 10.3-10.5 MacOSX.sdk: add SDK subports for 10.3-10.5 & 13-14 Apr 9, 2024
@MarcusCalhoun-Lopez
Copy link
Contributor Author

Of course, there is no rush on this pull request.
However, I am a little unclear about what issues still need to be addressed before merging it.

@ryandesign
Copy link
Contributor

I am a little unclear about what issues still need to be addressed before merging it.

Sorry, I haven't really looked at this again since my April comments.

The files installed by the MacOSX.sdk subports should be exactly the
same regardless of the system, so add `any` to `platforms`.

There might be use in installing an older SDK on a newer system, so
do not limit `supported_archs`.
@MarcusCalhoun-Lopez
Copy link
Contributor Author

Sorry, I haven't really looked at this again since my April comments.

Thank you for taking the time to review the changes.
There is certainly no rush.
This port is extremely useful, but I suspect to only to a very small population.

@RJVB
Copy link
Contributor

RJVB commented May 14, 2024 via email

@ryandesign
Copy link
Contributor

ryandesign commented May 22, 2024

It seems obvious that this port can't be used as any kind of dependency of another port.

I don't know why you say that. I created this port for ports that need older or newer SDKs. Ideally, the newer/older SDKs would only need to be installed on the buildbot workers and then the binary that gets produced would work without it. I didn't particularly intend users to use the older/newer SDKs directly, though there's no reason they can't do that if they want.

Regarding the rev-upgrade issue, I simply didn't notice when I created the ports since I had rev-upgrade turned off in my MacPorts installation.

@RJVB
Copy link
Contributor

RJVB commented May 22, 2024 via email

@Gcenx
Copy link
Contributor

Gcenx commented May 25, 2024

Any chance this can get merged?

homepage https://developer.apple.com/documentation/macos-release-notes/macos-14-release-notes
}

subport MacOSX13.sdk {
Copy link
Contributor

Choose a reason for hiding this comment

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

I’d ideally want this for game-porting-toolkit to avoid even more patches.

@reneeotten
Copy link
Contributor

is there a path forward here? If so, let's make some progress, otherwise let's close the PR

@RJVB
Copy link
Contributor

RJVB commented Aug 16, 2024

What is this even blocking on? Just the fact that the CI/testfarm/whatever can't find a logfile when it wants to?

@MarcusCalhoun-Lopez
Copy link
Contributor Author

I think I have addressed all the specific concerns expressed.
My best guess as to why the pull request has not been merged is that there are higher priorities.

@reneeotten
Copy link
Contributor

@MarcusCalhoun-Lopez then just merge it yourself.

I can't follow all the discussion here and @ryandesign hasn't been back to leave a response so this will remain in limbo. If you think it's all done then merge it. Of someone wants to make changes that can be done later.

@Gcenx
Copy link
Contributor

Gcenx commented Dec 26, 2024

Can we finally get this merged?

@cooljeanius
Copy link
Contributor

Can we finally get this merged?

Seconded!

@RJVB
Copy link
Contributor

RJVB commented May 30, 2025

I just tried to use the (patched) version to fetch the 10.7 SDK, and apparently I am not entitled to get the required Xcode installer with the developer account I've been using since forever.

Why's that? Do you need to be a paying developer for that, nowadays?

EDIT: to the rescue O:^)

@Gcenx
Copy link
Contributor

Gcenx commented May 30, 2025

I just tried to use the (patched) version to fetch the 10.7 SDK, and apparently I am not entitled to get the required Xcode installer with the developer account I've been using since forever.

Why's that? Do you need to be a paying developer for that, nowadays?

EDIT: to the rescue O:^)

You can download Xcode 2.3 & Xcode Tools v1.0 from https://developer.apple.com/download/all/ without even having a paid developers account.

@RJVB
Copy link
Contributor

RJVB commented May 30, 2025 via email

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

Successfully merging this pull request may close these issues.

7 participants