Title: [290883] trunk/Source/WebCore
Revision
290883
Author
[email protected]
Date
2022-03-07 04:43:32 -0800 (Mon, 07 Mar 2022)

Log Message

makeprop.pl breaks reproducible builds
https://bugs.webkit.org/show_bug.cgi?id=237521

Reviewed by Carlos Garcia Campos.

* css/makeprop.pl: Sort hash elements so the output file is always
the same across different builds.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (290882 => 290883)


--- trunk/Source/WebCore/ChangeLog	2022-03-07 11:47:23 UTC (rev 290882)
+++ trunk/Source/WebCore/ChangeLog	2022-03-07 12:43:32 UTC (rev 290883)
@@ -1,3 +1,13 @@
+2022-03-07  Alberto Garcia  <[email protected]>
+
+        makeprop.pl breaks reproducible builds
+        https://bugs.webkit.org/show_bug.cgi?id=237521
+
+        Reviewed by Carlos Garcia Campos.
+
+        * css/makeprop.pl: Sort hash elements so the output file is always
+        the same across different builds.
+
 2022-03-07  Nikolas Zimmermann  <[email protected]>
 
         Add hasTransformOrPerspective() helper to RenderObject

Modified: trunk/Source/WebCore/css/makeprop.pl (290882 => 290883)


--- trunk/Source/WebCore/css/makeprop.pl	2022-03-07 11:47:23 UTC (rev 290882)
+++ trunk/Source/WebCore/css/makeprop.pl	2022-03-07 12:43:32 UTC (rev 290883)
@@ -55,7 +55,7 @@
 my $jsonDecoder = JSON::PP->new->utf8;
 my $jsonHashRef = $jsonDecoder->decode($input);
 my $propertiesHashRef = $jsonHashRef->{properties};
-my @allNames = keys(%$propertiesHashRef);
+my @allNames = sort keys(%$propertiesHashRef);
 die "We've reached more than 1024 CSS properties, please make sure to update CSSProperty/StylePropertyMetadata accordingly" if @allNames > 1024;
 
 my %defines = map { $_ => 1 } split(/ /, $defines);
@@ -472,7 +472,7 @@
 {
     switch (id) {
 EOF
-  foreach my $name (keys %runtimeFlags) {
+  foreach my $name (sort keys %runtimeFlags) {
     print GPERF "    case CSSPropertyID::CSSProperty" . $nameToId{$name} . ":\n";
     print GPERF "        return RuntimeEnabledFeatures::sharedFeatures()." . $runtimeFlags{$name} . "Enabled();\n";
   }
@@ -500,7 +500,7 @@
     switch (id) {
 EOF
 
-foreach my $name (keys %settingsFlags) {
+foreach my $name (sort keys %settingsFlags) {
   print GPERF "    case CSSPropertyID::CSSProperty" . $nameToId{$name} . ":\n";
   print GPERF "        return settings->" . $settingsFlags{$name} . "();\n";
 }
@@ -647,8 +647,8 @@
 {
     switch (id) {
 EOF
-for my $logicalPropertyGroup (values %logicalPropertyGroups) {
-    for my $name (values %{ $logicalPropertyGroup->{"logical"} }) {
+for my $logicalPropertyGroup (sort values %logicalPropertyGroups) {
+    for my $name (sort values %{ $logicalPropertyGroup->{"logical"} }) {
         print GPERF "    case CSSPropertyID::CSSProperty" . $nameToId{$name} . ":\n";
     }
 }
@@ -665,9 +665,9 @@
     switch (id) {
 EOF
 
-for my $logicalPropertyGroup (values %logicalPropertyGroups) {
+for my $logicalPropertyGroup (sort values %logicalPropertyGroups) {
     for my $kind ("logical", "physical") {
-        for my $name (values %{ $logicalPropertyGroup->{$kind} }) {
+        for my $name (sort values %{ $logicalPropertyGroup->{$kind} }) {
             print GPERF "    case CSSPropertyID::CSSProperty" . $nameToId{$name} . ":\n";
         }
     }
@@ -685,16 +685,18 @@
     switch (id1) {
 EOF
 
-for my $logicalPropertyGroup (values %logicalPropertyGroups) {
+for my $logicalPropertyGroup (sort values %logicalPropertyGroups) {
     my $logical = $logicalPropertyGroup->{"logical"};
     my $physical = $logicalPropertyGroup->{"physical"};
     for my $first ($logical, $physical) {
         my $second = $first eq $logical ? $physical : $logical;
-        while (my ($resolver, $name) = each %{ $first }) {
+        for my $resolver (sort keys %{ $first }) {
+            my $name = $first->{$resolver};
             print GPERF "    case CSSPropertyID::CSSProperty" . $nameToId{$name} . ":\n";
         }
         print GPERF "        switch (id2) {\n";
-        while (my ($resolver, $name) = each %{ $second }) {
+        for my $resolver (sort keys %{ $second }) {
+            my $name = $second->{$resolver};
             print GPERF "        case CSSPropertyID::CSSProperty" . $nameToId{$name} . ":\n";
         }
         print GPERF << "EOF";
@@ -718,8 +720,9 @@
     switch (propertyID) {
 EOF
 
-for my $logicalPropertyGroup (values %logicalPropertyGroups) {
-    while (my ($resolver, $name) = each %{ $logicalPropertyGroup->{"logical"} }) {
+for my $logicalPropertyGroup (sort values %logicalPropertyGroups) {
+    for my $resolver (sort keys %{ $logicalPropertyGroup->{"logical"} }) {
+        my $name = $logicalPropertyGroup->{"logical"}->{$resolver};
         my $kind = $logicalPropertyGroup->{"kind"};
         my $kindId = nameToId($kind);
         my $resolverEnum = "LogicalBox" . $kindId . "::" . nameToId($resolver);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to