WebKit Bugzilla
Attachment 358091 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-20181227115125.patch (text/plain), 5.20 KB, created by
Fujii Hironori
on 2018-12-26 18:51:26 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Fujii Hironori
Created:
2018-12-26 18:51:26 PST
Size:
5.20 KB
patch
obsolete
>Subversion Revision: 239554 >diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog >index 181e6b2f9f57ad4eaab5b5f036f344bced1816a1..76822921cd55cb3a56f6ea82837c936651262441 100644 >--- a/Source/WTF/ChangeLog >+++ b/Source/WTF/ChangeLog >@@ -1,3 +1,28 @@ >+2018-12-26 Carlos Eduardo Ramalho <cadubentzen@gmail.com> and Fujii Hironori <Hironori.Fujii@sony.com> >+ >+ Use directory local sequential numbers for Unified Sources filenames instead of global sequential numbers for CMake >+ https://bugs.webkit.org/show_bug.cgi?id=192391 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Unified Source Builds are using global sequential numbers for >+ bundle filenames UnifiedSource{sequential-number}.cpp. As the >+ result, every new source file added would shift the next ones and >+ prevent compiler caches from speeding up consecutive builds e.g. >+ in git-bisect sessions. >+ >+ Changed it to directory local sequential numbers, >+ UnifiedSource-{hash-of-dir-name}-{sequential-number-within-the-dir}.cpp. >+ >+ This is affecting only CMake builds which is where no >+ '--max-cpp-bundle-count' nor '--max-obj-c-bundle-count' options >+ are set. Xcode builds still use the old convention. >+ >+ * Scripts/generate-unified-source-bundles.rb: Add new instance >+ variables @bundleCountInDirectory and @currentDirectory to >+ BundleManager. Still use global sequential numbers if >+ --max-cpp-bundle-count or --max-obj-c-bundle-count is given. >+ > 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..fa539cee6bde1cc220da2f45124683a3eeec107f 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' >@@ -51,8 +52,8 @@ def usage(message) > puts "--feature-flags (-f) Space or semicolon separated list of enabled feature flags" > puts > puts "Generation options:" >- puts "--max-cpp-bundle-count Sets the limit on the number of cpp bundles that can be generated" >- puts "--max-obj-c-bundle-count Sets the limit on the number of Obj-C bundles that can be generated" >+ puts "--max-cpp-bundle-count Use global sequential numbers for cpp bundle filenames and set the limit on the number" >+ puts "--max-obj-c-bundle-count Use global sequential numbers for Obj-C bundle filenames and set the limit on the number" > exit 1 > end > >@@ -185,8 +186,10 @@ class BundleManager > @extension = extension > @fileCount = 0 > @bundleCount = 0 >+ @bundleCountInDirectory = 0 > @currentBundleText = "" > @maxCount = max >+ @currentDirectory = nil > end > > def writeFile(file, text) >@@ -202,7 +205,15 @@ class BundleManager > end > > def bundleFileName(number) >- @extension == "cpp" ? "UnifiedSource#{number}.#{extension}" : "UnifiedSource#{number}-#{extension}.#{extension}" >+ id = >+ if @maxCount >+ number.to_s >+ else >+ # The dash makes the filenames more clear when using a hash. >+ hash = Digest::SHA1.hexdigest(@currentDirectory.to_s)[0..7] >+ "-#{hash}-#{@bundleCountInDirectory}" >+ end >+ @extension == "cpp" ? "UnifiedSource#{id}.#{extension}" : "UnifiedSource#{id}-#{extension}.#{extension}" > end > > def flush >@@ -210,6 +221,7 @@ class BundleManager > return if @currentBundleText == "" > > @bundleCount += 1 >+ @bundleCountInDirectory += 1 > bundleFile = bundleFileName(@bundleCount) > $generatedSources << $unifiedSourceOutputPath + bundleFile > >@@ -229,6 +241,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 +269,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
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