Fix functional build tests for swiftpm target #24
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
All of the
FunctionalBuildTests
is now failing when testing in Xcode with Cmd+U.It seems that the executable file
swift-build
is placed under.build/.bootstrap/bin
. At the same time, theResources.computeResourcesPaths()
is using "SPM_INSTALL_PATH" environment variable to search the built product. However, the install path is set to$(PROJECT_DIR)/../.build
. This leads the correct executable could not be found and the defaultswift-build
is returned.So invoking of
executeSwiftBuild(_:)
will always fail if theswift-build
could not be found in system search path. Even it is there, the executable might be an older one instead of newly built file. This might not be the expected behavior.Fix
Simply changing the "SPM_INSTALL_PATH" from
$(PROJECT_DIR)/../.build
to$(PROJECT_DIR)/../.build/.bootstrap
would solve it and make all tests green.P.S.
Everything goes well when using bootstrap script.
./Utilities/bootstrap --build-tests test
Since the
sandbox_path
is set correctly.