Sorry if I'm being stupid here. I synched up my swift directory with GitHub - apple/swift: The Swift Programming Languagemain and tried to do a naive build, using utils/update-checkout to get all the relevant dependencies then tried build and test with utils/build-script --clean -R --skip-ios --skip-watchos --skip-tvos -t.
It builds cleanly but a lot of tests fail (400 or so). Is that expected or am I doing something wrong? Many of them error with <unknown>:0: error: unexpected remark produced: unable to perform implicit import of "_StringProcessing" module: no such module found
macOS is Sonoma (14.1.2), Xcode is 15.0.1, ninja and cmake are installed. I did a spot check of dependencies (python3, cmake, ninja) as suggested in the help and everything looks fine.
I assumed that if I just pulled the latest main (last night) it would have all tests passing, but maybe that's not always true? Happy to go back to a snapshot if that's better?
(I'm trying to get a green slate of tests so I can check for regressions on the patch I'm submitting and so I can add new tests for it.)
Ideally to get tests in the exactly same state passing as on CI, you have to build the exactly same preset that a CI job matching your machine uses. IIRC utils/build-script --clean -R --skip-ios --skip-watchos --skip-tvos -t doesn't match any of the existing presets.
No, you don't need those, the tests invoked by the -t option of build-script run on the Swift stdlib. Swift NIO, corelibs-foundation etc are built after the stdlib compilation steps and its test run have completed.
Thank you guys. I can work with this and I'll just ignore these two test fails for the purposes of preparing my patch.
FYI The SceneKit failure seems based around...
/Users/carl/Documents/Code/swift/swift/test/ClangImporter/SceneKit_test.swift:6:8: error: unexpected error produced: failed to build module 'SceneKit'; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 5.9 (swiftlang-18.104.22.168.203 clang-1500.0.37.1)', while this compiler is 'Swift version 5.11-dev (LLVM e2b71339d3295a4, Swift 8ae3c9ed005bee1)'). Please select a toolchain which matches the SDK.
So then expected errors aren't produced.
And python lint is expecting flake and flake8 to be installed...
The flake8 and flake8-import-order Python packages are required for linting,
but these were not found on your system.