Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion components/lwp/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ CPPPATH += ['./terminal/']
if not GetDepend(['LWP_USING_RUNTIME']):
SrcRemove(src, 'lwp_runtime.c')

group = DefineGroup('lwP', src, depend = ['RT_USING_SMART'], CPPPATH = CPPPATH)
group = DefineGroup('lwProcess', src, depend = ['RT_USING_SMART'], CPPPATH = CPPPATH)

group = group + SConscript(os.path.join('vdso', 'SConscript'))
Return('group')
11 changes: 0 additions & 11 deletions components/lwp/arch/risc-v/rv64/SConscript

This file was deleted.

11 changes: 0 additions & 11 deletions components/lwp/arch/x86/i386/SConscript

This file was deleted.

13 changes: 8 additions & 5 deletions components/lwp/vdso/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,21 @@ else:
process_env['RTT_DEVICE'] = rtconfig.DEVICE

command = ["scons", "-C", vdso_arch]
clean_command = ["scons", "-C", vdso_arch, "--clean"]
if GetOption('clean'):
command = ["scons", "-C", vdso_arch, "--clean"]

if not GetOption('clean'):
try:
result = subprocess.run(command, env=process_env, check=True)
else:
result = subprocess.run(clean_command, env=process_env, check=True)
# generic error handle
except :
print('exec command: "%s" failed.' % ' '.join(command))
exit(1)
Copy link

Copilot AI Jun 25, 2025

Choose a reason for hiding this comment

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

Avoid using a bare except: which also catches system-exiting exceptions. Catch specific errors (e.g., except subprocess.CalledProcessError as e:) to prevent unintended behavior.

Suggested change
# generic error handle
except :
print('exec command: "%s" failed.' % ' '.join(command))
exit(1)
except subprocess.CalledProcessError as e:
print(f'Command "{e.cmd}" failed with return code {e.returncode}.')
exit(1)
except FileNotFoundError as e:
print(f'Command not found: {e}. Please ensure "scons" is installed and in your PATH.')
exit(1)

Copilot uses AI. Check for mistakes.

if result.returncode == 0:
print("Command executed successfully")
else:
print("Command failed with exit code:", result.returncode)
exit(1)
Copy link

Copilot AI Jun 25, 2025

Choose a reason for hiding this comment

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

When using check=True, subprocess.run will raise on non-zero exits, so this manual returncode check is redundant. Consider removing it or use check=False if you need to handle exit codes explicitly.

Suggested change
if result.returncode == 0:
print("Command executed successfully")
else:
print("Command failed with exit code:", result.returncode)
exit(1)
print("Command executed successfully")

Copilot uses AI. Check for mistakes.

group = DefineGroup('vDSO', src, depend = ['RT_USING_SMART','RT_USING_VDSO'], CPPPATH = CPPPATH)
group = DefineGroup('lwProcess', src, depend = ['RT_USING_SMART','RT_USING_VDSO'], CPPPATH = CPPPATH)
Return('group')