Closed
Bug 1328393
Opened 7 years ago
Closed 7 years ago
mach mixin run_process does not necessarily log commands that will actually parse or execute correctly
Categories
(Firefox Build System :: General, defect)
Firefox Build System
General
Tracking
(firefox53 affected)
RESOLVED
WONTFIX
Tracking | Status | |
---|---|---|
firefox53 | --- | affected |
People
(Reporter: wgianopoulos, Unassigned)
Details
Attachments
(1 file, 2 obsolete files)
2.37 KB,
patch
|
Details | Diff | Splinter Review |
I found this while developing the patch for bug 1328153. The run_process python function pr0vided as part of the mach mixins does not properly quote and/or escape the command arguments such that the logged command is non-parsable either by humans reading the log or the OS if you try to cut-and-paste the logged command into an interactive shell. So this call: self.run_process(['/usr/bin/notify-send', '--app-name=Mozilla Build System', 'Mozilla Build System', 'Build completed']) results in logging: /usr/bin/notify-send --app-name=Mozilla Build System Mozilla Build System Build complete which is a totally ill-formatted command. I would suggest modifying run+process such that all of the command arguments are scanned replacing all occurrences of the character "'" with "\'" and then surrounding the resultant string with the character "'" so that this log message would end up being: /usr/bin/notify-send '--app-name=Mozilla Build System' 'Mozilla Build System' 'Build complete'
Reporter | ||
Comment 1•7 years ago
|
||
Hmm,but I bet doing that universally would slow the build down. Perhaps add an option to espace-args that could be set to true in cases where it might be necessary? Or just change the messages about build completion status so that the msg string is either 'Build-completed' or 'Build-failed' and change the string 'Mozilla Build System' to be 'MozillaBuildSystem' in the run-process call so that all of this is unnecessary.
Reporter | ||
Comment 2•7 years ago
|
||
Hmm let me see what happens if i just escape the spaces in my other patch.
Reporter | ||
Comment 3•7 years ago
|
||
This avoids the issue where possible by not passing spaces in string constants to run_process where possible. This patch is dependent on the patch for bug 1328153.
Reporter | ||
Comment 4•7 years ago
|
||
Reporter | ||
Updated•7 years ago
|
Attachment #8823443 -
Attachment is obsolete: true
Reporter | ||
Comment 5•7 years ago
|
||
Attachment #8823836 -
Attachment is obsolete: true
Reporter | ||
Comment 6•7 years ago
|
||
I am closing this. I will open a new bug if I can come up with a better definition of the problem and.or a valid fix.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
Updated•6 years ago
|
Product: Core → Firefox Build System
You need to log in
before you can comment on or make changes to this bug.
Description
•