From 598b9c914482d7f6fcc284c8dc057e03ce58f6a9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 24 Apr 2026 18:16:06 +0000 Subject: [PATCH 1/6] Add copilot-setup-steps.yml with Nix dev shell setup Agent-Logs-Url: https://github.com/ocaml/dune/sessions/37b01ae9-426e-4f7f-a227-8b5ad104a68d Co-authored-by: Alizter <8614547+Alizter@users.noreply.github.com> --- .github/workflows/copilot-setup-steps.yml | 30 +++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/copilot-setup-steps.yml diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml new file mode 100644 index 00000000000..c432c4e153d --- /dev/null +++ b/.github/workflows/copilot-setup-steps.yml @@ -0,0 +1,30 @@ +name: "Copilot Setup Steps" + +# Automatically run the setup steps when they are changed to allow for easy +# validation, and allow manual testing through the repository's "Actions" tab +on: + workflow_dispatch: + push: + paths: + - .github/workflows/copilot-setup-steps.yml + pull_request: + paths: + - .github/workflows/copilot-setup-steps.yml + +jobs: + # The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot. + copilot-setup-steps: + runs-on: ubuntu-latest + + permissions: + contents: read + + steps: + - name: Checkout code + uses: actions/checkout@v6 + + - name: Install Nix + uses: nixbuild/nix-quick-install-action@v34 + + - name: Enter Nix dev shell + run: nix develop -c true From 9188a355ec5c550c6e98c5989f75820818fd23d6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 24 Apr 2026 18:21:18 +0000 Subject: [PATCH 2/6] Add nix cache to copilot-setup-steps using CI cache pattern Agent-Logs-Url: https://github.com/ocaml/dune/sessions/6cbddda1-b0da-47af-868d-dccfec173a86 Co-authored-by: Alizter <8614547+Alizter@users.noreply.github.com> --- .github/workflows/copilot-setup-steps.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index c432c4e153d..9e9f49fb060 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -26,5 +26,14 @@ jobs: - name: Install Nix uses: nixbuild/nix-quick-install-action@v34 + - name: Restore Nix cache + uses: nix-community/cache-nix-action@v7 + with: + primary-key: nix-${{ runner.os }}-${{ github.job }}--${{ hashFiles('**/*.nix', '**/flake.lock') }} + restore-prefixes-first-match: | + nix-${{ runner.os }}-${{ github.job }}-- + nix-Linux-nix-test-- + gc-max-store-size-linux: 2G + - name: Enter Nix dev shell run: nix develop -c true From 2b17dada928b485dbd52c743755978bfaadbf53e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 24 Apr 2026 18:24:16 +0000 Subject: [PATCH 3/6] Disable cache saving in copilot-setup-steps (restore only) Agent-Logs-Url: https://github.com/ocaml/dune/sessions/bc12efdd-9f18-48b6-b8c2-df5ccf2933c6 Co-authored-by: Alizter <8614547+Alizter@users.noreply.github.com> --- .github/workflows/copilot-setup-steps.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index 9e9f49fb060..0ab3b5e442e 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -34,6 +34,7 @@ jobs: nix-${{ runner.os }}-${{ github.job }}-- nix-Linux-nix-test-- gc-max-store-size-linux: 2G + save: false - name: Enter Nix dev shell run: nix develop -c true From 3a271e40e98afa2483b81fee6b5738d9f6e59378 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 24 Apr 2026 18:35:44 +0000 Subject: [PATCH 4/6] Fix: export Nix dev shell PATH entries to GITHUB_PATH Agent-Logs-Url: https://github.com/ocaml/dune/sessions/afd41894-6fde-4f3c-aca2-8d82331c4ba6 Co-authored-by: Alizter <8614547+Alizter@users.noreply.github.com> --- .github/workflows/copilot-setup-steps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index 0ab3b5e442e..16f9b3bb38d 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -37,4 +37,4 @@ jobs: save: false - name: Enter Nix dev shell - run: nix develop -c true + run: nix develop -c bash -c 'echo "$PATH"' | tr ':' '\n' >> "$GITHUB_PATH" From c8a16c6309011a82eb971700a0ff7c4777de909a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 24 Apr 2026 18:50:32 +0000 Subject: [PATCH 5/6] Revert: restore nix develop -c true in setup steps Agent-Logs-Url: https://github.com/ocaml/dune/sessions/c21108e1-647e-42fc-a870-dba08011ceb3 Co-authored-by: Alizter <8614547+Alizter@users.noreply.github.com> --- .github/workflows/copilot-setup-steps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index 16f9b3bb38d..0ab3b5e442e 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -37,4 +37,4 @@ jobs: save: false - name: Enter Nix dev shell - run: nix develop -c bash -c 'echo "$PATH"' | tr ':' '\n' >> "$GITHUB_PATH" + run: nix develop -c true From 49da9f5eacc16dc53233bce2d8640b243f1ba39a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 25 Apr 2026 09:36:19 +0000 Subject: [PATCH 6/6] Add .github/copilot-instructions.md with Nix dev shell guidance Agent-Logs-Url: https://github.com/ocaml/dune/sessions/4b3c63ec-a62f-44c3-a974-b0f1e6e20a96 Co-authored-by: Alizter <8614547+Alizter@users.noreply.github.com> --- .github/copilot-instructions.md | 37 +++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/copilot-instructions.md diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 00000000000..3054a32e780 --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,37 @@ +# Copilot Instructions + +For full development guidance, see [AGENTS.md](../AGENTS.md). + +## Environment Setup + +This repository uses a [Nix](https://nixos.org/) dev shell to provide the +OCaml toolchain (`ocaml`, `dune`, `opam`, `ocamlformat`, etc.). The shell is +**not** activated automatically, so every command must be prefixed with +`nix develop -c`. + +### First-time setup + +On a fresh checkout (or after the `_boot/` directory has been removed), run +bootstrap once before anything else: + +```bash +nix develop -c make bootstrap +``` + +This builds `_boot/dune.exe`, the seed binary that Dune uses to build itself. +It is slow but only needed once per environment. + +## Common Commands + +All commands from [AGENTS.md](../AGENTS.md) must be wrapped with +`nix develop -c`: + +```bash +nix develop -c dune build @check # Quick build (recommended) +nix develop -c dune build @install # Full build +nix develop -c dune runtest dir/ # Run tests in a directory +nix develop -c dune runtest dir/test.t # Run a specific cram test +nix develop -c dune fmt # Auto-format code (run before committing) +nix develop -c dune promote # Accept test output changes (ask user first) +nix develop -c make dev # Full build (bootstraps if necessary) +```