Skip to content

Commit 8ec44c1

Browse files
ddorwinCQ Bot
authored andcommitted
[build] Add exec_script() inputs as dependencies
Per https://gn.googlesource.com/gn/+/main/docs/reference.md#buildfile-functions-exec_script_synchronously-run-a-script-and-return-the-output_back-to-top-arguments, files that a script uses must be passed in `exec_script()`'s `dependencies` parameter so that the GN generation will re-run if they change. Previously, running `fx build` after modifying text in `//sdk/version_history.json` would rebuild affected files but not regenerate the build files. GN needs to be reprocessed because GN variables are generated from the JSON file. Make similar changes to some other uses of `exec_script()`, and update and add references to https://fxbug.dev/42141201. Bug: 325448727 Change-Id: Iffef68d6850dabbfdc86718cbdcd595fc7fef9e8 Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1150973 Commit-Queue: David Dorwin <[email protected]> Reviewed-by: David Turner <[email protected]>
1 parent 866b6fb commit 8ec44c1

File tree

5 files changed

+30
-10
lines changed

5 files changed

+30
-10
lines changed

.gn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ exec_script_whitelist = [
4343
"//build/config/mac/mac_sdk.gni",
4444
"//build/config/profile/BUILD.gn",
4545
"//build/config/sanitizers/BUILD.gn",
46+
"//build/icu/config.gni",
4647
"//build/toolchain/default_concurrent_jobs.gni",
4748
"//build/toolchain/zircon/zircon_toolchain.gni",
48-
"//build/icu/config.gni",
4949
"//zircon/kernel/arch/x86/phys/BUILD.gn",
5050
]
5151

build/config/fuchsia/platform_version.gni

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,21 @@
99

1010
_script = "get_platform_version.py"
1111
version_history_path = "//sdk/version_history.json"
12-
_process_versions_args = [
13-
"-S", # https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=62771
12+
_get_platform_version_args = [
13+
"-S", # See https://fxbug.dev/42141201.
1414
rebase_path(_script, root_build_dir),
1515
"--version-history-path",
1616
rebase_path(version_history_path, root_build_dir),
1717
]
18+
_file_dependencies = [
19+
_script, # See https://fxbug.dev/42141201#comment6.
20+
version_history_path,
21+
]
1822

19-
platform_version =
20-
exec_script(python_exe_src, _process_versions_args, "json", [ _script ])
23+
platform_version = exec_script(python_exe_src,
24+
_get_platform_version_args,
25+
"json",
26+
_file_dependencies)
2127

2228
declare_args() {
2329
# If true, generate golden files for API level N+1, where N is

build/config/mac/mac_sdk.gni

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,18 @@ declare_args() {
1414

1515
_script = "//build/mac/find_sdk.py"
1616
_find_sdk_args = [
17-
"-S", # https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=62771
17+
"-S", # See https://fxbug.dev/42141201.
1818
rebase_path(_script, root_build_dir),
1919
"--print-sdk-path",
2020
mac_sdk_min,
2121
]
2222
_find_sdk_lines =
23-
exec_script(python_exe_src, _find_sdk_args, "list lines", [ _script ])
23+
exec_script(python_exe_src,
24+
_find_sdk_args,
25+
"list lines",
26+
[
27+
_script, # See https://fxbug.dev/42141201#comment6.
28+
])
2429
mac_sdk_version = _find_sdk_lines[1]
2530

2631
if (mac_sdk_path == "") {

build/icu/config.gni

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ if (icu_config_use_jiri_hook) {
2828
"--fuchsia-dir=" + rebase_path("//", root_build_dir),
2929
"--mode=print",
3030
],
31-
"json")
31+
"json",
32+
[
33+
"//third_party/icu/default",
34+
"//third_party/icu/latest",
35+
])
3236
}
3337

3438
# A target that verifies that the content of config.json is valid at build time.

build/toolchain/default_concurrent_jobs.gni

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ assert(
88

99
_script = "get_concurrent_jobs.py"
1010
_args = [
11-
"-S", # https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=62771
11+
"-S", # See https://fxbug.dev/42141201.
1212
rebase_path(_script, root_build_dir),
1313
"--reserve-memory=1GB",
1414
]
@@ -19,4 +19,9 @@ _args += [
1919
]
2020

2121
default_concurrent_jobs =
22-
exec_script(python_exe_src, _args, "json", [ _script ])
22+
exec_script(python_exe_src,
23+
_args,
24+
"json",
25+
[
26+
_script, # See https://fxbug.dev/42141201#comment6.
27+
])

0 commit comments

Comments
 (0)