Closed Bug 1575135 Opened 2 years ago Closed 2 years ago

Only allow Unicode strings out of the python configure sandbox

Categories

(Firefox Build System :: General, task)

task
Not set
normal

Tracking

(firefox70 fixed)

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: glandium, Assigned: glandium)

References

Details

Attachments

(8 files, 1 obsolete file)

No description provided.

It only happens when things go badly, which is why it doesn't cause
problems, but when moving things around, triggering the error, we
currently get a formatting error rather than the actual error.

Because most calling places in python configure don't actually want to
deal with encodings, although in practical terms they should, make
get_cmd_output handle it itself.

Places that explicitly do want bytes can keep using subprocess directly.

As a consequence, we can replace the encoded_open function that did the
same in an opt-in manner.

Make it a hard error when the sandbox returns non-unicode strings.
This should help quickly catch any remaining non-unicode string that
are not caught by automation.

The configure sandbox has wrapped subprocess methods to do it since
bug 1520394.

Blocks: 844509
Attachment #9086596 - Attachment description: Bug 1575135 - Don't encode environment in get_cmd_output. → Bug 1575135 - Don't encode environment in get_cmd_output and old_configure.
Attachment #9086596 - Attachment is obsolete: true
Pushed by mh@glandium.org:
https://hg.mozilla.org/integration/autoland/rev/e0b2831af074
Remove unused subprocess imports. r=nalexander
https://hg.mozilla.org/integration/autoland/rev/38e02cd63d8d
Define whether the system encoding is mbcs or utf-8 once. r=nalexander
https://hg.mozilla.org/integration/autoland/rev/fd9f4d8f171b
Fix mock_pkg_config failure case. r=nalexander
https://hg.mozilla.org/integration/autoland/rev/f3e3d13c202a
Use functions from util.configure instead of subprocess.*. r=nalexander
https://hg.mozilla.org/integration/autoland/rev/9b73ac45f717
Change get_cmd_output to emit unicode strings. r=nalexander
https://hg.mozilla.org/integration/autoland/rev/2139ee18939e
Make configure sandbox open() look more like python 3's. r=nalexander
https://hg.mozilla.org/integration/autoland/rev/7e4b8df1e96a
Return an unicode path for nodejs. r=nalexander
https://hg.mozilla.org/integration/autoland/rev/b651185f9573
Make configure complain on non-unicode strings. r=nalexander
Regressions: 1575804
Regressions: 1580533
Regressions: 1595995
You need to log in before you can comment on or make changes to this bug.