Cloning a git repo in Xcode means unit test do not run - xcode

I have worked on machine A on an Xcode project, which is linked to a bitbucket git repo. All up-to-date and committed, unit tests run fine.
Now I want to work on it on machine B. I fire up Xcode, clone the repository, and all the files are there in my project. I press cmd-U to run the unit tests, and they 'pass' in lightning speed, or rather, they do not run at all. This is the error message I get:
objc[6434]: GC: forcing GC OFF because OBJC_DISABLE_GC is set
2013-06-11 10:20:05.935 otest[6434:303] The test bundle at /Users/oliver/Library/Developer/Xcode/DerivedData/TextToolsSystem-celmxjqlddjrjvblrklrnvdpytux/Build/Products/Debug/TextToolsSystemTests.octest could not be loaded because a link error occurred. It is likely that dyld cannot locate a framework framework or library that the the test bundle was linked against, possibly because the framework or library had an incorrect install path at link time.
2013-06-11 10:20:05.942 otest[6436:203] *** NSTask: Task create for path '
TextToolsSystemTests' failed: 22, "Invalid argument". Terminating temporary process.
The project does not use any additional frameworks or libraries, and works fine on machine A. A listing of the mentioned directory yields
total 192
-rwxr-xr-x 1 oliver staff 96604 11 Jun 10:20 TextToolsSystemTests
and that file is a Mach-O 64-bit bundle x86_64.
Machine A: MBP, OS X 10.8.2, Xcode 4.6.2
Machine B: MBA, OS X 10.7.5, Xcode 4.6.2
Building the project gives no error (it hasn't got an executable yet that could be run)
Are there any settings that I need to adjust to make it work which the cloning did not carry over?

OK, after some digging I found the solution:
I used otool -L to list the required libraries that the target was referencing (thanks to this question for reference).
Then I manually added in all the libraries/frameworks, even though they're CoreFoundation etc, which would normally not be required. However, it also included libobjc.A.dylib.
Now I was getting a different error, dyld: lazy symbol binding failed: Symbol not found: _objc_setProperty_atomic, which was expected in that library.
I then searched for that error message, and it lead me to this question, which had no accepted answer, but in a comment stated The problem for me was that I had a framework included with deployment target 6.0. After having recompiled it with deployment target 5.0, resulting in all projects and sub-projects being built with deployment target 5.0, everything worked.
I checked the OS X deployment target, and it was set to 10.8–but machine B only runs 10.7! So I changed the target to 10.7, and then it worked.
So, to summarise: the issue was that the deployment target was set to an OS revision which was higher than that of the current machine. Duh!

Related

XCode standard C++ headers suddenly not found before installing OSX update

I have a C++ project that have been compiling fine until now, I did not install any update of my system or XCode but I get this error:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/wchar.h:123:15: fatal error: 'wchar.h' file not found
This file does exist on my system, so I suppose it's the CMake env paths that are no longer set up properly in the console?
Edit: if I clean my build dir and regenerate the whole CMake project, it is working again, but I still find this behaviour very unpleasant.
This has happened just when there was an available update for MacOS 13.0, and probably XCode updates going with it. But I did not install any of them yet, and my compilation is already broken.
What is happening so that the dev env is changed anyway?
I remember I had likewise issues last time there was an OS update.
Is any configuration needed to "secure" a dev env on MacOS?
Are all OS updates going to screw my XCode includes etc?

Error Compiling Publish (Sundell) from Manifest File

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.

Getting "Library not loaded: #rpath/libswiftSwiftOnoneSupport.dylib" error

The problem occurred when I adding Nimble as a git submodule. I've fired an issue on Quick/Nimble, but the problem appears to be not likely a Nimble issue, it maybe rather an Xcode issue, thus I'm asking here.
I set up a simple project according to Nimble installation guid and it's on github now. Basically I created an xcworkspace and an xcodeproj (added to the workspace). Nimble is added as git submodule and subproject to the workspace. Then I added Nimble.framework to my test targets Build Phases and wrote some simple test code to see if Nimble was running.
And when I run the test, Xcode gave this error message:
2017-02-20 23:41:29.482 xctest[52165:616190] The bundle “MainProjTests” couldn’t be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle.
2017-02-20 23:41:29.483 xctest[52165:616190] (dlopen_preflight(/Users/nandiin/Library/Developer/Xcode/DerivedData/NimbleIssue-fkhppktoktwpjodtarmzrjobszwv/Build/Products/Debug-iphonesimulator/MainProjTests.xctest/MainProjTests): Library not loaded: #rpath/libswiftSwiftOnoneSupport.dylib
Referenced from: /Users/nandiin/Library/Developer/Xcode/DerivedData/NimbleIssue-fkhppktoktwpjodtarmzrjobszwv/Build/Products/Debug-iphonesimulator/Nimble.framework/Nimble
Reason: image not found)
Program ended with exit code: 82
I've tried some solution I found for similar problems and they didn't work:
setting Embed Asset Packs In Product Bundle to YES (tried for both main target and test target)
setting Always Embed Swift Standard Libraries to YES (tried for both main target and test target)
The issue is the run path for the dynamic library:
libswiftSwiftOnoneSupport.dylib
If this is not included in the app bundle after building your app you'll want to add it by including it in the Copy Files Build Phase. Another possible problem could be that it's run path is not correctly set ( which you'll need to set if not already ), or fix the rpath with install_name_tool.
↳ Run-Path Dependent Libraries

.NET Core installation on Mac OS X

I have a problem with .NET Core installation on Mac OS X (El Capitan 10.11). Generally, I did everything as MS documentation said but when I'm trying to test the installation (dotnet new) I get an error:
Unhandled Exception: System.TypeInitializationException: The type
initializer for 'Crypto' threw an exception. --->
System.TypeInitializationException: The type initializer for
'CryptoInitializer' threw an exception. --->
System.DllNotFoundException: Unable to load DLL
'System.Security.Cryptography.Native': The specified module could not
be found.
I was trying to deploy .NET core through manual process, i.e. downloaded all the packages from Git, install mandatory libraries (like openssl) via Homebrew and start compiling. Coreclr has compiled well, but corefx gives errors resembling to what I received with automatic installation:
In file included from
/usr/local/git/corefx/src/Native/Unix/System.Security.Cryptography.Native/pal_ecdsa.cpp:5:
/usr/local/git/corefx/src/Native/Unix/System.Security.Cryptography.Native/pal_ecdsa.h:7:10:
fatal error: 'openssl/ecdsa.h' file not found
include
^ make[2]: *** [System.Security.Cryptography.Native/CMakeFiles/System.Security.Cryptography.Native.dir/pal_bignum.cpp.o]
Error 1
I looked through the interned for possible solution with no luck. I cannot get one thing... if openssl lib is deprecated, why in the world MS keeps using it, as it obviously causes a lot of pain in well known place.
Has anybody managed to run .NET core on Mac, having the issue I described above?
After a while, I decided to reinstall everything from scratch. I have deleted git repo with dotnetfx source, cleaned out 'lib' and 'opt' folders (from 'openssl'), deleted Cellar folder (where 'openssl' reside). Once I did all this, I've started a new installation and followed instructions published on the official resource This time it all been deployed and works like a charm.

How do you install or upgrade to a release candidate of TortoiseSVN?

I've never had cause to use a nightly build or a release candidate of TortoiseSVN before but when trying to create a patch, I got the following crash dump page: https://drdump.com/UploadedReport.aspx?ProblemID=175094&DumpID=8037510
I'd like to try out the fix that is mentioned but I really don't know what to do with the DLLs and ZIP files located at https://nightlybuilds.tortoisesvn.net/1.9.x/x64/full/
From the instruction in the web site
The 'Latest/' folder contains files which are built daily from the HEAD
revision of TSVN trunk code, which is useful for testing the latest changes.
These are not official released files, so any new features may not have
been extensively tested.
You can take the files from the Latest build and replace the files in your local directory. Make sure to make a copy of the files you have locally in a separate directory so that you can fallback.
I believe the last build succeeded but upload of the Installer have failed. You might want to followup in their mailing list.
[exec] Uploading...
[exec] ERROR: SOAP 1.2 fault: SOAP-ENV:Sender[no subcode]
[exec] "HttpSendRequest failed"
[exec] Detail: The operation timed out
The nightly builds failed for several reasons (symbol server was down because of network and HDD issues and certificate had to be renewed)
Now you an download the nightlies again.
Get here the nightly for the trunk builds and 1.9 builds. Install the MSI just like you do with normal releases.

Resources