Generated build files should be deterministic with respect to build path |
||||||
Issue descriptionI care about deterministic build files because I often mount my build directory at different locations (eg. in a shared directory inside a VM). Right now, the generated build files on Linux with default configuration has just a few lines that depend on the name of the path to the source directory, or the name of the build directory relative to the source directory. The diff is shown below. We should fix this and perhaps add a step on a CQ bot that simply does "gn gen out/Default1; gn gen out/Default2; diff -ru out/Default1 out/Default2" and "grep `pwd` out/Defualt1 -r". thomasanderson@thomasanderson:~$ diff -ru dev/chromium_official/src/out/Default1/ dev/chromium_1/src/out/Default2 diff -ru dev/chromium_official/src/out/Default1/toolchain.ninja dev/chromium_1/src/out/Default2/toolchain.ninja --- dev/chromium_official/src/out/Default1/toolchain.ninja 2018-08-06 16:07:08.617735701 -0700 +++ dev/chromium_1/src/out/Default2/toolchain.ninja 2018-08-06 16:22:19.960980339 -0700 @@ -15079,7 +15079,7 @@ subninja obj/components/url_formatter/unit_tests.ninja subninja obj/components/url_formatter/url_formatter.ninja rule __components_url_formatter_top_domains_generate_top_domains_test_trie___build_toolchain_linux_clang_x64__rule - command = python ../../build/gn_run_binary.py top_domain_generator /usr/local/google/home/thomasanderson/dev/chromium_official/src/components/url_formatter/top_domains/test_domains.skeletons /usr/local/google/home/thomasanderson/dev/chromium_official/src/components/url_formatter/top_domains/top_domains_trie.template gen/components/url_formatter/top_domains/test_domains-trie-inc.cc + command = python ../../build/gn_run_binary.py top_domain_generator /usr/local/google/home/thomasanderson/dev/chromium_1/src/components/url_formatter/top_domains/test_domains.skeletons /usr/local/google/home/thomasanderson/dev/chromium_1/src/components/url_formatter/top_domains/top_domains_trie.template gen/components/url_formatter/top_domains/test_domains-trie-inc.cc description = ACTION //components/url_formatter/top_domains:generate_top_domains_test_trie(//build/toolchain/linux:clang_x64) restat = 1 pool = build_toolchain_action_pool @@ -15088,7 +15088,7 @@ build obj/components/url_formatter/top_domains/generate_top_domains_test_trie.stamp: stamp gen/components/url_formatter/top_domains/test_domains-trie-inc.cc rule __components_url_formatter_top_domains_generate_top_domains_trie___build_toolchain_linux_clang_x64__rule - command = python ../../build/gn_run_binary.py top_domain_generator /usr/local/google/home/thomasanderson/dev/chromium_official/src/components/url_formatter/top_domains/alexa_domains.skeletons /usr/local/google/home/thomasanderson/dev/chromium_official/src/components/url_formatter/top_domains/top_domains_trie.template gen/components/url_formatter/top_domains/alexa_domains-trie-inc.cc + command = python ../../build/gn_run_binary.py top_domain_generator /usr/local/google/home/thomasanderson/dev/chromium_1/src/components/url_formatter/top_domains/alexa_domains.skeletons /usr/local/google/home/thomasanderson/dev/chromium_1/src/components/url_formatter/top_domains/top_domains_trie.template gen/components/url_formatter/top_domains/alexa_domains-trie-inc.cc description = ACTION //components/url_formatter/top_domains:generate_top_domains_trie(//build/toolchain/linux:clang_x64) restat = 1 pool = build_toolchain_action_pool @@ -32207,7 +32207,7 @@ subninja obj/testing/libfuzzer/fuzzers/javascript_parser_proto.ninja subninja obj/testing/libfuzzer/fuzzers/javascript_parser_proto_fuzzer.ninja rule __testing_libfuzzer_fuzzers_javascript_parser_proto_fuzzer.owners___build_toolchain_linux_clang_x64__rule - command = python ../../testing/libfuzzer/gen_fuzzer_owners.py --owners javascript_parser_proto_fuzzer.owners --sources out/Default1/gen/testing/libfuzzer/fuzzers/javascript_parser_proto_to_string.cc testing/libfuzzer/fuzzers/javascript_parser_proto_fuzzer.cc testing/libfuzzer/fuzzers/javascript_parser_proto_to_string.h + command = python ../../testing/libfuzzer/gen_fuzzer_owners.py --owners javascript_parser_proto_fuzzer.owners --sources out/Default2/gen/testing/libfuzzer/fuzzers/javascript_parser_proto_to_string.cc testing/libfuzzer/fuzzers/javascript_parser_proto_fuzzer.cc testing/libfuzzer/fuzzers/javascript_parser_proto_to_string.h description = ACTION //testing/libfuzzer/fuzzers:javascript_parser_proto_fuzzer.owners(//build/toolchain/linux:clang_x64) restat = 1 pool = build_toolchain_action_pool
,
Sep 7
,
Sep 7
We have https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/Deterministic%20Linux on the main waterfall. It runs tools/determinism/compare_build_artifacts.py to compare all files referenced from isolated files (i.e. everything that's built). It could probably also compare generated ninja files. The only thing to watch out for is that we don't delete stale ninja files, and we probably wouldn't want to compare those.
,
Sep 7
,
Oct 27
,
Oct 27
,
Dec 3
|
||||||
►
Sign in to add a comment |
||||||
Comment 1 by bugdroid1@chromium.org
, Aug 14