diff options
| author | TBK <tbk@jjtc.eu> | 2020-03-25 20:23:21 +0100 |
|---|---|---|
| committer | Rasmus Thomsen <oss@cogitri.dev> | 2020-03-25 21:00:51 +0000 |
| commit | b8b1d2fb0bf3b535acd0c94f6e511ad8dbd93512 (patch) | |
| tree | 0180ca42a60c8109c4b248642244567bbd55bdb8 /testing/gn/python3.patch | |
| parent | 31f32a7bdb4e013e0b5eec78d617af50e4e78a5d (diff) | |
| download | aports-b8b1d2fb0bf3b535acd0c94f6e511ad8dbd93512.tar.bz2 aports-b8b1d2fb0bf3b535acd0c94f6e511ad8dbd93512.tar.xz | |
testing/gn: new aport
Diffstat (limited to 'testing/gn/python3.patch')
| -rw-r--r-- | testing/gn/python3.patch | 220 |
1 files changed, 220 insertions, 0 deletions
diff --git a/testing/gn/python3.patch b/testing/gn/python3.patch new file mode 100644 index 0000000000..78e11f67b8 --- /dev/null +++ b/testing/gn/python3.patch @@ -0,0 +1,220 @@ +--- a/build/full_test.py ++++ b/build/full_test.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # Copyright 2018 The Chromium Authors. All rights reserved. + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. +--- a/build/gen.py ++++ b/build/gen.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # Copyright 2014 The Chromium Authors. All rights reserved. + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. +--- a/infra/recipes.py ++++ b/infra/recipes.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + + # Copyright 2017 The LUCI Authors. All rights reserved. + # Use of this source code is governed under the Apache License, Version 2.0 +--- a/src/gn/exec_process_unittest.cc ++++ b/src/gn/exec_process_unittest.cc +@@ -33,7 +33,7 @@ + args.push_back(L"-c"); + args.push_back(base::UTF8ToUTF16(command)); + #else +- args.push_back("python"); ++ args.push_back("python3"); + args.push_back("-c"); + args.push_back(command); + #endif +--- a/src/gn/setup.cc ++++ b/src/gn/setup.cc +@@ -717,7 +717,7 @@ + } + build_settings_.set_python_path(python_path.NormalizePathSeparatorsTo('/')); + #else +- build_settings_.set_python_path(base::FilePath("python")); ++ build_settings_.set_python_path(base::FilePath("python3")); + #endif + } + return true; +--- a/src/gn/json_project_writer_unittest.cc ++++ b/src/gn/json_project_writer_unittest.cc +@@ -37,7 +37,7 @@ + SubstitutionList::MakeForTest("//out/Debug/output1.out"); + + setup.build_settings()->set_python_path( +- base::FilePath(FILE_PATH_LITERAL("/usr/bin/python"))); ++ base::FilePath(FILE_PATH_LITERAL("/usr/bin/python3"))); + std::vector<const Target*> targets; + targets.push_back(&target); + #if defined(OS_WIN) +@@ -172,7 +172,7 @@ + SubstitutionList::MakeForTest("//out/Debug/{{source_name_part}}.out"); + + setup.build_settings()->set_python_path( +- base::FilePath(FILE_PATH_LITERAL("/usr/bin/python"))); ++ base::FilePath(FILE_PATH_LITERAL("/usr/bin/python3"))); + std::vector<const Target*> targets; + targets.push_back(&target); + #if defined(OS_WIN) +--- a/src/gn/ninja_action_target_writer_unittest.cc ++++ b/src/gn/ninja_action_target_writer_unittest.cc +@@ -54,14 +54,14 @@ + ASSERT_TRUE(target.OnResolved(&err)); + + setup.build_settings()->set_python_path( +- base::FilePath(FILE_PATH_LITERAL("/usr/bin/python"))); ++ base::FilePath(FILE_PATH_LITERAL("/usr/bin/python3"))); + + std::ostringstream out; + NinjaActionTargetWriter writer(&target, out); + writer.Run(); + + const char* expected = R"(rule __foo_bar___rule +- command = /usr/bin/python ../../foo/script.py ++ command = /usr/bin/python3 ../../foo/script.py + description = ACTION //foo:bar() + restat = 1 + +@@ -96,7 +96,7 @@ + ASSERT_TRUE(target.OnResolved(&err)); + + setup.build_settings()->set_python_path( +- base::FilePath(FILE_PATH_LITERAL("/usr/bin/python"))); ++ base::FilePath(FILE_PATH_LITERAL("/usr/bin/python3"))); + + std::ostringstream out; + NinjaActionTargetWriter writer(&target, out); +@@ -105,7 +105,7 @@ + // The console pool's name must be mapped exactly to the string "console" + // which is a special pre-defined pool name in ninja. + const char* expected = R"(rule __foo_bar___rule +- command = /usr/bin/python ../../foo/script.py ++ command = /usr/bin/python3 ../../foo/script.py + description = ACTION //foo:bar() + restat = 1 + +@@ -138,7 +138,7 @@ + ASSERT_TRUE(target.OnResolved(&err)); + + setup.build_settings()->set_python_path( +- base::FilePath(FILE_PATH_LITERAL("/usr/bin/python"))); ++ base::FilePath(FILE_PATH_LITERAL("/usr/bin/python3"))); + + std::ostringstream out; + NinjaActionTargetWriter writer(&target, out); +@@ -146,7 +146,7 @@ + + const char expected_linux[] = + "rule __foo_bar___rule\n" +- " command = /usr/bin/python ../../foo/script.py\n" ++ " command = /usr/bin/python3 ../../foo/script.py\n" + " description = ACTION //foo:bar()\n" + " restat = 1\n" + "\n" +@@ -198,7 +198,7 @@ + ASSERT_TRUE(target.OnResolved(&err)); + + setup.build_settings()->set_python_path( +- base::FilePath(FILE_PATH_LITERAL("/usr/bin/python"))); ++ base::FilePath(FILE_PATH_LITERAL("/usr/bin/python3"))); + + std::ostringstream out; + NinjaActionTargetWriter writer(&target, out); +@@ -206,7 +206,7 @@ + + const char expected_linux[] = + "rule __foo_bar___rule\n" +- " command = /usr/bin/python ../../foo/script.py -i ${in} " ++ " command = /usr/bin/python3 ../../foo/script.py -i ${in} " + // Escaping is different between Windows and Posix. + #if defined(OS_WIN) + "\"--out=foo$ bar${source_name_part}.o\"\n" +@@ -263,7 +263,7 @@ + target.config_values().inputs().push_back(SourceFile("//foo/included.txt")); + + setup.build_settings()->set_python_path( +- base::FilePath(FILE_PATH_LITERAL("/usr/bin/python"))); ++ base::FilePath(FILE_PATH_LITERAL("/usr/bin/python3"))); + + std::ostringstream out; + NinjaActionTargetWriter writer(&target, out); +@@ -271,7 +271,7 @@ + + const char expected_linux[] = + "rule __foo_bar___rule\n" +- " command = /usr/bin/python ../../foo/script.py -i ${in} " ++ " command = /usr/bin/python3 ../../foo/script.py -i ${in} " + #if defined(OS_WIN) + "\"--out=foo$ bar${source_name_part}.o\"\n" + #else +@@ -318,7 +318,7 @@ + SubstitutionList::MakeForTest("//out/Debug/{{source_name_part}}.out"); + + setup.build_settings()->set_python_path( +- base::FilePath(FILE_PATH_LITERAL("/usr/bin/python"))); ++ base::FilePath(FILE_PATH_LITERAL("/usr/bin/python3"))); + + std::ostringstream out; + NinjaActionTargetWriter writer(&target, out); +@@ -331,7 +331,7 @@ + // These come from rsp_file_contents above. + " rspfile_content = -j ${source_name_part}\n" + // These come from the args. +- " command = /usr/bin/python ../../foo/script.py ${in} " ++ " command = /usr/bin/python3 ../../foo/script.py ${in} " + "${source_file_part} ${rspfile}\n" + " description = ACTION //foo:bar()\n" + " restat = 1\n" +@@ -376,7 +376,7 @@ + SubstitutionList::MakeForTest("//out/Debug/{{source_name_part}}.out"); + + setup.build_settings()->set_python_path( +- base::FilePath(FILE_PATH_LITERAL("/usr/bin/python"))); ++ base::FilePath(FILE_PATH_LITERAL("/usr/bin/python3"))); + + std::ostringstream out; + NinjaActionTargetWriter writer(&target, out); +@@ -385,7 +385,7 @@ + const char expected_linux[] = + "rule __foo_bar___rule\n" + // These come from the args. +- " command = /usr/bin/python ../../foo/script.py ${in} " ++ " command = /usr/bin/python3 ../../foo/script.py ${in} " + "${source_file_part}\n" + " description = ACTION //foo:bar()\n" + " restat = 1\n" +@@ -405,7 +405,7 @@ + TestWithScope setup; + + setup.build_settings()->set_python_path( +- base::FilePath(FILE_PATH_LITERAL("/usr/bin/python"))); ++ base::FilePath(FILE_PATH_LITERAL("/usr/bin/python3"))); + + Target dep(setup.settings(), Label(SourceDir("//foo/"), "dep")); + dep.set_output_type(Target::ACTION); +@@ -432,7 +432,7 @@ + const char expected_linux[] = + "rule __foo_foo___rule\n" + // These come from the args. +- " command = /usr/bin/python ../../foo/script.py\n" ++ " command = /usr/bin/python3 ../../foo/script.py\n" + " description = ACTION //foo:foo()\n" + " restat = 1\n" + "\n" +@@ -461,7 +461,7 @@ + const char expected_linux[] = + "rule __bar_bar___rule\n" + // These come from the args. +- " command = /usr/bin/python ../../bar/script.py\n" ++ " command = /usr/bin/python3 ../../bar/script.py\n" + " description = ACTION //bar:bar()\n" + " restat = 1\n" + "\n" |
