mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
serialization: obfuscate the serialized search paths
We noticed some Swift clients rely on the serialized search paths in the module to find dependencies and droping these paths altogether can lead to build failures like rdar://85840921. This change teaches the serialization to obfuscate the search paths and the deserialization to recover them. This allows clients to keep accessing these paths without exposing them when shipping the module to other users.
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
|
||||
#include "swift/Basic/FileTypes.h"
|
||||
#include "swift/Basic/Version.h"
|
||||
#include "swift/Basic/PathRemapper.h"
|
||||
#include "swift/Frontend/FrontendInputsAndOutputs.h"
|
||||
#include "swift/Frontend/InputFile.h"
|
||||
#include "llvm/ADT/Hashing.h"
|
||||
@@ -437,6 +438,10 @@ public:
|
||||
/// Whether to include symbols with SPI information in the symbol graph.
|
||||
bool IncludeSPISymbolsInSymbolGraph = false;
|
||||
|
||||
/// This is used to obfuscate the serialized search paths so we don't have
|
||||
/// to encode the actual paths into the .swiftmodule file.
|
||||
PathObfuscator serializedPathObfuscator;
|
||||
|
||||
private:
|
||||
static bool canActionEmitDependencies(ActionType);
|
||||
static bool canActionEmitReferenceDependencies(ActionType);
|
||||
|
||||
Reference in New Issue
Block a user