Hive Hive
Sign in

fix(cli): sanitize SwiftPM prebuilt paths

GitHub issue · Closed

Metadata
Source
tuist/tuist #11194
Updated
Jun 24, 2026
Domains
Generated projects
Details

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=""
Comments
TA
tuist-atlas[bot] Jun 21, 2026

SwiftPM prebuilt path sanitization is now available in 4.201.0-canary.19. This fixes issues with control characters and /private/var normalization in paths decoded from workspace-state.json, and adds prebuilt library directories to LD_RUNPATH_SEARCH_PATHS for macro executables. Update to 4.201.0-canary.19 to get this fix.