Skip to content
Open
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
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ types-requests==2.32.0.20241016
unittest-xml-reporting==3.2.0
deadcode==2.3.1
vulture==2.14
setproctitle==1.3.7

# This version is mentioned in `site/source/docs/site/about.rst`.
# Please keep them in sync.
Expand Down
1 change: 1 addition & 0 deletions tools/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,7 @@ def get_llvm_target():

def init():
utils.set_version_globals()
utils.set_process_title()
setup_temp_dirs()


Expand Down
23 changes: 23 additions & 0 deletions tools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,29 @@
logger = logging.getLogger('utils')


def set_process_title():
"""Remove the python prefix of the process title.

This makes the process listing easier to read as it just shows
`emcc ..` rather than e.g. `python3 -E emcc.py ...`.

This code depends the `setproctitle` PiPi module which might
not be installed. If the module cannot be loaded this function
simply does nothing.
"""
try:
import setproctitle
except ImportError:
return
t = setproctitle.getproctitle()
t = shlex.split(t)
while t and not t[0].endswith('.py'):
t.pop(0)
if t:
t[0] = os.path.splitext(t[0])[0]
setproctitle.setproctitle(shlex.join(t))


def run_process(cmd, check=True, input=None, *args, **kw):
"""Runs a subprocess returning the exit code.

Expand Down
Loading