Skip to content

Commit

Permalink
Bug 1368623 - Allow perl to be msys or strawberry, r=franziskus
Browse files Browse the repository at this point in the history
On windows, mozilla-build comes with perl.  The way that gyp ends up
invoking perl leads to perl receiving a filename argument that contains
backslashes.  You can address this, as you have suggested, by installing
strawberry perl and putting that on the path ahead of /bin, but it's more
software and unnecessary.  This little python wrapper avoids that problem.  It
works with both strawberry and the copy that comes with msys.

Differential Revision: https://nss-review.dev.mozaws.net/D327

--HG--
extra : rebase_source : 06fa67f2fdfef688cc422339c6be9a913102c4ef
  • Loading branch information
martinthomson committed May 30, 2017
1 parent 4becc89 commit e0bc09e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/ckfw/builtins/builtins.gyp
Expand Up @@ -19,7 +19,7 @@
'btoken.c',
'ckbiver.c',
'constants.c',
'<(INTERMEDIATE_DIR)/certdata.c'
'<(certdata_c)',
],
'dependencies': [
'<(DEPTH)/exports.gyp:nss_exports',
Expand All @@ -30,23 +30,25 @@
{
'msvs_cygwin_shell': 0,
'action': [
'perl',
'certdata.perl',
'python',
'certdata.py',
'certdata.txt',
'<@(_outputs)',
],
'inputs': [
'certdata.py',
'certdata.perl',
'certdata.txt'
],
'outputs': [
'<(INTERMEDIATE_DIR)/certdata.c'
'<(certdata_c)'
],
'action_name': 'generate_certdata_c'
}
],
'variables': {
'mapfile': 'nssckbi.def'
'mapfile': 'nssckbi.def',
'certdata_c': '<(INTERMEDIATE_DIR)/certdata.c',
}
}
],
Expand Down
16 changes: 16 additions & 0 deletions lib/ckfw/builtins/certdata.py
@@ -0,0 +1,16 @@
#!/usr/bin/env python
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

import subprocess
import os
import sys

def main():
args = [os.path.realpath(x) for x in sys.argv[1:]]
subprocess.check_call(['perl', 'certdata.perl'] + args, env=os.environ)

if __name__ == '__main__':
main()

0 comments on commit e0bc09e

Please sign in to comment.