SpiderMonkey 编译
2019-5-18 08:13:37 Author: programlife.net(查看原文) 阅读量:10 收藏

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
checking for llvm-config... c:/Users/User\.mozbuild\clang\bin\llvm-config
not found
Traceback (most recent call last):
File "../../../configure.py", line 132, in <module>
sys.exit(main(sys.argv))
File "../../../configure.py", line 38, in main
sandbox.run(os.path.join(os.path.dirname(__file__), 'moz.configure'))
File "d:\gecko-dev\python\mozbuild\mozbuild\configure\__init__.py", line 481, in run
func(*args)
File "d:\gecko-dev\python\mozbuild\mozbuild\configure\__init__.py", line 525, in _value_for
return self._value_for_depends(obj)
File "d:\gecko-dev\python\mozbuild\mozbuild\util.py", line 947, in method_call
cache[args] = self.func(instance, *args)
File "d:\gecko-dev\python\mozbuild\mozbuild\configure\__init__.py", line 534, in _value_for_depends
value = obj.result()
File "d:\gecko-dev\python\mozbuild\mozbuild\util.py", line 947, in method_call
cache[args] = self.func(instance, *args)
File "d:\gecko-dev\python\mozbuild\mozbuild\configure\__init__.py", line 151, in result
return self._func(*resolved_args)
File "d:\gecko-dev\python\mozbuild\mozbuild\configure\__init__.py", line 1097, in wrapped
return new_func(*args, **kwargs)
File "d:/gecko-dev/build/moz.configure/bindgen.configure", line 322, in basic_bindgen_cflags
info = check_compiler([clang_path], 'C++', target)
File "d:\gecko-dev\python\mozbuild\mozbuild\configure\__init__.py", line 1097, in wrapped
return new_func(*args, **kwargs)
File "d:/gecko-dev/build/moz.configure/toolchain.configure", line 508, in check_compiler
info = get_compiler_info(compiler, language)
File "d:\gecko-dev\python\mozbuild\mozbuild\configure\__init__.py", line 1097, in wrapped
return new_func(*args, **kwargs)
File "d:/gecko-dev/build/moz.configure/toolchain.configure", line 455, in get_compiler_info
result = try_preprocess(compiler, language, check)
File "d:\gecko-dev\python\mozbuild\mozbuild\configure\__init__.py", line 1097, in wrapped
return new_func(*args, **kwargs)
File "d:/gecko-dev/build/moz.configure/toolchain.configure", line 371, in try_preprocess
return try_invoke_compiler(compiler, language, source, ['-E'])
File "d:\gecko-dev\python\mozbuild\mozbuild\configure\__init__.py", line 1097, in wrapped
return new_func(*args, **kwargs)
File "d:/gecko-dev/build/moz.configure/util.configure", line 246, in try_invoke_compiler
return check_cmd_output(*cmd, **kwargs)
File "d:\gecko-dev\python\mozbuild\mozbuild\configure\__init__.py", line 1097, in wrapped
return new_func(*args, **kwargs)
File "d:/gecko-dev/build/moz.configure/util.configure", line 69, in check_cmd_output
retcode, stdout, stderr = get_cmd_output(*args, **kwargs)
File "d:\gecko-dev\python\mozbuild\mozbuild\configure\__init__.py", line 1097, in wrapped
return new_func(*args, **kwargs)
File "d:/gecko-dev/build/moz.configure/util.configure", line 46, in get_cmd_output
log.debug('Executing: `%s`', quote(*args))
File "d:\gecko-dev\python\mozbuild\mozbuild\shellutil.py", line 206, in quote
return ' '.join(_quote(s) for s in strings)
File "d:\gecko-dev\python\mozbuild\mozbuild\shellutil.py", line 206, in <genexpr>
return ' '.join(_quote(s) for s in strings)
File "d:\gecko-dev\python\mozbuild\mozbuild\shellutil.py", line 194, in _quote
return t("'%s'") % s.replace(t("'"), t("'\\''"))
TypeError: cannot create 'NoneType' instances

等 SpiderMonkey 编译完之后,在路径 build.asserts\dist\bin 下可以找到相关的二进制文件,其中 JavaScript Shell 为 js.exe

如果不想折腾编译,也可以直接从 Firefox Nightly Builds 直接下载已经编译好的 JavaScript Shell (这是 Release 版本,功能比 Debug 版本少一些)。

JavaScript Shell 提供了许多的内置函数可供调用,具体可以参考 help() 的执行结果( Debug 版本比 Release 提供了更多的内置函数);几个比较常用的函数:

SpiderMonkey 的 JavaScript Shell 同时支持设置其 JIT 编译引擎 IonMonkey 的相关参数,可以将环境变量 IONFLAGS 设置为 help 来查看详细的帮助信息:


文章来源: http://programlife.net/2019/05/18/spidermonkey-build/
如有侵权请联系:admin#unsafe.sh