Can't compile swift

Hi, I'm using gentoo linux, and I can't found any swift package. So, I have to compile it.

after clone, I'm running following code to compile

utils/update-checkout --clone
./swift/utils/build-toolchain gentoo

get error

-- Building Swift auxiliary executables for SDKs: LINUX
-- 
-- Building Swift Remote Mirror for SDKs: LINUX
-- 
CMake Error at cmake/modules/SwiftUtils.cmake:116 (get_filename_component):
  get_filename_component called with incorrect number of arguments
Call Stack (most recent call first):
  stdlib/cmake/modules/SwiftSource.cmake:891 (get_bootstrapping_swift_lib_dir)
  stdlib/cmake/modules/SwiftSource.cmake:141 (_compile_swift_files)
  stdlib/cmake/modules/AddSwiftStdlib.cmake:1023 (handle_swift_sources)
  stdlib/cmake/modules/AddSwiftStdlib.cmake:2478 (add_swift_target_library_single)
  stdlib/public/Cxx/CMakeLists.txt:9 (add_swift_target_library)

Hi @srbok! While it's not official, there is a Swift package available via GURU: Swift 5.10.1 for Gentoo on GURU Installation should hopefully be very straightforward!

I'm currently actively working on packaging up Swift 6.0.1 — if you're willing to wait a few days, I'm hoping it should be available very soon. (If you expect to want Swift 6+ in general, I'd recommend waiting until it's available; compiling Swift 6 and later will require bootstrapping with an earlier version of Swift, and unfortunately, the changes incoming will require a recompilation of Swift 5.10.1 if you have it installed.)

3 Likes

Very thanks.