-
-
Notifications
You must be signed in to change notification settings - Fork 159
Local testing on Mac not working (fix inside) #760
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
Comments
I am not really sure what this issue has to do with this repo? Feels like a swift issue or xcode issue. I use Swift frequently on Linux which have worst support than mac and xctest is builtin into the swift package and also which swift version do you use? |
I wanted to raise the potential issue with the docs of the Swift track, sorry if that wasn't clear. The issue might have occured on my system because I also installed the XCode 16 Beta in parallel. I am using the following swift version: |
Having run into this issue myself here is what I can say. I reckon the CLI users are a subset of the folks using this site. However, it is a bad experience to have the CLI fail straight out of the gate on the very first task for the Swift track. The issue is fairly simple once you know about it, but finding out about it can be difficult to understand, and especially for a beginner programmer may just turn them off of Swift in general. I believe this could be fixed up with a little documentation, the gist of it is fairly simple: You will need to have Xcode installed to use the Swift track locally. The command line tools Apple provides contain only a subset of the functionality that Xcode provides and do not include XCTest which is needed. If the user has both the command line tools and Xcode installed running xcode-select to point at the Xcode install will be necessary. I can write up a PR on this, though you closed my last one saying you were in the middle of a rewrite so perhaps best if you do @meatball133? To me, though this is a minor point and only affects a small portion of folks, I believe it is still a very important point. The experience for people to begin learning Swift should be easy and as clear as possible. |
A few hours before this I actually rewrote the installation docs(#840), pointing to that if you aren't using/want to be using Xcode, you should install the binary separately. Meaning if you are planning to use editors other than XCode we will discourage you install Swift through Xcode. What I understand the problem being is that you have installed Swift through xcode and then installed command line tools and then that doesn't automatically link the sdk. I have done a bit of research and this seems to be a quite common issue, but a quite common thing I found was that said person didn't use or want to use Xcode. I am not using macOS so it is a bit hard to test what the experience is like. And how testing works without using the command line. What I mostly have to go of is what other people say and what Apple points at. Also just to double check, are you using Xcode 16.x? If so we might put the first solution here, if your use case couldn't be satisfied through the non-Xcode path (if you are not using Xcode to begin with so to speak), but we can't have a full troubleshooting guide since that is just not possible. |
Assuming this is being written for beginners, the simplest thing to say in an installation document is along these lines: If you wish to run the exercises locally on MacOS, install Xcode, you do to have to use Xcode, but Xcode includes all of the needed libraries to work. If you have both Xcode and the command line tools installed, run Anything beyond that in my opinion becomes full blown troubleshooting, but to the best of my knowledge this should get folks through 90% of the trouble. Insert appropriate links like to the exercism CLI docs, Apple's site for the CLI tools and Xcode in the App Store. |
And yes, I am running Xcode 16.2 and had had the Xcode Command Line tools installed which made the tests fail due to not having XCTest included in them. |
A common error is occuring because of incorrect SDK paths.
You can fix this error as followed:
You might get this result:
Now change the default SDK location by invoking the following command:
If that also does not work, please take a look inside the regular SDK path:
Normally you should see the SDKs inside this directory. If not, you'll need to download the SDKs first.
The text was updated successfully, but these errors were encountered: