Skip to content

Commit a9d9b50

Browse files
committed
Merge remote-tracking branch 'upstream/master' into upstream-RossComputerGuy/feat/expose-computefsclosure
2 parents 6fa0376 + 606eb1d commit a9d9b50

File tree

467 files changed

+9260
-5040
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

467 files changed

+9260
-5040
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ so you understand the process and the expectations.
1515
- volunteering contributions effectively
1616
- how to get help and our review process.
1717
18+
PR stuck in review? We have two Nix team meetings per week online that are open for everyone in a jitsi conference:
19+
20+
- https://calendar.google.com/calendar/u/0/[email protected]
21+
1822
-->
1923

2024
## Motivation

.github/actions/install-nix-action/action.yaml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,22 @@ inputs:
44
dogfood:
55
description: "Whether to use Nix installed from the latest artifact from master branch"
66
required: true # Be explicit about the fact that we are using unreleased artifacts
7+
experimental-installer:
8+
description: "Whether to use the experimental installer to install Nix"
9+
default: false
10+
experimental-installer-version:
11+
description: "Version of the experimental installer to use. If `latest`, the newest artifact from the default branch is used."
12+
# TODO: This should probably be pinned to a release after https://github.com/NixOS/experimental-nix-installer/pull/49 lands in one
13+
default: "latest"
714
extra_nix_config:
815
description: "Gets appended to `/etc/nix/nix.conf` if passed."
916
install_url:
1017
description: "URL of the Nix installer"
1118
required: false
1219
default: "https://releases.nixos.org/nix/nix-2.30.2/install"
20+
tarball_url:
21+
description: "URL of the Nix tarball to use with the experimental installer"
22+
required: false
1323
github_token:
1424
description: "Github token"
1525
required: true
@@ -37,14 +47,74 @@ runs:
3747
3848
gh run download "$RUN_ID" --repo "$DOGFOOD_REPO" -n "$INSTALLER_ARTIFACT" -D "$INSTALLER_DOWNLOAD_DIR"
3949
echo "installer-path=file://$INSTALLER_DOWNLOAD_DIR" >> "$GITHUB_OUTPUT"
50+
TARBALL_PATH="$(find "$INSTALLER_DOWNLOAD_DIR" -name 'nix*.tar.xz' -print | head -n 1)"
51+
echo "tarball-path=file://$TARBALL_PATH" >> "$GITHUB_OUTPUT"
4052
4153
echo "::notice ::Dogfooding Nix installer from master (https://github.com/$DOGFOOD_REPO/actions/runs/$RUN_ID)"
4254
env:
4355
GH_TOKEN: ${{ inputs.github_token }}
4456
DOGFOOD_REPO: "NixOS/nix"
57+
- name: "Gather system info for experimental installer"
58+
shell: bash
59+
if: ${{ inputs.experimental-installer == 'true' }}
60+
run: |
61+
echo "::notice Using experimental installer from $EXPERIMENTAL_INSTALLER_REPO (https://github.com/$EXPERIMENTAL_INSTALLER_REPO)"
62+
63+
if [ "$RUNNER_OS" == "Linux" ]; then
64+
EXPERIMENTAL_INSTALLER_SYSTEM="linux"
65+
echo "EXPERIMENTAL_INSTALLER_SYSTEM=$EXPERIMENTAL_INSTALLER_SYSTEM" >> "$GITHUB_ENV"
66+
elif [ "$RUNNER_OS" == "macOS" ]; then
67+
EXPERIMENTAL_INSTALLER_SYSTEM="darwin"
68+
echo "EXPERIMENTAL_INSTALLER_SYSTEM=$EXPERIMENTAL_INSTALLER_SYSTEM" >> "$GITHUB_ENV"
69+
else
70+
echo "::error ::Unsupported RUNNER_OS: $RUNNER_OS"
71+
exit 1
72+
fi
73+
74+
if [ "$RUNNER_ARCH" == "X64" ]; then
75+
EXPERIMENTAL_INSTALLER_ARCH=x86_64
76+
echo "EXPERIMENTAL_INSTALLER_ARCH=$EXPERIMENTAL_INSTALLER_ARCH" >> "$GITHUB_ENV"
77+
elif [ "$RUNNER_ARCH" == "ARM64" ]; then
78+
EXPERIMENTAL_INSTALLER_ARCH=aarch64
79+
echo "EXPERIMENTAL_INSTALLER_ARCH=$EXPERIMENTAL_INSTALLER_ARCH" >> "$GITHUB_ENV"
80+
else
81+
echo "::error ::Unsupported RUNNER_ARCH: $RUNNER_ARCH"
82+
exit 1
83+
fi
84+
85+
echo "EXPERIMENTAL_INSTALLER_ARTIFACT=nix-installer-$EXPERIMENTAL_INSTALLER_ARCH-$EXPERIMENTAL_INSTALLER_SYSTEM" >> "$GITHUB_ENV"
86+
env:
87+
EXPERIMENTAL_INSTALLER_REPO: "NixOS/experimental-nix-installer"
88+
- name: "Download latest experimental installer"
89+
shell: bash
90+
id: download-latest-experimental-installer
91+
if: ${{ inputs.experimental-installer == 'true' && inputs.experimental-installer-version == 'latest' }}
92+
run: |
93+
RUN_ID=$(gh run list --repo "$EXPERIMENTAL_INSTALLER_REPO" --workflow ci.yml --branch main --status success --json databaseId --jq ".[0].databaseId")
94+
95+
EXPERIMENTAL_INSTALLER_DOWNLOAD_DIR="$GITHUB_WORKSPACE/$EXPERIMENTAL_INSTALLER_ARTIFACT"
96+
mkdir -p "$EXPERIMENTAL_INSTALLER_DOWNLOAD_DIR"
97+
98+
gh run download "$RUN_ID" --repo "$EXPERIMENTAL_INSTALLER_REPO" -n "$EXPERIMENTAL_INSTALLER_ARTIFACT" -D "$EXPERIMENTAL_INSTALLER_DOWNLOAD_DIR"
99+
# Executable permissions are lost in artifacts
100+
find $EXPERIMENTAL_INSTALLER_DOWNLOAD_DIR -type f -exec chmod +x {} +
101+
echo "installer-path=$EXPERIMENTAL_INSTALLER_DOWNLOAD_DIR" >> "$GITHUB_OUTPUT"
102+
env:
103+
GH_TOKEN: ${{ inputs.github_token }}
104+
EXPERIMENTAL_INSTALLER_REPO: "NixOS/experimental-nix-installer"
45105
- uses: cachix/install-nix-action@c134e4c9e34bac6cab09cf239815f9339aaaf84e # v31.5.1
106+
if: ${{ inputs.experimental-installer != 'true' }}
46107
with:
47108
# Ternary operator in GHA: https://www.github.com/actions/runner/issues/409#issuecomment-752775072
48109
install_url: ${{ inputs.dogfood == 'true' && format('{0}/install', steps.download-nix-installer.outputs.installer-path) || inputs.install_url }}
49110
install_options: ${{ inputs.dogfood == 'true' && format('--tarball-url-prefix {0}', steps.download-nix-installer.outputs.installer-path) || '' }}
50111
extra_nix_config: ${{ inputs.extra_nix_config }}
112+
- uses: DeterminateSystems/nix-installer-action@786fff0690178f1234e4e1fe9b536e94f5433196 # v20
113+
if: ${{ inputs.experimental-installer == 'true' }}
114+
with:
115+
diagnostic-endpoint: ""
116+
# TODO: It'd be nice to use `artifacts.nixos.org` for both of these, maybe through an `/experimental-installer/latest` endpoint? or `/commit/<hash>`?
117+
local-root: ${{ inputs.experimental-installer-version == 'latest' && steps.download-latest-experimental-installer.outputs.installer-path || '' }}
118+
source-url: ${{ inputs.experimental-installer-version != 'latest' && 'https://artifacts.nixos.org/experimental-installer/tag/${{ inputs.experimental-installer-version }}/${{ env.EXPERIMENTAL_INSTALLER_ARTIFACT }}' || '' }}
119+
nix-package-url: ${{ inputs.dogfood == 'true' && steps.download-nix-installer.outputs.tarball-path || (inputs.tarball_url || '') }}
120+
extra-conf: ${{ inputs.extra_nix_config }}

.github/workflows/backport.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Backport
2+
on:
3+
pull_request_target:
4+
types: [closed, labeled]
5+
permissions:
6+
contents: read
7+
jobs:
8+
backport:
9+
name: Backport Pull Request
10+
permissions:
11+
# for korthout/backport-action
12+
contents: write
13+
pull-requests: write
14+
if: github.repository_owner == 'NixOS' && github.event.pull_request.merged == true && (github.event_name != 'labeled' || startsWith('backport', github.event.label.name))
15+
runs-on: ubuntu-24.04-arm
16+
steps:
17+
- name: Generate GitHub App token
18+
id: generate-token
19+
uses: actions/create-github-app-token@v2
20+
with:
21+
app-id: ${{ vars.CI_APP_ID }}
22+
private-key: ${{ secrets.CI_APP_PRIVATE_KEY }}
23+
- uses: actions/checkout@v5
24+
with:
25+
ref: ${{ github.event.pull_request.head.sha }}
26+
# required to find all branches
27+
fetch-depth: 0
28+
- name: Create backport PRs
29+
uses: korthout/backport-action@d07416681cab29bf2661702f925f020aaa962997 # v3.4.1
30+
id: backport
31+
with:
32+
# Config README: https://github.com/korthout/backport-action#backport-action
33+
github_token: ${{ steps.generate-token.outputs.token }}
34+
github_workspace: ${{ github.workspace }}
35+
auto_merge_enabled: true
36+
pull_description: |-
37+
Automatic backport to `${target_branch}`, triggered by a label in #${pull_number}.

.github/workflows/ci.yml

Lines changed: 88 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
pull_request:
55
merge_group:
66
push:
7+
branches:
8+
- master
79
workflow_dispatch:
810
inputs:
911
dogfood:
@@ -29,7 +31,32 @@ jobs:
2931
github_token: ${{ secrets.GITHUB_TOKEN }}
3032
- run: nix flake show --all-systems --json
3133

34+
pre-commit-checks:
35+
name: pre-commit checks
36+
runs-on: ubuntu-24.04
37+
steps:
38+
- uses: actions/checkout@v5
39+
- uses: ./.github/actions/install-nix-action
40+
with:
41+
dogfood: ${{ github.event_name == 'workflow_dispatch' && inputs.dogfood || github.event_name != 'workflow_dispatch' }}
42+
extra_nix_config: experimental-features = nix-command flakes
43+
github_token: ${{ secrets.GITHUB_TOKEN }}
44+
- uses: DeterminateSystems/magic-nix-cache-action@main
45+
- run: ./ci/gha/tests/pre-commit-checks
46+
47+
basic-checks:
48+
name: aggregate basic checks
49+
if: ${{ always() }}
50+
runs-on: ubuntu-24.04
51+
needs: [pre-commit-checks, eval]
52+
steps:
53+
- name: Exit with any errors
54+
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
55+
run: |
56+
exit 1
57+
3258
tests:
59+
needs: basic-checks
3360
strategy:
3461
fail-fast: false
3562
matrix:
@@ -40,18 +67,42 @@ jobs:
4067
instrumented: false
4168
primary: true
4269
stdenv: stdenv
70+
withAWS: true
71+
withCurlS3: false
72+
# TODO: remove once curl-based-s3 fully lands
73+
- scenario: on ubuntu (no s3)
74+
runs-on: ubuntu-24.04
75+
os: linux
76+
instrumented: false
77+
primary: false
78+
stdenv: stdenv
79+
withAWS: false
80+
withCurlS3: false
81+
# TODO: remove once curl-based-s3 fully lands
82+
- scenario: on ubuntu (curl s3)
83+
runs-on: ubuntu-24.04
84+
os: linux
85+
instrumented: false
86+
primary: false
87+
stdenv: stdenv
88+
withAWS: false
89+
withCurlS3: true
4390
- scenario: on macos
4491
runs-on: macos-14
4592
os: darwin
4693
instrumented: false
4794
primary: true
4895
stdenv: stdenv
96+
withAWS: true
97+
withCurlS3: false
4998
- scenario: on ubuntu (with sanitizers / coverage)
5099
runs-on: ubuntu-24.04
51100
os: linux
52101
instrumented: true
53102
primary: false
54103
stdenv: clangStdenv
104+
withAWS: true
105+
withCurlS3: false
55106
name: tests ${{ matrix.scenario }}
56107
runs-on: ${{ matrix.runs-on }}
57108
timeout-minutes: 60
@@ -74,7 +125,17 @@ jobs:
74125
run: |
75126
nix build --file ci/gha/tests/wrapper.nix componentTests -L \
76127
--arg withInstrumentation ${{ matrix.instrumented }} \
77-
--argstr stdenv "${{ matrix.stdenv }}"
128+
--argstr stdenv "${{ matrix.stdenv }}" \
129+
${{ format('--arg withAWS {0}', matrix.withAWS) }} \
130+
${{ format('--arg withCurlS3 {0}', matrix.withCurlS3) }}
131+
- name: Run VM tests
132+
run: |
133+
nix build --file ci/gha/tests/wrapper.nix vmTests -L \
134+
--arg withInstrumentation ${{ matrix.instrumented }} \
135+
--argstr stdenv "${{ matrix.stdenv }}" \
136+
${{ format('--arg withAWS {0}', matrix.withAWS) }} \
137+
${{ format('--arg withCurlS3 {0}', matrix.withCurlS3) }}
138+
if: ${{ matrix.os == 'linux' }}
78139
- name: Run flake checks and prepare the installer tarball
79140
run: |
80141
ci/gha/tests/build-checks
@@ -85,6 +146,8 @@ jobs:
85146
nix build --file ci/gha/tests/wrapper.nix codeCoverage.coverageReports -L \
86147
--arg withInstrumentation ${{ matrix.instrumented }} \
87148
--argstr stdenv "${{ matrix.stdenv }}" \
149+
${{ format('--arg withAWS {0}', matrix.withAWS) }} \
150+
${{ format('--arg withCurlS3 {0}', matrix.withCurlS3) }} \
88151
--out-link coverage-reports
89152
cat coverage-reports/index.txt >> $GITHUB_STEP_SUMMARY
90153
if: ${{ matrix.instrumented }}
@@ -110,9 +173,19 @@ jobs:
110173
- scenario: on ubuntu
111174
runs-on: ubuntu-24.04
112175
os: linux
176+
experimental-installer: false
113177
- scenario: on macos
114178
runs-on: macos-14
115179
os: darwin
180+
experimental-installer: false
181+
- scenario: on ubuntu (experimental)
182+
runs-on: ubuntu-24.04
183+
os: linux
184+
experimental-installer: true
185+
- scenario: on macos (experimental)
186+
runs-on: macos-14
187+
os: darwin
188+
experimental-installer: true
116189
name: installer test ${{ matrix.scenario }}
117190
runs-on: ${{ matrix.runs-on }}
118191
steps:
@@ -124,11 +197,22 @@ jobs:
124197
path: out
125198
- name: Looking up the installer tarball URL
126199
id: installer-tarball-url
127-
run: echo "installer-url=file://$GITHUB_WORKSPACE/out" >> "$GITHUB_OUTPUT"
200+
run: |
201+
echo "installer-url=file://$GITHUB_WORKSPACE/out" >> "$GITHUB_OUTPUT"
202+
TARBALL_PATH="$(find "$GITHUB_WORKSPACE/out" -name 'nix*.tar.xz' -print | head -n 1)"
203+
echo "tarball-path=file://$TARBALL_PATH" >> "$GITHUB_OUTPUT"
128204
- uses: cachix/install-nix-action@v31
205+
if: ${{ !matrix.experimental-installer }}
129206
with:
130207
install_url: ${{ format('{0}/install', steps.installer-tarball-url.outputs.installer-url) }}
131208
install_options: ${{ format('--tarball-url-prefix {0}', steps.installer-tarball-url.outputs.installer-url) }}
209+
- uses: ./.github/actions/install-nix-action
210+
if: ${{ matrix.experimental-installer }}
211+
with:
212+
dogfood: false
213+
experimental-installer: true
214+
tarball_url: ${{ steps.installer-tarball-url.outputs.tarball-path }}
215+
github_token: ${{ secrets.GITHUB_TOKEN }}
132216
- run: sudo apt install fish zsh
133217
if: matrix.os == 'linux'
134218
- run: brew install fish
@@ -160,7 +244,7 @@ jobs:
160244
echo "docker=${{ env._DOCKER_SECRETS != '' }}" >> $GITHUB_OUTPUT
161245
162246
docker_push_image:
163-
needs: [tests, vm_tests, check_secrets]
247+
needs: [tests, check_secrets]
164248
permissions:
165249
contents: read
166250
packages: write
@@ -213,27 +297,8 @@ jobs:
213297
docker tag nix:$NIX_VERSION $IMAGE_ID:master
214298
docker push $IMAGE_ID:master
215299
216-
vm_tests:
217-
runs-on: ubuntu-24.04
218-
steps:
219-
- uses: actions/checkout@v5
220-
- uses: ./.github/actions/install-nix-action
221-
with:
222-
dogfood: ${{ github.event_name == 'workflow_dispatch' && inputs.dogfood || github.event_name != 'workflow_dispatch' }}
223-
extra_nix_config:
224-
experimental-features = nix-command flakes
225-
github_token: ${{ secrets.GITHUB_TOKEN }}
226-
- uses: DeterminateSystems/magic-nix-cache-action@main
227-
- run: |
228-
nix build -L \
229-
.#hydraJobs.tests.functional_user \
230-
.#hydraJobs.tests.githubFlakes \
231-
.#hydraJobs.tests.nix-docker \
232-
.#hydraJobs.tests.tarballFlakes \
233-
;
234-
235300
flake_regressions:
236-
needs: vm_tests
301+
needs: tests
237302
runs-on: ubuntu-24.04
238303
steps:
239304
- name: Checkout nix

0 commit comments

Comments
 (0)