Skip to content

Commit c6ea30c

Browse files
authored
Instead of random file name, use a hash as a deterministic name for Swift source file list in _compile_swift_files (#33190)
1 parent 270b5dc commit c6ea30c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

stdlib/cmake/modules/SwiftSource.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -688,9 +688,9 @@ function(_compile_swift_files
688688
# need to work around this by avoiding long command line arguments. This can
689689
# be achieved by writing the list of file paths to a file, then reading that
690690
# list in the Python script.
691-
string(RANDOM file_name)
692-
set(file_path "${CMAKE_CURRENT_BINARY_DIR}/${file_name}.txt")
693691
string(REPLACE ";" "'\n'" source_files_quoted "${source_files}")
692+
string(SHA1 file_name "'${source_files_quoted}'")
693+
set(file_path "${CMAKE_CURRENT_BINARY_DIR}/${file_name}.txt")
694694
file(WRITE "${file_path}" "'${source_files_quoted}'")
695695

696696
# If this platform/architecture combo supports backward deployment to old
@@ -717,7 +717,7 @@ function(_compile_swift_files
717717
OUTPUT ${standard_outputs}
718718
DEPENDS
719719
${swift_compiler_tool_dep}
720-
${file_path} ${source_files} ${SWIFTFILE_DEPENDS}
720+
${source_files} ${SWIFTFILE_DEPENDS}
721721
${swift_ide_test_dependency}
722722
${create_dirs_dependency_target}
723723
${copy_legacy_layouts_dep}

0 commit comments

Comments
 (0)