Skip to content

Commit f9f6953

Browse files
authored
Revert "[Impeller] Make incremental builds faster when tinkering on the compiler." (flutter#167965)
Reverts flutter#167492 Makes things slower if the sources are newer than the outputs.
1 parent b0e52e5 commit f9f6953

File tree

7 files changed

+40
-123
lines changed

7 files changed

+40
-123
lines changed

engine/src/flutter/ci/licenses_golden/licenses_flutter

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51084,8 +51084,6 @@ ORIGIN: ../../../flutter/impeller/compiler/compiler_test.cc + ../../../flutter/L
5108451084
ORIGIN: ../../../flutter/impeller/compiler/compiler_test.h + ../../../flutter/LICENSE
5108551085
ORIGIN: ../../../flutter/impeller/compiler/constants.cc + ../../../flutter/LICENSE
5108651086
ORIGIN: ../../../flutter/impeller/compiler/constants.h + ../../../flutter/LICENSE
51087-
ORIGIN: ../../../flutter/impeller/compiler/filesystem.cc + ../../../flutter/LICENSE
51088-
ORIGIN: ../../../flutter/impeller/compiler/filesystem.h + ../../../flutter/LICENSE
5108951087
ORIGIN: ../../../flutter/impeller/compiler/impellerc_main.cc + ../../../flutter/LICENSE
5109051088
ORIGIN: ../../../flutter/impeller/compiler/include_dir.h + ../../../flutter/LICENSE
5109151089
ORIGIN: ../../../flutter/impeller/compiler/includer.cc + ../../../flutter/LICENSE
@@ -54076,8 +54074,6 @@ FILE: ../../../flutter/impeller/compiler/compiler_test.cc
5407654074
FILE: ../../../flutter/impeller/compiler/compiler_test.h
5407754075
FILE: ../../../flutter/impeller/compiler/constants.cc
5407854076
FILE: ../../../flutter/impeller/compiler/constants.h
54079-
FILE: ../../../flutter/impeller/compiler/filesystem.cc
54080-
FILE: ../../../flutter/impeller/compiler/filesystem.h
5408154077
FILE: ../../../flutter/impeller/compiler/impellerc_main.cc
5408254078
FILE: ../../../flutter/impeller/compiler/include_dir.h
5408354079
FILE: ../../../flutter/impeller/compiler/includer.cc

engine/src/flutter/impeller/compiler/BUILD.gn

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ impeller_component("compiler_lib") {
3838
"compiler_backend.h",
3939
"constants.cc",
4040
"constants.h",
41-
"filesystem.cc",
42-
"filesystem.h",
4341
"include_dir.h",
4442
"includer.cc",
4543
"includer.h",

engine/src/flutter/impeller/compiler/compiler_test.cc

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@
33
// found in the LICENSE file.
44

55
#include "impeller/compiler/compiler_test.h"
6+
#include "flutter/fml/paths.h"
7+
#include "flutter/fml/process.h"
68

79
#include <algorithm>
810
#include <filesystem>
911

10-
#include "flutter/fml/paths.h"
11-
#include "flutter/fml/process.h"
12-
#include "impeller/compiler/filesystem.h"
13-
1412
namespace impeller {
1513
namespace compiler {
1614
namespace testing {
@@ -121,9 +119,9 @@ bool CompilerTest::CanCompileAndReflect(const char* fixture_name,
121119
return false;
122120
}
123121

124-
if (!WriteAtomicallyIfChanged(intermediates_directory_,
125-
SPIRVFileName(fixture_name).c_str(),
126-
*spirv_assembly)) {
122+
if (!fml::WriteAtomically(intermediates_directory_,
123+
SPIRVFileName(fixture_name).c_str(),
124+
*spirv_assembly)) {
127125
VALIDATION_LOG << "Could not write SPIRV intermediates.";
128126
return false;
129127
}
@@ -134,9 +132,9 @@ bool CompilerTest::CanCompileAndReflect(const char* fixture_name,
134132
return false;
135133
}
136134

137-
if (!WriteAtomicallyIfChanged(intermediates_directory_,
138-
SLFileName(fixture_name, GetParam()).c_str(),
139-
*sl_source)) {
135+
if (!fml::WriteAtomically(intermediates_directory_,
136+
SLFileName(fixture_name, GetParam()).c_str(),
137+
*sl_source)) {
140138
VALIDATION_LOG << "Could not write SL intermediates.";
141139
return false;
142140
}
@@ -168,23 +166,23 @@ bool CompilerTest::CanCompileAndReflect(const char* fixture_name,
168166
return false;
169167
}
170168

171-
if (!WriteAtomicallyIfChanged(intermediates_directory_,
172-
ReflectionHeaderName(fixture_name).c_str(),
173-
*reflection_header)) {
169+
if (!fml::WriteAtomically(intermediates_directory_,
170+
ReflectionHeaderName(fixture_name).c_str(),
171+
*reflection_header)) {
174172
VALIDATION_LOG << "Could not write reflection header intermediates.";
175173
return false;
176174
}
177175

178-
if (!WriteAtomicallyIfChanged(intermediates_directory_,
179-
ReflectionCCName(fixture_name).c_str(),
180-
*reflection_source)) {
176+
if (!fml::WriteAtomically(intermediates_directory_,
177+
ReflectionCCName(fixture_name).c_str(),
178+
*reflection_source)) {
181179
VALIDATION_LOG << "Could not write reflection CC intermediates.";
182180
return false;
183181
}
184182

185-
if (!WriteAtomicallyIfChanged(intermediates_directory_,
186-
ReflectionJSONName(fixture_name).c_str(),
187-
*reflection_json)) {
183+
if (!fml::WriteAtomically(intermediates_directory_,
184+
ReflectionJSONName(fixture_name).c_str(),
185+
*reflection_json)) {
188186
VALIDATION_LOG << "Could not write reflection json intermediates.";
189187
return false;
190188
}

engine/src/flutter/impeller/compiler/filesystem.cc

Lines changed: 0 additions & 33 deletions
This file was deleted.

engine/src/flutter/impeller/compiler/filesystem.h

Lines changed: 0 additions & 40 deletions
This file was deleted.

engine/src/flutter/impeller/compiler/impellerc_main.cc

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include "flutter/fml/file.h"
1111
#include "flutter/fml/mapping.h"
1212
#include "impeller/compiler/compiler.h"
13-
#include "impeller/compiler/filesystem.h"
1413
#include "impeller/compiler/runtime_stage_data.h"
1514
#include "impeller/compiler/shader_bundle.h"
1615
#include "impeller/compiler/source_options.h"
@@ -108,10 +107,10 @@ static bool OutputIPLR(
108107
std::cerr << "Runtime stage data could not be created." << std::endl;
109108
return false;
110109
}
111-
if (!WriteAtomicallyIfChanged(*switches.working_directory, //
112-
Utf8FromPath(switches.sl_file_name).c_str(), //
113-
*stage_data_mapping //
114-
)) {
110+
if (!fml::WriteAtomically(*switches.working_directory, //
111+
Utf8FromPath(switches.sl_file_name).c_str(), //
112+
*stage_data_mapping //
113+
)) {
115114
std::cerr << "Could not write file to " << switches.sl_file_name
116115
<< std::endl;
117116
return false;
@@ -132,9 +131,9 @@ static bool OutputSLFile(const Compiler& compiler, const Switches& switches) {
132131

133132
auto sl_file_name = std::filesystem::absolute(
134133
std::filesystem::current_path() / switches.sl_file_name);
135-
if (!WriteAtomicallyIfChanged(*switches.working_directory,
136-
Utf8FromPath(sl_file_name).c_str(),
137-
*compiler.GetSLShaderSource())) {
134+
if (!fml::WriteAtomically(*switches.working_directory,
135+
Utf8FromPath(sl_file_name).c_str(),
136+
*compiler.GetSLShaderSource())) {
138137
std::cerr << "Could not write file to " << switches.sl_file_name
139138
<< std::endl;
140139
return false;
@@ -154,7 +153,7 @@ static bool OutputReflectionData(const Compiler& compiler,
154153
if (!switches.reflection_json_name.empty()) {
155154
auto reflection_json_name = std::filesystem::absolute(
156155
std::filesystem::current_path() / switches.reflection_json_name);
157-
if (!WriteAtomicallyIfChanged(
156+
if (!fml::WriteAtomically(
158157
*switches.working_directory,
159158
Utf8FromPath(reflection_json_name).c_str(),
160159
*compiler.GetReflector()->GetReflectionJSON())) {
@@ -168,7 +167,7 @@ static bool OutputReflectionData(const Compiler& compiler,
168167
auto reflection_header_name =
169168
std::filesystem::absolute(std::filesystem::current_path() /
170169
switches.reflection_header_name.c_str());
171-
if (!WriteAtomicallyIfChanged(
170+
if (!fml::WriteAtomically(
172171
*switches.working_directory,
173172
Utf8FromPath(reflection_header_name).c_str(),
174173
*compiler.GetReflector()->GetReflectionHeader())) {
@@ -182,10 +181,9 @@ static bool OutputReflectionData(const Compiler& compiler,
182181
auto reflection_cc_name =
183182
std::filesystem::absolute(std::filesystem::current_path() /
184183
switches.reflection_cc_name.c_str());
185-
if (!WriteAtomicallyIfChanged(
186-
*switches.working_directory,
187-
Utf8FromPath(reflection_cc_name).c_str(),
188-
*compiler.GetReflector()->GetReflectionCC())) {
184+
if (!fml::WriteAtomically(*switches.working_directory,
185+
Utf8FromPath(reflection_cc_name).c_str(),
186+
*compiler.GetReflector()->GetReflectionCC())) {
189187
std::cerr << "Could not write reflection CC to "
190188
<< switches.reflection_cc_name << std::endl;
191189
return false;
@@ -221,9 +219,9 @@ static bool OutputDepfile(const Compiler& compiler, const Switches& switches) {
221219
}
222220
auto depfile_path = std::filesystem::absolute(
223221
std::filesystem::current_path() / switches.depfile_path.c_str());
224-
if (!WriteAtomicallyIfChanged(
225-
*switches.working_directory, Utf8FromPath(depfile_path).c_str(),
226-
*compiler.CreateDepfileContents({result_file}))) {
222+
if (!fml::WriteAtomically(*switches.working_directory,
223+
Utf8FromPath(depfile_path).c_str(),
224+
*compiler.CreateDepfileContents({result_file}))) {
227225
std::cerr << "Could not write depfile to " << switches.depfile_path
228226
<< std::endl;
229227
return false;
@@ -283,9 +281,9 @@ bool Main(const fml::CommandLine& command_line) {
283281

284282
auto spriv_file_name = std::filesystem::absolute(
285283
std::filesystem::current_path() / switches.spirv_file_name);
286-
if (!WriteAtomicallyIfChanged(*switches.working_directory,
287-
Utf8FromPath(spriv_file_name).c_str(),
288-
*compiler.GetSPIRVAssembly())) {
284+
if (!fml::WriteAtomically(*switches.working_directory,
285+
Utf8FromPath(spriv_file_name).c_str(),
286+
*compiler.GetSPIRVAssembly())) {
289287
std::cerr << "Could not write file to " << switches.spirv_file_name
290288
<< std::endl;
291289
return false;

engine/src/flutter/impeller/compiler/shader_bundle.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
#include "impeller/compiler/source_options.h"
99
#include "impeller/compiler/types.h"
1010

11-
#include "impeller/compiler/filesystem.h"
1211
#include "impeller/compiler/utilities.h"
12+
#include "impeller/runtime_stage/runtime_stage.h"
1313
#include "impeller/shader_bundle/shader_bundle_flatbuffers.h"
1414
#include "third_party/json/include/nlohmann/json.hpp"
1515

@@ -235,10 +235,10 @@ bool GenerateShaderBundle(Switches& switches) {
235235
auto sl_file_name = std::filesystem::absolute(
236236
std::filesystem::current_path() / switches.sl_file_name);
237237

238-
if (!WriteAtomicallyIfChanged(*switches.working_directory, //
239-
Utf8FromPath(sl_file_name).c_str(), //
240-
*mapping //
241-
)) {
238+
if (!fml::WriteAtomically(*switches.working_directory, //
239+
Utf8FromPath(sl_file_name).c_str(), //
240+
*mapping //
241+
)) {
242242
std::cerr << "Could not write file to " << switches.sl_file_name
243243
<< std::endl;
244244
return false;

0 commit comments

Comments
 (0)