From 1eb95bd815cc5c4f60b093185de2d8a5171e4ed0 Mon Sep 17 00:00:00 2001 From: Dengke Tang Date: Tue, 20 Feb 2024 00:01:25 +0000 Subject: [PATCH] check if it exist first --- builder/actions/cmake.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/actions/cmake.py b/builder/actions/cmake.py index cfc86b30f..5ace53691 100644 --- a/builder/actions/cmake.py +++ b/builder/actions/cmake.py @@ -105,7 +105,7 @@ def _build_project(env, project, cmake_extra, build_tests=False, args_transforme config = project.get_config(env.spec) build_env = [] toolchain = env.toolchain - if toolchain.cross_compile and env.variables['go_path'] is not None: + if toolchain.cross_compile and 'go_path' in env.variables and env.variables['go_path'] is not None: # We need to set the envrionment variable of GO_PATH for cross compile build_env = ["GO_PATH={}\n".format(env.variables['go_path'])]