Skip to content

Commit

Permalink
[GN] Explicitly set script_executable to python3
Browse files Browse the repository at this point in the history
When we don't have python3 available as an executable i.e. on
windows, ensure that our python executable is python 3.

b/62677273

Change-Id: I871d2c879761381a8c0234d449ab5841df4f4b46
  • Loading branch information
andrewsavage1 committed Feb 2, 2022
1 parent 3677b43 commit 7f2320c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gn
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,8 @@

# The location of the build configuration file.
buildconfig = "//starboard/build/config/BUILDCONFIG.gn"

# We have `python3` if we're in a container or on buildbot, so use that.
if (getenv("IS_DOCKER") == "1" || getenv("BUILDBOT_PROJECT") != "") {
script_executable = "python3"
}
3 changes: 3 additions & 0 deletions starboard/build/config/BUILDCONFIG.gn
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

_is_python2 = exec_script("//build/util/is_python2.py", [], "json")
assert(!_is_python2, "`python` must resolve to Python 3 when building with GN.")

declare_args() {
is_clang = true

Expand Down

0 comments on commit 7f2320c

Please sign in to comment.