Help with build project

Because you are running the frontend in -typecheck mode, which does not go beyond semantic analysis, aka type-checking. To compile all the way through and run, you can use the -interpret mode. -help for the list of modes and what they do.
docs/ for more details on some of these modes.

Ah, I see. swift-frontend builds only the compiler. If you added this property to the standard library, you need to rebuild it using e.g. the swift-stdlib-macosx-x86_64 target for the change to take effect.

1 Like

So if I ever edit anything in the swift frontend compiler (like AST or Type Checker), I need to run:
ninja -C build/DIR/swift-macos-arm64 bin/swift-frontend

if I edit a Boolean / Standard library, what command do I run?

To build a target, you pass that target to Ninja, as in ninja -C <build_dir> bin/swift-frontend, where the target is bin/swift-frontend. Run ninja -C <build_dir> -t targets all to get a list of all available targets. For the standard library, the swift-stdlib-macosx target will suffice just about always. That said, swift-stdlib-macosx will rebuild the entire standard library umbrella in the presence of compiler changes. If you modified just e.g. the core library sources and the compiler, and you need to rebuild that one library, you want swiftCore-macosx.

Or you could always run Ninja without a target to incrementally rebuild everything, but that would just slow down the feedback loop substantially.

Anthony I had no clue about this thank you very much for enlightening me with this information!

1 Like