Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Env fix #8920

Closed
wants to merge 2 commits into from
Closed

Env fix #8920

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion tools/building.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [
os.environ['RTT_CC_PREFIX'] = exec_prefix

# auto change the 'RTT_EXEC_PATH' when 'rtconfig.EXEC_PATH' get failed
if not utils.CmdExists(os.path.join(rtconfig.EXEC_PATH, rtconfig.CC)):
if not os.path.exists(rtconfig.EXEC_PATH):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

啥情况,又改回去,改坏掉了?

if 'RTT_EXEC_PATH' in os.environ:
# del the 'RTT_EXEC_PATH' and using the 'EXEC_PATH' setting on rtconfig.py
del os.environ['RTT_EXEC_PATH']
Expand All @@ -212,6 +212,7 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [
print('set CC to ' + exec_path)
rtconfig.EXEC_PATH = exec_path
os.environ['RTT_EXEC_PATH'] = exec_path

except Exception as e:
# detect failed, ignore
pass
Expand Down
20 changes: 0 additions & 20 deletions tools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,23 +309,3 @@ def VerTuple(version_str):
ver = tuple(int(part) for part in ver_parts)

return ver

def CmdExists(cmd):
import platform

cmd_list = cmd.split(' ')
cmd = cmd_list[0]
if os.path.isfile(cmd):
return True
else:
# check cmd(.exe|.bat|.ps1) under Windows
if platform.system() == 'Windows':
if cmd.find('exe') != -1 or cmd.find('bat') != -1 or cmd.find('ps1') != -1:
return False

# add .exe then check whether the cmd exists
cmd = cmd + '.exe'
if os.path.isfile(cmd):
return True

return False
Loading