brookinc/swift-linux-vagrant

SwiftLint build fails with "could not find the `swiftc`" on Windows 10

Closed this issue · 1 comments

When INSTALL_SWIFTLINT is set to true in Vagrantboot.sh, the following build / provisioning error can occur in a Windows environment:

    ...
    default: Cloning into '/home/vagrant/swiftlinttemp'...
    default: /home/vagrant/swiftlinttemp /vagrant/swift
    default: error:
    default: could not find the `swiftc` at expected path /vagrant/swift/swift-4.1.2-RELEASE-ubuntu16.04/usr/bin/swiftc

When this happens, inspection of the given usr/bin directory will likely indicate that, indeed, there is no swiftc file there -- swiftc is a symlink, and there are three main reasons that it might not be successfully created in a Windows environment:

I will investigate further to see which of those factors are at play in this case.

In my test case, I was running as a Windows user with Administrator privileges, including SeCreateSymbolicLinkPrivilege, so that wasn't the issue. Enabling SharedFoldersEnableSymlinksCreate in the Vagrantfile did not resolve the issue for me, but running my command prompt as administrator did -- so that step appears to be a necessary workaround in the Windows environment for now to build SwiftLint (and presumably any build tasks that require swiftc or other standard Swift symlinks).