我从来没有从源代码上构建过软件,因此请原谅我对此主题的完全无知。我试图确定从OS X安装程序pkg安装Node.js与将64位二进制文​​件(从Node.js downloads page解压缩)与移至/usr/local/(然后确保权限)之间有什么区别当然是正确的。)下面是在解压缩的二进制目录路径diff和安装路径[binaries]之间运行[install]的输出。

有人可以解释一下什么是测试文件,以及执行上述操作时的其他区别吗?用输出来解释将对我有帮助。

Only in [binaries]: ChangeLog
Only in [binaries]: LICENSE
Only in [binaries]: README.md
Binary files [binaries]/bin/node and [install]/bin/node differ
diff -r [binaries]/bin/npm [install]/bin/npm
1,2c1
< #!/bin/sh
< // 2>/dev/null; exec "`dirname "$0"`/node" "$0" "$@"
---
> #!/usr/bin/env node
diff -r [binaries]/include/node/config.gypi [install]/include/node/config.gypi
10c10
<                  'node_prefix': '/',
---
>                  'node_prefix': '',
diff -r [binaries]/lib/node_modules/npm/bin/npm-cli.js [install]/lib/node_modules/npm/bin/npm-cli.js
1,2c1
< #!/bin/sh
< // 2>/dev/null; exec "`dirname "$0"`/node" "$0" "$@"
---
> #!/usr/bin/env node
Only in [install]/lib/node_modules/npm/node_modules/ansicolors: test
Only in [install]/lib/node_modules/npm/node_modules/ansistyles: test
Only in [install]/lib/node_modules/npm/node_modules/block-stream: test
Only in [install]/lib/node_modules/npm/node_modules/char-spinner: test
Only in [install]/lib/node_modules/npm/node_modules/child-process-close: test
Only in [install]/lib/node_modules/npm/node_modules/chmodr: test
Only in [install]/lib/node_modules/npm/node_modules/cmd-shim: test
Only in [install]/lib/node_modules/npm/node_modules/columnify/node_modules/wcwidth: test
Only in [install]/lib/node_modules/npm/node_modules/fstream-npm/node_modules/fstream-ignore: test
Only in [install]/lib/node_modules/npm/node_modules/github-url-from-username-repo: test
Only in [install]/lib/node_modules/npm/node_modules/glob: test
Only in [install]/lib/node_modules/npm/node_modules/graceful-fs: test
Only in [install]/lib/node_modules/npm/node_modules/ini: test
Only in [install]/lib/node_modules/npm/node_modules/init-package-json/node_modules/promzard: test
Only in [install]/lib/node_modules/npm/node_modules/init-package-json: test
Only in [install]/lib/node_modules/npm/node_modules/lockfile: test
Only in [install]/lib/node_modules/npm/node_modules/lru-cache: test
Only in [install]/lib/node_modules/npm/node_modules/minimatch/node_modules/sigmund: test
Only in [install]/lib/node_modules/npm/node_modules/minimatch: test
Only in [install]/lib/node_modules/npm/node_modules/mkdirp/node_modules/minimist: test
Only in [install]/lib/node_modules/npm/node_modules/mkdirp: test
Only in [install]/lib/node_modules/npm/node_modules/nopt: test
Only in [install]/lib/node_modules/npm/node_modules/npm-install-checks: test
Only in [install]/lib/node_modules/npm/node_modules/npm-registry-client: test
Only in [install]/lib/node_modules/npm/node_modules/npm-user-validate: test
Only in [install]/lib/node_modules/npm/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list: test
Only in [install]/lib/node_modules/npm/node_modules/npmconf/node_modules/config-chain: test
Only in [install]/lib/node_modules/npm/node_modules/npmconf: test
Only in [install]/lib/node_modules/npm/node_modules/npmlog: test
Only in [install]/lib/node_modules/npm/node_modules/once: test
Only in [install]/lib/node_modules/npm/node_modules/osenv: test
Only in [install]/lib/node_modules/npm/node_modules/read/node_modules/mute-stream: test
Only in [install]/lib/node_modules/npm/node_modules/read: test
Only in [install]/lib/node_modules/npm/node_modules/read-installed: test
Only in [install]/lib/node_modules/npm/node_modules/read-package-json/node_modules/normalize-package-data: test
Only in [install]/lib/node_modules/npm/node_modules/read-package-json: test
Only in [install]/lib/node_modules/npm/node_modules/request/node_modules/bl: test
Only in [install]/lib/node_modules/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream: test
Only in [install]/lib/node_modules/npm/node_modules/request/node_modules/hawk/node_modules/boom: test
Only in [install]/lib/node_modules/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles: test
Only in [install]/lib/node_modules/npm/node_modules/request/node_modules/hawk/node_modules/hoek: test
Only in [install]/lib/node_modules/npm/node_modules/request/node_modules/hawk/node_modules/sntp: test
Only in [install]/lib/node_modules/npm/node_modules/request/node_modules/hawk: test
Only in [install]/lib/node_modules/npm/node_modules/request/node_modules/node-uuid: test
Only in [install]/lib/node_modules/npm/node_modules/request/node_modules/qs: test
Only in [install]/lib/node_modules/npm/node_modules/retry: test
Only in [install]/lib/node_modules/npm/node_modules/rimraf: test
Only in [install]/lib/node_modules/npm/node_modules/semver: test
Only in [install]/lib/node_modules/npm/node_modules/tar: test
Only in [install]/lib/node_modules/npm/node_modules/text-table: test
Only in [install]/lib/node_modules/npm: test

最佳答案

一般差异

由于预生成的二进制文件可以在部署(压缩)之前进行测试,因此无需在zip中包含测试即可在下载后再次对其进行测试。

OS X(通用)安装程序将进行各种检查,并且取决于您的系统,它将根据系统设置编译/下载/安装不同的文件。
在执行了各个步骤之后,它将使用测试文件来验证已安装的文件,该文件基本上包含一些编程,以便节点能够理解如何测试实际文件。

但是,OS X二进制文件基本上已经“安装”(在建筑机器上),然后压缩了。

在OS X上构建的某些东西将在具有相似系统构建的所有OS X上运行

但是,如果您自己编译/构建代码,则对其进行测试对于检测潜在的构建错误非常有用。

与构建系统相比,其他的小变化与(在)系统上编译/构建应用程序的方式(略有不同)有关。

"source"

二进制差异

二进制差异似乎只是(在二进制文件上)声明它是一个外壳应用程序,然后是注释掉的行。
根据this github issue comment,node_prefix值似乎仅由安装程序使用

10-05 21:04
查看更多