tpoechtrager / osxcross

Mac OS X cross toolchain for Linux, FreeBSD, OpenBSD and Android (Termux)
GNU General Public License v2.0
2.91k stars 329 forks source link

gen_sdk_package cannot find my xcode #207

Open greearb opened 5 years ago

greearb commented 5 years ago

I downloaded the latest xcode dmg and mounted it on my mac-mini. I copied over the gen_sdk_package.sh, but it will not find my xcode. Any suggestions? And, any mailing list or similar that could be used to ask such questions instead of a bug report?

ct-mini1:~ greearb$ ./gen_sdk_package.sh please mount Xcode.dmg ct-mini1:~ greearb$ ct-mini1:~ greearb$ ct-mini1:~ greearb$ ct-mini1:~ greearb$ mount /dev/disk1s2 on / (hfs, local, journaled) devfs on /dev (devfs, local, nobrowse) map -hosts on /net (autofs, nosuid, automounted, nobrowse) map auto_home on /home (autofs, automounted, nobrowse) /dev/disk2s3 on /Volumes/Xcode (hfs, local, nodev, nosuid, read-only, noowners, mounted by greearb) ct-mini1:~ greearb$ ls /Volumes/Xcode/Packages/ BluetoothSDK.pkg MacOSX10.6.pkg CHUD.pkg OpenGLApps.pkg CoreAudioSDK.pkg OpenGLSDK.pkg Dashcode.pkg OtherDevDocumentation.pkg DevDocumentation.pkg QuickTimeSDK.pkg DevSDK.pkg RelocatableScript.pkg DevSamples.pkg SystemScript.pkg DevToolsDocumentation.pkg VersionedDeveloperToolsSystemSupport.pkg DeveloperTools.pkg WebKitSDK.pkg DeveloperToolsCLI.pkg X11Documentation.pkg DeveloperToolsSystemSupport.pkg X11SDK.pkg DistributedBuildsSupport.pkg gcc4.0.pkg DocDownloadOff.pkg gcc4.0ADCDocs.pkg DocDownloadOn.pkg gcc4.2.pkg FireWireSDK.pkg gcc4.2ADCDocs.pkg JavaSDK.pkg llvm-gcc4.2.pkg MacOSX10.4.Universal.pkg xcrun.pkg MacOSX10.5.pkg ct-mini1:~ greearb$

aknuds1 commented 4 years ago

I had the problem that I couldn't download a DMG of the SDK, but found only an xip file (are SDK DMGs made available from Apple any longer at all?). My solution was to install XCode into /Applications, since the script would find it there.

tpoechtrager commented 4 years ago

There is gen_sdk_package_pbzx.sh for xip files.

aknuds1 commented 4 years ago

@tpoechtrager Thanks, had no idea. Should the README be updated to make users aware of this?? I can make a PR.

tpoechtrager commented 4 years ago

It's already in the README. "Packing the SDK on Linux - Method 1 (Xcode > 8.0)"

aknuds1 commented 4 years ago

@tpoechtrager But that's for packaging on Linux, I am packaging on OSX. Am I missing something?

tpoechtrager commented 4 years ago

I have never tried the pbzx method on macOS. Let me know if it works.

aknuds1 commented 4 years ago

@tpoechtrager Gotcha, will try to experiment with it.

aknuds1 commented 4 years ago

@tpoechtrager I packaged the SDK with ./tools/gen_sdk_package_pbzx.sh, and while it was outputting a bunch of warnings throughout (see below), it seemed to succeed in the end, although I don't know if the result is good or not.

./Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator.sdk/usr/include/sysexits.h: Can't create 'Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator.sdk/usr/include/sysexits.h'
./Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator.sdk/usr/include/string.h: Can't create 'Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator.sdk/usr/include/string.h'
./Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator.sdk/usr/include/ndbm.h: Can't create 'Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator.sdk/usr/include/ndbm.h'
tpoechtrager commented 4 years ago

Ignore it if it's just that. AppleTVSimulator.platform is not relevant for us.

aknuds1 commented 4 years ago

@tpoechtrager Can you suggest a way of verifying the produced package?

There were far more warnings of the kind above BTW, I just didn't paste all of them. Just took an excerpt towards the end.

tpoechtrager commented 4 years ago

Why are you not using the normal packaging method on macOS? Mount the xip image and run ./tools/gen_sdk_package.sh.

You could test it with the cross-compiler.

aknuds1 commented 4 years ago

@tpoechtrager How can I mount a xip archive? The official osxcross docs say to download a DMG file and mount it, which is why I asked in the first place how to deal with xip since Apple don't provide XCode DMGs AFAICT. After all, you're the one who told me to use gen_sdk_package_pbzx.sh.

tpoechtrager commented 4 years ago

My solution was to install XCode into /Applications, since the script would find it there.

So what's the problem? Just run ./tools/gen_sdk_package.sh. I suggested you to use gen_sdk_package_pbzx.sh because I thought you were on a non-Darwin OS. I misread the /Application part.

I don't even have access to a macOS machine at the moment, so I can't update the README.

aknuds1 commented 4 years ago

@tpoechtrager My original point is that I think the README is out of date, since it says to download and mount a DMG, which apparently isn't available from Apple any longer. In my opinion, the README should be updated with a solution that describes how to build from a xip file. I can provide a PR, to do so if you want.

tpoechtrager commented 4 years ago

Yes, file a PR please. Thanks.

aknuds1 commented 4 years ago

OK 👍