WebKit Bugzilla
Attachment 358073 Details for
Bug 192391
: Use directory local sequential numbers for Unified Sources filenames instead of global sequential numbers for CMake
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192391-20181226134303.patch (text/plain), 6.82 KB, created by
Fujii Hironori
on 2018-12-25 20:43:04 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Fujii Hironori
Created:
2018-12-25 20:43:04 PST
Size:
6.82 KB
patch
obsolete
>Subversion Revision: 239551 >diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog >index 181e6b2f9f57ad4eaab5b5f036f344bced1816a1..09ac6360b9950cd179b8e92d09805de9c7f34277 100644 >--- a/Source/WTF/ChangeLog >+++ b/Source/WTF/ChangeLog >@@ -1,3 +1,21 @@ >+2018-12-25 Carlos Eduardo Ramalho <cadubentzen@gmail.com> and Fujii Hironori <Hironori.Fujii@sony.com> >+ >+ Use hash in Unified Sources filename instead of ascending integers >+ https://bugs.webkit.org/show_bug.cgi?id=192391 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Unified Source Builds are using UnifiedSource{sequential-number}.cpp. >+ With ascending integer, every new bundle added would shift the next ones and >+ prevent compiler caches from speeding up consecutive builds e.g. in git-bisect sessions. >+ >+ Changed it to UnifiedSource-{hash-of-dir-name}-{sequential-number-within-the-dir}.cpp. >+ >+ This is affecting only CMake builds which is where the '--use-hash-filenames' option is set. >+ Xcode builds still use the old convention. >+ >+ * Scripts/generate-unified-source-bundles.rb: Use a 12-characters SHA1 digest in filename when passed --use-hash-filenames option. >+ > 2018-12-21 Dan Bernstein <mitz@apple.com> > > Fixed building for macOS 10.13 using the macOS 10.14 SDK. >diff --git a/Source/WTF/Scripts/generate-unified-source-bundles.rb b/Source/WTF/Scripts/generate-unified-source-bundles.rb >index 8880e6f7488f11b7f4f9b597b0b9b2cba15713bc..5caf007cda49b667dfca501d608fe2a052bbc485 100644 >--- a/Source/WTF/Scripts/generate-unified-source-bundles.rb >+++ b/Source/WTF/Scripts/generate-unified-source-bundles.rb >@@ -21,6 +21,7 @@ > # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF > # THE POSSIBILITY OF SUCH DAMAGE. > >+require 'digest' > require 'fileutils' > require 'pathname' > require 'getoptlong' >@@ -49,6 +50,7 @@ def usage(message) > puts "--input-xcfilelist-path Path of the generated input .xcfilelist file" > puts "--output-xcfilelist-path Path of the generated output .xcfilelist file" > puts "--feature-flags (-f) Space or semicolon separated list of enabled feature flags" >+ puts "--use-hash-filenames Use a hash in unified source filenames instead of ascending integers" > puts > puts "Generation options:" > puts "--max-cpp-bundle-count Sets the limit on the number of cpp bundles that can be generated" >@@ -67,6 +69,7 @@ $inputXCFilelistPath = nil > $outputXCFilelistPath = nil > $maxCppBundleCount = nil > $maxObjCBundleCount = nil >+$useHashFilenames = false > > def log(text) > $stderr.puts text if $verbose >@@ -78,6 +81,7 @@ GetoptLong.new(['--help', '-h', GetoptLong::NO_ARGUMENT], > ['--source-tree-path', '-s', GetoptLong::REQUIRED_ARGUMENT], > ['--feature-flags', '-f', GetoptLong::REQUIRED_ARGUMENT], > ['--print-bundled-sources', GetoptLong::NO_ARGUMENT], >+ ['--use-hash-filenames', GetoptLong::NO_ARGUMENT], > ['--generate-xcfilelists', GetoptLong::NO_ARGUMENT], > ['--input-xcfilelist-path', GetoptLong::REQUIRED_ARGUMENT], > ['--output-xcfilelist-path', GetoptLong::REQUIRED_ARGUMENT], >@@ -108,6 +112,8 @@ GetoptLong.new(['--help', '-h', GetoptLong::NO_ARGUMENT], > $maxCppBundleCount = arg.to_i > when '--max-obj-c-bundle-count' > $maxObjCBundleCount = arg.to_i >+ when '--use-hash-filenames' >+ $useHashFilenames = true > end > } > >@@ -185,8 +191,10 @@ class BundleManager > @extension = extension > @fileCount = 0 > @bundleCount = 0 >+ @bundleCountInDirectory = 0 > @currentBundleText = "" > @maxCount = max >+ @currentDirectory = nil > end > > def writeFile(file, text) >@@ -202,7 +210,15 @@ class BundleManager > end > > def bundleFileName(number) >- @extension == "cpp" ? "UnifiedSource#{number}.#{extension}" : "UnifiedSource#{number}-#{extension}.#{extension}" >+ id = >+ if $useHashFilenames >+ # The dash makes the filenames more clear when using a hash. >+ hash = Digest::SHA1.hexdigest(@currentDirectory.to_s)[0..7] >+ "-#{hash}-#{@bundleCountInDirectory}" >+ else >+ number.to_s >+ end >+ @extension == "cpp" ? "UnifiedSource#{id}.#{extension}" : "UnifiedSource#{id}-#{extension}.#{extension}" > end > > def flush >@@ -210,6 +226,7 @@ class BundleManager > return if @currentBundleText == "" > > @bundleCount += 1 >+ @bundleCountInDirectory += 1 > bundleFile = bundleFileName(@bundleCount) > $generatedSources << $unifiedSourceOutputPath + bundleFile > >@@ -229,6 +246,12 @@ class BundleManager > def addFile(sourceFile) > path = sourceFile.path > raise "wrong extension: #{path.extname} expected #{@extension}" unless path.extname == ".#{@extension}" >+ if (TopLevelDirectoryForPath(@currentDirectory) != TopLevelDirectoryForPath(path.dirname)) >+ log("Flushing because new top level directory; old: #{@currentDirectory}, new: #{path.dirname}") >+ flush >+ @currentDirectory = path.dirname >+ @bundleCountInDirectory = 0 >+ end > if @fileCount == MAX_BUNDLE_SIZE > log("Flushing because new bundle is full (#{@fileCount} sources)") > flush >@@ -251,11 +274,6 @@ end > def ProcessFileForUnifiedSourceGeneration(sourceFile) > path = sourceFile.path > $inputSources << sourceFile.to_s >- if (TopLevelDirectoryForPath($currentDirectory) != TopLevelDirectoryForPath(path.dirname)) >- log("Flushing because new top level directory; old: #{$currentDirectory}, new: #{path.dirname}") >- $bundleManagers.each_value { |x| x.flush } >- $currentDirectory = path.dirname >- end > > bundle = $bundleManagers[path.extname] > if !bundle >diff --git a/Source/cmake/WebKitMacros.cmake b/Source/cmake/WebKitMacros.cmake >index 36e5a0200c92cd692445c1458741a3feab9e29ee..565a0c7a09ee66779821f81752867ba358471a8b 100644 >--- a/Source/cmake/WebKitMacros.cmake >+++ b/Source/cmake/WebKitMacros.cmake >@@ -21,6 +21,7 @@ macro(WEBKIT_COMPUTE_SOURCES _framework) > "--source-tree-path" ${CMAKE_CURRENT_SOURCE_DIR} > "--print-bundled-sources" > "--feature-flags" "${UNIFIED_SOURCE_LIST_ENABLED_FEATURES}" >+ "--use-hash-filenames" > ${_sourceListFileTruePaths} > RESULT_VARIABLE _resultTmp > OUTPUT_VARIABLE _outputTmp) >@@ -39,6 +40,7 @@ macro(WEBKIT_COMPUTE_SOURCES _framework) > "--derived-sources-path" "${DERIVED_SOURCES_DIR}/${_framework}" > "--source-tree-path" ${CMAKE_CURRENT_SOURCE_DIR} > "--feature-flags" "${UNIFIED_SOURCE_LIST_ENABLED_FEATURES}" >+ "--use-hash-filenames" > ${_sourceListFileTruePaths} > RESULT_VARIABLE _resultTmp > OUTPUT_VARIABLE _outputTmp)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192391
:
356571
|
356572
|
356658
|
356715
|
358073
|
358091
|
358576