kfix / MacPin

a webapp container & site specific browser made from WebKit.swift and JavaScriptCore
GNU General Public License v3.0
331 stars 27 forks source link

disrequire Xcode to build once again #39

Open kfix opened 2 years ago

kfix commented 2 years ago

Xcode is huge, almost 12GB downloaded and needs 40GB to extract (really 50Gb if your XCode.xip is on the same filesystem you're installing to)

now that swiftlibs are in the base macOS, should investigate whether the plain "Command Line Tools" package is enough to build MacPin. I think building with CLT used to work but can't remember when/if/why it stopped.

CDT won't have the iOS Simulator to test the mobile builds (or even its SDKs??), but that port is just a toy at this point.

kfix commented 2 years ago

homebrew's installer has a scriptable way to deploy CLT.pkg https://github.com/Homebrew/install/blob/master/install.sh#L813

kfix commented 2 years ago

just calling git on a stock macOS install will try to get CLT installed: https://apple.stackexchange.com/a/304101

so that's a plus

kfix commented 1 year ago

I didn't document it yet, but CLT is insufficient.

It has a swift-package binary at /Library/Developer/CommandLineTools/usr/bin/swift-package

if you invoke that with build, or just run swift build, you'll get this on stderr:

error: terminated(72): /usr/bin/xcrun --sdk macosx --find xctest output:
    xcrun: error: unable to find utility "xctest", not a developer tool or in PATH

this also shows up when running make to just show basic infos, so eXcode.mk is finding the right swift bins, they just don't don't want to do anything beyond basic compile invokes. maybe upstream will un-eff this xctest issue: https://github.com/apple/swift-package-manager/issues/4396 (more context https://forums.swift.org/t/pitch-standardise-swift-cli-across-all-platforms/46672)

if I try to workaround that, I get this:

$ ln -s /usr/bin/true ~/bin/xctest
$ /Library/Developer/CommandLineTools/usr/bin/swift-package build
'macpin': error: invalidManifestFormat("/Users/joey/src/MacPin/Package.swift:2:8: error: no such module \'PackageDescription\'\nimport PackageDescription\n       ^", diagnosticFile: nil)
kfix commented 4 months ago

well, maybe I can use https://github.com/yonaskolb/XcodeGen to automate the unpleasantness of maintaining an Xcode project