I’m attempting to add Swift to the BYO HTTP Server challenge. I have read through the contributor guidelines, created a language folder in starter_templates, and added a docker file to dockerfiles. I ran the course-sdk test swift– everything looked pretty good and it started running tests on the app built by my code. I fixed some minor problems with my source code and tried to test again, but now I get an error I don’t know how to diagnose. It seems to be from the course-sdk-js-tools container.
@ShonFrazier I’ve been trying to replicate this but haven’t been able to yet. For context, the error occurs here:
That’s supposed to be listing all items under starter_templates/swift and then running stat on them. I’m sure there’s a simpler explanation here, but according to the code, the only expected case for this to fail would be if a file existed during glob and was deleted before fs.statSync ran, which seem… highly unlikely
@ShonFrazier some questions that could help narrow this down:
(a) Is this error persistent?
(b) Could you try adding a console.log to the line, re-compiling course-sdk and seeing what you get? i.e. apply this diff:
Question a): It is persistent. Cleaning and re-running the process results in the same error. I started from scratch on another Mac and got the same result.
Question b):
the last file logged before the error is .../build-your-own-http-server/starter_templates/swift/code/.build/x86_64-apple-macosx/debug/swift-nio_NIOPosix.bundle/PrivacyInfo.xcprivacy
that file is lrwxr-xr-x 1 shon staff 28B Jul 21 22:11 .../build-your-own-http-server/starter_templates/swift/code/.build/x86_64-apple-macosx/debug/swift-nio_NIOPosix.bundle/PrivacyInfo.xcprivacy@ -> ../../.PrivacyInfo.xcprivacy
Giving this a bit more thought, it might be the difference between lstat on Linux, and stat on macOS (instructions say to link lstat to stat.) I can see about running this all on a Linux VM or container.
This problem was with Docker itself. The version installed by apt did not include buildx. Installing Docker with instructions from the Docker website solved it.
Think I’ve found the error! This happened to me locally when trying to add OCaml support, and it was because the file was a broken symlink. Working on a fix…