Resolves https://github.com/tuist/tuist/issues/YYY
This fixes two SwiftPM prebuilt integration issues that show up with precompiled SwiftSyntax packages:
- Sanitizes control characters from paths decoded out of
workspace-state.json before converting them to AbsolutePath or RelativePath.
- Reuses the existing
/private/var normalization through the same path sanitization boundary for dependency, artifact, prebuilt, checkout, and include paths.
- Adds the prebuilt library directory to
LD_RUNPATH_SEARCH_PATHS so macro executables can locate Swift compatibility dylibs such as libswiftCompatibilitySpan.dylib at runtime.
- Covers both the path sanitization and runtime search path behavior in
TuistLoaderTests.
How to test locally
tuist generate TuistLoaderTests --no-open
xcodebuild test -workspace Tuist.xcworkspace -scheme TuistUnitTests -only-testing TuistLoaderTests/SwiftPackageManagerGraphLoaderTests/load_whenWorkspaceStateContainsPrebuilts_sanitizesPathsAndPassesPackagePrebuiltsToMapper -only-testing TuistLoaderTests/PackageInfoMapperTests/map_whenMacroTargetDependsOnPrebuiltProduct_usesPrebuiltSettings CODE_SIGNING_ALLOWED=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY=""