Error Compiling Publish (Sundell) from Manifest File - installation

TLDR;
I installed John Sundell's Publish according to the accepted practices and immediately get an error when I try to build my site package. How do I successfully install the product?
After cloning the publish package:
git clone https://github.com/JohnSundell/Publish.git
I cd'd into the Publish folder and ran:
make
which created an executable at /usr/local/bin/publish
I opened a new terminal window, created a directory using mkdir Saturday and then cd'd into that folder. I typed publish new and was successful:
✅ Generated website project for 'Saturday'
Run 'open Package.swift' to open it and start building
When I open the manifest file (Package.swift) and type cmd-S (Save) it imports all the necessary packages, and everything looks good to go.
When I type cmd-B (Build), however this error message comes up:
The package product 'CollectionConcurrencyKit' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0
When I look at the clone/install of Publish I see:
Computing version for https://github.com/johnsundell/collectionConcurrencyKit.git
Computed https://github.com/johnsundell/collectionConcurrencyKit.git at 0.1.0 (0.37s)
Notice it says version 0.1.0. In the generated package for my site, it retrieves version 0.2.0. I don't know if that's an issue.
But not one other Package.swift file in all the fetched dependencies mentions iOS.
I have this line in my Package.swift
platforms: [.macOS(.v12)],
So I know I haven't added this dependency on iOS inadvertently, so I don't understand the error message.
I'm running macOS Monterey 12.6 on Xcode 14.0 (14A309) - both are the most recent release versions available.
The hardware is: MacBook Pro (16-inch, 2021) using the Apple M1 Pro chip
If I'm leaving anything out, please comment and I'll provide more detail.

This is a slap your forehead 🤦🏽‍♂️ kind of thing here.
It turns out that when I opened the Package.swift it defaulted to an iOS scheme that I had just been using. I updated the scheme to a macOS based one, the problem went away. Now I understand the source of the iOS error. Apparently the two versions of ConcurrencyKit is a red herring.
Hope this helps others! Always check your target when compiling.

Related

XCode 9 unable to build - linker fails with "File not found" on object files - project builds fine in XCode 8.3.3

Here's a frustrating one. My project builds perfectly in 8.x versions of XCode, and yet in 9.x versions, it fails consistently in the linker phase, as the linker is unable to find the .o file for a seemingly random class.
For example, in one build it will be unable to find the intermediate object file for my UIWindow subclass:
In other builds, other files may be identified as the culprit, with the same "file not found" linker error.
So, clearly there is a disconnect in the linker phase. I can understand that. But I cannot make it work to save my life.
Here's what DIDN'T work:
• Deleting derived data
• Cleaning and option-cleaning
• In the .swift file inspector, removing the file from the target and re-adding to target
• Renaming the target
• Deleting the supposedly erroneous files from the project, and moving to trash, then re-adding the files to the project and target.
• Switching advanced workspace settings for Build Settings from "XCode default" to "Legacy"
• Updating XCode from 9.0 to 9.0.1
• Deintegrating Cocoapods and reinstalling them
Jeez.
So, none of the usual suspects are at play here.
Additional details :
• When I look in the folder specified in the linker error message, the .o files are NOT THERE. (Are they not being created? Is there a setting for that?)
• Using Mac OS High Sierra on a MacBook Pro Retina 15
So there's my conundrum.
Does anyone know why XCode 9 would either not be creating .o files, or would be unable to find those files, for a project that build perfectly in previous versions of XCode?
Thanks!
The only solution I found was admittedly pretty painful. I created a new project and then re-imported all the files and dependencies into the new project. Then setup all the build settings, etc. At that point the project was back to building and working fine.
If this happened again, I would try deleting the .xcworkspace file and re-generating it with pod install first before starting a new project.
May this not happen to you.

Create custom Platform and SDK for Xcode 8.3+

I'm trying to create a custom .platform and SDK in Xcode 8.3 and higher.
I am ultimately attempting to update the old DarwinBuild build system so that I can compile a few of the Apple open source components. DarwinBuild used to use this technique in order to be able to compile against a different set of headers and libraries without having to chroot.
DarwinBuild includes a setup script, installXcode32, that creates a new .platform under Xcode's Developer/Platforms directory, and a new sdk under the platform's Developer/SDKs directory. It also creates an Info.plist and SDKSettings.plist in the right spots. This script needs some updating to work with Xcode 8.3.
I know this is unsupported, but that doesn't matter in this case. After all, Apple published the original script...
I updated the original installXcode32 script to work with the new Xcode paths (/Applications/Xcode.app/Contents/...), and it produces the new .platform, Info.plist, and SDKSettings.plist, and they're all symlinked to the right spots. However, xcodebuild -showsdks now produces this error:
xcodebuild: error: Initialization failed.
Reason: Required content for platform darwin is missing.
I know it's an issue with the Info.plist and SDKSettings.plist files. I have tried copying the entire MacOSX.platform directory, and changing the names in the .plist, and I get the same error.
Does anyone know enough about Xcode and platforms to know what is required to get Xcode 8.3+ to recognize a "new" Platform and sdk?
Many thanks!
I have successfully done this with Xcode 9.4, pretty much like you did. I changed:
CanonicalName
PLATFORM_NAME
DisplayName

How to change qmake when upgrading to qt5 for pyqt5

I am trying to install Pyqt but I am having significant issues getting all the seperate installation processes to work in sync. I have looked online but I can't find anything to help in my specific situation.
So far I have downloaded and built Sip4.16.7. I saved the file to a random location on my directory and ran the configure file, it then installed the module in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages and seemed to work.
I then downloaded the latest version of Qt5.2 and installed it using the installer. The files are stored in /users/MyUsername/Qt
I then installed PyQt5.4.1 and tried to run the configure file but I obviously have an older version of qmake on my system as I get an error of Error: PyQt5 requires Qt v5.0 or later. You seem to be using v4.7.4. Use the
--qmake flag to specify the correct version of qmake. This is confirmed by typing qmake -v in the terminal and I get the output of QMake version 2.01a
Using Qt version 4.7.4 in /opt/anaconda1anaconda2anaconda3/lib. I have scoured the internet and I can't work out how to tell whether I have a new qmake for the Qt5.2 or If I have to make it. And I have no idea how to get set the right Qtmake directory for the new PyQt configure file.
I apologise for the very specific and confused question but I am totally lost at the moment. As an additional question When you download the PyQt and SIP files should they be saved in specific directories relative to each other?
To follow the entire discussion for how I answered this refer to https://forum.qt.io/topic/53035/installation-problems-with-pyqt-locating-old-version-of-qmake/37
There were 2 main problems:
1) The --qmake=/Users/MyUsername/Qt/5.4/ios/bin/qmake was directed to the iOS qmake which requires a subscription to apple developers program. using the --verbose option returned Check dependencies
Code Sign error: No code signing identities found: No valid signing identities (i.e. certificate and private key pair) matching the team ID “(null)” were found.
CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 8.1'
The solution to this was to refer qmake to the clang-64 version to allow development on OS X not iOS.
2) I had saved the PyQt directory in my google drive and therefore there was a space in the file name. Therefore when I referred to the qmake in the clang-64 directory I got the error of ```clang: error: no such file or directory: Drive/Personal/Code/PyQT/PyQt-gpl-5.4.1 (when using --verbose) So I had to move the PyQT file to outside my google drive and rerun, and it worked fine.

How do I Compile a Framework in Xcode?

Ever since I switched to Yosemite, I have been getting an Xcode quit unexpectedly error whenever I try to run SDL2. I can't even get a "hello world" to run.
I am trying the fix it by following the directions on this page:
Xcode 5 crashes when running an app with SDL 2
But I don't know how to "Compile the "Framework" target in Xcode/SDL/SDL.xcodeproj" I tried just simply building it but that doesn't seem to work because I don't see any framework file showing up.
Can someone help me figure out how to get rid of this error?
I assume you have got the latest version of the code either by doing hg clone http://hg.libsdl.org/SDL or by downloading the latest snapshot from https://www.libsdl.org/hg.php
This should give you a directory called SDL which contains the source and all of the projects. You will want to open 'Xcode/SDL/SDL.xcodeproj'
Then ensure the following is set as your build target - Framework > My Mac (64-bit) You can change it by clicking on it.
Then hit CMD+B (or select Product->Build from the menu) to build the framework. You will then be able to find the SDL2.framework in the following location:
/Users/*yourusername*/Library/Developer/Xcode/DerivedData/SDL2-*randomstring*/Build/Products/<*Debug/Release*>
Copy the framework to /Library/Frameworks

Jenkins vs. Xcode plugin - codesign troubles

I have updated to OS X Yosemite and also Xcode 6.1 (downloaded from the developer site), from this time I have had the problem with the building as in the log file I see the note "Warning: --resource-rules has been deprecated in Mac OS X >= 10.10!". Does someone know how to use Xcode plugin without "resource-rules" flag? Thank you.
Everything is ok with Jenkins plugin. Just product settings is incorrect.
Open the "Build Settings" tab of your project. Searched "Code Signing Resource Rules Path", it was empty for me. Change to: $(SDKROOT)/ResourceRules.plist
credits goes to Adams Blair who described this problem with SDK2.2
https://stackoverflow.com/a/7919137/2124345
Update
This solution doesn't remove the warning itself. But i'm pretty sure that warning isn't a problem. The problem is that without this setting ResourceRules.plist files isn't generated in Payload folder, and build process stops because file is missing.
And again, it's not related with jenkins plugin at all. Same error happens with xcrun -sdk iphoneos PackageApplication. Jenkins just calling this command line as a build step.
The answer provided by Julius Lisauskas will resolve the warning, but it is actually just a workaround for a bug that exists in the Jenkins Xcode plugin xcrun.
As mentioned in Apple Technical Note TN2206:
Systems before OS X Mavericks documented a signing feature
(--resource-rules) to control which files in a bundle should be sealed
by a code signature. This feature has been obsoleted for Mavericks.
Code signatures made in Mavericks and later always seal all files in a
bundle; there is no need to specify this explicitly any more. This
also means that the Code Signing Resource Rules Path build setting in
Xcode should no longer be used and should be left blank.
It is thus no longer possible to exclude parts of a bundle from the
signature. Bundles should be treated as read-only once they have been
signed.
There is an issue raised on the Jenkins Xcode plugin regarding this bug that concludes the bug lies in Xcrun.
As specified in another answer, you can also just not specify the distribution certificate to sign with and it will package correctly.

Resources