Closed Bug 818366 Opened 9 years ago Closed 9 years ago

Ability to pass through file descriptors to child processes


(Firefox Build System :: Mach Core, enhancement)

Not set


(Not tracked)



(Reporter: gps, Assigned: gps)




(1 file)

Mach isn't playing well with child processes that need full control over the standard file descriptors (stdin, stdout, stderr). This patch adds a process execution mode that uses subprocess instead of mozprocess to work around mozprocess's special handling of the standard file descriptors.

In my ideal world, mozprocess would offer this backdoor and we would never have to call subprocess. That being said, I think this is the path of least resistance today. If mozprocess ever develops this ability, we should convert mach to use mozprocess for everything again.
Attachment #688591 - Flags: review?(jhammel)
We went through this same thing for the same reason in bug 746239, and jhammel wound up with the same solution.
Attachment #688591 - Flags: review?(jhammel) → review+
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
This is causing failure in Jenkins CI for firefox OS automation in TPE CI server.

The reason of failure:
Jenkins CI is not using shell, and nothing matches in the following logic. It would throw an exception of "Could not detect environment shell!".

if 'SHELL' in os.environ:
    _current_shell = os.environ['SHELL']
elif 'MOZILLABUILD' in os.environ:
    _current_shell = os.environ['MOZILLABUILD'] + '/msys/bin/sh.exe'
elif 'COMSPEC' in os.environ:
    _current_shell = os.environ['COMSPEC']
    raise Exception('Could not detect environment shell!')

The solution:
Do "export SHELL=/bin/bash", or just use injection of environment variable
Assignee: nobody → gps
Walter: that doesn't actually seem relevant to this bug. It sounds like you're talking about this Pymake code:

The only supported build environment on Windows is the Mozillabuild shell. If you're trying to build in some other environment you are going to have a bad time.
So, while we (=A*Team, Mozbase firing squad) have been fairly slow at addressing the many needed mozprocess bugs (see bug 881421 for a rough attempt at triage) I would like to aim (as priority/time permits) to make this sort of thing possible sans consumer refactor. Thoughts?
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.