1

我从来没有从源代码构建软件,所以请原谅我对这个主题的完全无知。我试图确定从 OS X Installer pkg 安装 Node.js 与解压缩 64 位二进制文​​件(来自 Node.js下载页面)和移动到/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
4

1 回答 1

0

一般差异

由于可以在部署(压缩)之前测试预构建二进制文件,因此它们不必在 zip 中包含测试以在下载后再次对其进行测试。

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

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

在 OS X 上构建的东西将适用于所有具有类似系统构建的 OS X

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

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

“资源”

二进制差异

二进制差异似乎只是声明(在二进制文件上)它是一个 shell 应用程序,然后是注释掉的行。根据此 github 问题评论,node_prefix 值似乎仅由安装程序使用

于 2014-10-01T04:27:57.570 回答