Closed LinusU closed 6 years ago
Thank you for opening the issue. I have experienced this myself, too.
I guessed that /usr/bin/env swift
is not exactly the same swift SDE used as I usually use swiftenv, but SDE does not and I have a global config for that.
Although I have never validated this assumption.
It would be awesome if you could play a bit around with the swift.path.swift_driver_bin
-setting or even debug a bit because I won't have enough time this week.
Hmm, the only swift I'm using is /usr/bin/swift
, as far as I know I don't have multiple versions installed.
The strange thing is, as far as I can tell, this package just spawn(swiftBinPath, ['build'])
and I've just set swiftBinPath
to /usr/bin/swift
. It should be exactly the same, but for some reason, the cache gets invalidated 🤔
Will try to investigate some more...
That seems strange. Maybe there are some relevant differences within the environment?
Maybe setting the path to the expansion of /Applications/Xcode.app/**/bin/swift
helps?
But besides that, I’ve got no idea yet.
@LinusU I could not find a solution on this by now. As a workaround we could add a new setting to allow passing a custom build path if this issue becomes too big.
This would additionally help others who want to automatically build their tests like https://github.com/jinmingjian/sde/pull/32, too.
Whenever I save a file in an SPM project,
swift build
will automatically be run. After that has happened, runningswift test
from my terminal rebuilds all dependencies and the source.This is not the case if I just run
swift build
and thenswift test
straight from my terminal.I can also see the issue in reverse, that is, after I have run
swift build
orswift test
from the terminal, the build time is much longer in VS Code.This leads to the very annoying workflow that I save a test file, then wait for everything to be rebuilt from scratch in VS Code, then finally run
swift test
which again rebuilds everything from scratch, and then runs the tests.Happy to provide any more information that might be relevant ☺️