Compare commits
23 Commits
string-str
...
2.29.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0cd1fce3c3 | ||
|
|
90eb2f759c | ||
|
|
d1e4be6fb4 | ||
|
|
29d98da636 | ||
|
|
91dc6e7fa0 | ||
|
|
b33fd1e4fb | ||
|
|
1c618a9d87 | ||
|
|
ab2abebfc3 | ||
|
|
0f132fc129 | ||
|
|
6fc6db3496 | ||
|
|
ca0bde3578 | ||
|
|
f51b537239 | ||
|
|
2b7e3e9b81 | ||
|
|
fee8454dd0 | ||
|
|
dc238ba102 | ||
|
|
fa7a5ab07a | ||
|
|
27932ae6da | ||
|
|
631d23788e | ||
|
|
4f03bfebd9 | ||
|
|
7f488dc7d3 | ||
|
|
1b2e88effd | ||
|
|
4dcf21a2f6 | ||
|
|
ff24751bdd |
@@ -8,7 +8,7 @@ BraceWrapping:
|
||||
AfterUnion: true
|
||||
SplitEmptyRecord: false
|
||||
PointerAlignment: Middle
|
||||
FixNamespaceComments: true
|
||||
FixNamespaceComments: false
|
||||
SortIncludes: Never
|
||||
#IndentPPDirectives: BeforeHash
|
||||
SpaceAfterCStyleCast: true
|
||||
@@ -32,4 +32,3 @@ IndentPPDirectives: AfterHash
|
||||
PPIndentWidth: 2
|
||||
BinPackArguments: false
|
||||
BreakBeforeTernaryOperators: true
|
||||
SeparateDefinitionBlocks: Always
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
|
||||
# Disable CodeRabbit auto-review to prevent verbose comments on PRs.
|
||||
# When enabled: false, CodeRabbit won't attempt reviews and won't post
|
||||
# "Review skipped" or other automated comments.
|
||||
reviews:
|
||||
auto_review:
|
||||
enabled: false
|
||||
review_status: false
|
||||
high_level_summary: false
|
||||
poem: false
|
||||
sequence_diagrams: false
|
||||
changed_files_summary: false
|
||||
tools:
|
||||
github-checks:
|
||||
enabled: false
|
||||
chat:
|
||||
art: false
|
||||
auto_reply: false
|
||||
@@ -1,6 +0,0 @@
|
||||
# bulk initial re-formatting with clang-format
|
||||
e4f62e46088919428a68bd8014201dc8e379fed7 # !autorebase ./maintainers/format.sh --until-stable
|
||||
# meson re-formatting
|
||||
385e2c3542c707d95e3784f7f6d623f67e77ab61 # !autorebase ./maintainers/format.sh --until-stable
|
||||
# nixfmt 1.0.0
|
||||
1d943f581908f35075a84a3d89c2eba3ff35067f # !autorebase ./maintainers/format.sh --until-stable
|
||||
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -45,7 +45,7 @@ assignees: ''
|
||||
- [ ] checked [latest Nix manual] \([source])
|
||||
- [ ] checked [open bug issues and pull requests] for possible duplicates
|
||||
|
||||
[latest Nix manual]: https://nix.dev/manual/nix/development/
|
||||
[latest Nix manual]: https://nixos.org/manual/nix/unstable/
|
||||
[source]: https://github.com/NixOS/nix/tree/master/doc/manual/source
|
||||
[open bug issues and pull requests]: https://github.com/NixOS/nix/labels/bug
|
||||
|
||||
|
||||
2
.github/ISSUE_TEMPLATE/feature_request.md
vendored
2
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -30,7 +30,7 @@ assignees: ''
|
||||
- [ ] checked [latest Nix manual] \([source])
|
||||
- [ ] checked [open feature issues and pull requests] for possible duplicates
|
||||
|
||||
[latest Nix manual]: https://nix.dev/manual/nix/development/
|
||||
[latest Nix manual]: https://nixos.org/manual/nix/unstable/
|
||||
[source]: https://github.com/NixOS/nix/tree/master/doc/manual/source
|
||||
[open feature issues and pull requests]: https://github.com/NixOS/nix/labels/feature
|
||||
|
||||
|
||||
2
.github/ISSUE_TEMPLATE/installer.md
vendored
2
.github/ISSUE_TEMPLATE/installer.md
vendored
@@ -38,7 +38,7 @@ assignees: ''
|
||||
- [ ] checked [latest Nix manual] \([source])
|
||||
- [ ] checked [open installer issues and pull requests] for possible duplicates
|
||||
|
||||
[latest Nix manual]: https://nix.dev/manual/nix/development/
|
||||
[latest Nix manual]: https://nixos.org/manual/nix/unstable/
|
||||
[source]: https://github.com/NixOS/nix/tree/master/doc/manual/source
|
||||
[open installer issues and pull requests]: https://github.com/NixOS/nix/labels/installer
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ assignees: ''
|
||||
- [ ] checked [latest Nix manual] \([source])
|
||||
- [ ] checked [open documentation issues and pull requests] for possible duplicates
|
||||
|
||||
[latest Nix manual]: https://nix.dev/manual/nix/development/
|
||||
[latest Nix manual]: https://nixos.org/manual/nix/unstable/
|
||||
[source]: https://github.com/NixOS/nix/tree/master/doc/manual/source
|
||||
[open documentation issues and pull requests]: https://github.com/NixOS/nix/labels/documentation
|
||||
|
||||
|
||||
4
.github/PULL_REQUEST_TEMPLATE.md
vendored
4
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -15,10 +15,6 @@ so you understand the process and the expectations.
|
||||
- volunteering contributions effectively
|
||||
- how to get help and our review process.
|
||||
|
||||
PR stuck in review? We have two Nix team meetings per week online that are open for everyone in a jitsi conference:
|
||||
|
||||
- https://calendar.google.com/calendar/u/0/embed?src=b9o52fobqjak8oq8lfkhg3t0qg@group.calendar.google.com
|
||||
|
||||
-->
|
||||
|
||||
## Motivation
|
||||
|
||||
131
.github/actions/install-nix-action/action.yaml
vendored
131
.github/actions/install-nix-action/action.yaml
vendored
@@ -1,131 +0,0 @@
|
||||
name: "Install Nix"
|
||||
description: "Helper action for installing Nix with support for dogfooding from master"
|
||||
inputs:
|
||||
dogfood:
|
||||
description: "Whether to use Nix installed from the latest artifact from master branch"
|
||||
required: true # Be explicit about the fact that we are using unreleased artifacts
|
||||
experimental-installer:
|
||||
description: "Whether to use the experimental installer to install Nix"
|
||||
default: false
|
||||
experimental-installer-version:
|
||||
description: "Version of the experimental installer to use. If `latest`, the newest artifact from the default branch is used."
|
||||
# TODO: This should probably be pinned to a release after https://github.com/NixOS/experimental-nix-installer/pull/49 lands in one
|
||||
default: "latest"
|
||||
extra_nix_config:
|
||||
description: "Gets appended to `/etc/nix/nix.conf` if passed."
|
||||
install_url:
|
||||
description: "URL of the Nix installer"
|
||||
required: false
|
||||
default: "https://releases.nixos.org/nix/nix-2.32.1/install"
|
||||
tarball_url:
|
||||
description: "URL of the Nix tarball to use with the experimental installer"
|
||||
required: false
|
||||
github_token:
|
||||
description: "Github token"
|
||||
required: true
|
||||
use_cache:
|
||||
description: "Whether to setup magic-nix-cache"
|
||||
default: true
|
||||
required: false
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: "Download nix install artifact from master"
|
||||
shell: bash
|
||||
id: download-nix-installer
|
||||
if: inputs.dogfood == 'true'
|
||||
run: |
|
||||
RUN_ID=$(gh run list --repo "$DOGFOOD_REPO" --workflow ci.yml --branch master --status success --json databaseId --jq ".[0].databaseId")
|
||||
|
||||
if [ "$RUNNER_OS" == "Linux" ]; then
|
||||
INSTALLER_ARTIFACT="installer-linux"
|
||||
elif [ "$RUNNER_OS" == "macOS" ]; then
|
||||
INSTALLER_ARTIFACT="installer-darwin"
|
||||
else
|
||||
echo "::error ::Unsupported RUNNER_OS: $RUNNER_OS"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
INSTALLER_DOWNLOAD_DIR="$GITHUB_WORKSPACE/$INSTALLER_ARTIFACT"
|
||||
mkdir -p "$INSTALLER_DOWNLOAD_DIR"
|
||||
|
||||
gh run download "$RUN_ID" --repo "$DOGFOOD_REPO" -n "$INSTALLER_ARTIFACT" -D "$INSTALLER_DOWNLOAD_DIR"
|
||||
echo "installer-path=file://$INSTALLER_DOWNLOAD_DIR" >> "$GITHUB_OUTPUT"
|
||||
TARBALL_PATH="$(find "$INSTALLER_DOWNLOAD_DIR" -name 'nix*.tar.xz' -print | head -n 1)"
|
||||
echo "tarball-path=file://$TARBALL_PATH" >> "$GITHUB_OUTPUT"
|
||||
|
||||
echo "::notice ::Dogfooding Nix installer from master (https://github.com/$DOGFOOD_REPO/actions/runs/$RUN_ID)"
|
||||
env:
|
||||
GH_TOKEN: ${{ inputs.github_token }}
|
||||
DOGFOOD_REPO: "NixOS/nix"
|
||||
- name: "Gather system info for experimental installer"
|
||||
shell: bash
|
||||
if: ${{ inputs.experimental-installer == 'true' }}
|
||||
run: |
|
||||
echo "::notice Using experimental installer from $EXPERIMENTAL_INSTALLER_REPO (https://github.com/$EXPERIMENTAL_INSTALLER_REPO)"
|
||||
|
||||
if [ "$RUNNER_OS" == "Linux" ]; then
|
||||
EXPERIMENTAL_INSTALLER_SYSTEM="linux"
|
||||
echo "EXPERIMENTAL_INSTALLER_SYSTEM=$EXPERIMENTAL_INSTALLER_SYSTEM" >> "$GITHUB_ENV"
|
||||
elif [ "$RUNNER_OS" == "macOS" ]; then
|
||||
EXPERIMENTAL_INSTALLER_SYSTEM="darwin"
|
||||
echo "EXPERIMENTAL_INSTALLER_SYSTEM=$EXPERIMENTAL_INSTALLER_SYSTEM" >> "$GITHUB_ENV"
|
||||
else
|
||||
echo "::error ::Unsupported RUNNER_OS: $RUNNER_OS"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$RUNNER_ARCH" == "X64" ]; then
|
||||
EXPERIMENTAL_INSTALLER_ARCH=x86_64
|
||||
echo "EXPERIMENTAL_INSTALLER_ARCH=$EXPERIMENTAL_INSTALLER_ARCH" >> "$GITHUB_ENV"
|
||||
elif [ "$RUNNER_ARCH" == "ARM64" ]; then
|
||||
EXPERIMENTAL_INSTALLER_ARCH=aarch64
|
||||
echo "EXPERIMENTAL_INSTALLER_ARCH=$EXPERIMENTAL_INSTALLER_ARCH" >> "$GITHUB_ENV"
|
||||
else
|
||||
echo "::error ::Unsupported RUNNER_ARCH: $RUNNER_ARCH"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "EXPERIMENTAL_INSTALLER_ARTIFACT=nix-installer-$EXPERIMENTAL_INSTALLER_ARCH-$EXPERIMENTAL_INSTALLER_SYSTEM" >> "$GITHUB_ENV"
|
||||
env:
|
||||
EXPERIMENTAL_INSTALLER_REPO: "NixOS/experimental-nix-installer"
|
||||
- name: "Download latest experimental installer"
|
||||
shell: bash
|
||||
id: download-latest-experimental-installer
|
||||
if: ${{ inputs.experimental-installer == 'true' && inputs.experimental-installer-version == 'latest' }}
|
||||
run: |
|
||||
RUN_ID=$(gh run list --repo "$EXPERIMENTAL_INSTALLER_REPO" --workflow ci.yml --branch main --status success --json databaseId --jq ".[0].databaseId")
|
||||
|
||||
EXPERIMENTAL_INSTALLER_DOWNLOAD_DIR="$GITHUB_WORKSPACE/$EXPERIMENTAL_INSTALLER_ARTIFACT"
|
||||
mkdir -p "$EXPERIMENTAL_INSTALLER_DOWNLOAD_DIR"
|
||||
|
||||
gh run download "$RUN_ID" --repo "$EXPERIMENTAL_INSTALLER_REPO" -n "$EXPERIMENTAL_INSTALLER_ARTIFACT" -D "$EXPERIMENTAL_INSTALLER_DOWNLOAD_DIR"
|
||||
# Executable permissions are lost in artifacts
|
||||
find $EXPERIMENTAL_INSTALLER_DOWNLOAD_DIR -type f -exec chmod +x {} +
|
||||
echo "installer-path=$EXPERIMENTAL_INSTALLER_DOWNLOAD_DIR" >> "$GITHUB_OUTPUT"
|
||||
env:
|
||||
GH_TOKEN: ${{ inputs.github_token }}
|
||||
EXPERIMENTAL_INSTALLER_REPO: "NixOS/experimental-nix-installer"
|
||||
- uses: cachix/install-nix-action@c134e4c9e34bac6cab09cf239815f9339aaaf84e # v31.5.1
|
||||
if: ${{ inputs.experimental-installer != 'true' }}
|
||||
with:
|
||||
# Ternary operator in GHA: https://www.github.com/actions/runner/issues/409#issuecomment-752775072
|
||||
install_url: ${{ inputs.dogfood == 'true' && format('{0}/install', steps.download-nix-installer.outputs.installer-path) || inputs.install_url }}
|
||||
install_options: ${{ inputs.dogfood == 'true' && format('--tarball-url-prefix {0}', steps.download-nix-installer.outputs.installer-path) || '' }}
|
||||
extra_nix_config: ${{ inputs.extra_nix_config }}
|
||||
- uses: DeterminateSystems/nix-installer-action@786fff0690178f1234e4e1fe9b536e94f5433196 # v20
|
||||
if: ${{ inputs.experimental-installer == 'true' }}
|
||||
with:
|
||||
diagnostic-endpoint: ""
|
||||
# TODO: It'd be nice to use `artifacts.nixos.org` for both of these, maybe through an `/experimental-installer/latest` endpoint? or `/commit/<hash>`?
|
||||
local-root: ${{ inputs.experimental-installer-version == 'latest' && steps.download-latest-experimental-installer.outputs.installer-path || '' }}
|
||||
source-url: ${{ inputs.experimental-installer-version != 'latest' && 'https://artifacts.nixos.org/experimental-installer/tag/${{ inputs.experimental-installer-version }}/${{ env.EXPERIMENTAL_INSTALLER_ARTIFACT }}' || '' }}
|
||||
nix-package-url: ${{ inputs.dogfood == 'true' && steps.download-nix-installer.outputs.tarball-path || (inputs.tarball_url || '') }}
|
||||
extra-conf: ${{ inputs.extra_nix_config }}
|
||||
- uses: DeterminateSystems/magic-nix-cache-action@565684385bcd71bad329742eefe8d12f2e765b39 # v13
|
||||
if: ${{ inputs.use_cache == 'true' }}
|
||||
with:
|
||||
diagnostic-endpoint: ''
|
||||
use-flakehub: false
|
||||
use-gha-cache: true
|
||||
source-revision: 92d9581367be2233c2d5714a2640e1339f4087d8 # main
|
||||
37
.github/workflows/backport.yml
vendored
37
.github/workflows/backport.yml
vendored
@@ -1,37 +0,0 @@
|
||||
name: Backport
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [closed, labeled]
|
||||
permissions:
|
||||
contents: read
|
||||
jobs:
|
||||
backport:
|
||||
name: Backport Pull Request
|
||||
permissions:
|
||||
# for korthout/backport-action
|
||||
contents: write
|
||||
pull-requests: write
|
||||
if: github.repository_owner == 'NixOS' && github.event.pull_request.merged == true && (github.event_name != 'labeled' || startsWith('backport', github.event.label.name))
|
||||
runs-on: ubuntu-24.04-arm
|
||||
steps:
|
||||
- name: Generate GitHub App token
|
||||
id: generate-token
|
||||
uses: actions/create-github-app-token@v2
|
||||
with:
|
||||
app-id: ${{ vars.CI_APP_ID }}
|
||||
private-key: ${{ secrets.CI_APP_PRIVATE_KEY }}
|
||||
- uses: actions/checkout@v5
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
# required to find all branches
|
||||
fetch-depth: 0
|
||||
- name: Create backport PRs
|
||||
uses: korthout/backport-action@d07416681cab29bf2661702f925f020aaa962997 # v3.4.1
|
||||
id: backport
|
||||
with:
|
||||
# Config README: https://github.com/korthout/backport-action#backport-action
|
||||
github_token: ${{ steps.generate-token.outputs.token }}
|
||||
github_workspace: ${{ github.workspace }}
|
||||
auto_merge_enabled: true
|
||||
pull_description: |-
|
||||
Automatic backport to `${target_branch}`, triggered by a label in #${pull_number}.
|
||||
224
.github/workflows/ci.yml
vendored
224
.github/workflows/ci.yml
vendored
@@ -2,21 +2,7 @@ name: "CI"
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
merge_group:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
dogfood:
|
||||
description: 'Use dogfood Nix build'
|
||||
required: false
|
||||
default: true
|
||||
type: boolean
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions: read-all
|
||||
|
||||
@@ -24,43 +10,13 @@ jobs:
|
||||
eval:
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: ./.github/actions/install-nix-action
|
||||
with:
|
||||
dogfood: ${{ github.event_name == 'workflow_dispatch' && inputs.dogfood || github.event_name != 'workflow_dispatch' }}
|
||||
extra_nix_config:
|
||||
experimental-features = nix-command flakes
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
use_cache: false
|
||||
- run: nix flake show --all-systems --json
|
||||
|
||||
pre-commit-checks:
|
||||
name: pre-commit checks
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: ./.github/actions/install-nix-action
|
||||
with:
|
||||
dogfood: ${{ github.event_name == 'workflow_dispatch' && inputs.dogfood || github.event_name != 'workflow_dispatch' }}
|
||||
extra_nix_config: experimental-features = nix-command flakes
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- run: ./ci/gha/tests/pre-commit-checks
|
||||
|
||||
basic-checks:
|
||||
name: aggregate basic checks
|
||||
if: ${{ always() }}
|
||||
runs-on: ubuntu-24.04
|
||||
needs: [pre-commit-checks, eval]
|
||||
steps:
|
||||
- name: Exit with any errors
|
||||
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
|
||||
run: |
|
||||
exit 1
|
||||
- uses: cachix/install-nix-action@v31
|
||||
- run: nix --experimental-features 'nix-command flakes' flake show --all-systems --json
|
||||
|
||||
tests:
|
||||
needs: basic-checks
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
@@ -68,74 +24,34 @@ jobs:
|
||||
- scenario: on ubuntu
|
||||
runs-on: ubuntu-24.04
|
||||
os: linux
|
||||
instrumented: false
|
||||
primary: true
|
||||
stdenv: stdenv
|
||||
- scenario: on macos
|
||||
runs-on: macos-14
|
||||
os: darwin
|
||||
instrumented: false
|
||||
primary: true
|
||||
stdenv: stdenv
|
||||
- scenario: on ubuntu (with sanitizers / coverage)
|
||||
runs-on: ubuntu-24.04
|
||||
os: linux
|
||||
instrumented: true
|
||||
primary: false
|
||||
stdenv: clangStdenv
|
||||
name: tests ${{ matrix.scenario }}
|
||||
runs-on: ${{ matrix.runs-on }}
|
||||
timeout-minutes: 60
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: ./.github/actions/install-nix-action
|
||||
- uses: cachix/install-nix-action@v31
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
dogfood: ${{ github.event_name == 'workflow_dispatch' && inputs.dogfood || github.event_name != 'workflow_dispatch' }}
|
||||
# The sandbox would otherwise be disabled by default on Darwin
|
||||
extra_nix_config: "sandbox = true"
|
||||
extra_nix_config: |
|
||||
sandbox = true
|
||||
max-jobs = 1
|
||||
- uses: DeterminateSystems/magic-nix-cache-action@main
|
||||
# Since ubuntu 22.30, unprivileged usernamespaces are no longer allowed to map to the root user:
|
||||
# https://ubuntu.com/blog/ubuntu-23-10-restricted-unprivileged-user-namespaces
|
||||
- run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
|
||||
if: matrix.os == 'linux'
|
||||
- name: Run component tests
|
||||
run: |
|
||||
nix build --file ci/gha/tests/wrapper.nix componentTests -L \
|
||||
--arg withInstrumentation ${{ matrix.instrumented }} \
|
||||
--argstr stdenv "${{ matrix.stdenv }}"
|
||||
- name: Run VM tests
|
||||
run: |
|
||||
nix build --file ci/gha/tests/wrapper.nix vmTests -L \
|
||||
--arg withInstrumentation ${{ matrix.instrumented }} \
|
||||
--argstr stdenv "${{ matrix.stdenv }}"
|
||||
if: ${{ matrix.os == 'linux' }}
|
||||
- name: Run flake checks and prepare the installer tarball
|
||||
run: |
|
||||
ci/gha/tests/build-checks
|
||||
ci/gha/tests/prepare-installer-for-github-actions
|
||||
if: ${{ matrix.primary }}
|
||||
- name: Collect code coverage
|
||||
run: |
|
||||
nix build --file ci/gha/tests/wrapper.nix codeCoverage.coverageReports -L \
|
||||
--arg withInstrumentation ${{ matrix.instrumented }} \
|
||||
--argstr stdenv "${{ matrix.stdenv }}" \
|
||||
--out-link coverage-reports
|
||||
cat coverage-reports/index.txt >> $GITHUB_STEP_SUMMARY
|
||||
if: ${{ matrix.instrumented }}
|
||||
- name: Upload coverage reports
|
||||
uses: actions/upload-artifact@v5
|
||||
with:
|
||||
name: coverage-reports
|
||||
path: coverage-reports/
|
||||
if: ${{ matrix.instrumented }}
|
||||
- run: scripts/build-checks
|
||||
- run: scripts/prepare-installer-for-github-actions
|
||||
- name: Upload installer tarball
|
||||
uses: actions/upload-artifact@v5
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: installer-${{matrix.os}}
|
||||
path: out/*
|
||||
if: ${{ matrix.primary }}
|
||||
|
||||
installer_test:
|
||||
needs: [tests]
|
||||
@@ -146,46 +62,25 @@ jobs:
|
||||
- scenario: on ubuntu
|
||||
runs-on: ubuntu-24.04
|
||||
os: linux
|
||||
experimental-installer: false
|
||||
- scenario: on macos
|
||||
runs-on: macos-14
|
||||
os: darwin
|
||||
experimental-installer: false
|
||||
- scenario: on ubuntu (experimental)
|
||||
runs-on: ubuntu-24.04
|
||||
os: linux
|
||||
experimental-installer: true
|
||||
- scenario: on macos (experimental)
|
||||
runs-on: macos-14
|
||||
os: darwin
|
||||
experimental-installer: true
|
||||
name: installer test ${{ matrix.scenario }}
|
||||
runs-on: ${{ matrix.runs-on }}
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v4
|
||||
- name: Download installer tarball
|
||||
uses: actions/download-artifact@v6
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: installer-${{matrix.os}}
|
||||
path: out
|
||||
- name: Looking up the installer tarball URL
|
||||
id: installer-tarball-url
|
||||
run: |
|
||||
echo "installer-url=file://$GITHUB_WORKSPACE/out" >> "$GITHUB_OUTPUT"
|
||||
TARBALL_PATH="$(find "$GITHUB_WORKSPACE/out" -name 'nix*.tar.xz' -print | head -n 1)"
|
||||
echo "tarball-path=file://$TARBALL_PATH" >> "$GITHUB_OUTPUT"
|
||||
- uses: cachix/install-nix-action@7ec16f2c061ab07b235a7245e06ed46fe9a1cab6 # v31.8.3
|
||||
if: ${{ !matrix.experimental-installer }}
|
||||
- name: Serving installer
|
||||
id: serving_installer
|
||||
run: ./scripts/serve-installer-for-github-actions
|
||||
- uses: cachix/install-nix-action@v31
|
||||
with:
|
||||
install_url: ${{ format('{0}/install', steps.installer-tarball-url.outputs.installer-url) }}
|
||||
install_options: ${{ format('--tarball-url-prefix {0}', steps.installer-tarball-url.outputs.installer-url) }}
|
||||
- uses: ./.github/actions/install-nix-action
|
||||
if: ${{ matrix.experimental-installer }}
|
||||
with:
|
||||
dogfood: false
|
||||
experimental-installer: true
|
||||
tarball_url: ${{ steps.installer-tarball-url.outputs.tarball-path }}
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
install_url: 'http://localhost:8126/install'
|
||||
install_options: "--tarball-url-prefix http://localhost:8126/"
|
||||
- run: sudo apt install fish zsh
|
||||
if: matrix.os == 'linux'
|
||||
- run: brew install fish
|
||||
@@ -204,20 +99,20 @@ jobs:
|
||||
check_secrets:
|
||||
permissions:
|
||||
contents: none
|
||||
name: Check presence of secrets
|
||||
name: Check Docker secrets present for installer tests
|
||||
runs-on: ubuntu-24.04
|
||||
outputs:
|
||||
docker: ${{ steps.secret.outputs.docker }}
|
||||
steps:
|
||||
- name: Check for DockerHub secrets
|
||||
- name: Check for secrets
|
||||
id: secret
|
||||
env:
|
||||
_DOCKER_SECRETS: ${{ secrets.DOCKERHUB_USERNAME }}${{ secrets.DOCKERHUB_TOKEN }}
|
||||
run: |
|
||||
echo "docker=${{ env._DOCKER_SECRETS != '' }}" >> $GITHUB_OUTPUT
|
||||
echo "::set-output name=docker::${{ env._DOCKER_SECRETS != '' }}"
|
||||
|
||||
docker_push_image:
|
||||
needs: [tests, check_secrets]
|
||||
needs: [tests, vm_tests, check_secrets]
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
@@ -227,16 +122,21 @@ jobs:
|
||||
github.ref_name == 'master'
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- name: Check for secrets
|
||||
id: secret
|
||||
env:
|
||||
_DOCKER_SECRETS: ${{ secrets.DOCKERHUB_USERNAME }}${{ secrets.DOCKERHUB_TOKEN }}
|
||||
run: |
|
||||
echo "::set-output name=docker::${{ env._DOCKER_SECRETS != '' }}"
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: ./.github/actions/install-nix-action
|
||||
- uses: cachix/install-nix-action@v31
|
||||
with:
|
||||
dogfood: false
|
||||
extra_nix_config: |
|
||||
experimental-features = flakes nix-command
|
||||
- run: echo NIX_VERSION="$(nix eval .\#nix.version | tr -d \")" >> $GITHUB_ENV
|
||||
- run: nix build .#dockerImage -L
|
||||
install_url: https://releases.nixos.org/nix/nix-2.20.3/install
|
||||
- uses: DeterminateSystems/magic-nix-cache-action@main
|
||||
- run: echo NIX_VERSION="$(nix --experimental-features 'nix-command flakes' eval .\#nix.version | tr -d \")" >> $GITHUB_ENV
|
||||
- run: nix --experimental-features 'nix-command flakes' build .#dockerImage -L
|
||||
- run: docker load -i ./result/image.tar.gz
|
||||
- run: docker tag nix:$NIX_VERSION ${{ secrets.DOCKERHUB_USERNAME }}/nix:$NIX_VERSION
|
||||
- run: docker tag nix:$NIX_VERSION ${{ secrets.DOCKERHUB_USERNAME }}/nix:master
|
||||
@@ -271,48 +171,36 @@ jobs:
|
||||
docker tag nix:$NIX_VERSION $IMAGE_ID:master
|
||||
docker push $IMAGE_ID:master
|
||||
|
||||
vm_tests:
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: DeterminateSystems/nix-installer-action@main
|
||||
- uses: DeterminateSystems/magic-nix-cache-action@main
|
||||
- run: |
|
||||
nix build -L \
|
||||
.#hydraJobs.tests.functional_user \
|
||||
.#hydraJobs.tests.githubFlakes \
|
||||
.#hydraJobs.tests.nix-docker \
|
||||
.#hydraJobs.tests.tarballFlakes \
|
||||
;
|
||||
|
||||
flake_regressions:
|
||||
needs: tests
|
||||
needs: vm_tests
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- name: Checkout nix
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v4
|
||||
- name: Checkout flake-regressions
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: NixOS/flake-regressions
|
||||
path: flake-regressions
|
||||
- name: Checkout flake-regressions-data
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: NixOS/flake-regressions-data
|
||||
path: flake-regressions/tests
|
||||
- uses: ./.github/actions/install-nix-action
|
||||
with:
|
||||
dogfood: ${{ github.event_name == 'workflow_dispatch' && inputs.dogfood || github.event_name != 'workflow_dispatch' }}
|
||||
extra_nix_config:
|
||||
experimental-features = nix-command flakes
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- uses: DeterminateSystems/nix-installer-action@main
|
||||
- uses: DeterminateSystems/magic-nix-cache-action@main
|
||||
- run: nix build -L --out-link ./new-nix && PATH=$(pwd)/new-nix/bin:$PATH MAX_FLAKES=25 flake-regressions/eval-all.sh
|
||||
|
||||
profile_build:
|
||||
needs: tests
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 60
|
||||
if: >-
|
||||
github.event_name == 'push' &&
|
||||
github.ref_name == 'master'
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: ./.github/actions/install-nix-action
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
dogfood: ${{ github.event_name == 'workflow_dispatch' && inputs.dogfood || github.event_name != 'workflow_dispatch' }}
|
||||
extra_nix_config: |
|
||||
experimental-features = flakes nix-command ca-derivations impure-derivations
|
||||
max-jobs = 1
|
||||
- run: |
|
||||
nix build -L --file ./ci/gha/profile-build buildTimeReport --out-link build-time-report.md
|
||||
cat build-time-report.md >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
2
.github/workflows/labels.yml
vendored
2
.github/workflows/labels.yml
vendored
@@ -18,7 +18,7 @@ jobs:
|
||||
runs-on: ubuntu-24.04
|
||||
if: github.repository_owner == 'NixOS'
|
||||
steps:
|
||||
- uses: actions/labeler@v6
|
||||
- uses: actions/labeler@v5
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
sync-labels: false
|
||||
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -47,6 +47,3 @@ result-*
|
||||
.DS_Store
|
||||
|
||||
flake-regressions
|
||||
|
||||
# direnv
|
||||
.direnv/
|
||||
|
||||
141
.mergify.yml
Normal file
141
.mergify.yml
Normal file
@@ -0,0 +1,141 @@
|
||||
queue_rules:
|
||||
- name: default
|
||||
# all required tests need to go here
|
||||
merge_conditions:
|
||||
- check-success=tests on macos
|
||||
- check-success=tests on ubuntu
|
||||
- check-success=installer test on macos
|
||||
- check-success=installer test on ubuntu
|
||||
- check-success=vm_tests
|
||||
batch_size: 5
|
||||
|
||||
pull_request_rules:
|
||||
- name: merge using the merge queue
|
||||
conditions:
|
||||
- base~=master|.+-maintenance
|
||||
- label~=merge-queue|dependencies
|
||||
actions:
|
||||
queue: {}
|
||||
|
||||
# The rules below will first create backport pull requests and put those in a merge queue.
|
||||
|
||||
- name: backport patches to 2.18
|
||||
conditions:
|
||||
- label=backport 2.18-maintenance
|
||||
actions:
|
||||
backport:
|
||||
branches:
|
||||
- 2.18-maintenance
|
||||
labels:
|
||||
- automatic backport
|
||||
- merge-queue
|
||||
|
||||
- name: backport patches to 2.19
|
||||
conditions:
|
||||
- label=backport 2.19-maintenance
|
||||
actions:
|
||||
backport:
|
||||
branches:
|
||||
- 2.19-maintenance
|
||||
labels:
|
||||
- automatic backport
|
||||
- merge-queue
|
||||
|
||||
- name: backport patches to 2.20
|
||||
conditions:
|
||||
- label=backport 2.20-maintenance
|
||||
actions:
|
||||
backport:
|
||||
branches:
|
||||
- 2.20-maintenance
|
||||
labels:
|
||||
- automatic backport
|
||||
- merge-queue
|
||||
|
||||
- name: backport patches to 2.21
|
||||
conditions:
|
||||
- label=backport 2.21-maintenance
|
||||
actions:
|
||||
backport:
|
||||
branches:
|
||||
- 2.21-maintenance
|
||||
labels:
|
||||
- automatic backport
|
||||
- merge-queue
|
||||
|
||||
- name: backport patches to 2.22
|
||||
conditions:
|
||||
- label=backport 2.22-maintenance
|
||||
actions:
|
||||
backport:
|
||||
branches:
|
||||
- 2.22-maintenance
|
||||
labels:
|
||||
- automatic backport
|
||||
- merge-queue
|
||||
|
||||
- name: backport patches to 2.23
|
||||
conditions:
|
||||
- label=backport 2.23-maintenance
|
||||
actions:
|
||||
backport:
|
||||
branches:
|
||||
- 2.23-maintenance
|
||||
labels:
|
||||
- automatic backport
|
||||
- merge-queue
|
||||
|
||||
- name: backport patches to 2.24
|
||||
conditions:
|
||||
- label=backport 2.24-maintenance
|
||||
actions:
|
||||
backport:
|
||||
branches:
|
||||
- "2.24-maintenance"
|
||||
labels:
|
||||
- automatic backport
|
||||
- merge-queue
|
||||
|
||||
- name: backport patches to 2.25
|
||||
conditions:
|
||||
- label=backport 2.25-maintenance
|
||||
actions:
|
||||
backport:
|
||||
branches:
|
||||
- "2.25-maintenance"
|
||||
labels:
|
||||
- automatic backport
|
||||
- merge-queue
|
||||
|
||||
- name: backport patches to 2.26
|
||||
conditions:
|
||||
- label=backport 2.26-maintenance
|
||||
actions:
|
||||
backport:
|
||||
branches:
|
||||
- "2.26-maintenance"
|
||||
labels:
|
||||
- automatic backport
|
||||
- merge-queue
|
||||
|
||||
- name: backport patches to 2.27
|
||||
conditions:
|
||||
- label=backport 2.27-maintenance
|
||||
actions:
|
||||
backport:
|
||||
branches:
|
||||
- "2.27-maintenance"
|
||||
labels:
|
||||
- automatic backport
|
||||
- merge-queue
|
||||
|
||||
- name: backport patches to 2.28
|
||||
conditions:
|
||||
- label=backport 2.28-maintenance
|
||||
actions:
|
||||
backport:
|
||||
branches:
|
||||
- "2.28-maintenance"
|
||||
labels:
|
||||
- automatic backport
|
||||
- merge-queue
|
||||
@@ -89,7 +89,7 @@ Check out the [security policy](https://github.com/NixOS/nix/security/policy).
|
||||
|
||||
## Making changes to the Nix manual
|
||||
|
||||
The Nix reference manual is hosted on https://nix.dev/manual/nix.
|
||||
The Nix reference manual is hosted on https://nixos.org/manual/nix.
|
||||
The underlying source files are located in [`doc/manual/source`](./doc/manual/source).
|
||||
For small changes you can [use GitHub to edit these files](https://docs.github.com/en/repositories/working-with-files/managing-files/editing-files)
|
||||
For larger changes see the [Nix reference manual](https://nix.dev/manual/nix/development/development/contributing.html).
|
||||
|
||||
25
COPYING
25
COPYING
@@ -1,8 +1,8 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
<https://fsf.org/>
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
@@ -112,7 +112,7 @@ modification follow. Pay close attention to the difference between a
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
@@ -146,7 +146,7 @@ such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
@@ -432,7 +432,7 @@ decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
@@ -455,7 +455,7 @@ FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
@@ -484,7 +484,8 @@ convey the exclusion of warranty; and each file should have at least the
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, see <https://www.gnu.org/licenses/>.
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
@@ -495,7 +496,9 @@ necessary. Here is a sample; alter the names:
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Moe Ghoul>, 1 April 1990
|
||||
Moe Ghoul, President of Vice
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
|
||||
|
||||
|
||||
@@ -1,101 +0,0 @@
|
||||
{
|
||||
nixFlake ? builtins.getFlake ("git+file://" + toString ../../..),
|
||||
system ? builtins.currentSystem,
|
||||
pkgs ? nixFlake.inputs.nixpkgs.legacyPackages.${system},
|
||||
}:
|
||||
|
||||
let
|
||||
inherit (pkgs) lib;
|
||||
|
||||
nixComponentsInstrumented =
|
||||
(nixFlake.lib.makeComponents {
|
||||
inherit pkgs;
|
||||
getStdenv = p: p.clangStdenv;
|
||||
}).overrideScope
|
||||
(
|
||||
_: _: {
|
||||
mesonComponentOverrides = finalAttrs: prevAttrs: {
|
||||
outputs = (prevAttrs.outputs or [ "out" ]) ++ [ "buildprofile" ];
|
||||
nativeBuildInputs = [ pkgs.clangbuildanalyzer ] ++ prevAttrs.nativeBuildInputs or [ ];
|
||||
__impure = true;
|
||||
|
||||
env = {
|
||||
CFLAGS = "-ftime-trace";
|
||||
CXXFLAGS = "-ftime-trace";
|
||||
};
|
||||
|
||||
preBuild = ''
|
||||
ClangBuildAnalyzer --start $PWD
|
||||
'';
|
||||
|
||||
postBuild = ''
|
||||
ClangBuildAnalyzer --stop $PWD $buildprofile
|
||||
'';
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
componentsToProfile = {
|
||||
"nix-util" = { };
|
||||
"nix-util-c" = { };
|
||||
"nix-util-test-support" = { };
|
||||
"nix-util-tests" = { };
|
||||
"nix-store" = { };
|
||||
"nix-store-c" = { };
|
||||
"nix-store-test-support" = { };
|
||||
"nix-store-tests" = { };
|
||||
"nix-fetchers" = { };
|
||||
"nix-fetchers-c" = { };
|
||||
"nix-fetchers-tests" = { };
|
||||
"nix-expr" = { };
|
||||
"nix-expr-c" = { };
|
||||
"nix-expr-test-support" = { };
|
||||
"nix-expr-tests" = { };
|
||||
"nix-flake" = { };
|
||||
"nix-flake-c" = { };
|
||||
"nix-flake-tests" = { };
|
||||
"nix-main" = { };
|
||||
"nix-main-c" = { };
|
||||
"nix-cmd" = { };
|
||||
"nix-cli" = { };
|
||||
};
|
||||
|
||||
componentDerivationsToProfile = builtins.intersectAttrs componentsToProfile nixComponentsInstrumented;
|
||||
componentBuildProfiles = lib.mapAttrs (
|
||||
n: v: lib.getOutput "buildprofile" v
|
||||
) componentDerivationsToProfile;
|
||||
|
||||
buildTimeReport =
|
||||
pkgs.runCommand "build-time-report"
|
||||
{
|
||||
__impure = true;
|
||||
__structuredAttrs = true;
|
||||
nativeBuildInputs = [ pkgs.clangbuildanalyzer ];
|
||||
inherit componentBuildProfiles;
|
||||
}
|
||||
''
|
||||
{
|
||||
echo "# Build time performance profile for components:"
|
||||
echo
|
||||
echo "This reports the build profile collected via \`-ftime-trace\` for each component."
|
||||
echo
|
||||
} >> $out
|
||||
|
||||
for name in "''\${!componentBuildProfiles[@]}"; do
|
||||
{
|
||||
echo "<details><summary><strong>$name</strong></summary>"
|
||||
echo
|
||||
echo '````'
|
||||
ClangBuildAnalyzer --analyze "''\${componentBuildProfiles[$name]}"
|
||||
echo '````'
|
||||
echo
|
||||
echo "</details>"
|
||||
} >> $out
|
||||
done
|
||||
'';
|
||||
in
|
||||
|
||||
{
|
||||
inherit buildTimeReport;
|
||||
inherit componentDerivationsToProfile;
|
||||
}
|
||||
@@ -1,257 +0,0 @@
|
||||
{
|
||||
nixFlake ? builtins.getFlake ("git+file://" + toString ../../..),
|
||||
system ? builtins.currentSystem,
|
||||
pkgs ? nixFlake.inputs.nixpkgs.legacyPackages.${system},
|
||||
nixComponents ? (
|
||||
nixFlake.lib.makeComponents {
|
||||
inherit pkgs;
|
||||
inherit getStdenv;
|
||||
}
|
||||
),
|
||||
getStdenv ? p: p.stdenv,
|
||||
componentTestsPrefix ? "",
|
||||
withSanitizers ? false,
|
||||
withCoverage ? false,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
inherit (pkgs) lib;
|
||||
hydraJobs = nixFlake.hydraJobs;
|
||||
packages' = nixFlake.packages.${system};
|
||||
stdenv = (getStdenv pkgs);
|
||||
|
||||
collectCoverageLayer = finalAttrs: prevAttrs: {
|
||||
env =
|
||||
let
|
||||
# https://clang.llvm.org/docs/SourceBasedCodeCoverage.html#the-code-coverage-workflow
|
||||
coverageFlags = [
|
||||
"-fprofile-instr-generate"
|
||||
"-fcoverage-mapping"
|
||||
];
|
||||
in
|
||||
{
|
||||
CFLAGS = toString coverageFlags;
|
||||
CXXFLAGS = toString coverageFlags;
|
||||
};
|
||||
|
||||
# Done in a pre-configure hook, because $NIX_BUILD_TOP needs to be substituted.
|
||||
preConfigure = prevAttrs.preConfigure or "" + ''
|
||||
mappingFlag=" -fcoverage-prefix-map=$NIX_BUILD_TOP/${finalAttrs.src.name}=${finalAttrs.src}"
|
||||
CFLAGS+="$mappingFlag"
|
||||
CXXFLAGS+="$mappingFlag"
|
||||
'';
|
||||
};
|
||||
|
||||
componentOverrides = (lib.optional withCoverage collectCoverageLayer);
|
||||
in
|
||||
|
||||
rec {
|
||||
nixComponentsInstrumented = nixComponents.overrideScope (
|
||||
final: prev: {
|
||||
withASan = withSanitizers;
|
||||
withUBSan = withSanitizers;
|
||||
|
||||
nix-store-tests = prev.nix-store-tests.override { withBenchmarks = true; };
|
||||
# Boehm is incompatible with ASAN.
|
||||
nix-expr = prev.nix-expr.override { enableGC = !withSanitizers; };
|
||||
|
||||
mesonComponentOverrides = lib.composeManyExtensions componentOverrides;
|
||||
# Unclear how to make Perl bindings work with a dynamically linked ASAN.
|
||||
nix-perl-bindings = if withSanitizers then null else prev.nix-perl-bindings;
|
||||
}
|
||||
);
|
||||
|
||||
# Import NixOS tests using the instrumented components
|
||||
nixosTests = import ../../../tests/nixos {
|
||||
inherit lib pkgs;
|
||||
nixComponents = nixComponentsInstrumented;
|
||||
nixpkgs = nixFlake.inputs.nixpkgs;
|
||||
inherit (nixFlake.inputs) nixpkgs-23-11;
|
||||
};
|
||||
|
||||
/**
|
||||
Top-level tests for the flake outputs, as they would be built by hydra.
|
||||
These tests generally can't be overridden to run with sanitizers.
|
||||
*/
|
||||
topLevel = {
|
||||
installerScriptForGHA = hydraJobs.installerScriptForGHA.${system};
|
||||
installTests = hydraJobs.installTests.${system};
|
||||
nixpkgsLibTests = hydraJobs.tests.nixpkgsLibTests.${system};
|
||||
rl-next = pkgs.buildPackages.runCommand "test-rl-next-release-notes" { } ''
|
||||
LANG=C.UTF-8 ${pkgs.changelog-d}/bin/changelog-d ${../../../doc/manual/rl-next} >$out
|
||||
'';
|
||||
repl-completion = pkgs.callPackage ../../../tests/repl-completion.nix { inherit (packages') nix; };
|
||||
|
||||
/**
|
||||
Checks for our packaging expressions.
|
||||
This shouldn't build anything significant; just check that things
|
||||
(including derivations) are _set up_ correctly.
|
||||
*/
|
||||
packaging-overriding =
|
||||
let
|
||||
nix = packages'.nix;
|
||||
in
|
||||
assert (nix.appendPatches [ pkgs.emptyFile ]).libs.nix-util.src.patches == [ pkgs.emptyFile ];
|
||||
if pkgs.stdenv.buildPlatform.isDarwin then
|
||||
lib.warn "packaging-overriding check currently disabled because of a permissions issue on macOS" pkgs.emptyFile
|
||||
else
|
||||
# If this fails, something might be wrong with how we've wired the scope,
|
||||
# or something could be broken in Nixpkgs.
|
||||
pkgs.testers.testEqualContents {
|
||||
assertion = "trivial patch does not change source contents";
|
||||
expected = "${../../..}";
|
||||
actual =
|
||||
# Same for all components; nix-util is an arbitrary pick
|
||||
(nix.appendPatches [ pkgs.emptyFile ]).libs.nix-util.src;
|
||||
};
|
||||
};
|
||||
|
||||
disable =
|
||||
let
|
||||
inherit (pkgs.stdenv) hostPlatform;
|
||||
in
|
||||
args@{
|
||||
pkgName,
|
||||
testName,
|
||||
test,
|
||||
}:
|
||||
lib.any (b: b) [
|
||||
# FIXME: Nix manual is impure and does not produce all settings on darwin
|
||||
(hostPlatform.isDarwin && pkgName == "nix-manual" && testName == "linkcheck")
|
||||
];
|
||||
|
||||
componentTests =
|
||||
(lib.concatMapAttrs (
|
||||
pkgName: pkg:
|
||||
lib.concatMapAttrs (
|
||||
testName: test:
|
||||
lib.optionalAttrs (!disable { inherit pkgName testName test; }) {
|
||||
"${componentTestsPrefix}${pkgName}-${testName}" = test;
|
||||
}
|
||||
) (pkg.tests or { })
|
||||
) nixComponentsInstrumented)
|
||||
// lib.optionalAttrs (pkgs.stdenv.hostPlatform == pkgs.stdenv.buildPlatform) {
|
||||
"${componentTestsPrefix}nix-functional-tests" = nixComponentsInstrumented.nix-functional-tests;
|
||||
"${componentTestsPrefix}nix-json-schema-checks" = nixComponentsInstrumented.nix-json-schema-checks;
|
||||
};
|
||||
|
||||
codeCoverage =
|
||||
let
|
||||
componentsTestsToProfile =
|
||||
(builtins.mapAttrs (n: v: nixComponentsInstrumented.${n}.tests.run) {
|
||||
"nix-util-tests" = { };
|
||||
"nix-store-tests" = { };
|
||||
"nix-fetchers-tests" = { };
|
||||
"nix-expr-tests" = { };
|
||||
"nix-flake-tests" = { };
|
||||
})
|
||||
// {
|
||||
inherit (nixComponentsInstrumented) nix-functional-tests;
|
||||
};
|
||||
|
||||
coverageProfileDrvs = lib.mapAttrs (
|
||||
n: v:
|
||||
v.overrideAttrs (
|
||||
finalAttrs: prevAttrs: {
|
||||
outputs = (prevAttrs.outputs or [ "out" ]) ++ [ "profraw" ];
|
||||
env = {
|
||||
LLVM_PROFILE_FILE = "${placeholder "profraw"}/%m";
|
||||
};
|
||||
}
|
||||
)
|
||||
) componentsTestsToProfile;
|
||||
|
||||
coverageProfiles = lib.mapAttrsToList (n: v: lib.getOutput "profraw" v) coverageProfileDrvs;
|
||||
|
||||
mergedProfdata =
|
||||
pkgs.runCommand "merged-profdata"
|
||||
{
|
||||
__structuredAttrs = true;
|
||||
nativeBuildInputs = [ pkgs.llvmPackages.libllvm ];
|
||||
inherit coverageProfiles;
|
||||
}
|
||||
''
|
||||
rawProfiles=()
|
||||
for dir in "''\${coverageProfiles[@]}"; do
|
||||
rawProfiles+=($dir/*)
|
||||
done
|
||||
llvm-profdata merge -sparse -output $out "''\${rawProfiles[@]}"
|
||||
'';
|
||||
|
||||
coverageReports =
|
||||
let
|
||||
nixComponentDrvs = lib.filter (lib.isDerivation) (lib.attrValues nixComponentsInstrumented);
|
||||
in
|
||||
pkgs.runCommand "code-coverage-report"
|
||||
{
|
||||
nativeBuildInputs = [
|
||||
pkgs.llvmPackages.libllvm
|
||||
pkgs.jq
|
||||
];
|
||||
__structuredAttrs = true;
|
||||
nixComponents = nixComponentDrvs;
|
||||
}
|
||||
''
|
||||
# ${toString (lib.map (v: v.src) nixComponentDrvs)}
|
||||
|
||||
binaryFiles=()
|
||||
for dir in "''\${nixComponents[@]}"; do
|
||||
readarray -t filesInDir < <(find "$dir" -type f -executable)
|
||||
binaryFiles+=("''\${filesInDir[@]}")
|
||||
done
|
||||
|
||||
arguments=$(concatStringsSep " -object " binaryFiles)
|
||||
llvm-cov show $arguments -instr-profile ${mergedProfdata} -output-dir $out -format=html
|
||||
|
||||
{
|
||||
echo "# Code coverage summary (generated via \`llvm-cov\`):"
|
||||
echo
|
||||
echo '```'
|
||||
llvm-cov report $arguments -instr-profile ${mergedProfdata} -format=text -use-color=false
|
||||
echo '```'
|
||||
echo
|
||||
} >> $out/index.txt
|
||||
|
||||
llvm-cov export $arguments -instr-profile ${mergedProfdata} -format=text > $out/coverage.json
|
||||
|
||||
mkdir -p $out/nix-support
|
||||
|
||||
coverageTotals=$(jq ".data[0].totals" $out/coverage.json)
|
||||
|
||||
# Mostly inline from pkgs/build-support/setup-hooks/make-coverage-analysis-report.sh [1],
|
||||
# which we can't use here, because we rely on LLVM's infra for source code coverage collection.
|
||||
# [1]: https://github.com/NixOS/nixpkgs/blob/67bb48c4c8e327417d6d5aa7e538244b209e852b/pkgs/build-support/setup-hooks/make-coverage-analysis-report.sh#L16
|
||||
declare -A metricsArray=(["lineCoverage"]="lines" ["functionCoverage"]="functions" ["branchCoverage"]="branches")
|
||||
|
||||
for metricName in "''\${!metricsArray[@]}"; do
|
||||
key="''\${metricsArray[$metricName]}"
|
||||
metric=$(echo "$coverageTotals" | jq ".$key.percent * 10 | round / 10")
|
||||
echo "$metricName $metric %" >> $out/nix-support/hydra-metrics
|
||||
done
|
||||
|
||||
echo "report coverage $out" >> $out/nix-support/hydra-build-products
|
||||
'';
|
||||
in
|
||||
assert withCoverage;
|
||||
assert stdenv.cc.isClang;
|
||||
{
|
||||
inherit coverageProfileDrvs mergedProfdata coverageReports;
|
||||
};
|
||||
|
||||
vmTests = {
|
||||
inherit (nixosTests) s3-binary-cache-store;
|
||||
}
|
||||
// lib.optionalAttrs (!withSanitizers && !withCoverage) {
|
||||
# evalNixpkgs uses non-instrumented components from hydraJobs, so only run it
|
||||
# when not testing with sanitizers to avoid rebuilding nix
|
||||
inherit (hydraJobs.tests) evalNixpkgs;
|
||||
# FIXME: CI times out when building vm tests instrumented
|
||||
inherit (nixosTests)
|
||||
functional_user
|
||||
githubFlakes
|
||||
nix-docker
|
||||
tarballFlakes
|
||||
;
|
||||
};
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
system=$(nix eval --raw --impure --expr builtins.currentSystem)
|
||||
|
||||
echo "::group::Running pre-commit checks"
|
||||
|
||||
if nix build ".#checks.$system.pre-commit" -L; then
|
||||
echo "::endgroup::"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "::error ::Changes do not pass pre-commit checks"
|
||||
|
||||
cat <<EOF
|
||||
The code isn't formatted or doesn't pass lints. You can run pre-commit locally with:
|
||||
|
||||
nix develop -c ./maintainers/format.sh
|
||||
EOF
|
||||
|
||||
echo "::endgroup::"
|
||||
|
||||
exit 1
|
||||
@@ -1,16 +0,0 @@
|
||||
{
|
||||
nixFlake ? builtins.getFlake ("git+file://" + toString ../../..),
|
||||
system ? builtins.currentSystem,
|
||||
pkgs ? nixFlake.inputs.nixpkgs.legacyPackages.${system},
|
||||
stdenv ? "stdenv",
|
||||
componentTestsPrefix ? "",
|
||||
withInstrumentation ? false,
|
||||
}@args:
|
||||
import ./. (
|
||||
args
|
||||
// {
|
||||
getStdenv = p: p.${stdenv};
|
||||
withSanitizers = withInstrumentation;
|
||||
withCoverage = withInstrumentation;
|
||||
}
|
||||
)
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
|
||||
def transform_anchors_html:
|
||||
. | gsub($empty_anchor_regex; "<a id=\"" + .anchor + "\"></a>")
|
||||
. | gsub($empty_anchor_regex; "<a name=\"" + .anchor + "\"></a>")
|
||||
| gsub($anchor_regex; "<a href=\"#" + .anchor + "\" id=\"" + .anchor + "\">" + .text + "</a>");
|
||||
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ additional-css = ["custom.css"]
|
||||
additional-js = ["redirects.js"]
|
||||
edit-url-template = "https://github.com/NixOS/nix/tree/master/doc/manual/{path}"
|
||||
git-repository-url = "https://github.com/NixOS/nix"
|
||||
mathjax-support = true
|
||||
|
||||
# Handles replacing @docroot@ with a path to ./source relative to that markdown file,
|
||||
# {{#include handlebars}}, and the @generated@ syntax used within these. it mostly
|
||||
|
||||
@@ -24,9 +24,9 @@ let
|
||||
in
|
||||
concatStringsSep "\n" (map showEntry storesList);
|
||||
|
||||
"index.md" = replaceStrings [ "@store-types@" ] [ index ] (
|
||||
readFile ./source/store/types/index.md.in
|
||||
);
|
||||
"index.md" =
|
||||
replaceStrings [ "@store-types@" ] [ index ]
|
||||
(readFile ./source/store/types/index.md.in);
|
||||
|
||||
tableOfContents =
|
||||
let
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
project(
|
||||
'nix-manual',
|
||||
project('nix-manual',
|
||||
version : files('.version'),
|
||||
meson_version : '>= 1.1',
|
||||
license : 'LGPL-2.1-or-later',
|
||||
@@ -9,45 +8,43 @@ nix = find_program('nix', native : true)
|
||||
|
||||
mdbook = find_program('mdbook', native : true)
|
||||
bash = find_program('bash', native : true)
|
||||
rsync = find_program('rsync', required : true, native : true)
|
||||
|
||||
pymod = import('python')
|
||||
python = pymod.find_installation('python3')
|
||||
|
||||
nix_env_for_docs = {
|
||||
'HOME' : '/dummy',
|
||||
'NIX_CONF_DIR' : '/dummy',
|
||||
'NIX_SSL_CERT_FILE' : '/dummy/no-ca-bundle.crt',
|
||||
'NIX_STATE_DIR' : '/dummy',
|
||||
'NIX_CONFIG' : 'cores = 0',
|
||||
'HOME': '/dummy',
|
||||
'NIX_CONF_DIR': '/dummy',
|
||||
'NIX_SSL_CERT_FILE': '/dummy/no-ca-bundle.crt',
|
||||
'NIX_STATE_DIR': '/dummy',
|
||||
'NIX_CONFIG': 'cores = 0',
|
||||
}
|
||||
|
||||
nix_for_docs = [ nix, '--experimental-features', 'nix-command' ]
|
||||
nix_for_docs = [nix, '--experimental-features', 'nix-command']
|
||||
nix_eval_for_docs_common = nix_for_docs + [
|
||||
'eval',
|
||||
'-I',
|
||||
'nix=' + meson.current_source_dir(),
|
||||
'-I', 'nix=' + meson.current_source_dir(),
|
||||
'--store', 'dummy://',
|
||||
'--impure',
|
||||
]
|
||||
nix_eval_for_docs = nix_eval_for_docs_common + '--raw'
|
||||
|
||||
conf_file_json = custom_target(
|
||||
command : nix_for_docs + [ 'config', 'show', '--json' ],
|
||||
command : nix_for_docs + ['config', 'show', '--json'],
|
||||
capture : true,
|
||||
output : 'conf-file.json',
|
||||
env : nix_env_for_docs,
|
||||
)
|
||||
|
||||
language_json = custom_target(
|
||||
command : [ nix, '__dump-language' ],
|
||||
command: [nix, '__dump-language'],
|
||||
output : 'language.json',
|
||||
capture : true,
|
||||
env : nix_env_for_docs,
|
||||
)
|
||||
|
||||
nix3_cli_json = custom_target(
|
||||
command : [ nix, '__dump-cli' ],
|
||||
command : [nix, '__dump-cli'],
|
||||
capture : true,
|
||||
output : 'nix.json',
|
||||
env : nix_env_for_docs,
|
||||
@@ -81,26 +78,22 @@ manual = custom_target(
|
||||
'manual',
|
||||
command : [
|
||||
bash,
|
||||
'-euo',
|
||||
'pipefail',
|
||||
'-euo', 'pipefail',
|
||||
'-c',
|
||||
'''
|
||||
@0@ @INPUT0@ @CURRENT_SOURCE_DIR@ > @DEPFILE@
|
||||
@0@ @INPUT1@ summary @2@ < @CURRENT_SOURCE_DIR@/source/SUMMARY.md.in > @2@/source/SUMMARY.md
|
||||
sed -e 's|@version@|@3@|g' < @INPUT2@ > @2@/book.toml
|
||||
@4@ -r -L --include='*.md' @CURRENT_SOURCE_DIR@/ @2@/
|
||||
rsync -r --include='*.md' @CURRENT_SOURCE_DIR@/ @2@/
|
||||
(cd @2@; RUST_LOG=warn @1@ build -d @2@ 3>&2 2>&1 1>&3) | { grep -Fv "because fragment resolution isn't implemented" || :; } 3>&2 2>&1 1>&3
|
||||
rm -rf @2@/manual
|
||||
mv @2@/html @2@/manual
|
||||
# Remove Mathjax 2.7, because we will actually use MathJax 3.x
|
||||
find @2@/manual | grep .html | xargs sed -i -e '/2.7.1.MathJax.js/d'
|
||||
find @2@/manual -iname meson.build -delete
|
||||
'''.format(
|
||||
python.full_path(),
|
||||
mdbook.full_path(),
|
||||
meson.current_build_dir(),
|
||||
meson.project_version(),
|
||||
rsync.full_path(),
|
||||
),
|
||||
],
|
||||
input : [
|
||||
@@ -117,7 +110,6 @@ manual = custom_target(
|
||||
builtins_md,
|
||||
rl_next_generated,
|
||||
summary_rl_next,
|
||||
json_schema_generated_files,
|
||||
nix_input,
|
||||
],
|
||||
output : [
|
||||
@@ -126,8 +118,8 @@ manual = custom_target(
|
||||
],
|
||||
depfile : 'manual.d',
|
||||
env : {
|
||||
'RUST_LOG' : 'info',
|
||||
'MDBOOK_SUBSTITUTE_SEARCH' : meson.current_build_dir() / 'source',
|
||||
'RUST_LOG': 'info',
|
||||
'MDBOOK_SUBSTITUTE_SEARCH': meson.current_build_dir() / 'source',
|
||||
},
|
||||
)
|
||||
manual_html = manual[0]
|
||||
@@ -139,8 +131,7 @@ install_subdir(
|
||||
)
|
||||
|
||||
nix_nested_manpages = [
|
||||
[
|
||||
'nix-env',
|
||||
[ 'nix-env',
|
||||
[
|
||||
'delete-generations',
|
||||
'install',
|
||||
@@ -155,8 +146,7 @@ nix_nested_manpages = [
|
||||
'upgrade',
|
||||
],
|
||||
],
|
||||
[
|
||||
'nix-store',
|
||||
[ 'nix-store',
|
||||
[
|
||||
'add-fixed',
|
||||
'add',
|
||||
@@ -256,11 +246,11 @@ nix3_manpages = [
|
||||
'nix3-nar',
|
||||
'nix3-path-info',
|
||||
'nix3-print-dev-env',
|
||||
'nix3-profile',
|
||||
'nix3-profile-add',
|
||||
'nix3-profile-diff-closures',
|
||||
'nix3-profile-history',
|
||||
'nix3-profile-install',
|
||||
'nix3-profile-list',
|
||||
'nix3-profile',
|
||||
'nix3-profile-remove',
|
||||
'nix3-profile-rollback',
|
||||
'nix3-profile-upgrade',
|
||||
|
||||
@@ -12,15 +12,11 @@
|
||||
rsync,
|
||||
nix-cli,
|
||||
changelog-d,
|
||||
json-schema-for-humans,
|
||||
officialRelease,
|
||||
|
||||
# Configuration Options
|
||||
|
||||
version,
|
||||
|
||||
# `tests` attribute
|
||||
testers,
|
||||
}:
|
||||
|
||||
let
|
||||
@@ -36,15 +32,6 @@ mkMesonDerivation (finalAttrs: {
|
||||
fileset.difference
|
||||
(fileset.unions [
|
||||
../../.version
|
||||
# For example JSON
|
||||
../../src/libutil-tests/data/hash
|
||||
../../src/libstore-tests/data/content-address
|
||||
../../src/libstore-tests/data/store-path
|
||||
../../src/libstore-tests/data/realisation
|
||||
../../src/libstore-tests/data/derived-path
|
||||
../../src/libstore-tests/data/path-info
|
||||
../../src/libstore-tests/data/nar-info
|
||||
../../src/libstore-tests/data/build-result
|
||||
# Too many different types of files to filter for now
|
||||
../../doc/manual
|
||||
./.
|
||||
@@ -58,24 +45,28 @@ mkMesonDerivation (finalAttrs: {
|
||||
"man"
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
# Hack for sake of the dev shell
|
||||
passthru.externalNativeBuildInputs =
|
||||
[
|
||||
meson
|
||||
ninja
|
||||
(lib.getBin lowdown-unsandboxed)
|
||||
mdbook
|
||||
mdbook-linkcheck
|
||||
jq
|
||||
python3
|
||||
rsync
|
||||
changelog-d
|
||||
]
|
||||
++ lib.optionals (!officialRelease) [
|
||||
# When not an official release, we likely have changelog entries that have
|
||||
# yet to be rendered.
|
||||
# When released, these are rendered into a committed file to save a dependency.
|
||||
changelog-d
|
||||
];
|
||||
|
||||
nativeBuildInputs = finalAttrs.passthru.externalNativeBuildInputs ++ [
|
||||
nix-cli
|
||||
meson
|
||||
ninja
|
||||
(lib.getBin lowdown-unsandboxed)
|
||||
mdbook
|
||||
mdbook-linkcheck
|
||||
jq
|
||||
python3
|
||||
rsync
|
||||
json-schema-for-humans
|
||||
changelog-d
|
||||
]
|
||||
++ lib.optionals (!officialRelease) [
|
||||
# When not an official release, we likely have changelog entries that have
|
||||
# yet to be rendered.
|
||||
# When released, these are rendered into a committed file to save a dependency.
|
||||
changelog-d
|
||||
];
|
||||
|
||||
preConfigure = ''
|
||||
@@ -88,29 +79,6 @@ mkMesonDerivation (finalAttrs: {
|
||||
echo "doc manual ''$out/share/doc/nix/manual" >> ''$out/nix-support/hydra-build-products
|
||||
'';
|
||||
|
||||
/**
|
||||
The root of the HTML manual.
|
||||
E.g. "${nix-manual.site}/index.html" exists.
|
||||
*/
|
||||
passthru.site = finalAttrs.finalPackage + "/share/doc/nix/manual";
|
||||
|
||||
passthru.tests = {
|
||||
# https://nixos.org/manual/nixpkgs/stable/index.html#tester-lycheeLinkCheck
|
||||
linkcheck = testers.lycheeLinkCheck {
|
||||
inherit (finalAttrs.finalPackage) site;
|
||||
extraConfig = {
|
||||
exclude = [
|
||||
# Exclude auto-generated JSON schema documentation which has
|
||||
# auto-generated fragment IDs that don't match the link references
|
||||
".*/protocols/json/.*\\.html"
|
||||
# Exclude undocumented builtins
|
||||
".*/language/builtins\\.html#builtins-addErrorContext"
|
||||
".*/language/builtins\\.html#builtins-appendContext"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
meta = {
|
||||
platforms = lib.platforms.all;
|
||||
};
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
---
|
||||
synopsis: Channel URLs migrated to channels.nixos.org subdomain
|
||||
prs: [14518]
|
||||
issues: [14517]
|
||||
---
|
||||
|
||||
Channel URLs have been updated from `https://nixos.org/channels/` to `https://channels.nixos.org/` throughout Nix.
|
||||
|
||||
The subdomain provides better reliability with IPv6 support and improved CDN distribution. The old domain apex (`nixos.org/channels/`) currently redirects to the new location but may be deprecated in the future.
|
||||
@@ -1,55 +0,0 @@
|
||||
---
|
||||
synopsis: "JSON format changes for store path info and derivations"
|
||||
prs: []
|
||||
issues: []
|
||||
---
|
||||
|
||||
JSON formats for store path info and derivations have been updated with new versions and structured fields.
|
||||
|
||||
## Store Path Info JSON (Version 2)
|
||||
|
||||
The store path info JSON format has been updated from version 1 to version 2:
|
||||
|
||||
- **Added `version` field**:
|
||||
|
||||
All store path info JSON now includes `"version": 2`.
|
||||
|
||||
- **Structured `ca` field**:
|
||||
|
||||
Content address is now a structured JSON object instead of a string:
|
||||
|
||||
- Old: `"ca": "fixed:r:sha256:1abc..."`
|
||||
- New: `"ca": {"method": "nar", "hash": {"algorithm": "sha256", "format": "base64", "hash": "EMIJ+giQ..."}}`
|
||||
- Still `null` values for input-addressed store objects
|
||||
|
||||
- **Structured hash fields**:
|
||||
|
||||
Hash values (`narHash` and `downloadHash`) are now structured JSON objects instead of strings:
|
||||
|
||||
- Old: `"narHash": "sha256:FePFYIlMuycIXPZbWi7LGEiMmZSX9FMbaQenWBzm1Sc="`
|
||||
- New: `"narHash": {"algorithm": "sha256", "format": "base64", "hash": "FePFYIlM..."}`
|
||||
- Same structure applies to `downloadHash` in NAR info contexts
|
||||
|
||||
Nix currently only produces, and doesn't consume this format.
|
||||
|
||||
**Affected command**: `nix path-info --json`
|
||||
|
||||
## Derivation JSON (Version 4)
|
||||
|
||||
The derivation JSON format has been updated from version 3 to version 4:
|
||||
|
||||
- **Restructured inputs**:
|
||||
|
||||
Inputs are now nested under an `inputs` object:
|
||||
|
||||
- Old: `"inputSrcs": [...], "inputDrvs": {...}`
|
||||
- New: `"inputs": {"srcs": [...], "drvs": {...}}`
|
||||
|
||||
- **Consistent content addresses**:
|
||||
|
||||
Floating content-addressed outputs now use structured JSON format.
|
||||
This is the same format as `ca` in in store path info (after the new version).
|
||||
|
||||
Version 3 and earlier formats are *not* accepted when reading.
|
||||
|
||||
**Affected command**: `nix derivation`, namely it's `show` and `add` sub-commands.
|
||||
@@ -1,40 +0,0 @@
|
||||
---
|
||||
synopsis: "Improved S3 binary cache support via HTTP"
|
||||
prs: [13752, 13823, 14026, 14120, 14131, 14135, 14144, 14170, 14190, 14198, 14206, 14209, 14222, 14223, 14330, 14333, 14335, 14336, 14337, 14350, 14356, 14357, 14374, 14375, 14376, 14377, 14391, 14393, 14420, 14421]
|
||||
issues: [13084, 12671, 11748, 12403]
|
||||
---
|
||||
|
||||
S3 binary cache operations now happen via HTTP, leveraging `libcurl`'s native
|
||||
AWS SigV4 authentication instead of the AWS C++ SDK, providing significant
|
||||
improvements:
|
||||
|
||||
- **Reduced memory usage**: Eliminates memory buffering issues that caused
|
||||
segfaults with large files
|
||||
- **Fixed upload reliability**: Resolves AWS SDK chunking errors
|
||||
(`InvalidChunkSizeError`)
|
||||
- **Lighter dependencies**: Uses lightweight `aws-crt-cpp` instead of full
|
||||
`aws-cpp-sdk`, reducing build complexity
|
||||
|
||||
The new implementation requires curl >= 7.75.0 and `aws-crt-cpp` for credential
|
||||
management.
|
||||
|
||||
All existing S3 URL formats and parameters remain supported, however the store
|
||||
settings for configuring multipart uploads have changed:
|
||||
|
||||
- **`multipart-upload`** (default: `false`): Enable multipart uploads for large
|
||||
files. When enabled, files exceeding the multipart threshold will be uploaded
|
||||
in multiple parts.
|
||||
|
||||
- **`multipart-threshold`** (default: `100 MiB`): Minimum file size for using
|
||||
multipart uploads. Files smaller than this will use regular PUT requests.
|
||||
Only takes effect when `multipart-upload` is enabled.
|
||||
|
||||
- **`multipart-chunk-size`** (default: `5 MiB`): Size of each part in multipart
|
||||
uploads. Must be at least 5 MiB (AWS S3 requirement). Larger chunk sizes
|
||||
reduce the number of requests but use more memory.
|
||||
|
||||
- **`buffer-size`**: Has been replaced by `multipart-chunk-size` and is now an alias to it.
|
||||
|
||||
Note that this change also means Nix now supports S3 binary cache stores even
|
||||
if built without `aws-crt-cpp`, but only for public buckets which do not
|
||||
require authentication.
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
synopsis: "S3 URLs now support object versioning via versionId parameter"
|
||||
prs: [14274]
|
||||
issues: [13955]
|
||||
---
|
||||
|
||||
S3 URLs now support a `versionId` query parameter to fetch specific versions
|
||||
of objects from S3 buckets with versioning enabled. This allows pinning to
|
||||
exact object versions for reproducibility and protection against unexpected
|
||||
changes:
|
||||
|
||||
```
|
||||
s3://bucket/key?region=us-east-1&versionId=abc123def456
|
||||
```
|
||||
@@ -1,21 +0,0 @@
|
||||
---
|
||||
synopsis: "S3 binary cache stores now support storage class configuration"
|
||||
prs: [14464]
|
||||
issues: [7015]
|
||||
---
|
||||
|
||||
S3 binary cache stores now support configuring the storage class for uploaded objects via the `storage-class` parameter. This allows users to optimize costs by selecting appropriate storage tiers based on access patterns.
|
||||
|
||||
Example usage:
|
||||
|
||||
```bash
|
||||
# Use Glacier storage for long-term archival
|
||||
nix copy --to 's3://my-bucket?storage-class=GLACIER' /nix/store/...
|
||||
|
||||
# Use Intelligent Tiering for automatic cost optimization
|
||||
nix copy --to 's3://my-bucket?storage-class=INTELLIGENT_TIERING' /nix/store/...
|
||||
```
|
||||
|
||||
The storage class applies to both regular uploads and multipart uploads. When not specified, objects use the bucket's default storage class.
|
||||
|
||||
See the [S3 storage classes documentation](https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-class-intro.html) for available storage classes and their characteristics.
|
||||
@@ -26,13 +26,9 @@
|
||||
- [Derivation Outputs and Types of Derivations](store/derivation/outputs/index.md)
|
||||
- [Content-addressing derivation outputs](store/derivation/outputs/content-address.md)
|
||||
- [Input-addressing derivation outputs](store/derivation/outputs/input-address.md)
|
||||
- [Build Trace](store/build-trace.md)
|
||||
- [Derivation Resolution](store/resolution.md)
|
||||
- [Building](store/building.md)
|
||||
- [Secrets](store/secrets.md)
|
||||
- [Store Types](store/types/index.md)
|
||||
{{#include ./store/types/SUMMARY.md}}
|
||||
- [Appendix: Math notation](store/math-notation.md)
|
||||
- [Nix Language](language/index.md)
|
||||
- [Data Types](language/types.md)
|
||||
- [String context](language/string-context.md)
|
||||
@@ -61,7 +57,6 @@
|
||||
- [Tuning Cores and Jobs](advanced-topics/cores-vs-jobs.md)
|
||||
- [Verifying Build Reproducibility](advanced-topics/diff-hook.md)
|
||||
- [Using the `post-build-hook`](advanced-topics/post-build-hook.md)
|
||||
- [Evaluation profiler](advanced-topics/eval-profiler.md)
|
||||
- [Command Reference](command-ref/index.md)
|
||||
- [Common Options](command-ref/opt-common.md)
|
||||
- [Common Environment Variables](command-ref/env-common.md)
|
||||
@@ -121,24 +116,17 @@
|
||||
- [Architecture and Design](architecture/architecture.md)
|
||||
- [Formats and Protocols](protocols/index.md)
|
||||
- [JSON Formats](protocols/json/index.md)
|
||||
- [Hash](protocols/json/hash.md)
|
||||
- [Content Address](protocols/json/content-address.md)
|
||||
- [Store Path](protocols/json/store-path.md)
|
||||
- [Store Object Info](protocols/json/store-object-info.md)
|
||||
- [Derivation](protocols/json/derivation.md)
|
||||
- [Deriving Path](protocols/json/deriving-path.md)
|
||||
- [Build Trace Entry](protocols/json/build-trace-entry.md)
|
||||
- [Build Result](protocols/json/build-result.md)
|
||||
- [Serving Tarball Flakes](protocols/tarball-fetcher.md)
|
||||
- [Store Path Specification](protocols/store-path.md)
|
||||
- [Nix Archive (NAR) Format](protocols/nix-archive/index.md)
|
||||
- [Nix Archive (NAR) Format](protocols/nix-archive.md)
|
||||
- [Derivation "ATerm" file format](protocols/derivation-aterm.md)
|
||||
- [C API](c-api.md)
|
||||
- [Glossary](glossary.md)
|
||||
- [Development](development/index.md)
|
||||
- [Building](development/building.md)
|
||||
- [Testing](development/testing.md)
|
||||
- [Benchmarking](development/benchmarking.md)
|
||||
- [Debugging](development/debugging.md)
|
||||
- [Documentation](development/documentation.md)
|
||||
- [CLI guideline](development/cli-guideline.md)
|
||||
@@ -148,9 +136,6 @@
|
||||
- [Contributing](development/contributing.md)
|
||||
- [Releases](release-notes/index.md)
|
||||
{{#include ./SUMMARY-rl-next.md}}
|
||||
- [Release 2.32 (2025-10-06)](release-notes/rl-2.32.md)
|
||||
- [Release 2.31 (2025-08-21)](release-notes/rl-2.31.md)
|
||||
- [Release 2.30 (2025-07-07)](release-notes/rl-2.30.md)
|
||||
- [Release 2.29 (2025-05-14)](release-notes/rl-2.29.md)
|
||||
- [Release 2.28 (2025-04-02)](release-notes/rl-2.28.md)
|
||||
- [Release 2.27 (2025-03-03)](release-notes/rl-2.27.md)
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
# Using the `eval-profiler`
|
||||
|
||||
Nix evaluator supports [evaluation](@docroot@/language/evaluation.md)
|
||||
[profiling](<https://en.wikipedia.org/wiki/Profiling_(computer_programming)>)
|
||||
compatible with `flamegraph.pl`. The profiler samples the nix
|
||||
function call stack at regular intervals. It can be enabled with the
|
||||
[`eval-profiler`](@docroot@/command-ref/conf-file.md#conf-eval-profiler)
|
||||
setting:
|
||||
|
||||
```console
|
||||
$ nix-instantiate "<nixpkgs>" -A hello --eval-profiler flamegraph
|
||||
```
|
||||
|
||||
Stack sampling frequency and the output file path can be configured with
|
||||
[`eval-profile-file`](@docroot@/command-ref/conf-file.md#conf-eval-profile-file)
|
||||
and [`eval-profiler-frequency`](@docroot@/command-ref/conf-file.md#conf-eval-profiler-frequency).
|
||||
By default the collected profile is saved to `nix.profile` file in the current working directory.
|
||||
|
||||
The collected profile can be directly consumed by `flamegraph.pl`:
|
||||
|
||||
```console
|
||||
$ flamegraph.pl nix.profile > flamegraph.svg
|
||||
```
|
||||
|
||||
The line information in the profile contains the location of the [call
|
||||
site](https://en.wikipedia.org/wiki/Call_site) position and the name of the
|
||||
function being called (when available). For example:
|
||||
|
||||
```
|
||||
/nix/store/x9wnkly3k1gkq580m90jjn32q9f05q2v-source/pkgs/top-level/default.nix:167:5:primop import
|
||||
```
|
||||
|
||||
Here `import` primop is called at `/nix/store/x9wnkly3k1gkq580m90jjn32q9f05q2v-source/pkgs/top-level/default.nix:167:5`.
|
||||
@@ -75,7 +75,7 @@ Most Nix commands interpret the following environment variables:
|
||||
- <span id="env-NIX_CONF_DIR">[`NIX_CONF_DIR`](#env-NIX_CONF_DIR)</span>
|
||||
|
||||
Overrides the location of the system Nix configuration directory
|
||||
(default `sysconfdir/nix`, i.e. `/etc/nix` on most systems).
|
||||
(default `prefix/etc/nix`).
|
||||
|
||||
- <span id="env-NIX_CONFIG">[`NIX_CONFIG`](#env-NIX_CONFIG)</span>
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
xp_features_json = custom_target(
|
||||
command : [ nix, '__dump-xp-features' ],
|
||||
command : [nix, '__dump-xp-features'],
|
||||
capture : true,
|
||||
output : 'xp-features.json',
|
||||
env : nix_env_for_docs,
|
||||
)
|
||||
|
||||
experimental_features_shortlist_md = custom_target(
|
||||
command : nix_eval_for_docs + [
|
||||
'--expr', 'import @INPUT0@ (builtins.fromJSON (builtins.readFile ./@INPUT1@))',
|
||||
'--expr',
|
||||
'import @INPUT0@ (builtins.fromJSON (builtins.readFile ./@INPUT1@))',
|
||||
],
|
||||
input : [
|
||||
'../../generate-xp-features-shortlist.nix',
|
||||
@@ -19,8 +19,14 @@ experimental_features_shortlist_md = custom_target(
|
||||
)
|
||||
|
||||
nix3_cli_files = custom_target(
|
||||
command : [ python.full_path(), '@INPUT0@', '@OUTPUT@', '--' ] + nix_eval_for_docs + [
|
||||
'--expr', 'import @INPUT1@ true (builtins.readFile ./@INPUT2@)',
|
||||
command : [
|
||||
python.full_path(),
|
||||
'@INPUT0@',
|
||||
'@OUTPUT@',
|
||||
'--'
|
||||
] + nix_eval_for_docs + [
|
||||
'--expr',
|
||||
'import @INPUT1@ true (builtins.readFile ./@INPUT2@)',
|
||||
],
|
||||
input : [
|
||||
'../../remove_before_wrapper.py',
|
||||
@@ -34,7 +40,8 @@ nix3_cli_files = custom_target(
|
||||
conf_file_md_body = custom_target(
|
||||
command : [
|
||||
nix_eval_for_docs,
|
||||
'--expr', 'import @INPUT0@ { prefix = "conf"; } (builtins.fromJSON (builtins.readFile ./@INPUT1@))',
|
||||
'--expr',
|
||||
'import @INPUT0@ { prefix = "conf"; } (builtins.fromJSON (builtins.readFile ./@INPUT1@))',
|
||||
],
|
||||
capture : true,
|
||||
input : [
|
||||
|
||||
@@ -11,10 +11,10 @@
|
||||
Channels are a mechanism for referencing remote Nix expressions and conveniently retrieving their latest version.
|
||||
|
||||
The moving parts of channels are:
|
||||
- The official channels listed at <https://channels.nixos.org>
|
||||
- The official channels listed at <https://nixos.org/channels>
|
||||
- The user-specific list of [subscribed channels](#subscribed-channels)
|
||||
- The [downloaded channel contents](#channels)
|
||||
- The [Nix expression search path](@docroot@/command-ref/conf-file.md#conf-nix-path), set with the [`-I` option](#opt-I) or the [`NIX_PATH` environment variable](#env-NIX_PATH)
|
||||
- The [Nix expression search path](@docroot@/command-ref/conf-file.md#conf-nix-path), set with the [`-I` option](#opt-i) or the [`NIX_PATH` environment variable](#env-NIX_PATH)
|
||||
|
||||
> **Note**
|
||||
>
|
||||
@@ -53,11 +53,6 @@ This command has the following operations:
|
||||
Download the Nix expressions of subscribed channels and create a new generation.
|
||||
Update all channels if none is specified, and only those included in *names* otherwise.
|
||||
|
||||
> **Note**
|
||||
>
|
||||
> Downloaded channel contents are cached.
|
||||
> Use `--tarball-ttl` or the [`tarball-ttl` configuration option](@docroot@/command-ref/conf-file.md#conf-tarball-ttl) to change the validity period of cached downloads.
|
||||
|
||||
- `--list-generations`
|
||||
|
||||
Prints a list of all the current existing generations for the
|
||||
@@ -88,9 +83,9 @@ This command has the following operations:
|
||||
Subscribe to the Nixpkgs channel and run `hello` from the GNU Hello package:
|
||||
|
||||
```console
|
||||
$ nix-channel --add https://channels.nixos.org/nixpkgs-unstable
|
||||
$ nix-channel --add https://nixos.org/channels/nixpkgs-unstable
|
||||
$ nix-channel --list
|
||||
nixpkgs https://channels.nixos.org/nixpkgs
|
||||
nixpkgs https://nixos.org/channels/nixpkgs
|
||||
$ nix-channel --update
|
||||
$ nix-shell -p hello --run hello
|
||||
hello
|
||||
|
||||
@@ -22,7 +22,7 @@ left untouched; this is not an error. It is also not an error if an
|
||||
element of *args* matches no installed derivations.
|
||||
|
||||
For a description of how *args* is mapped to a set of store paths, see
|
||||
[`--install`](./install.md). If *args* describes multiple
|
||||
[`--install`](#operation---install). If *args* describes multiple
|
||||
store paths with the same symbolic name, only the one with the highest
|
||||
version is installed.
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
This man page describes the command `nix-shell`, which is distinct from `nix
|
||||
shell`. For documentation on the latter, run `nix shell --help` or see `man
|
||||
nix3-env-shell`.
|
||||
nix3-shell`.
|
||||
|
||||
# Description
|
||||
|
||||
|
||||
@@ -48,7 +48,8 @@ The behaviour of the collector is also influenced by the
|
||||
configuration file.
|
||||
|
||||
By default, the collector prints the total number of freed bytes when it
|
||||
finishes (or when it is interrupted).
|
||||
finishes (or when it is interrupted). With `--print-dead`, it prints the
|
||||
number of bytes that would be freed.
|
||||
|
||||
{{#include ./opt-common.md}}
|
||||
|
||||
|
||||
@@ -1,187 +0,0 @@
|
||||
# Running Benchmarks
|
||||
|
||||
This guide explains how to build and run performance benchmarks in the Nix codebase.
|
||||
|
||||
## Overview
|
||||
|
||||
Nix uses the [Google Benchmark](https://github.com/google/benchmark) framework for performance testing. Benchmarks help measure and track the performance of critical operations like derivation parsing.
|
||||
|
||||
## Building Benchmarks
|
||||
|
||||
Benchmarks are disabled by default and must be explicitly enabled during the build configuration. For accurate results, use a debug-optimized release build.
|
||||
|
||||
### Development Environment Setup
|
||||
|
||||
First, enter the development shell which includes the necessary dependencies:
|
||||
|
||||
```bash
|
||||
nix develop .#native-ccacheStdenv
|
||||
```
|
||||
|
||||
### Configure Build with Benchmarks
|
||||
|
||||
From the project root, configure the build with benchmarks enabled and optimization:
|
||||
|
||||
```bash
|
||||
cd build
|
||||
meson configure -Dbenchmarks=true -Dbuildtype=debugoptimized
|
||||
```
|
||||
|
||||
The `debugoptimized` build type provides:
|
||||
- Compiler optimizations for realistic performance measurements
|
||||
- Debug symbols for profiling and analysis
|
||||
- Balance between performance and debuggability
|
||||
|
||||
### Build the Benchmarks
|
||||
|
||||
Build the project including benchmarks:
|
||||
|
||||
```bash
|
||||
ninja
|
||||
```
|
||||
|
||||
This will create benchmark executables in the build directory. Currently available:
|
||||
- `build/src/libstore-tests/nix-store-benchmarks` - Store-related performance benchmarks
|
||||
|
||||
Additional benchmark executables will be created as more benchmarks are added to the codebase.
|
||||
|
||||
## Running Benchmarks
|
||||
|
||||
### Basic Usage
|
||||
|
||||
Run benchmark executables directly. For example, to run store benchmarks:
|
||||
|
||||
```bash
|
||||
./build/src/libstore-tests/nix-store-benchmarks
|
||||
```
|
||||
|
||||
As more benchmark executables are added, run them similarly from their respective build directories.
|
||||
|
||||
### Filtering Benchmarks
|
||||
|
||||
Run specific benchmarks using regex patterns:
|
||||
|
||||
```bash
|
||||
# Run only derivation parser benchmarks
|
||||
./build/src/libstore-tests/nix-store-benchmarks --benchmark_filter="derivation.*"
|
||||
|
||||
# Run only benchmarks for hello.drv
|
||||
./build/src/libstore-tests/nix-store-benchmarks --benchmark_filter=".*hello.*"
|
||||
```
|
||||
|
||||
### Output Formats
|
||||
|
||||
Generate benchmark results in different formats:
|
||||
|
||||
```bash
|
||||
# JSON output
|
||||
./build/src/libstore-tests/nix-store-benchmarks --benchmark_format=json > results.json
|
||||
|
||||
# CSV output
|
||||
./build/src/libstore-tests/nix-store-benchmarks --benchmark_format=csv > results.csv
|
||||
```
|
||||
|
||||
### Advanced Options
|
||||
|
||||
```bash
|
||||
# Run benchmarks multiple times for better statistics
|
||||
./build/src/libstore-tests/nix-store-benchmarks --benchmark_repetitions=10
|
||||
|
||||
# Set minimum benchmark time (useful for micro-benchmarks)
|
||||
./build/src/libstore-tests/nix-store-benchmarks --benchmark_min_time=2
|
||||
|
||||
# Compare against baseline
|
||||
./build/src/libstore-tests/nix-store-benchmarks --benchmark_baseline=baseline.json
|
||||
|
||||
# Display time in custom units
|
||||
./build/src/libstore-tests/nix-store-benchmarks --benchmark_time_unit=ms
|
||||
```
|
||||
|
||||
## Writing New Benchmarks
|
||||
|
||||
To add new benchmarks:
|
||||
|
||||
1. Create a new `.cc` file in the appropriate `*-tests` directory
|
||||
2. Include the benchmark header:
|
||||
```cpp
|
||||
#include <benchmark/benchmark.h>
|
||||
```
|
||||
|
||||
3. Write benchmark functions:
|
||||
```cpp
|
||||
static void BM_YourBenchmark(benchmark::State & state)
|
||||
{
|
||||
// Setup code here
|
||||
|
||||
for (auto _ : state) {
|
||||
// Code to benchmark
|
||||
}
|
||||
}
|
||||
BENCHMARK(BM_YourBenchmark);
|
||||
```
|
||||
|
||||
4. Add the file to the corresponding `meson.build`:
|
||||
```meson
|
||||
benchmarks_sources = files(
|
||||
'your-benchmark.cc',
|
||||
# existing benchmarks...
|
||||
)
|
||||
```
|
||||
|
||||
## Profiling with Benchmarks
|
||||
|
||||
For deeper performance analysis, combine benchmarks with profiling tools:
|
||||
|
||||
```bash
|
||||
# Using Linux perf
|
||||
perf record ./build/src/libstore-tests/nix-store-benchmarks
|
||||
perf report
|
||||
```
|
||||
|
||||
### Using Valgrind Callgrind
|
||||
|
||||
Valgrind's callgrind tool provides detailed profiling information that can be visualized with kcachegrind:
|
||||
|
||||
```bash
|
||||
# Profile with callgrind
|
||||
valgrind --tool=callgrind ./build/src/libstore-tests/nix-store-benchmarks
|
||||
|
||||
# Visualize the results with kcachegrind
|
||||
kcachegrind callgrind.out.*
|
||||
```
|
||||
|
||||
This provides:
|
||||
- Function call graphs
|
||||
- Instruction-level profiling
|
||||
- Source code annotation
|
||||
- Interactive visualization of performance bottlenecks
|
||||
|
||||
## Continuous Performance Testing
|
||||
|
||||
```bash
|
||||
# Save baseline results
|
||||
./build/src/libstore-tests/nix-store-benchmarks --benchmark_format=json > baseline.json
|
||||
|
||||
# Compare against baseline in CI
|
||||
./build/src/libstore-tests/nix-store-benchmarks --benchmark_baseline=baseline.json
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Benchmarks not building
|
||||
|
||||
Ensure benchmarks are enabled:
|
||||
```bash
|
||||
meson configure build | grep benchmarks
|
||||
# Should show: benchmarks true
|
||||
```
|
||||
|
||||
### Inconsistent results
|
||||
|
||||
- Ensure your system is not under heavy load
|
||||
- Disable CPU frequency scaling for consistent results
|
||||
- Run benchmarks multiple times with `--benchmark_repetitions`
|
||||
|
||||
## See Also
|
||||
|
||||
- [Google Benchmark documentation](https://github.com/google/benchmark/blob/main/docs/user_guide.md)
|
||||
@@ -23,7 +23,7 @@ $ nix-shell
|
||||
To get a shell with one of the other [supported compilation environments](#compilation-environments):
|
||||
|
||||
```console
|
||||
$ nix-shell --attr devShells.x86_64-linux.native-clangStdenv
|
||||
$ nix-shell --attr devShells.x86_64-linux.native-clangStdenvPackages
|
||||
```
|
||||
|
||||
> **Note**
|
||||
@@ -34,7 +34,7 @@ $ nix-shell --attr devShells.x86_64-linux.native-clangStdenv
|
||||
To build Nix itself in this shell:
|
||||
|
||||
```console
|
||||
[nix-shell]$ out="$(pwd)/outputs/out" dev=$out debug=$out mesonFlags+=" --prefix=${out}"
|
||||
[nix-shell]$ mesonFlags+=" --prefix=$(pwd)/outputs/out"
|
||||
[nix-shell]$ dontAddPrefix=1 configurePhase
|
||||
[nix-shell]$ buildPhase
|
||||
```
|
||||
@@ -66,7 +66,7 @@ You can also build Nix for one of the [supported platforms](#platforms).
|
||||
This section assumes you are using Nix with the [`flakes`] and [`nix-command`] experimental features enabled.
|
||||
|
||||
[`flakes`]: @docroot@/development/experimental-features.md#xp-feature-flakes
|
||||
[`nix-command`]: @docroot@/development/experimental-features.md#xp-feature-nix-command
|
||||
[`nix-command`]: @docroot@/development/experimental-features.md#xp-nix-command
|
||||
|
||||
To build all dependencies and start a shell in which all environment variables are set up so that those dependencies can be found:
|
||||
|
||||
@@ -215,18 +215,14 @@ nix build .#nix-everything-x86_64-w64-mingw32
|
||||
|
||||
For historic reasons and backward-compatibility, some CPU and OS identifiers are translated as follows:
|
||||
|
||||
| `host_machine.cpu_family()` | `host_machine.endian()` | Nix |
|
||||
|-----------------------------|-------------------------|---------------------|
|
||||
| `x86` | | `i686` |
|
||||
| `arm` | | `host_machine.cpu()`|
|
||||
| `ppc` | `little` | `powerpcle` |
|
||||
| `ppc64` | `little` | `powerpc64le` |
|
||||
| `ppc` | `big` | `powerpc` |
|
||||
| `ppc64` | `big` | `powerpc64` |
|
||||
| `mips` | `little` | `mipsel` |
|
||||
| `mips64` | `little` | `mips64el` |
|
||||
| `mips` | `big` | `mips` |
|
||||
| `mips64` | `big` | `mips64` |
|
||||
| `config.guess` | Nix |
|
||||
|----------------------------|---------------------|
|
||||
| `amd64` | `x86_64` |
|
||||
| `i*86` | `i686` |
|
||||
| `arm6` | `arm6l` |
|
||||
| `arm7` | `arm7l` |
|
||||
| `linux-gnu*` | `linux` |
|
||||
| `linux-musl*` | `linux` |
|
||||
|
||||
## Compilation environments
|
||||
|
||||
@@ -256,7 +252,7 @@ You can use any of the other supported environments in place of `nix-cli-ccacheS
|
||||
## Editor integration
|
||||
|
||||
The `clangd` LSP server is installed by default on the `clang`-based `devShell`s.
|
||||
See [supported compilation environments](#compilation-environments) and instructions how to set up a shell [with flakes](#building-nix-with-flakes) or in [classic Nix](#building-nix).
|
||||
See [supported compilation environments](#compilation-environments) and instructions how to set up a shell [with flakes](#nix-with-flakes) or in [classic Nix](#classic-nix).
|
||||
|
||||
To use the LSP with your editor, you will want a `compile_commands.json` file telling `clangd` how we are compiling the code.
|
||||
Meson's configure always produces this inside the build directory.
|
||||
|
||||
@@ -24,19 +24,6 @@ It is also possible to build without debugging for faster build:
|
||||
|
||||
(The first line is needed because `fortify` hardening requires at least some optimization.)
|
||||
|
||||
## Building Nix with sanitizers
|
||||
|
||||
Nix can be built with [Address](https://clang.llvm.org/docs/AddressSanitizer.html) and
|
||||
[UB](https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html) sanitizers using LLVM
|
||||
or GCC. This is useful when debugging memory corruption issues.
|
||||
|
||||
```console
|
||||
[nix-shell]$ export mesonBuildType=debugoptimized
|
||||
[nix-shell]$ appendToVar mesonFlags "-Dlibexpr:gc=disabled" # Disable Boehm
|
||||
[nix-shell]$ appendToVar mesonFlags "-Dbindings=false" # Disable nix-perl
|
||||
[nix-shell]$ appendToVar mesonFlags "-Db_sanitize=address,undefined"
|
||||
```
|
||||
|
||||
## Debugging the Nix Binary
|
||||
|
||||
Obtain your preferred debugger within the development shell:
|
||||
|
||||
@@ -25,31 +25,20 @@ nix build .#nix-manual
|
||||
and open `./result/share/doc/nix/manual/index.html`.
|
||||
|
||||
|
||||
To build the manual incrementally, [enter the development shell](./building.md) and configure with `doc-gen` enabled:
|
||||
|
||||
**If using interactive `nix develop`:**
|
||||
To build the manual incrementally, [enter the development shell](./building.md) and run:
|
||||
|
||||
```console
|
||||
$ nix develop
|
||||
$ mesonFlags="$mesonFlags -Ddoc-gen=true" mesonConfigurePhase
|
||||
make manual-html-open -j $NIX_BUILD_CORES
|
||||
```
|
||||
|
||||
**If using direnv:**
|
||||
In order to reflect changes to the [Makefile for the manual], clear all generated files before re-building:
|
||||
|
||||
[Makefile for the manual]: https://github.com/NixOS/nix/blob/master/doc/manual/local.mk
|
||||
|
||||
```console
|
||||
$ direnv allow
|
||||
$ bash -c 'source $stdenv/setup && mesonFlags="$mesonFlags -Ddoc-gen=true" mesonConfigurePhase'
|
||||
rm $(git ls-files doc/manual/ -o | grep -F '.md') && rmdir doc/manual/source/command-ref/new-cli && make manual-html -j $NIX_BUILD_CORES
|
||||
```
|
||||
|
||||
Then build the manual:
|
||||
|
||||
```console
|
||||
$ cd build
|
||||
$ meson compile manual
|
||||
```
|
||||
|
||||
The HTML manual will be generated at `build/src/nix-manual/manual/index.html`.
|
||||
|
||||
## Style guide
|
||||
|
||||
The goal of this style guide is to make it such that
|
||||
@@ -240,9 +229,3 @@ $ configurePhase
|
||||
$ ninja src/external-api-docs/html
|
||||
$ xdg-open src/external-api-docs/html/index.html
|
||||
```
|
||||
|
||||
If you use direnv, or otherwise want to run `configurePhase` in a transient shell, use:
|
||||
|
||||
```bash
|
||||
nix-shell -A devShells.x86_64-linux.native-clangStdenv --command 'appendToVar mesonFlags "-Ddoc-gen=true"; mesonConfigurePhase'
|
||||
```
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
experimental_feature_descriptions_md = custom_target(
|
||||
command : nix_eval_for_docs + [
|
||||
'--expr', 'import @INPUT0@ (builtins.fromJSON (builtins.readFile @INPUT1@))',
|
||||
'--expr',
|
||||
'import @INPUT0@ (builtins.fromJSON (builtins.readFile @INPUT1@))',
|
||||
],
|
||||
input : [
|
||||
'../../generate-xp-features.nix',
|
||||
xp_features_json,
|
||||
],
|
||||
capture : true,
|
||||
env : nix_env_for_docs,
|
||||
output : 'experimental-feature-descriptions.md',
|
||||
)
|
||||
|
||||
@@ -119,7 +119,7 @@ This will:
|
||||
|
||||
3. Stop the program when the test fails, allowing the user to then issue arbitrary commands to GDB.
|
||||
|
||||
### Characterisation testing { #characterisation-testing-unit }
|
||||
### Characterisation testing { #characaterisation-testing-unit }
|
||||
|
||||
See [functional characterisation testing](#characterisation-testing-functional) for a broader discussion of characterisation testing.
|
||||
|
||||
|
||||
@@ -31,22 +31,9 @@
|
||||
|
||||
The industry term for storage and retrieval systems using [content addressing](#gloss-content-address). A Nix store also has [input addressing](#gloss-input-addressed-store-object), and metadata.
|
||||
|
||||
- [derivation]{#gloss-derivation}
|
||||
|
||||
A derivation can be thought of as a [pure function](https://en.wikipedia.org/wiki/Pure_function) that produces new [store objects][store object] from existing store objects.
|
||||
|
||||
Derivations are implemented as [operating system processes that run in a sandbox](@docroot@/store/building.md#builder-execution).
|
||||
This sandbox by default only allows reading from store objects specified as inputs, and only allows writing to designated [outputs][output] to be [captured as store objects](@docroot@/store/building.md#processing-outputs).
|
||||
|
||||
A derivation is typically specified as a [derivation expression] in the [Nix language], and [instantiated][instantiate] to a [store derivation].
|
||||
There are multiple ways of obtaining store objects from store derivatons, collectively called [realisation][realise].
|
||||
|
||||
[derivation]: #gloss-derivation
|
||||
|
||||
- [store derivation]{#gloss-store-derivation}
|
||||
|
||||
A [derivation] represented as a [store object].
|
||||
|
||||
A single build task.
|
||||
See [Store Derivation](@docroot@/store/derivation/index.md#store-derivation) for details.
|
||||
|
||||
[store derivation]: #gloss-store-derivation
|
||||
@@ -70,7 +57,10 @@
|
||||
|
||||
- [derivation expression]{#gloss-derivation-expression}
|
||||
|
||||
A description of a [store derivation] using the [`derivation` primitive](./language/derivations.md) in the [Nix language].
|
||||
A description of a [store derivation] in the Nix language.
|
||||
The output(s) of a derivation are store objects.
|
||||
Derivations are typically specified in Nix expressions using the [`derivation` primitive](./language/derivations.md).
|
||||
These are translated into store layer *derivations* (implicitly by `nix-env` and `nix-build`, or explicitly by `nix-instantiate`).
|
||||
|
||||
[derivation expression]: #gloss-derivation-expression
|
||||
|
||||
@@ -208,7 +198,7 @@
|
||||
|
||||
- [impure derivation]{#gloss-impure-derivation}
|
||||
|
||||
[An experimental feature](@docroot@/development/experimental-features.md#xp-feature-impure-derivations) that allows derivations to be explicitly marked as impure,
|
||||
[An experimental feature](#@docroot@/development/experimental-features.md#xp-feature-impure-derivations) that allows derivations to be explicitly marked as impure,
|
||||
so that they are always rebuilt, and their outputs not reused by subsequent calls to realise them.
|
||||
|
||||
- [Nix database]{#gloss-nix-database}
|
||||
@@ -279,7 +269,7 @@
|
||||
|
||||
See [References](@docroot@/store/store-object.md#references) for details.
|
||||
|
||||
- [referrer]{#gloss-referrer}
|
||||
- [referrer]{#gloss-reference}
|
||||
|
||||
A reversed edge from one [store object] to another.
|
||||
|
||||
@@ -367,8 +357,8 @@
|
||||
|
||||
Nix represents files as [file system objects][file system object], and how they belong together is encoded as [references][reference] between [store objects][store object] that contain these file system objects.
|
||||
|
||||
The [Nix language] allows denoting packages in terms of [attribute sets](@docroot@/language/types.md#type-attrs) containing:
|
||||
- attributes that refer to the files of a package, typically in the form of [derivation outputs](#gloss-output),
|
||||
The [Nix language] allows denoting packages in terms of [attribute sets](@docroot@/language/types.md#attribute-set) containing:
|
||||
- attributes that refer to the files of a package, typically in the form of [derivation outputs](#output),
|
||||
- attributes with metadata, such as information about how the package is supposed to be used.
|
||||
|
||||
The exact shape of these attribute sets is up to convention.
|
||||
@@ -383,7 +373,7 @@
|
||||
|
||||
[string]: ./language/types.md#type-string
|
||||
[path]: ./language/types.md#type-path
|
||||
[attribute name]: ./language/types.md#type-attrs
|
||||
[attribute name]: ./language/types.md#attribute-set
|
||||
|
||||
- [base directory]{#gloss-base-directory}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ This performs the default type of installation for your platform:
|
||||
|
||||
We recommend the multi-user installation if it supports your platform and you can authenticate with `sudo`.
|
||||
|
||||
The installer can be configured with various command line arguments and environment variables.
|
||||
The installer can configured with various command line arguments and environment variables.
|
||||
To show available command line flags:
|
||||
|
||||
```console
|
||||
|
||||
@@ -3,21 +3,19 @@
|
||||
To run the latest stable release of Nix with Docker run the following command:
|
||||
|
||||
```console
|
||||
$ docker run -ti docker.io/nixos/nix
|
||||
Unable to find image 'docker.io/nixos/nix:latest' locally
|
||||
latest: Pulling from docker.io/nixos/nix
|
||||
$ docker run -ti ghcr.io/nixos/nix
|
||||
Unable to find image 'ghcr.io/nixos/nix:latest' locally
|
||||
latest: Pulling from ghcr.io/nixos/nix
|
||||
5843afab3874: Pull complete
|
||||
b52bf13f109c: Pull complete
|
||||
1e2415612aa3: Pull complete
|
||||
Digest: sha256:27f6e7f60227e959ee7ece361f75d4844a40e1cc6878b6868fe30140420031ff
|
||||
Status: Downloaded newer image for docker.io/nixos/nix:latest
|
||||
Status: Downloaded newer image for ghcr.io/nixos/nix:latest
|
||||
35ca4ada6e96:/# nix --version
|
||||
nix (Nix) 2.3.12
|
||||
35ca4ada6e96:/# exit
|
||||
```
|
||||
|
||||
> If you want the latest pre-release you can use ghcr.io/nixos/nix and view them at https://github.com/nixos/nix/pkgs/container/nix
|
||||
|
||||
# What is included in Nix's Docker image?
|
||||
|
||||
The official Docker image is created using `pkgs.dockerTools.buildLayeredImage`
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
- Bash Shell. The `./configure` script relies on bashisms, so Bash is
|
||||
required.
|
||||
|
||||
- A version of GCC or Clang that supports C++23.
|
||||
- A version of GCC or Clang that supports C++20.
|
||||
|
||||
- `pkg-config` to locate dependencies. If your distribution does not
|
||||
provide it, you can get it from
|
||||
|
||||
@@ -41,38 +41,6 @@ There may also be references to Nix in
|
||||
|
||||
which you may remove.
|
||||
|
||||
### FreeBSD
|
||||
|
||||
1. Stop and remove the Nix daemon service:
|
||||
|
||||
```console
|
||||
sudo service nix-daemon stop
|
||||
sudo rm -f /usr/local/etc/rc.d/nix-daemon
|
||||
sudo sysrc -x nix_daemon_enable
|
||||
```
|
||||
|
||||
2. Remove files created by Nix:
|
||||
|
||||
```console
|
||||
sudo rm -rf /etc/nix /usr/local/etc/profile.d/nix.sh /nix ~root/.nix-channels ~root/.nix-defexpr ~root/.nix-profile ~root/.cache/nix
|
||||
```
|
||||
|
||||
3. Remove build users and their group:
|
||||
|
||||
```console
|
||||
for i in $(seq 1 32); do
|
||||
sudo pw userdel nixbld$i
|
||||
done
|
||||
sudo pw groupdel nixbld
|
||||
```
|
||||
|
||||
4. There may also be references to Nix in:
|
||||
- `/usr/local/etc/bashrc`
|
||||
- `/usr/local/etc/zshrc`
|
||||
- Shell configuration files in users' home directories
|
||||
|
||||
which you may remove.
|
||||
|
||||
### macOS
|
||||
|
||||
> **Updating to macOS 15 Sequoia**
|
||||
|
||||
@@ -53,13 +53,23 @@ Derivations can declare some infrequently used optional attributes.
|
||||
|
||||
- [`__structuredAttrs`]{#adv-attr-structuredAttrs}\
|
||||
If the special attribute `__structuredAttrs` is set to `true`, the other derivation
|
||||
attributes are serialised into a file in JSON format.
|
||||
attributes are serialised into a file in JSON format. The environment variable
|
||||
`NIX_ATTRS_JSON_FILE` points to the exact location of that file both in a build
|
||||
and a [`nix-shell`](../command-ref/nix-shell.md). This obviates the need for
|
||||
[`passAsFile`](#adv-attr-passAsFile) since JSON files have no size restrictions,
|
||||
unlike process environments.
|
||||
|
||||
This obviates the need for [`passAsFile`](#adv-attr-passAsFile) since JSON files have no size restrictions, unlike process environments.
|
||||
It also makes it possible to tweak derivation settings in a structured way;
|
||||
see [`outputChecks`](#adv-attr-outputChecks) for example.
|
||||
It also makes it possible to tweak derivation settings in a structured way; see
|
||||
[`outputChecks`](#adv-attr-outputChecks) for example.
|
||||
|
||||
See the [corresponding section in the derivation page](@docroot@/store/derivation/index.md#structured-attrs) for further details.
|
||||
As a convenience to Bash builders,
|
||||
Nix writes a script that initialises shell variables
|
||||
corresponding to all attributes that are representable in Bash. The
|
||||
environment variable `NIX_ATTRS_SH_FILE` points to the exact
|
||||
location of the script, both in a build and a
|
||||
[`nix-shell`](../command-ref/nix-shell.md). This includes non-nested
|
||||
(associative) arrays. For example, the attribute `hardening.format = true`
|
||||
ends up as the Bash associative array element `${hardening[format]}`.
|
||||
|
||||
> **Warning**
|
||||
>
|
||||
@@ -160,6 +170,7 @@ See the [corresponding section in the derivation output page](@docroot@/store/de
|
||||
## Other output modifications
|
||||
|
||||
- [`unsafeDiscardReferences`]{#adv-attr-unsafeDiscardReferences}\
|
||||
|
||||
When using [structured attributes](#adv-attr-structuredAttrs), the
|
||||
attribute `unsafeDiscardReferences` is an attribute set with a boolean value for each output name.
|
||||
If set to `true`, it disables scanning the output for runtime dependencies.
|
||||
@@ -194,6 +205,7 @@ See the [corresponding section in the derivation output page](@docroot@/store/de
|
||||
[`builder`]: ./derivations.md#attr-builder
|
||||
|
||||
- [`requiredSystemFeatures`]{#adv-attr-requiredSystemFeatures}\
|
||||
|
||||
If a derivation has the `requiredSystemFeatures` attribute, then Nix will only build it on a machine that has the corresponding features set in its [`system-features` configuration](@docroot@/command-ref/conf-file.md#conf-system-features).
|
||||
|
||||
For example, setting
|
||||
@@ -333,7 +345,7 @@ Here is more information on the `output*` attributes, and what values they may b
|
||||
|
||||
`outputHashAlgo` can only be `null` when `outputHash` follows the SRI format, because in that case the choice of hash algorithm is determined by `outputHash`.
|
||||
|
||||
- [`outputHash`]{#adv-attr-outputHash}
|
||||
- [`outputHash`]{#adv-attr-outputHashAlgo}; [`outputHash`]{#adv-attr-outputHashMode}
|
||||
|
||||
This will specify the output hash of the single output of a [fixed-output derivation].
|
||||
|
||||
|
||||
@@ -5,28 +5,12 @@ All built-ins are available through the global [`builtins`](#builtins-builtins)
|
||||
|
||||
Some built-ins are also exposed directly in the global scope:
|
||||
|
||||
<!-- TODO(@rhendric, #10970): this list is incomplete -->
|
||||
|
||||
- [`derivation`](#builtins-derivation)
|
||||
- `derivationStrict`
|
||||
- [`abort`](#builtins-abort)
|
||||
- [`baseNameOf`](#builtins-baseNameOf)
|
||||
- [`break`](#builtins-break)
|
||||
- [`dirOf`](#builtins-dirOf)
|
||||
- [`false`](#builtins-false)
|
||||
- [`fetchGit`](#builtins-fetchGit)
|
||||
- `fetchMercurial`
|
||||
- [`fetchTarball`](#builtins-fetchTarball)
|
||||
- [`fetchTree`](#builtins-fetchTree)
|
||||
- [`fromTOML`](#builtins-fromTOML)
|
||||
- [`import`](#builtins-import)
|
||||
- [`isNull`](#builtins-isNull)
|
||||
- [`map`](#builtins-map)
|
||||
- [`null`](#builtins-null)
|
||||
- [`placeholder`](#builtins-placeholder)
|
||||
- [`removeAttrs`](#builtins-removeAttrs)
|
||||
- `scopedImport`
|
||||
- [`abort`](#builtins-abort)
|
||||
- [`throw`](#builtins-throw)
|
||||
- [`toString`](#builtins-toString)
|
||||
- [`true`](#builtins-true)
|
||||
|
||||
<dl>
|
||||
<dt id="builtins-derivation"><a href="#builtins-derivation"><code>derivation <var>attrs</var></code></a></dt>
|
||||
|
||||
@@ -16,7 +16,7 @@ It outputs an attribute set, and produces a [store derivation] as a side effect
|
||||
- [`name`]{#attr-name} ([String](@docroot@/language/types.md#type-string))
|
||||
|
||||
A symbolic name for the derivation.
|
||||
See [derivation outputs](@docroot@/store/derivation/outputs/index.md#outputs) for what this is affects.
|
||||
See [derivation outputs](@docroot@/store/derivation/index.md#outputs) for what this is affects.
|
||||
|
||||
[store path]: @docroot@/store/store-path.md
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ An *identifier* is an [ASCII](https://en.wikipedia.org/wiki/ASCII) character seq
|
||||
|
||||
# Names
|
||||
|
||||
A *name* can be written as an [identifier](#identifiers) or a [string literal](./string-literals.md).
|
||||
A *name* can be written as an [identifier](#identifier) or a [string literal](./string-literals.md).
|
||||
|
||||
> **Syntax**
|
||||
>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Nix Language
|
||||
|
||||
The Nix language is designed for conveniently creating and composing [derivations](@docroot@/glossary.md#gloss-derivation) – precise descriptions of how contents of existing files are used to derive new files.
|
||||
The Nix language is designed for conveniently creating and composing *derivations* – precise descriptions of how contents of existing files are used to derive new files.
|
||||
|
||||
> **Tip**
|
||||
>
|
||||
@@ -137,7 +137,7 @@ This is an incomplete overview of language features, by example.
|
||||
</td>
|
||||
<td>
|
||||
|
||||
[Booleans](@docroot@/language/types.md#type-bool)
|
||||
[Booleans](@docroot@/language/types.md#type-boolean)
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
@@ -245,7 +245,7 @@ This is an incomplete overview of language features, by example.
|
||||
</td>
|
||||
<td>
|
||||
|
||||
An [attribute set](@docroot@/language/types.md#type-attrs) with attributes named `x` and `y`
|
||||
An [attribute set](@docroot@/language/types.md#attribute-set) with attributes named `x` and `y`
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
@@ -285,7 +285,7 @@ This is an incomplete overview of language features, by example.
|
||||
</td>
|
||||
<td>
|
||||
|
||||
[Lists](@docroot@/language/types.md#type-list) with three elements.
|
||||
[Lists](@docroot@/language/types.md#list) with three elements.
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
@@ -369,7 +369,7 @@ This is an incomplete overview of language features, by example.
|
||||
</td>
|
||||
<td>
|
||||
|
||||
[Attribute selection](@docroot@/language/types.md#type-attrs) (evaluates to `1`)
|
||||
[Attribute selection](@docroot@/language/types.md#attribute-set) (evaluates to `1`)
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
@@ -381,7 +381,7 @@ This is an incomplete overview of language features, by example.
|
||||
</td>
|
||||
<td>
|
||||
|
||||
[Attribute selection](@docroot@/language/types.md#type-attrs) with default (evaluates to `3`)
|
||||
[Attribute selection](@docroot@/language/types.md#attribute-set) with default (evaluates to `3`)
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -1,13 +1,19 @@
|
||||
builtins_md = custom_target(
|
||||
command : [ python.full_path(), '@INPUT0@', '@OUTPUT@', '--' ] + nix_eval_for_docs + [
|
||||
'--expr', '(builtins.readFile @INPUT3@) + import @INPUT1@ (builtins.fromJSON (builtins.readFile ./@INPUT2@)) + (builtins.readFile @INPUT4@)',
|
||||
command : [
|
||||
python.full_path(),
|
||||
'@INPUT0@',
|
||||
'@OUTPUT@',
|
||||
'--'
|
||||
] + nix_eval_for_docs + [
|
||||
'--expr',
|
||||
'(builtins.readFile @INPUT3@) + import @INPUT1@ (builtins.fromJSON (builtins.readFile ./@INPUT2@)) + (builtins.readFile @INPUT4@)',
|
||||
],
|
||||
input : [
|
||||
'../../remove_before_wrapper.py',
|
||||
'../../generate-builtins.nix',
|
||||
language_json,
|
||||
'builtins-prefix.md',
|
||||
'builtins-suffix.md',
|
||||
'builtins-suffix.md'
|
||||
],
|
||||
output : 'builtins.md',
|
||||
env : nix_env_for_docs,
|
||||
|
||||
@@ -196,7 +196,7 @@ All comparison operators are implemented in terms of `<`, and the following equi
|
||||
|
||||
## Logical implication
|
||||
|
||||
Equivalent to `!`*b1* `||` *b2* (or `if` *b1* `then` *b2* `else true`)
|
||||
Equivalent to `!`*b1* `||` *b2*.
|
||||
|
||||
[Logical implication]: #logical-implication
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ It creates an [attribute set] representing the string context, which can be insp
|
||||
|
||||
[`builtins.hasContext`]: ./builtins.md#builtins-hasContext
|
||||
[`builtins.getContext`]: ./builtins.md#builtins-getContext
|
||||
[attribute set]: ./types.md#type-attrs
|
||||
[attribute set]: ./types.md#attribute-set
|
||||
|
||||
## Clearing string contexts
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ Such a construct is called *interpolated string*, and the expression inside is a
|
||||
|
||||
[string]: ./types.md#type-string
|
||||
[path]: ./types.md#type-path
|
||||
[attribute set]: ./types.md#type-attrs
|
||||
[attribute set]: ./types.md#attribute-set
|
||||
|
||||
> **Syntax**
|
||||
>
|
||||
|
||||
@@ -51,7 +51,7 @@ See [String literals](string-literals.md).
|
||||
|
||||
Path literals can also include [string interpolation], besides being [interpolated into other expressions].
|
||||
|
||||
[interpolated into other expressions]: ./string-interpolation.md#interpolated-expression
|
||||
[interpolated into other expressions]: ./string-interpolation.md#interpolated-expressions
|
||||
|
||||
At least one slash (`/`) must appear *before* any interpolated expression for the result to be recognized as a path.
|
||||
|
||||
@@ -225,8 +225,8 @@ passed in first , e.g.,
|
||||
|
||||
```nix
|
||||
let add = { __functor = self: x: x + self.x; };
|
||||
inc = add // { x = 1; }; # inc is { x = 1; __functor = (...) }
|
||||
in inc 1 # equivalent of `add.__functor add 1` i.e. `1 + self.x`
|
||||
inc = add // { x = 1; };
|
||||
in inc 1
|
||||
```
|
||||
|
||||
evaluates to `2`. This can be used to attach metadata to a function
|
||||
@@ -235,7 +235,7 @@ of object-oriented programming, for example.
|
||||
|
||||
## Recursive sets
|
||||
|
||||
Recursive sets are like normal [attribute sets](./types.md#type-attrs), but the attributes can refer to each other.
|
||||
Recursive sets are like normal [attribute sets](./types.md#attribute-set), but the attributes can refer to each other.
|
||||
|
||||
> *rec-attrset* = `rec {` [ *name* `=` *expr* `;` `]`... `}`
|
||||
|
||||
@@ -287,7 +287,7 @@ This evaluates to `"foobar"`.
|
||||
|
||||
## Inheriting attributes
|
||||
|
||||
When defining an [attribute set](./types.md#type-attrs) or in a [let-expression](#let-expressions) it is often convenient to copy variables from the surrounding lexical scope (e.g., when you want to propagate attributes).
|
||||
When defining an [attribute set](./types.md#attribute-set) or in a [let-expression](#let-expressions) it is often convenient to copy variables from the surrounding lexical scope (e.g., when you want to propagate attributes).
|
||||
This can be shortened using the `inherit` keyword.
|
||||
|
||||
Example:
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
# Process JSON schema documentation
|
||||
subdir('protocols')
|
||||
|
||||
summary_rl_next = custom_target(
|
||||
command : [
|
||||
bash,
|
||||
'-euo',
|
||||
'pipefail',
|
||||
'-euo', 'pipefail',
|
||||
'-c',
|
||||
'''
|
||||
if [ -e "@INPUT@" ]; then
|
||||
@@ -16,6 +12,6 @@ summary_rl_next = custom_target(
|
||||
input : [
|
||||
rl_next_generated,
|
||||
],
|
||||
capture : true,
|
||||
capture: true,
|
||||
output : 'SUMMARY-rl-next.md',
|
||||
)
|
||||
|
||||
@@ -12,7 +12,7 @@ $ ln -s /nix/store/d718ef...-foo /nix/var/nix/gcroots/bar
|
||||
That is, after this command, the garbage collector will not remove
|
||||
`/nix/store/d718ef...-foo` or any of its dependencies.
|
||||
|
||||
Subdirectories of `prefix/nix/var/nix/gcroots` are searched
|
||||
recursively. Symlinks to store paths count as roots. Symlinks to
|
||||
non-store paths are ignored, unless the non-store path is itself a
|
||||
symlink to a store path.
|
||||
Subdirectories of `prefix/nix/var/nix/gcroots` are also searched for
|
||||
symlinks. Symlinks to non-store paths are followed and searched for
|
||||
roots, but symlinks to non-store paths *inside* the paths reached in
|
||||
that way are not followed to prevent infinite recursion.
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
# Derivation "ATerm" file format
|
||||
|
||||
For historical reasons, [store derivations][store derivation] are stored on-disk in "Annotated Term" (ATerm) format
|
||||
([guide](https://homepages.cwi.nl/~daybuild/daily-books/technology/aterm-guide/aterm-guide.html),
|
||||
[paper](https://doi.org/10.1002/(SICI)1097-024X(200003)30:3%3C259::AID-SPE298%3E3.0.CO;2-Y)).
|
||||
For historical reasons, [store derivations][store derivation] are stored on-disk in [ATerm](https://homepages.cwi.nl/~daybuild/daily-books/technology/aterm-guide/aterm-guide.html) format.
|
||||
|
||||
## The ATerm format used
|
||||
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
{{#include build-result-v1-fixed.md}}
|
||||
|
||||
## Examples
|
||||
|
||||
### Successful build
|
||||
|
||||
```json
|
||||
{{#include schema/build-result-v1/success.json}}
|
||||
```
|
||||
|
||||
### Failed build (output rejected)
|
||||
|
||||
```json
|
||||
{{#include schema/build-result-v1/output-rejected.json}}
|
||||
```
|
||||
|
||||
### Failed build (non-deterministic)
|
||||
|
||||
```json
|
||||
{{#include schema/build-result-v1/not-deterministic.json}}
|
||||
```
|
||||
@@ -1,27 +0,0 @@
|
||||
{{#include build-trace-entry-v1-fixed.md}}
|
||||
|
||||
## Examples
|
||||
|
||||
### Simple build trace entry
|
||||
|
||||
```json
|
||||
{{#include schema/build-trace-entry-v1/simple.json}}
|
||||
```
|
||||
|
||||
### Build trace entry with dependencies
|
||||
|
||||
```json
|
||||
{{#include schema/build-trace-entry-v1/with-dependent-realisations.json}}
|
||||
```
|
||||
|
||||
### Build trace entry with signature
|
||||
|
||||
```json
|
||||
{{#include schema/build-trace-entry-v1/with-signature.json}}
|
||||
```
|
||||
|
||||
<!--
|
||||
## Raw Schema
|
||||
|
||||
[JSON Schema for Build Trace Entry v1](schema/build-trace-entry-v1.json)
|
||||
-->
|
||||
@@ -1,21 +0,0 @@
|
||||
{{#include content-address-v1-fixed.md}}
|
||||
|
||||
## Examples
|
||||
|
||||
### [Text](@docroot@/store/store-object/content-address.html#method-text) method
|
||||
|
||||
```json
|
||||
{{#include schema/content-address-v1/text.json}}
|
||||
```
|
||||
|
||||
### [Nix Archive](@docroot@/store/store-object/content-address.html#method-nix-archive) method
|
||||
|
||||
```json
|
||||
{{#include schema/content-address-v1/nar.json}}
|
||||
```
|
||||
|
||||
<!-- need to convert YAML to JSON first
|
||||
## Raw Schema
|
||||
|
||||
[JSON Schema for Hash v1](schema/content-address-v1.json)
|
||||
-->
|
||||
@@ -1,7 +1,93 @@
|
||||
{{#include derivation-v4-fixed.md}}
|
||||
# Derivation JSON Format
|
||||
|
||||
<!-- need to convert YAML to JSON first
|
||||
## Raw Schema
|
||||
> **Warning**
|
||||
>
|
||||
> This JSON format is currently
|
||||
> [**experimental**](@docroot@/development/experimental-features.md#xp-feature-nix-command)
|
||||
> and subject to change.
|
||||
|
||||
[JSON Schema for Derivation v3](schema/derivation-v4.json)
|
||||
-->
|
||||
The JSON serialization of a
|
||||
[derivations](@docroot@/glossary.md#gloss-store-derivation)
|
||||
is a JSON object with the following fields:
|
||||
|
||||
* `name`:
|
||||
The name of the derivation.
|
||||
This is used when calculating the store paths of the derivation's outputs.
|
||||
|
||||
* `outputs`:
|
||||
Information about the output paths of the derivation.
|
||||
This is a JSON object with one member per output, where the key is the output name and the value is a JSON object with these fields:
|
||||
|
||||
* `path`:
|
||||
The output path, if it is known in advanced.
|
||||
Otherwise, `null`.
|
||||
|
||||
|
||||
* `method`:
|
||||
For an output which will be [content addressed], a string representing the [method](@docroot@/store/store-object/content-address.md) of content addressing that is chosen.
|
||||
Valid method strings are:
|
||||
|
||||
- [`flat`](@docroot@/store/store-object/content-address.md#method-flat)
|
||||
- [`nar`](@docroot@/store/store-object/content-address.md#method-nix-archive)
|
||||
- [`text`](@docroot@/store/store-object/content-address.md#method-text)
|
||||
- [`git`](@docroot@/store/store-object/content-address.md#method-git)
|
||||
|
||||
Otherwise, `null`.
|
||||
|
||||
* `hashAlgo`:
|
||||
For an output which will be [content addressed], the name of the hash algorithm used.
|
||||
Valid algorithm strings are:
|
||||
|
||||
- `blake3`
|
||||
- `md5`
|
||||
- `sha1`
|
||||
- `sha256`
|
||||
- `sha512`
|
||||
|
||||
* `hash`:
|
||||
For fixed-output derivations, the expected content hash in base-16.
|
||||
|
||||
> **Example**
|
||||
>
|
||||
> ```json
|
||||
> "outputs": {
|
||||
> "out": {
|
||||
> "path": "/nix/store/2543j7c6jn75blc3drf4g5vhb1rhdq29-source",
|
||||
> "method": "nar",
|
||||
> "hashAlgo": "sha256",
|
||||
> "hash": "6fc80dcc62179dbc12fc0b5881275898f93444833d21b89dfe5f7fbcbb1d0d62"
|
||||
> }
|
||||
> }
|
||||
> ```
|
||||
|
||||
* `inputSrcs`:
|
||||
A list of store paths on which this derivation depends.
|
||||
|
||||
* `inputDrvs`:
|
||||
A JSON object specifying the derivations on which this derivation depends, and what outputs of those derivations.
|
||||
|
||||
> **Example**
|
||||
>
|
||||
> ```json
|
||||
> "inputDrvs": {
|
||||
> "/nix/store/6lkh5yi7nlb7l6dr8fljlli5zfd9hq58-curl-7.73.0.drv": ["dev"],
|
||||
> "/nix/store/fn3kgnfzl5dzym26j8g907gq3kbm8bfh-unzip-6.0.drv": ["out"]
|
||||
> }
|
||||
> ```
|
||||
|
||||
specifies that this derivation depends on the `dev` output of `curl`, and the `out` output of `unzip`.
|
||||
|
||||
* `system`:
|
||||
The system type on which this derivation is to be built
|
||||
(e.g. `x86_64-linux`).
|
||||
|
||||
* `builder`:
|
||||
The absolute path of the program to be executed to run the build.
|
||||
Typically this is the `bash` shell
|
||||
(e.g. `/nix/store/r3j288vpmczbl500w6zz89gyfa4nr0b1-bash-4.4-p23/bin/bash`).
|
||||
|
||||
* `args`:
|
||||
The command-line arguments passed to the `builder`.
|
||||
|
||||
* `env`:
|
||||
The environment passed to the `builder`.
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
{{#include deriving-path-v1-fixed.md}}
|
||||
|
||||
## Examples
|
||||
|
||||
### Constant
|
||||
|
||||
```json
|
||||
{{#include schema/deriving-path-v1/single_opaque.json}}
|
||||
```
|
||||
|
||||
### Output of static derivation
|
||||
|
||||
```json
|
||||
{{#include schema/deriving-path-v1/single_built.json}}
|
||||
```
|
||||
|
||||
### Output of dynamic derivation
|
||||
|
||||
```json
|
||||
{{#include schema/deriving-path-v1/single_built_built.json}}
|
||||
```
|
||||
@@ -1,17 +0,0 @@
|
||||
# For some reason, backticks in the JSON schema are being escaped rather
|
||||
# than being kept as intentional code spans. This removes all backtick
|
||||
# escaping, which is an ugly solution, but one that is fine, because we
|
||||
# are not using backticks for any other purpose.
|
||||
s/\\`/`/g
|
||||
|
||||
# The way that semi-external references are rendered (i.e. ones to
|
||||
# sibling schema files, as opposed to separate website ones, is not nice
|
||||
# for humans. Replace it with a nice relative link within the manual
|
||||
# instead.
|
||||
#
|
||||
# As we have more such relative links, more replacements of this nature
|
||||
# should appear below.
|
||||
s^\(./hash-v1.yaml\)\?#/$defs/algorithm^[JSON format for `Hash`](./hash.html#algorithm)^g
|
||||
s^\(./hash-v1.yaml\)^[JSON format for `Hash`](./hash.html)^g
|
||||
s^\(./content-address-v1.yaml\)\?#/$defs/method^[JSON format for `ContentAddress`](./content-address.html#method)^g
|
||||
s^\(./content-address-v1.yaml\)^[JSON format for `ContentAddress`](./content-address.html)^g
|
||||
@@ -1,33 +0,0 @@
|
||||
{{#include hash-v1-fixed.md}}
|
||||
|
||||
## Examples
|
||||
|
||||
### SHA-256 with Base64 encoding
|
||||
|
||||
```json
|
||||
{{#include schema/hash-v1/sha256-base64.json}}
|
||||
```
|
||||
|
||||
### SHA-256 with Base16 (hexadecimal) encoding
|
||||
|
||||
```json
|
||||
{{#include schema/hash-v1/sha256-base16.json}}
|
||||
```
|
||||
|
||||
### SHA-256 with Nix32 encoding
|
||||
|
||||
```json
|
||||
{{#include schema/hash-v1/sha256-nix32.json}}
|
||||
```
|
||||
|
||||
### BLAKE3 with Base64 encoding
|
||||
|
||||
```json
|
||||
{{#include schema/hash-v1/blake3-base64.json}}
|
||||
```
|
||||
|
||||
<!-- need to convert YAML to JSON first
|
||||
## Raw Schema
|
||||
|
||||
[JSON Schema for Hash v1](schema/hash-v1.json)
|
||||
-->
|
||||
@@ -1,17 +0,0 @@
|
||||
# Configuration file for json-schema-for-humans
|
||||
#
|
||||
# https://github.com/coveooss/json-schema-for-humans/blob/main/docs/examples/examples_md_default/Configuration.md
|
||||
|
||||
template_name: md
|
||||
show_toc: true
|
||||
# impure timestamp and distracting
|
||||
with_footer: false
|
||||
recursive_detection_depth: 3
|
||||
show_breadcrumbs: false
|
||||
description_is_markdown: true
|
||||
template_md_options:
|
||||
properties_table_columns:
|
||||
- Property
|
||||
- Type
|
||||
- Pattern
|
||||
- Title/Description
|
||||
@@ -1,80 +0,0 @@
|
||||
# Tests in: ../../../../src/json-schema-checks
|
||||
|
||||
fs = import('fs')
|
||||
|
||||
# Find json-schema-for-humans if available
|
||||
json_schema_for_humans = find_program('generate-schema-doc', required : false)
|
||||
|
||||
# Configuration for json-schema-for-humans
|
||||
json_schema_config = files('json-schema-for-humans-config.yaml')
|
||||
|
||||
schemas = [
|
||||
'hash-v1',
|
||||
'content-address-v1',
|
||||
'store-path-v1',
|
||||
'store-object-info-v2',
|
||||
'derivation-v4',
|
||||
'deriving-path-v1',
|
||||
'build-trace-entry-v1',
|
||||
'build-result-v1',
|
||||
]
|
||||
|
||||
schema_files = files()
|
||||
foreach schema_name : schemas
|
||||
schema_files += files('schema' / schema_name + '.yaml')
|
||||
endforeach
|
||||
|
||||
|
||||
schema_outputs = []
|
||||
foreach schema_name : schemas
|
||||
schema_outputs += schema_name + '.md'
|
||||
endforeach
|
||||
|
||||
json_schema_generated_files = []
|
||||
|
||||
# Generate markdown documentation from JSON schema
|
||||
# Note: output must be just a filename, not a path
|
||||
gen_file = custom_target(
|
||||
schema_name + '-schema-docs.tmp',
|
||||
command : [
|
||||
json_schema_for_humans,
|
||||
'--config-file',
|
||||
json_schema_config,
|
||||
meson.current_source_dir() / 'schema',
|
||||
meson.current_build_dir(),
|
||||
],
|
||||
input : schema_files + [
|
||||
json_schema_config,
|
||||
],
|
||||
output : schema_outputs,
|
||||
capture : false,
|
||||
build_by_default : true,
|
||||
)
|
||||
|
||||
idx = 0
|
||||
if json_schema_for_humans.found()
|
||||
foreach schema_name : schemas
|
||||
#schema_file = 'schema' / schema_name + '.yaml'
|
||||
|
||||
# There is one so-so hack, and one horrible hack being done here.
|
||||
sedded_file = custom_target(
|
||||
schema_name + '-schema-docs',
|
||||
command : [
|
||||
'sed',
|
||||
'-f',
|
||||
# Out of line to avoid https://github.com/mesonbuild/meson/issues/1564
|
||||
files('fixup-json-schema-generated-doc.sed'),
|
||||
'@INPUT@',
|
||||
],
|
||||
capture : true,
|
||||
input : gen_file[idx],
|
||||
output : schema_name + '-fixed.md',
|
||||
)
|
||||
idx += 1
|
||||
json_schema_generated_files += [ sedded_file ]
|
||||
endforeach
|
||||
else
|
||||
warning(
|
||||
'json-schema-for-humans not found, skipping JSON schema documentation generation',
|
||||
)
|
||||
endif
|
||||
@@ -1 +0,0 @@
|
||||
../../../../../../src/libstore-tests/data/build-result
|
||||
@@ -1,136 +0,0 @@
|
||||
"$schema": "http://json-schema.org/draft-04/schema"
|
||||
"$id": "https://nix.dev/manual/nix/latest/protocols/json/schema/build-result-v1.json"
|
||||
title: Build Result
|
||||
description: |
|
||||
This schema describes the JSON representation of Nix's `BuildResult` type, which represents the result of building a derivation or substituting store paths.
|
||||
|
||||
Build results can represent either successful builds (with built outputs) or various types of failures.
|
||||
|
||||
oneOf:
|
||||
- "$ref": "#/$defs/success"
|
||||
- "$ref": "#/$defs/failure"
|
||||
type: object
|
||||
required:
|
||||
- success
|
||||
- status
|
||||
properties:
|
||||
timesBuilt:
|
||||
type: integer
|
||||
minimum: 0
|
||||
title: Times built
|
||||
description: |
|
||||
How many times this build was performed.
|
||||
|
||||
startTime:
|
||||
type: integer
|
||||
minimum: 0
|
||||
title: Start time
|
||||
description: |
|
||||
The start time of the build (or one of the rounds, if it was repeated), as a Unix timestamp.
|
||||
|
||||
stopTime:
|
||||
type: integer
|
||||
minimum: 0
|
||||
title: Stop time
|
||||
description: |
|
||||
The stop time of the build (or one of the rounds, if it was repeated), as a Unix timestamp.
|
||||
|
||||
cpuUser:
|
||||
type: integer
|
||||
minimum: 0
|
||||
title: User CPU time
|
||||
description: |
|
||||
User CPU time the build took, in microseconds.
|
||||
|
||||
cpuSystem:
|
||||
type: integer
|
||||
minimum: 0
|
||||
title: System CPU time
|
||||
description: |
|
||||
System CPU time the build took, in microseconds.
|
||||
|
||||
"$defs":
|
||||
success:
|
||||
type: object
|
||||
title: Successful Build Result
|
||||
description: |
|
||||
Represents a successful build with built outputs.
|
||||
required:
|
||||
- success
|
||||
- status
|
||||
- builtOutputs
|
||||
properties:
|
||||
success:
|
||||
const: true
|
||||
title: Success indicator
|
||||
description: |
|
||||
Always true for successful build results.
|
||||
|
||||
status:
|
||||
type: string
|
||||
title: Success status
|
||||
description: |
|
||||
Status string for successful builds.
|
||||
enum:
|
||||
- "Built"
|
||||
- "Substituted"
|
||||
- "AlreadyValid"
|
||||
- "ResolvesToAlreadyValid"
|
||||
|
||||
builtOutputs:
|
||||
type: object
|
||||
title: Built outputs
|
||||
description: |
|
||||
A mapping from output names to their build trace entries.
|
||||
additionalProperties:
|
||||
"$ref": "build-trace-entry-v1.yaml"
|
||||
|
||||
failure:
|
||||
type: object
|
||||
title: Failed Build Result
|
||||
description: |
|
||||
Represents a failed build with error information.
|
||||
required:
|
||||
- success
|
||||
- status
|
||||
- errorMsg
|
||||
properties:
|
||||
success:
|
||||
const: false
|
||||
title: Success indicator
|
||||
description: |
|
||||
Always false for failed build results.
|
||||
|
||||
status:
|
||||
type: string
|
||||
title: Failure status
|
||||
description: |
|
||||
Status string for failed builds.
|
||||
enum:
|
||||
- "PermanentFailure"
|
||||
- "InputRejected"
|
||||
- "OutputRejected"
|
||||
- "TransientFailure"
|
||||
- "CachedFailure"
|
||||
- "TimedOut"
|
||||
- "MiscFailure"
|
||||
- "DependencyFailed"
|
||||
- "LogLimitExceeded"
|
||||
- "NotDeterministic"
|
||||
- "NoSubstituters"
|
||||
- "HashMismatch"
|
||||
|
||||
errorMsg:
|
||||
type: string
|
||||
title: Error message
|
||||
description: |
|
||||
Information about the error if the build failed.
|
||||
|
||||
isNonDeterministic:
|
||||
type: boolean
|
||||
title: Non-deterministic flag
|
||||
description: |
|
||||
If timesBuilt > 1, whether some builds did not produce the same result.
|
||||
|
||||
Note that 'isNonDeterministic = false' does not mean the build is deterministic,
|
||||
just that we don't have evidence of non-determinism.
|
||||
@@ -1 +0,0 @@
|
||||
../../../../../../src/libstore-tests/data/realisation
|
||||
@@ -1,74 +0,0 @@
|
||||
"$schema": "http://json-schema.org/draft-04/schema"
|
||||
"$id": "https://nix.dev/manual/nix/latest/protocols/json/schema/build-trace-entry-v1.json"
|
||||
title: Build Trace Entry
|
||||
description: |
|
||||
A record of a successful build outcome for a specific derivation output.
|
||||
|
||||
This schema describes the JSON representation of a [build trace entry](@docroot@/store/build-trace.md) entry.
|
||||
|
||||
> **Warning**
|
||||
>
|
||||
> This JSON format is currently
|
||||
> [**experimental**](@docroot@/development/experimental-features.md#xp-feature-ca-derivations)
|
||||
> and subject to change.
|
||||
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
- outPath
|
||||
- dependentRealisations
|
||||
- signatures
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
title: Derivation Output ID
|
||||
pattern: "^sha256:[0-9a-f]{64}![a-zA-Z_][a-zA-Z0-9_-]*$"
|
||||
description: |
|
||||
Unique identifier for the derivation output that was built.
|
||||
|
||||
Format: `{hash-quotient-drv}!{output-name}`
|
||||
|
||||
- **hash-quotient-drv**: SHA-256 [hash of the quotient derivation](@docroot@/store/derivation/outputs/input-address.md#hash-quotient-drv).
|
||||
Begins with `sha256:`.
|
||||
|
||||
- **output-name**: Name of the specific output (e.g., "out", "dev", "doc")
|
||||
|
||||
Example: `"sha256:ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad!foo"`
|
||||
|
||||
outPath:
|
||||
"$ref": "store-path-v1.yaml"
|
||||
title: Output Store Path
|
||||
description: |
|
||||
The path to the store object that resulted from building this derivation for the given output name.
|
||||
|
||||
dependentRealisations:
|
||||
type: object
|
||||
title: Underlying Base Build Trace
|
||||
description: |
|
||||
This is for [*derived*](@docroot@/store/build-trace.md#derived) build trace entries to ensure coherence.
|
||||
|
||||
Keys are derivation output IDs (same format as the main `id` field).
|
||||
Values are the store paths that those dependencies resolved to.
|
||||
|
||||
As described in the linked section on derived build trace traces, derived build trace entries must be kept in addition and not instead of the underlying base build entries.
|
||||
This is the set of base build trace entries that this derived build trace is derived from.
|
||||
(The set is also a map since this miniature base build trace must be coherent, mapping each key to a single value.)
|
||||
|
||||
patternProperties:
|
||||
"^sha256:[0-9a-f]{64}![a-zA-Z_][a-zA-Z0-9_-]*$":
|
||||
$ref: "store-path-v1.yaml"
|
||||
title: Dependent Store Path
|
||||
description: Store path that this dependency resolved to during the build
|
||||
additionalProperties: false
|
||||
|
||||
signatures:
|
||||
type: array
|
||||
title: Build Signatures
|
||||
description: |
|
||||
A set of cryptographic signatures attesting to the authenticity of this build trace entry.
|
||||
items:
|
||||
type: string
|
||||
title: Signature
|
||||
description: A single cryptographic signature
|
||||
|
||||
additionalProperties: false
|
||||
@@ -1 +0,0 @@
|
||||
../../../../../../src/libstore-tests/data/content-address
|
||||
@@ -1,55 +0,0 @@
|
||||
"$schema": "http://json-schema.org/draft-04/schema"
|
||||
"$id": "https://nix.dev/manual/nix/latest/protocols/json/schema/content-address-v1.json"
|
||||
title: Content Address
|
||||
description: |
|
||||
This schema describes the JSON representation of Nix's `ContentAddress` type, which conveys information about [content-addressing store objects](@docroot@/store/store-object/content-address.md).
|
||||
|
||||
> **Note**
|
||||
>
|
||||
> For current methods of content addressing, this data type is a bit suspicious, because it is neither simply a content address of a file system object (the `method` is richer), nor simply a content address of a store object (the `hash` doesn't account for the references).
|
||||
> It should thus only be used in contexts where the references are also known / otherwise made tamper-resistant.
|
||||
|
||||
<!--
|
||||
TODO currently `ContentAddress` is used in both of these, and so same rationale applies, but actually in both cases the JSON is currently ad-hoc.
|
||||
That will be fixed, and as each is fixed, the example (along with a more precise link to the field in question) should be become part of the above note, so what is is saying is more clear.
|
||||
|
||||
> For example:
|
||||
|
||||
> - Fixed outputs of derivations are not allowed to have any references, so an empty reference set is statically known by assumption.
|
||||
|
||||
> - [Store object info](./store-object-info.md) includes the set of references along side the (optional) content address.
|
||||
|
||||
> This data type is thus safely used in both of these contexts.
|
||||
|
||||
-->
|
||||
|
||||
type: object
|
||||
properties:
|
||||
method:
|
||||
"$ref": "#/$defs/method"
|
||||
hash:
|
||||
title: Content Address
|
||||
description: |
|
||||
This would be the content-address itself.
|
||||
|
||||
For all current methods, this is just a content address of the file system object of the store object, [as described in the store chapter](@docroot@/store/file-system-object/content-address.md), and not of the store object as a whole.
|
||||
In particular, the references of the store object are *not* taken into account with this hash (and currently-supported methods).
|
||||
"$ref": "./hash-v1.yaml"
|
||||
required:
|
||||
- method
|
||||
- hash
|
||||
additionalProperties: false
|
||||
"$defs":
|
||||
method:
|
||||
type: string
|
||||
enum: [flat, nar, text, git]
|
||||
title: Content-Addressing Method
|
||||
description: |
|
||||
A string representing the [method](@docroot@/store/store-object/content-address.md) of content addressing that is chosen.
|
||||
|
||||
Valid method strings are:
|
||||
|
||||
- [`flat`](@docroot@/store/store-object/content-address.md#method-flat) (provided the contents are a single file)
|
||||
- [`nar`](@docroot@/store/store-object/content-address.md#method-nix-archive)
|
||||
- [`text`](@docroot@/store/store-object/content-address.md#method-text)
|
||||
- [`git`](@docroot@/store/store-object/content-address.md#method-git)
|
||||
@@ -1,299 +0,0 @@
|
||||
"$schema": "http://json-schema.org/draft-04/schema"
|
||||
"$id": "https://nix.dev/manual/nix/latest/protocols/json/schema/derivation-v4.json"
|
||||
title: Derivation
|
||||
description: |
|
||||
Experimental JSON representation of a Nix derivation (version 4).
|
||||
|
||||
This schema describes the JSON representation of Nix's `Derivation` type.
|
||||
|
||||
> **Warning**
|
||||
>
|
||||
> This JSON format is currently
|
||||
> [**experimental**](@docroot@/development/experimental-features.md#xp-feature-nix-command)
|
||||
> and subject to change.
|
||||
|
||||
type: object
|
||||
required:
|
||||
- name
|
||||
- version
|
||||
- outputs
|
||||
- inputs
|
||||
- system
|
||||
- builder
|
||||
- args
|
||||
- env
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
title: Derivation name
|
||||
description: |
|
||||
The name of the derivation.
|
||||
Used when calculating store paths for the derivation’s outputs.
|
||||
|
||||
version:
|
||||
const: 4
|
||||
title: Format version (must be 4)
|
||||
description: |
|
||||
Must be `4`.
|
||||
This is a guard that allows us to continue evolving this format.
|
||||
The choice of `3` is fairly arbitrary, but corresponds to this informal version:
|
||||
|
||||
- Version 0: ATerm format
|
||||
|
||||
- Version 1: Original JSON format, with ugly `"r:sha256"` inherited from ATerm format.
|
||||
|
||||
- Version 2: Separate `method` and `hashAlgo` fields in output specs
|
||||
|
||||
- Version 3: Drop store dir from store paths, just include base name.
|
||||
|
||||
- Version 4: Two cleanups, batched together to lesson churn:
|
||||
|
||||
- Reorganize inputs into nested structure (`inputs.srcs` and `inputs.drvs`)
|
||||
|
||||
- Use canonical content address JSON format for floating content addressed derivation outputs.
|
||||
|
||||
Note that while this format is experimental, the maintenance of versions is best-effort, and not promised to identify every change.
|
||||
|
||||
outputs:
|
||||
type: object
|
||||
title: Output specifications
|
||||
description: |
|
||||
Information about the output paths of the derivation.
|
||||
This is a JSON object with one member per output, where the key is the output name and the value is a JSON object as described.
|
||||
|
||||
> **Example**
|
||||
>
|
||||
> ```json
|
||||
> "outputs": {
|
||||
> "out": {
|
||||
> "method": "nar",
|
||||
> "hashAlgo": "sha256",
|
||||
> "hash": "6fc80dcc62179dbc12fc0b5881275898f93444833d21b89dfe5f7fbcbb1d0d62"
|
||||
> }
|
||||
> }
|
||||
> ```
|
||||
additionalProperties:
|
||||
"$ref": "#/$defs/output/overall"
|
||||
|
||||
inputs:
|
||||
type: object
|
||||
title: Derivation inputs
|
||||
description: |
|
||||
Input dependencies for the derivation, organized into source paths and derivation dependencies.
|
||||
required:
|
||||
- srcs
|
||||
- drvs
|
||||
properties:
|
||||
srcs:
|
||||
type: array
|
||||
title: Input source paths
|
||||
description: |
|
||||
List of store paths on which this derivation depends.
|
||||
|
||||
> **Example**
|
||||
>
|
||||
> ```json
|
||||
> "srcs": [
|
||||
> "47y241wqdhac3jm5l7nv0x4975mb1975-separate-debug-info.sh",
|
||||
> "56d0w71pjj9bdr363ym3wj1zkwyqq97j-fix-pop-var-context-error.patch"
|
||||
> ]
|
||||
> ```
|
||||
items:
|
||||
$ref: "store-path-v1.yaml"
|
||||
drvs:
|
||||
type: object
|
||||
title: Input derivations
|
||||
description: |
|
||||
Mapping of derivation paths to lists of output names they provide.
|
||||
|
||||
> **Example**
|
||||
>
|
||||
> ```json
|
||||
> "drvs": {
|
||||
> "6lkh5yi7nlb7l6dr8fljlli5zfd9hq58-curl-7.73.0.drv": ["dev"],
|
||||
> "fn3kgnfzl5dzym26j8g907gq3kbm8bfh-unzip-6.0.drv": ["out"]
|
||||
> }
|
||||
> ```
|
||||
>
|
||||
> specifies that this derivation depends on the `dev` output of `curl`, and the `out` output of `unzip`.
|
||||
patternProperties:
|
||||
"^[0123456789abcdfghijklmnpqrsvwxyz]{32}-.+\\.drv$":
|
||||
title: Store Path
|
||||
description: |
|
||||
A store path to a derivation, mapped to the outputs of that derivation.
|
||||
oneOf:
|
||||
- "$ref": "#/$defs/outputNames"
|
||||
- "$ref": "#/$defs/dynamicOutputs"
|
||||
additionalProperties: false
|
||||
additionalProperties: false
|
||||
|
||||
system:
|
||||
type: string
|
||||
title: Build system type
|
||||
description: |
|
||||
The system type on which this derivation is to be built
|
||||
(e.g. `x86_64-linux`).
|
||||
|
||||
builder:
|
||||
type: string
|
||||
title: Build program path
|
||||
description: |
|
||||
Absolute path of the program used to perform the build.
|
||||
Typically this is the `bash` shell
|
||||
(e.g. `/nix/store/r3j288vpmczbl500w6zz89gyfa4nr0b1-bash-4.4-p23/bin/bash`).
|
||||
|
||||
args:
|
||||
type: array
|
||||
title: Builder arguments
|
||||
description: |
|
||||
Command-line arguments passed to the `builder`.
|
||||
items:
|
||||
type: string
|
||||
|
||||
env:
|
||||
type: object
|
||||
title: Environment variables
|
||||
description: |
|
||||
Environment variables passed to the `builder`.
|
||||
additionalProperties:
|
||||
type: string
|
||||
|
||||
structuredAttrs:
|
||||
title: Structured attributes
|
||||
description: |
|
||||
[Structured Attributes](@docroot@/store/derivation/index.md#structured-attrs), only defined if the derivation contains them.
|
||||
Structured attributes are JSON, and thus embedded as-is.
|
||||
type: object
|
||||
additionalProperties: true
|
||||
|
||||
"$defs":
|
||||
output:
|
||||
overall:
|
||||
title: Derivation Output
|
||||
description: |
|
||||
A single output of a derivation, with different variants for different output types.
|
||||
oneOf:
|
||||
- "$ref": "#/$defs/output/inputAddressed"
|
||||
- "$ref": "#/$defs/output/caFixed"
|
||||
- "$ref": "#/$defs/output/caFloating"
|
||||
- "$ref": "#/$defs/output/deferred"
|
||||
- "$ref": "#/$defs/output/impure"
|
||||
|
||||
inputAddressed:
|
||||
title: Input-Addressed Output
|
||||
description: |
|
||||
The traditional non-fixed-output derivation type.
|
||||
The output path is determined from the derivation itself.
|
||||
|
||||
See [Input-addressing derivation outputs](@docroot@/store/derivation/outputs/input-address.md) for more details.
|
||||
type: object
|
||||
required:
|
||||
- path
|
||||
properties:
|
||||
path:
|
||||
$ref: "store-path-v1.yaml"
|
||||
title: Output path
|
||||
description: |
|
||||
The output path determined from the derivation itself.
|
||||
additionalProperties: false
|
||||
|
||||
caFixed:
|
||||
title: Fixed Content-Addressed Output
|
||||
description: |
|
||||
The output is content-addressed, and the content-address is fixed in advance.
|
||||
|
||||
See [Fixed-output content-addressing](@docroot@/store/derivation/outputs/content-address.md#fixed) for more details.
|
||||
"$ref": "./content-address-v1.yaml"
|
||||
required:
|
||||
- method
|
||||
- hash
|
||||
properties:
|
||||
method:
|
||||
description: |
|
||||
Method of content addressing used for this output.
|
||||
hash:
|
||||
title: Expected hash value
|
||||
description: |
|
||||
The expected content hash.
|
||||
additionalProperties: false
|
||||
|
||||
caFloating:
|
||||
title: Floating Content-Addressed Output
|
||||
description: |
|
||||
Floating-output derivations, whose outputs are content
|
||||
addressed, but not fixed, and so the output paths are dynamically calculated from
|
||||
whatever the output ends up being.
|
||||
|
||||
See [Floating Content-Addressing](@docroot@/store/derivation/outputs/content-address.md#floating) for more details.
|
||||
type: object
|
||||
required:
|
||||
- method
|
||||
- hashAlgo
|
||||
properties:
|
||||
method:
|
||||
"$ref": "./content-address-v1.yaml#/$defs/method"
|
||||
description: |
|
||||
Method of content addressing used for this output.
|
||||
hashAlgo:
|
||||
title: Hash algorithm
|
||||
"$ref": "./hash-v1.yaml#/$defs/algorithm"
|
||||
description: |
|
||||
What hash algorithm to use for the given method of content-addressing.
|
||||
additionalProperties: false
|
||||
|
||||
deferred:
|
||||
title: Deferred Output
|
||||
description: |
|
||||
Input-addressed output which depends on a (CA) derivation whose outputs (and thus their content-address
|
||||
are not yet known.
|
||||
type: object
|
||||
properties: {}
|
||||
additionalProperties: false
|
||||
|
||||
impure:
|
||||
title: Impure Output
|
||||
description: |
|
||||
Impure output which is just like a floating content-addressed output, but this derivation runs without sandboxing.
|
||||
As such, we don't record it in the build trace, under the assumption that if we need it again, we should rebuild it, as it might produce something different.
|
||||
required:
|
||||
- impure
|
||||
- method
|
||||
- hashAlgo
|
||||
properties:
|
||||
impure:
|
||||
const: true
|
||||
method:
|
||||
"$ref": "./content-address-v1.yaml#/$defs/method"
|
||||
description: |
|
||||
How the file system objects will be serialized for hashing.
|
||||
hashAlgo:
|
||||
title: Hash algorithm
|
||||
"$ref": "./hash-v1.yaml#/$defs/algorithm"
|
||||
description: |
|
||||
How the serialization will be hashed.
|
||||
additionalProperties: false
|
||||
|
||||
outputName:
|
||||
type: string
|
||||
title: Output name
|
||||
description: Name of the derivation output to depend on
|
||||
|
||||
outputNames:
|
||||
type: array
|
||||
title: Output Names
|
||||
description: Set of names of derivation outputs to depend on
|
||||
items:
|
||||
"$ref": "#/$defs/outputName"
|
||||
|
||||
dynamicOutputs:
|
||||
type: object
|
||||
title: Dynamic Outputs
|
||||
description: |
|
||||
**Experimental feature**: [`dynamic-derivations`](@docroot@/development/experimental-features.md#xp-feature-dynamic-derivations)
|
||||
|
||||
This recursive data type allows for depending on outputs of outputs.
|
||||
properties:
|
||||
outputs:
|
||||
"$ref": "#/$defs/outputNames"
|
||||
dynamicOutputs:
|
||||
"$ref": "#/$defs/dynamicOutputs"
|
||||
@@ -1 +0,0 @@
|
||||
../../../../../../src/libstore-tests/data/derived-path
|
||||
@@ -1,27 +0,0 @@
|
||||
"$schema": "http://json-schema.org/draft-04/schema"
|
||||
"$id": "https://nix.dev/manual/nix/latest/protocols/json/schema/deriving-path-v1.json"
|
||||
title: Deriving Path
|
||||
description: |
|
||||
This schema describes the JSON representation of Nix's [Deriving Path](@docroot@/store/derivation/index.md#deriving-path).
|
||||
oneOf:
|
||||
- title: Constant
|
||||
description: |
|
||||
See [Constant](@docroot@/store/derivation/index.md#deriving-path-constant) deriving path.
|
||||
$ref: "store-path-v1.yaml"
|
||||
- title: Output
|
||||
description: |
|
||||
See [Output](@docroot@/store/derivation/index.md#deriving-path-output) deriving path.
|
||||
type: object
|
||||
properties:
|
||||
drvPath:
|
||||
"$ref": "#"
|
||||
description: |
|
||||
A deriving path to a [Derivation](@docroot@/store/derivation/index.md#store-derivation), whose output is being referred to.
|
||||
output:
|
||||
type: string
|
||||
description: |
|
||||
The name of an output produced by that derivation (e.g. "out", "doc", etc.).
|
||||
required:
|
||||
- drvPath
|
||||
- output
|
||||
additionalProperties: false
|
||||
@@ -1 +0,0 @@
|
||||
../../../../../../src/libutil-tests/data/hash/
|
||||
@@ -1,54 +0,0 @@
|
||||
"$schema": "http://json-schema.org/draft-04/schema"
|
||||
"$id": "https://nix.dev/manual/nix/latest/protocols/json/schema/hash-v1.json"
|
||||
title: Hash
|
||||
description: |
|
||||
A cryptographic hash value used throughout Nix for content addressing and integrity verification.
|
||||
|
||||
This schema describes the JSON representation of Nix's `Hash` type.
|
||||
type: object
|
||||
properties:
|
||||
algorithm:
|
||||
"$ref": "#/$defs/algorithm"
|
||||
format:
|
||||
type: string
|
||||
enum:
|
||||
- base64
|
||||
- nix32
|
||||
- base16
|
||||
- sri
|
||||
title: Hash format
|
||||
description: |
|
||||
The encoding format of the hash value.
|
||||
|
||||
- `base64` uses standard Base64 encoding [RFC 4648, section 4](https://datatracker.ietf.org/doc/html/rfc4648#section-4)
|
||||
- `nix32` is Nix-specific base-32 encoding
|
||||
- `base16` is lowercase hexadecimal
|
||||
- `sri` is the [Subresource Integrity format](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity).
|
||||
hash:
|
||||
type: string
|
||||
title: Hash
|
||||
description: |
|
||||
The encoded hash value, itself.
|
||||
|
||||
It is specified in the format specified by the `format` field.
|
||||
It must be the right length for the hash algorithm specified in the `algorithm` field, also.
|
||||
The hash value does not include any algorithm prefix.
|
||||
required:
|
||||
- algorithm
|
||||
- format
|
||||
- hash
|
||||
additionalProperties: false
|
||||
"$defs":
|
||||
algorithm:
|
||||
type: string
|
||||
enum:
|
||||
- blake3
|
||||
- md5
|
||||
- sha1
|
||||
- sha256
|
||||
- sha512
|
||||
title: Hash algorithm
|
||||
description: |
|
||||
The hash algorithm used to compute the hash value.
|
||||
|
||||
`blake3` is currently experimental and requires the [`blake-hashing`](@docroot@/development/experimental-features.md#xp-feature-blake3-hashes) experimental feature.
|
||||
@@ -1 +0,0 @@
|
||||
../../../../../../src/libstore-tests/data/nar-info
|
||||
@@ -1 +0,0 @@
|
||||
../../../../../../src/libstore-tests/data/path-info
|
||||
@@ -1,258 +0,0 @@
|
||||
"$schema": "http://json-schema.org/draft-04/schema"
|
||||
"$id": "https://nix.dev/manual/nix/latest/protocols/json/schema/store-object-info-v2.json"
|
||||
title: Store Object Info v2
|
||||
description: |
|
||||
Information about a [store object](@docroot@/store/store-object.md).
|
||||
|
||||
This schema describes the JSON representation of store object metadata as returned by commands like [`nix path-info --json`](@docroot@/command-ref/new-cli/nix3-path-info.md).
|
||||
|
||||
> **Warning**
|
||||
>
|
||||
> This JSON format is currently
|
||||
> [**experimental**](@docroot@/development/experimental-features.md#xp-feature-nix-command)
|
||||
> and subject to change.
|
||||
|
||||
### Field Categories
|
||||
|
||||
Store object information can come in a few different variations.
|
||||
|
||||
Firstly, "impure" fields, which contain non-intrinsic information about the store object, may or may not be included.
|
||||
|
||||
Second, binary cache stores have extra non-intrinsic infomation about the store objects they contain.
|
||||
|
||||
Thirdly, [`nix path-info --json --closure-size`](@docroot@/command-ref/new-cli/nix3-path-info.html#opt-closure-size) can compute some extra information about not just the single store object in question, but the store object and its [closure](@docroot@/glossary.md#gloss-closure).
|
||||
|
||||
The impure and NAR fields are grouped into separate variants below.
|
||||
See their descriptions for additional information.
|
||||
The closure fields however as just included as optional fields, to avoid a combinatorial explosion of variants.
|
||||
|
||||
oneOf:
|
||||
- $ref: "#/$defs/base"
|
||||
|
||||
- $ref: "#/$defs/impure"
|
||||
|
||||
- $ref: "#/$defs/narInfo"
|
||||
|
||||
$defs:
|
||||
base:
|
||||
title: Store Object Info
|
||||
description: |
|
||||
Basic store object metadata containing only intrinsic properties.
|
||||
This is the minimal set of fields that describe what a store object contains.
|
||||
type: object
|
||||
required:
|
||||
- version
|
||||
- narHash
|
||||
- narSize
|
||||
- references
|
||||
- ca
|
||||
properties:
|
||||
version:
|
||||
type: integer
|
||||
const: 2
|
||||
title: Format version (must be 2)
|
||||
description: |
|
||||
Must be `2`.
|
||||
This is a guard that allows us to continue evolving this format.
|
||||
Here is the rough version history:
|
||||
|
||||
- Version 0: `.narinfo` line-oriented format
|
||||
|
||||
- Version 1: Original JSON format, with ugly `"r:sha256"` inherited from `.narinfo` format.
|
||||
|
||||
- Version 2: Use structured JSON type for `ca`
|
||||
|
||||
path:
|
||||
type: string
|
||||
title: Store Path
|
||||
description: |
|
||||
[Store path](@docroot@/store/store-path.md) to the given store object.
|
||||
|
||||
Note: This field may not be present in all contexts, such as when the path is used as the key and the the store object info the value in map.
|
||||
|
||||
narHash:
|
||||
"$ref": "./hash-v1.yaml"
|
||||
title: NAR Hash
|
||||
description: |
|
||||
Hash of the [file system object](@docroot@/store/file-system-object.md) part of the store object when serialized as a [Nix Archive](@docroot@/store/file-system-object/content-address.md#serial-nix-archive).
|
||||
|
||||
narSize:
|
||||
type: integer
|
||||
minimum: 0
|
||||
title: NAR Size
|
||||
description: |
|
||||
Size of the [file system object](@docroot@/store/file-system-object.md) part of the store object when serialized as a [Nix Archive](@docroot@/store/file-system-object/content-address.md#serial-nix-archive).
|
||||
|
||||
references:
|
||||
type: array
|
||||
title: References
|
||||
description: |
|
||||
An array of [store paths](@docroot@/store/store-path.md), possibly including this one.
|
||||
items:
|
||||
type: string
|
||||
|
||||
ca:
|
||||
oneOf:
|
||||
- type: "null"
|
||||
const: null
|
||||
- "$ref": "./content-address-v1.yaml"
|
||||
title: Content Address
|
||||
description: |
|
||||
If the store object is [content-addressed](@docroot@/store/store-object/content-address.md),
|
||||
this is the content address of this store object's file system object, used to compute its store path.
|
||||
Otherwise (i.e. if it is [input-addressed](@docroot@/glossary.md#gloss-input-addressed-store-object)), this is `null`.
|
||||
additionalProperties: false
|
||||
|
||||
impure:
|
||||
title: Store Object Info with Impure Fields
|
||||
description: |
|
||||
Store object metadata including impure fields that are not *intrinsic* properties.
|
||||
In other words, the same store object in different stores could have different values for these impure fields.
|
||||
type: object
|
||||
required:
|
||||
- version
|
||||
- narHash
|
||||
- narSize
|
||||
- references
|
||||
- ca
|
||||
# impure
|
||||
- deriver
|
||||
- registrationTime
|
||||
- ultimate
|
||||
- signatures
|
||||
properties:
|
||||
version: { $ref: "#/$defs/base/properties/version" }
|
||||
path: { $ref: "#/$defs/base/properties/path" }
|
||||
narHash: { $ref: "#/$defs/base/properties/narHash" }
|
||||
narSize: { $ref: "#/$defs/base/properties/narSize" }
|
||||
references: { $ref: "#/$defs/base/properties/references" }
|
||||
ca: { $ref: "#/$defs/base/properties/ca" }
|
||||
deriver:
|
||||
type: ["string", "null"]
|
||||
title: Deriver
|
||||
description: |
|
||||
If known, the path to the [store derivation](@docroot@/glossary.md#gloss-store-derivation) from which this store object was produced.
|
||||
Otherwise `null`.
|
||||
|
||||
> This is an "impure" field that may not be included in certain contexts.
|
||||
|
||||
registrationTime:
|
||||
type: ["integer", "null"]
|
||||
title: Registration Time
|
||||
description: |
|
||||
If known, when this derivation was added to the store (Unix timestamp).
|
||||
Otherwise `null`.
|
||||
|
||||
> This is an "impure" field that may not be included in certain contexts.
|
||||
|
||||
ultimate:
|
||||
type: boolean
|
||||
title: Ultimate
|
||||
description: |
|
||||
Whether this store object is trusted because we built it ourselves, rather than substituted a build product from elsewhere.
|
||||
|
||||
> This is an "impure" field that may not be included in certain contexts.
|
||||
|
||||
signatures:
|
||||
type: array
|
||||
title: Signatures
|
||||
description: |
|
||||
Signatures claiming that this store object is what it claims to be.
|
||||
Not relevant for [content-addressed](@docroot@/store/store-object/content-address.md) store objects,
|
||||
but useful for [input-addressed](@docroot@/glossary.md#gloss-input-addressed-store-object) store objects.
|
||||
|
||||
> This is an "impure" field that may not be included in certain contexts.
|
||||
items:
|
||||
type: string
|
||||
|
||||
# Computed closure fields
|
||||
closureSize:
|
||||
type: integer
|
||||
minimum: 0
|
||||
title: Closure Size
|
||||
description: |
|
||||
The total size of this store object and every other object in its [closure](@docroot@/glossary.md#gloss-closure).
|
||||
|
||||
> This field is not stored at all, but computed by traversing the other fields across all the store objects in a closure.
|
||||
additionalProperties: false
|
||||
|
||||
narInfo:
|
||||
title: Store Object Info with Impure fields and NAR Info
|
||||
description: |
|
||||
The store object info in the "binary cache" family of Nix store type contain extra information pertaining to *downloads* of the store object in question.
|
||||
(This store info is called "NAR info", since the downloads take the form of [Nix Archives](@docroot@/store/file-system-object/content-address.md#serial-nix-archive, and the metadata is served in a file with a `.narinfo` extension.)
|
||||
|
||||
This download information, being specific to how the store object happens to be stored and transferred, is also considered to be non-intrinsic / impure.
|
||||
type: object
|
||||
required:
|
||||
- version
|
||||
- narHash
|
||||
- narSize
|
||||
- references
|
||||
- ca
|
||||
# impure
|
||||
- deriver
|
||||
- registrationTime
|
||||
- ultimate
|
||||
- signatures
|
||||
# nar
|
||||
- url
|
||||
- compression
|
||||
- downloadHash
|
||||
- downloadSize
|
||||
properties:
|
||||
version: { $ref: "#/$defs/base/properties/version" }
|
||||
path: { $ref: "#/$defs/base/properties/path" }
|
||||
narHash: { $ref: "#/$defs/base/properties/narHash" }
|
||||
narSize: { $ref: "#/$defs/base/properties/narSize" }
|
||||
references: { $ref: "#/$defs/base/properties/references" }
|
||||
ca: { $ref: "#/$defs/base/properties/ca" }
|
||||
deriver: { $ref: "#/$defs/impure/properties/deriver" }
|
||||
registrationTime: { $ref: "#/$defs/impure/properties/registrationTime" }
|
||||
ultimate: { $ref: "#/$defs/impure/properties/ultimate" }
|
||||
signatures: { $ref: "#/$defs/impure/properties/signatures" }
|
||||
closureSize: { $ref: "#/$defs/impure/properties/closureSize" }
|
||||
url:
|
||||
type: string
|
||||
title: URL
|
||||
description: |
|
||||
Where to download a compressed archive of the file system objects of this store object.
|
||||
|
||||
> This is an impure "`.narinfo`" field that may not be included in certain contexts.
|
||||
|
||||
compression:
|
||||
type: string
|
||||
title: Compression
|
||||
description: |
|
||||
The compression format that the archive is in.
|
||||
|
||||
> This is an impure "`.narinfo`" field that may not be included in certain contexts.
|
||||
|
||||
downloadHash:
|
||||
"$ref": "./hash-v1.yaml"
|
||||
title: Download Hash
|
||||
description: |
|
||||
A digest for the compressed archive itself, as opposed to the data contained within.
|
||||
|
||||
> This is an impure "`.narinfo`" field that may not be included in certain contexts.
|
||||
|
||||
downloadSize:
|
||||
type: integer
|
||||
minimum: 0
|
||||
title: Download Size
|
||||
description: |
|
||||
The size of the compressed archive itself.
|
||||
|
||||
> This is an impure "`.narinfo`" field that may not be included in certain contexts.
|
||||
|
||||
closureDownloadSize:
|
||||
type: integer
|
||||
minimum: 0
|
||||
title: Closure Download Size
|
||||
description: |
|
||||
The total size of the compressed archive itself for this object, and the compressed archive of every object in this object's [closure](@docroot@/glossary.md#gloss-closure).
|
||||
|
||||
> This is an impure "`.narinfo`" field that may not be included in certain contexts.
|
||||
|
||||
> This field is not stored at all, but computed by traversing the other fields across all the store objects in a closure.
|
||||
additionalProperties: false
|
||||
@@ -1 +0,0 @@
|
||||
../../../../../../src/libstore-tests/data/store-path
|
||||
@@ -1,32 +0,0 @@
|
||||
"$schema": "http://json-schema.org/draft-07/schema"
|
||||
"$id": "https://nix.dev/manual/nix/latest/protocols/json/schema/store-path-v1.json"
|
||||
title: Store Path
|
||||
description: |
|
||||
A [store path](@docroot@/store/store-path.md) identifying a store object.
|
||||
|
||||
This schema describes the JSON representation of store paths as used in various Nix JSON APIs.
|
||||
|
||||
> **Warning**
|
||||
>
|
||||
> This JSON format is currently
|
||||
> [**experimental**](@docroot@/development/experimental-features.md#xp-feature-nix-command)
|
||||
> and subject to change.
|
||||
|
||||
## Format
|
||||
|
||||
Store paths in JSON are represented as strings containing just the hash and name portion, without the store directory prefix.
|
||||
|
||||
For example: `"g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo.drv"`
|
||||
|
||||
(If the store dir is `/nix/store`, then this corresponds to the path `/nix/store/g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo.drv`.)
|
||||
|
||||
## Structure
|
||||
|
||||
The format follows this pattern: `${digest}-${name}`
|
||||
|
||||
- **hash**: Digest rendered in a custom variant of [Base32](https://en.wikipedia.org/wiki/Base32) (20 arbitrary bytes become 32 ASCII characters)
|
||||
- **name**: The package name and optional version/suffix information
|
||||
|
||||
type: string
|
||||
pattern: "^[0123456789abcdfghijklmnpqrsvwxyz]{32}-.+$"
|
||||
minLength: 34
|
||||
@@ -1,45 +1,102 @@
|
||||
{{#include store-object-info-v2-fixed.md}}
|
||||
# Store object info JSON format
|
||||
|
||||
## Examples
|
||||
> **Warning**
|
||||
>
|
||||
> This JSON format is currently
|
||||
> [**experimental**](@docroot@/development/experimental-features.md#xp-feature-nix-command)
|
||||
> and subject to change.
|
||||
|
||||
### Minimal store object (content-addressed)
|
||||
Info about a [store object].
|
||||
|
||||
```json
|
||||
{{#include schema/store-object-info-v2/pure.json}}
|
||||
```
|
||||
* `path`:
|
||||
|
||||
### Store object with impure fields
|
||||
[Store path][store path] to the given store object.
|
||||
|
||||
```json
|
||||
{{#include schema/store-object-info-v2/impure.json}}
|
||||
```
|
||||
* `narHash`:
|
||||
|
||||
### Minimal store object (empty)
|
||||
Hash of the [file system object] part of the store object when serialized as a [Nix Archive].
|
||||
|
||||
```json
|
||||
{{#include schema/store-object-info-v2/empty_pure.json}}
|
||||
```
|
||||
* `narSize`:
|
||||
|
||||
### Store object with all impure fields
|
||||
Size of the [file system object] part of the store object when serialized as a [Nix Archive].
|
||||
|
||||
```json
|
||||
{{#include schema/store-object-info-v2/empty_impure.json}}
|
||||
```
|
||||
* `references`:
|
||||
|
||||
### NAR info (minimal)
|
||||
An array of [store paths][store path], possibly including this one.
|
||||
|
||||
```json
|
||||
{{#include schema/nar-info-v1/pure.json}}
|
||||
```
|
||||
* `ca`:
|
||||
|
||||
### NAR info (with binary cache fields)
|
||||
If the store object is [content-addressed],
|
||||
this is the content address of this store object's file system object, used to compute its store path.
|
||||
Otherwise (i.e. if it is [input-addressed]), this is `null`.
|
||||
|
||||
```json
|
||||
{{#include schema/nar-info-v1/impure.json}}
|
||||
```
|
||||
[store path]: @docroot@/store/store-path.md
|
||||
[file system object]: @docroot@/store/file-system-object.md
|
||||
[Nix Archive]: @docroot@/store/file-system-object/content-address.md#serial-nix-archive
|
||||
|
||||
<!-- need to convert YAML to JSON first
|
||||
## Raw Schema
|
||||
## Impure fields
|
||||
|
||||
[JSON Schema for Store Object Info v1](schema/store-object-info-v2.json)
|
||||
-->
|
||||
These are not intrinsic properties of the store object.
|
||||
In other words, the same store object residing in different store could have different values for these properties.
|
||||
|
||||
* `deriver`:
|
||||
|
||||
If known, the path to the [store derivation] from which this store object was produced.
|
||||
Otherwise `null`.
|
||||
|
||||
[store derivation]: @docroot@/glossary.md#gloss-store-derivation
|
||||
|
||||
* `registrationTime` (optional):
|
||||
|
||||
If known, when this derivation was added to the store.
|
||||
Otherwise `null`.
|
||||
|
||||
* `ultimate`:
|
||||
|
||||
Whether this store object is trusted because we built it ourselves, rather than substituted a build product from elsewhere.
|
||||
|
||||
* `signatures`:
|
||||
|
||||
Signatures claiming that this store object is what it claims to be.
|
||||
Not relevant for [content-addressed] store objects,
|
||||
but useful for [input-addressed] store objects.
|
||||
|
||||
[content-addressed]: @docroot@/store/store-object/content-address.md
|
||||
[input-addressed]: @docroot@/glossary.md#gloss-input-addressed-store-object
|
||||
|
||||
### `.narinfo` extra fields
|
||||
|
||||
This meta data is specific to the "binary cache" family of Nix store types.
|
||||
This information is not intrinsic to the store object, but about how it is stored.
|
||||
|
||||
* `url`:
|
||||
|
||||
Where to download a compressed archive of the file system objects of this store object.
|
||||
|
||||
* `compression`:
|
||||
|
||||
The compression format that the archive is in.
|
||||
|
||||
* `fileHash`:
|
||||
|
||||
A digest for the compressed archive itself, as opposed to the data contained within.
|
||||
|
||||
* `fileSize`:
|
||||
|
||||
The size of the compressed archive itself.
|
||||
|
||||
## Computed closure fields
|
||||
|
||||
These fields are not stored at all, but computed by traversing the other fields across all the store objects in a [closure].
|
||||
|
||||
* `closureSize`:
|
||||
|
||||
The total size of the compressed archive itself for this object, and the compressed archive of every object in this object's [closure].
|
||||
|
||||
### `.narinfo` extra fields
|
||||
|
||||
* `closureSize`:
|
||||
|
||||
The total size of this store object and every other object in its [closure].
|
||||
|
||||
[closure]: @docroot@/glossary.md#gloss-closure
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
{{#include store-path-v1-fixed.md}}
|
||||
|
||||
## Examples
|
||||
|
||||
### Simple store path
|
||||
|
||||
```json
|
||||
{{#include schema/store-path-v1/simple.json}}
|
||||
```
|
||||
|
||||
<!-- need to convert YAML to JSON first
|
||||
## Raw Schema
|
||||
|
||||
[JSON Schema for Store Path v1](schema/store-path-v1.json)
|
||||
-->
|
||||
@@ -1,2 +0,0 @@
|
||||
# Process JSON schema documentation
|
||||
subdir('json')
|
||||
@@ -4,7 +4,7 @@ This is the complete specification of the [Nix Archive] format.
|
||||
The Nix Archive format closely follows the abstract specification of a [file system object] tree,
|
||||
because it is designed to serialize exactly that data structure.
|
||||
|
||||
[Nix Archive]: @docroot@/store/file-system-object/content-address.md#serial-nix-archive
|
||||
[Nix Archive]: @docroot@/store/file-system-object/content-address.md#nix-archive
|
||||
[file system object]: @docroot@/store/file-system-object.md
|
||||
|
||||
The format of this specification is close to [Extended Backus–Naur form](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form), with the exception of the `str(..)` function / parameterized rule, which length-prefixes and pads strings.
|
||||
@@ -41,15 +41,3 @@ The `str` function / parameterized rule is defined as follows:
|
||||
- `int(n)` = the 64-bit little endian representation of the number `n`
|
||||
|
||||
- `pad(s)` = the byte sequence `s`, padded with 0s to a multiple of 8 byte
|
||||
|
||||
## Kaitai Struct Specification
|
||||
|
||||
The Nix Archive (NAR) format is also formally described using [Kaitai Struct](https://kaitai.io/), an Interface Description Language (IDL) for defining binary data structures.
|
||||
|
||||
> Kaitai Struct provides a language-agnostic, machine-readable specification that can be compiled into parsers for various programming languages (e.g., C++, Python, Java, Rust).
|
||||
|
||||
```yaml
|
||||
{{#include nar.ksy}}
|
||||
```
|
||||
|
||||
The source of the spec can be found [here](https://github.com/nixos/nix/blob/master/src/nix-manual/source/protocols/nix-archive/nar.ksy). Contributions and improvements to the spec are welcomed.
|
||||
@@ -1,169 +0,0 @@
|
||||
meta:
|
||||
id: nix_nar
|
||||
title: Nix Archive (NAR)
|
||||
file-extension: nar
|
||||
endian: le
|
||||
doc: |
|
||||
Nix Archive (NAR) format. A simple, reproducible binary archive
|
||||
format used by the Nix package manager to serialize file system objects.
|
||||
doc-ref: 'https://nixos.org/manual/nix/stable/command-ref/nix-store.html#nar-format'
|
||||
|
||||
seq:
|
||||
- id: magic
|
||||
type: padded_str
|
||||
doc: "Magic string, must be 'nix-archive-1'."
|
||||
valid:
|
||||
expr: _.body == 'nix-archive-1'
|
||||
- id: root_node
|
||||
type: node
|
||||
doc: "The root of the archive, which is always a single node."
|
||||
|
||||
types:
|
||||
padded_str:
|
||||
doc: |
|
||||
A string, prefixed with its length (u8le) and
|
||||
padded with null bytes to the next 8-byte boundary.
|
||||
seq:
|
||||
- id: len_str
|
||||
type: u8
|
||||
- id: body
|
||||
type: str
|
||||
size: len_str
|
||||
encoding: 'ASCII'
|
||||
- id: padding
|
||||
size: (8 - (len_str % 8)) % 8
|
||||
|
||||
node:
|
||||
doc: "A single filesystem node (file, directory, or symlink)."
|
||||
seq:
|
||||
- id: open_paren
|
||||
type: padded_str
|
||||
doc: "Must be '(', a token starting the node definition."
|
||||
valid:
|
||||
expr: _.body == '('
|
||||
- id: type_key
|
||||
type: padded_str
|
||||
doc: "Must be 'type'."
|
||||
valid:
|
||||
expr: _.body == 'type'
|
||||
- id: type_val
|
||||
type: padded_str
|
||||
doc: "The type of the node: 'regular', 'directory', or 'symlink'."
|
||||
- id: body
|
||||
type:
|
||||
switch-on: type_val.body
|
||||
cases:
|
||||
"'directory'": type_directory
|
||||
"'regular'": type_regular
|
||||
"'symlink'": type_symlink
|
||||
- id: close_paren
|
||||
type: padded_str
|
||||
valid:
|
||||
expr: _.body == ')'
|
||||
if: "type_val.body != 'directory'"
|
||||
doc: "Must be ')', a token ending the node definition."
|
||||
|
||||
type_directory:
|
||||
doc: "A directory node, containing a list of entries. Entries must be ordered by their names."
|
||||
seq:
|
||||
- id: entries
|
||||
type: dir_entry
|
||||
repeat: until
|
||||
repeat-until: _.kind.body == ')'
|
||||
types:
|
||||
dir_entry:
|
||||
doc: "A single entry within a directory, or a terminator."
|
||||
seq:
|
||||
- id: kind
|
||||
type: padded_str
|
||||
valid:
|
||||
expr: _.body == 'entry' or _.body == ')'
|
||||
doc: "Must be 'entry' (for a child node) or '' (for terminator)."
|
||||
- id: open_paren
|
||||
type: padded_str
|
||||
valid:
|
||||
expr: _.body == '('
|
||||
if: 'kind.body == "entry"'
|
||||
- id: name_key
|
||||
type: padded_str
|
||||
valid:
|
||||
expr: _.body == 'name'
|
||||
if: 'kind.body == "entry"'
|
||||
- id: name
|
||||
type: padded_str
|
||||
if: 'kind.body == "entry"'
|
||||
- id: node_key
|
||||
type: padded_str
|
||||
valid:
|
||||
expr: _.body == 'node'
|
||||
if: 'kind.body == "entry"'
|
||||
- id: node
|
||||
type: node
|
||||
if: 'kind.body == "entry"'
|
||||
doc: "The child node, present only if kind is 'entry'."
|
||||
- id: close_paren
|
||||
type: padded_str
|
||||
valid:
|
||||
expr: _.body == ')'
|
||||
if: 'kind.body == "entry"'
|
||||
instances:
|
||||
is_terminator:
|
||||
value: kind.body == ')'
|
||||
|
||||
type_regular:
|
||||
doc: "A regular file node."
|
||||
seq:
|
||||
# Read attributes (like 'executable') until we hit 'contents'
|
||||
- id: attributes
|
||||
type: reg_attribute
|
||||
repeat: until
|
||||
repeat-until: _.key.body == "contents"
|
||||
# After the 'contents' token, read the file data
|
||||
- id: file_data
|
||||
type: file_content
|
||||
instances:
|
||||
is_executable:
|
||||
value: 'attributes[0].key.body == "executable"'
|
||||
doc: "True if the file has the 'executable' attribute."
|
||||
types:
|
||||
reg_attribute:
|
||||
doc: "An attribute of the file, e.g., 'executable' or 'contents'."
|
||||
seq:
|
||||
- id: key
|
||||
type: padded_str
|
||||
doc: "Attribute key, e.g., 'executable' or 'contents'."
|
||||
valid:
|
||||
expr: _.body == 'executable' or _.body == 'contents'
|
||||
- id: value
|
||||
type: padded_str
|
||||
if: 'key.body == "executable"'
|
||||
valid:
|
||||
expr: _.body == ''
|
||||
doc: "Must be '' if key is 'executable'."
|
||||
file_content:
|
||||
doc: "The raw data of the file, prefixed by length."
|
||||
seq:
|
||||
- id: len_contents
|
||||
type: u8
|
||||
# # This relies on the property of instances that they are lazily evaluated and cached.
|
||||
- size: 0
|
||||
if: nar_offset < 0
|
||||
- id: contents
|
||||
size: len_contents
|
||||
- id: padding
|
||||
size: (8 - (len_contents % 8)) % 8
|
||||
instances:
|
||||
nar_offset:
|
||||
value: _io.pos
|
||||
|
||||
type_symlink:
|
||||
doc: "A symbolic link node."
|
||||
seq:
|
||||
- id: target_key
|
||||
type: padded_str
|
||||
doc: "Must be 'target'."
|
||||
valid:
|
||||
expr: _.body == 'target'
|
||||
- id: target_val
|
||||
type: padded_str
|
||||
doc: "The destination path of the symlink."
|
||||
@@ -358,7 +358,7 @@ This release has the following new features:
|
||||
they are needed for evaluation.
|
||||
|
||||
- You can now use `channel:` as a short-hand for
|
||||
<https://nixos.org/channels//nixexprs.tar.xz> [now <https://channels.nixos.org//nixexprs.tar.xz>]. For example,
|
||||
<https://nixos.org/channels//nixexprs.tar.xz>. For example,
|
||||
`nix-build channel:nixos-15.09 -A hello` will build the GNU Hello
|
||||
package from the `nixos-15.09` channel. In the future, this may
|
||||
use Git to fetch updates more efficiently.
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
- The `discard-references` feature has been stabilized.
|
||||
This means that the
|
||||
[unsafeDiscardReferences](@docroot@/language/advanced-attributes.md#adv-attr-unsafeDiscardReferences)
|
||||
[unsafeDiscardReferences](@docroot@/development/experimental-features.md#xp-feature-discard-references)
|
||||
attribute is no longer guarded by an experimental flag and can be used
|
||||
freely.
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
|
||||
- `nix-shell` shebang lines now support single-quoted arguments.
|
||||
|
||||
- `builtins.fetchTree` is now its own experimental feature, [`fetch-tree`](@docroot@/development/experimental-features.md#xp-feature-fetch-tree).
|
||||
This allows stabilising it independently of the rest of what is encompassed by [`flakes`](@docroot@/development/experimental-features.md#xp-feature-flakes).
|
||||
- `builtins.fetchTree` is now its own experimental feature, [`fetch-tree`](@docroot@/development/experimental-features.md#xp-fetch-tree).
|
||||
This allows stabilising it independently of the rest of what is encompassed by [`flakes`](@docroot@/development/experimental-features.md#xp-fetch-tree).
|
||||
|
||||
- The interface for creating and updating lock files has been overhauled:
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
- Modify `nix derivation {add,show}` JSON format [#9866](https://github.com/NixOS/nix/issues/9866) [#10722](https://github.com/NixOS/nix/pull/10722)
|
||||
|
||||
The JSON format for derivations has been slightly revised to better conform to our [JSON guidelines](@docroot@/development/json-guideline.md).
|
||||
The JSON format for derivations has been slightly revised to better conform to our [JSON guidelines](@docroot@/development/cli-guideline.md#returning-future-proof-json).
|
||||
In particular, the hash algorithm and content addressing method of content-addressed derivation outputs are now separated into two fields `hashAlgo` and `method`,
|
||||
rather than one field with an arcane `:`-separated format.
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
|
||||
- Support unit prefixes in configuration settings [#10668](https://github.com/NixOS/nix/pull/10668)
|
||||
|
||||
Configuration settings in Nix now support unit prefixes, allowing for more intuitive and readable configurations. For example, you can now specify [`--min-free 1G`](@docroot@/command-ref/conf-file.md#conf-min-free) to set the minimum free space to 1 gigabyte.
|
||||
Configuration settings in Nix now support unit prefixes, allowing for more intuitive and readable configurations. For example, you can now specify [`--min-free 1G`](@docroot@/command-ref/opt-common.md#opt-min-free) to set the minimum free space to 1 gigabyte.
|
||||
|
||||
This enhancement was extracted from [#7851](https://github.com/NixOS/nix/pull/7851) and is also useful for PR [#10661](https://github.com/NixOS/nix/pull/10661).
|
||||
|
||||
@@ -269,7 +269,7 @@
|
||||
e.g. `--warn-large-path-threshold 100M`.
|
||||
|
||||
|
||||
## Contributors
|
||||
# Contributors
|
||||
|
||||
This release was made possible by the following 43 contributors:
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
`<nix/fetchurl.nix>` is also known as the builtin derivation builder `builtin:fetchurl`. It's not to be confused with the evaluation-time function `builtins.fetchurl`, which was not affected by this issue.
|
||||
|
||||
|
||||
## Contributors
|
||||
# Contributors
|
||||
|
||||
This release was made possible by the following 58 contributors:
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
|
||||
- Evaluation caching now works for dirty Git workdirs [#11992](https://github.com/NixOS/nix/pull/11992)
|
||||
|
||||
## Contributors
|
||||
# Contributors
|
||||
|
||||
This release was made possible by the following 45 contributors:
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user