Skip to content

[tools] fix EXEC_PATH exists, but the CC does not. #8830

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

Merged
merged 1 commit into from
Apr 20, 2024
Merged
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
14 changes: 7 additions & 7 deletions tools/building.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,23 +195,23 @@ 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 os.path.exists(rtconfig.EXEC_PATH):
if not os.path.exists(os.path.join(rtconfig.EXEC_PATH, rtconfig.CC)):
Copy link
Member

Choose a reason for hiding this comment

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

这句话改的有问题,这么改之后导致env scons的时候找不到已经设置的RTT_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.

验证环境 Env for windows 1.5.2

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']

try:
# try to detect toolchains in env
from utils import ImportModule
envm = ImportModule('env')
envm = utils.ImportModule('env')
# from env import GetSDKPath
exec_path = envm.GetSDKPath(rtconfig.CC)
if 'gcc' in rtconfig.CC:
exec_path = os.path.join(exec_path, 'bin')
if os.path.exists(exec_path):
print('set CC to ' + exec_path)
rtconfig.EXEC_PATH = exec_path
os.environ['RTT_EXEC_PATH'] = exec_path

if os.path.exists(exec_path):
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
Loading