Nix (package manager)/zh: Difference between revisions

Mayer (talk | contribs)
No edit summary
Mayer (talk | contribs)
Created page with "由Nix构建的软件包被放在只读的''Nix存储'', 通常位于<code>/nix/store</code>. 每个软件包会被赋予一个由加密hash值指定的独一无二的地址, 该地址位于软件包名称和版本之后, 例如<code>/nix/store/nawl092prjblbhvv16kxxbk6j9gkgcqm-git-2.14.1</code>. 这些前缀的哈希处理使用到了对构建过程的所有输入, 包括源文件, 完整依赖关系树, 编译器标志, 等等. 这让Nix可以同时安装同一软件包..."
Line 28: Line 28:
=== Nix存储 ===
=== Nix存储 ===


<div lang="en" dir="ltr" class="mw-content-ltr">
由Nix构建的软件包被放在只读的''Nix存储'', 通常位于<code>/nix/store</code>. 每个软件包会被赋予一个由加密hash值指定的独一无二的地址, 该地址位于软件包名称和版本之后, 例如<code>/nix/store/nawl092prjblbhvv16kxxbk6j9gkgcqm-git-2.14.1</code>. 这些前缀的哈希处理使用到了对构建过程的所有输入, 包括源文件, 完整依赖关系树, 编译器标志, 等等. 这让Nix可以同时安装同一软件包的不同版本, 甚至同一版本的不同构建, 比如由不同的编译器构建的变体. . When adding, removing or updating a package, nothing is removed from the store; instead, symlinks to these packages are added, removed or changed in ''profiles''.
Packages built by Nix are placed in the read-only ''Nix store'', normally found in <code>/nix/store</code>. Each package is given a unique address specified by a cryptographic hash followed by the package name and version, for example <code>/nix/store/nawl092prjblbhvv16kxxbk6j9gkgcqm-git-2.14.1</code>. These prefixes hash all the inputs to the build process, including the source files, the full dependency tree, compiler flags, etc. This allows Nix to simultaneously install different versions of the same package, and even different builds of the same version, for example variants built with different compilers. When adding, removing or updating a package, nothing is removed from the store; instead, symlinks to these packages are added, removed or changed in ''profiles''.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">